Skip to content

Commit

Permalink
Merge pull request #342 from randovania/fix-custom-doors
Browse files Browse the repository at this point in the history
Door Lock Fixes
  • Loading branch information
ThanatosGit authored May 16, 2024
2 parents f58214c + ed9cf00 commit fb8ea57
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/open_samus_returns_rando/specific_patches/door_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class DoorType(Enum):
"sounds/props/doorchargecharge/powerbombdoor_hum.bcwav"
])
ICE_BEAM = ("ice_beam", ActorData.DOOR_POWER, "doorice", True, ActorData.SHIELD_ICE_BEAM, [
"actors/props/doorshield", "actors/props/doorshieldicebeam","sounds/props/creaturedoor",
"system/fx/textures/blood_gray.bctex",
"actors/props/doorshield", "actors/props/doorcreature", "actors/props/doorshieldicebeam",
"sounds/props/creaturedoor", "system/fx/textures/blood_gray.bctex",
])
GRAPPLE_BEAM = ("grapple_beam", ActorData.DOOR_POWER, "doorgrapple", True, ActorData.SHIELD_GRAPPLE_BEAM, [
"actors/props/doorshield", "actors/props/doorshieldgrapplebeam",
Expand Down Expand Up @@ -495,16 +495,11 @@ def add_custom_shields(editor: PatcherEditor, new_shield: NewShield) -> None:

# Update the life component
life_component = custom_shield.raw["components"]["LIFE"]["functions"]
if new_shield.base_shield == "doorshield":
# Remove the Super Missile weakness
life_component[1]["params"]["Param1"]["value"] = new_shield.weakness
elif new_shield.base_shield == "doorspazerbeam":
# Remove all weaknesses
for i in range(4):
life_component[i]["params"]["Param1"]["value"] = new_shield.weakness
elif new_shield.base_shield == "doorcreature":
# Remove the Power Bomb weakness
life_component[1]["params"]["Param1"]["value"] = new_shield.weakness
# Change the weaknesses for each door
for damage_source in life_component:
if damage_source["name"] == "AddDamageSource":
damage_source["params"]["Param1"]["value"] = new_shield.weakness
if new_shield.base_shield == "doorcreature":
# Set shield health to 1
life_component[2]["params"]["Param2"]["value"] = 1.0
life_component[3]["params"]["Param2"]["value"] = 1.0
Expand Down

0 comments on commit fb8ea57

Please sign in to comment.