|
2 | 2 | import struct |
3 | 3 |
|
4 | 4 | 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 |
6 | 6 | from retro_data_structures.formats.script_object import ScriptInstance |
7 | 7 | from retro_data_structures.game_check import Game |
8 | 8 | from retro_data_structures.properties.echoes.archetypes.EditorProperties import EditorProperties |
9 | 9 | from retro_data_structures.properties.echoes.archetypes.LayerSwitch import LayerSwitch |
10 | 10 | from retro_data_structures.properties.echoes.objects.Counter import Counter |
11 | 11 | from retro_data_structures.properties.echoes.objects.Relay import Relay |
12 | 12 | from retro_data_structures.properties.echoes.objects.ScriptLayerController import ScriptLayerController |
| 13 | +from retro_data_structures.properties.echoes.objects.Trigger import Trigger |
13 | 14 |
|
14 | 15 | from open_prime_rando.echoes.asset_ids.agon_wastes import ( |
15 | 16 | COMMAND_CENTER_MREA, |
16 | 17 | MINING_STATION_B_MREA, |
17 | 18 | PORTAL_TERMINAL_MREA, |
18 | 19 | ) |
| 20 | +from open_prime_rando.echoes.asset_ids.sanctuary_fortress import MINIGYRO_CHAMBER_MREA |
19 | 21 | from open_prime_rando.echoes.asset_ids.torvus_bog import TORVUS_ENERGY_CONTROLLER_MREA, TORVUS_TEMPLE_MREA |
20 | 22 | from open_prime_rando.echoes.asset_ids.world import AGON_WASTES_MLVL, TORVUS_BOG_MLVL |
21 | 23 | from open_prime_rando.patcher_editor import PatcherEditor |
@@ -165,3 +167,77 @@ def command_center_door(editor: PatcherEditor): |
165 | 167 | Message.Activate, |
166 | 168 | default.get_instance(instance), |
167 | 169 | ) |
| 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