From 895c631d02ef39c554580a107d2b3239955cb536 Mon Sep 17 00:00:00 2001 From: dyceron <38679103+dyceron@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:43:33 -0400 Subject: [PATCH] Support fx for aeion abilities --- .../templates/template_powerup_bmsad.json | 68 +++++++++++++++++++ open_samus_returns_rando/pickup.py | 17 +++++ 2 files changed, 85 insertions(+) diff --git a/open_samus_returns_rando/files/templates/template_powerup_bmsad.json b/open_samus_returns_rando/files/templates/template_powerup_bmsad.json index a473403..d333231 100644 --- a/open_samus_returns_rando/files/templates/template_powerup_bmsad.json +++ b/open_samus_returns_rando/files/templates/template_powerup_bmsad.json @@ -171,6 +171,74 @@ "fields": {}, "dependencies": [] }, + "FX": { + "type": "CFXComponent", + "unk_1": 1500, + "unk_2": 0.0, + "functions": [ + { + "name": "FXCreateAndLink", + "unk1": true, + "unk2": false, + "params": { + "Param1": { + "type": "s", + "value": "" + }, + "Param2": { + "type": "s", + "value": "" + }, + "Param3": { + "type": "s", + "value": "" + }, + "Param4": { + "type": "s", + "value": "" + }, + "Param5": { + "type": "i", + "value": 0 + }, + "Param6": { + "type": "i", + "value": 4 + }, + "Param7": { + "type": "f", + "value": 0.0 + }, + "Param8": { + "type": "f", + "value": 0.0 + }, + "Param9": { + "type": "f", + "value": 0.0 + }, + "Param10": { + "type": "f", + "value": 0.0 + }, + "Param11": { + "type": "f", + "value": 0.0 + }, + "Param12": { + "type": "f", + "value": 0.0 + }, + "Param13": { + "type": "b", + "value": false + } + } + } + ], + "fields": {}, + "dependencies": [] + }, "AUDIO": { "type": "CAudioComponent", "unk_1": 3000, diff --git a/open_samus_returns_rando/pickup.py b/open_samus_returns_rando/pickup.py index bf24e66..1d1ace6 100644 --- a/open_samus_returns_rando/pickup.py +++ b/open_samus_returns_rando/pickup.py @@ -45,6 +45,8 @@ def patch_single_item_pickup(self, bmsad: dict) -> dict: action_sets: dict = bmsad["action_sets"][0]["animations"][0] + fx_create_and_link: dict = bmsad["components"]["FX"]["functions"][0]["params"] + if item_id == "ITEM_ENERGY_TANKS": item_id = "fMaxLife" quantity *= self.configuration["energy_per_tank"] @@ -67,6 +69,21 @@ def patch_single_item_pickup(self, bmsad: dict) -> dict: action_sets["animation_id"] = 150 action_sets["action"]["bcskla"] = "actors/items/itemtank/animations/relax.bcskla" + elif item_id.startswith("ITEM_SPECIAL_ENERGY"): + fx_create_and_link["Param13"]["value"] = True + if item_id == "ITEM_SPECIAL_ENERGY_SCANNING_PULSE": + fx_create_and_link["Param1"]["value"] = "orb" + fx_create_and_link["Param2"]["value"] = "actors/items/powerup_scanningpulse/fx/orb.bcptl" + if item_id == "ITEM_SPECIAL_ENERGY_ENERGY_SHIELD": + fx_create_and_link["Param1"]["value"] = "orb" + fx_create_and_link["Param2"]["value"] = "actors/items/powerup_energyshield/fx/orb.bcptl" + if item_id == "ITEM_SPECIAL_ENERGY_ENERGY_WAVE": + fx_create_and_link["Param1"]["value"] = "yelloworb" + fx_create_and_link["Param2"]["value"] = "actors/items/powerup_energywave/fx/yelloworb.bcptl" + elif item_id == "ITEM_SPECIAL_ENERGY_PHASE_DISPLACEMENT": + fx_create_and_link["Param1"]["value"] = "purpleorb" + fx_create_and_link["Param2"]["value"] = "actors/items/powerup_phasedisplacement/fx/purpleorb.bcptl" + set_custom_params["Param1"]["value"] = item_id set_custom_params["Param2"]["value"] = quantity