Skip to content

Commit 6114382

Browse files
committed
Several patches for Sanctuary Fortress - Minigyro Chamber
Added Cannon Ball fix for Sanctuary Fortress - Minigyro Chamber Added no backward traversal QoL patch for Sanctuary Fortress - Minigyro Chamber
1 parent 513b20f commit 6114382

1 file changed

Lines changed: 77 additions & 1 deletion

File tree

src/open_prime_rando/echoes/specific_area_patches.py

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
import struct
33

44
from construct import Container
5-
from retro_data_structures.enums.echoes import Message, State
5+
from retro_data_structures.enums.echoes import Function, Message, State
66
from retro_data_structures.formats.script_object import ScriptInstance
77
from retro_data_structures.game_check import Game
88
from retro_data_structures.properties.echoes.archetypes.EditorProperties import EditorProperties
99
from retro_data_structures.properties.echoes.archetypes.LayerSwitch import LayerSwitch
1010
from retro_data_structures.properties.echoes.objects.Counter import Counter
1111
from retro_data_structures.properties.echoes.objects.Relay import Relay
1212
from retro_data_structures.properties.echoes.objects.ScriptLayerController import ScriptLayerController
13+
from retro_data_structures.properties.echoes.objects.Trigger import Trigger
1314

1415
from open_prime_rando.echoes.asset_ids.agon_wastes import (
1516
COMMAND_CENTER_MREA,
1617
MINING_STATION_B_MREA,
1718
PORTAL_TERMINAL_MREA,
1819
)
20+
from open_prime_rando.echoes.asset_ids.sanctuary_fortress import MINIGYRO_CHAMBER_MREA
1921
from open_prime_rando.echoes.asset_ids.torvus_bog import TORVUS_ENERGY_CONTROLLER_MREA, TORVUS_TEMPLE_MREA
2022
from open_prime_rando.echoes.asset_ids.world import AGON_WASTES_MLVL, TORVUS_BOG_MLVL
2123
from open_prime_rando.patcher_editor import PatcherEditor
@@ -165,3 +167,77 @@ def command_center_door(editor: PatcherEditor):
165167
Message.Activate,
166168
default.get_instance(instance),
167169
)
170+
171+
172+
def sanctuary_fortress_minigyro_chamber_cannon_ball_fix(editor: PatcherEditor):
173+
"""
174+
Patches Sanctuary Fortress - Minigyro Chamber to prevent Cannon Ball from
175+
going through the gyroscope damage force field
176+
"""
177+
area = editor.get_mrea(MINIGYRO_CHAMBER_MREA)
178+
179+
"""
180+
Add special function to send player away from gyroscope
181+
"""
182+
special_function = area.get_layer("Gyroscope puzzle").add_instance_with(SpecialFunction(
183+
editor_properties=EditorProperties(
184+
name="SpecialFunction - keep off gyroscope (Front)",
185+
active=True
186+
),
187+
function=Function.LaunchPlayer,
188+
value_parm=-10.0,
189+
))
190+
191+
"""
192+
Link triggers that damages you to our special function
193+
"""
194+
trigger_ids = [0x0C070005, 0x0C070009, 0x0C070034, 0x0C07003D]
195+
for trigger_id in trigger_ids:
196+
trigger = area.get_instance(trigger_id)
197+
198+
with trigger.edit_properties(Trigger) as props:
199+
props.trigger.damage.di_damage = 0.0
200+
props.trigger.damage.di_radius = 0.0
201+
props.trigger.damage.di_knock_back_power = 0.0
202+
203+
trigger.add_connection(State.Entered, Message.Action, special_function)
204+
205+
206+
def sanctuary_fortress_minigyro_chamber_prevent_backward_traversal_patch(editor: PatcherEditor):
207+
"""
208+
Patches Sanctuary Fortress - Minigyro Chamber to prevent coming from the back of the room
209+
until the puzzle is solved
210+
"""
211+
area = editor.get_mrea(MINIGYRO_CHAMBER_MREA)
212+
213+
"""
214+
Add special function to send player away from gyroscope
215+
"""
216+
special_function = area.get_layer("Gyroscope puzzle").add_instance_with(SpecialFunction(
217+
editor_properties=EditorProperties(
218+
name="SpecialFunction - keep off gyroscope (Back)",
219+
active=True
220+
),
221+
function=Function.LaunchPlayer,
222+
value_parm=10.0,
223+
))
224+
225+
"""
226+
Link triggers that damages you to our special function
227+
"""
228+
trigger = area.get_layer("Gyroscope puzzle").add_instance_with(Trigger(
229+
editor_properties=EditorProperties(
230+
name="Trigger - keep off gyroscope (Back)",
231+
active=True
232+
),
233+
))
234+
235+
with trigger.edit_properties(Trigger) as props:
236+
props.editor_properties.position.x = 150.726303
237+
props.editor_properties.position.y = 129.589584
238+
props.editor_properties.position.z = -115.434067
239+
props.editor_properties.scale.x = 2.6
240+
props.editor_properties.scale.y = 1.0
241+
props.editor_properties.scale.z = 2.0
242+
243+
trigger.add_connection(State.Entered, Message.Action, special_function)

0 commit comments

Comments
 (0)