|
# Based on research using https://github.com/JayFoxRox/futurama-tools |
|
|
|
# LABEL: [{'name': '@@action@@aEgg', 'path': 'Level1\\Level1-1\\Level1-1A.fis', 'address': 28580, 'type': 40, 'unk4': 385, 'locals': [{'name': 'eggdoor', 'offset': 0, 'type': 27}, {'name': 't_next', 'offset': 216, 'type': 12}, {'name': 't_hit', 'offset': 220, 'type': 12}]}] |
|
function StageA:@@action@@aEgg { |
|
.stack_size 0 |
|
.extra_stack_size 224 |
|
|
|
.local Door eggdoor # Offset 0 |
|
.local Trigger t_next # Offset 216 |
|
.local Trigger t_hit # Offset 220 |
|
|
|
# Unknown what this does |
|
unknown(StageA.@@AID@@) |
|
|
|
:entry: |
|
|
|
# Initialize egg state |
|
StageA.aEgg = 0 |
|
|
|
# Yield = give other tasks chance to run (why?) |
|
*yield 0 |
|
|
|
# This would prevent the code from running.. is this a bug? |
|
# Is this easter egg disabled? |
|
if 1 == 0 { |
|
goto entry |
|
} |
|
|
|
# Mark easter-egg as initialized |
|
StageA.aEgg = 1 |
|
|
|
# Unknown what this does |
|
:FsRWStart("easter_egg", "on") |
|
|
|
# Create door and initialize it |
|
Door:Door(&eggdoor.@@AID@@) |
|
Door:Init(&eggdoor.@@AID@@, "PE_HangarDoor", "easterdoor:Animation (Translational)", "open", "close", StageA.m_Elevator.m_door1.m_bOpenRunning, StageA.m_Elevator.m_door1.m_bCloseRunning) |
|
|
|
# Toggle door (what does this mean?) |
|
Door:Toggle(&eggdoor.@@AID@@, 0) |
|
|
|
# Create a trigger for our easter-egg condition |
|
# Probably, this is the trigger for the boiler room |
|
t_next.@@Reserved@@ = :FsTriggerBox("PLAYER", "tEnterBoil") |
|
|
|
# Wait for trigger to be hit |
|
while int(t_next.@@Reserved@@) == False { |
|
*yield 0.0 # Stuck until trigger is hit |
|
} |
|
|
|
# Create a trigger for our easter-egg condition |
|
# Probably, this is for when the fire extinguisher window is broken |
|
t_next.@@Reserved@@ = :FsTriggerDestructable("Firewindow") |
|
|
|
|
|
# Wait for trigger to be hit |
|
while int(t_next.@@Reserved@@) == 0 { |
|
*yield 0.0 # Stuck until trigger is hit |
|
} |
|
|
|
# Check another condition.. this is a short-cut if the drawer was already in state 1 |
|
if StageA.m_LabDrawer.m_CurState == 1 { |
|
|
|
# Destroy the door immediately (does that mean it will disappear?) |
|
Door:Die(&eggdoor.@@AID@@) |
|
goto cleanup |
|
|
|
} |
|
|
|
# Check the drawer again, and wait until it is finally in state 1 |
|
while StageA.m_LabDrawer.m_CurState != 1 { |
|
*yield 0.0 # Stuck until condition true |
|
} |
|
|
|
# Check another condition.. this is a short-cut if the fire extinguisher was already picked up |
|
if StageA.m_fireExtinguisher.m_pickup.m_bIsPickedUp == True { |
|
|
|
# Destroy the door immediately (does that mean it will disappear?) |
|
Door:Die(&eggdoor.@@AID@@) |
|
goto cleanup |
|
|
|
} |
|
|
|
# If the fire extinguisher was not picked up, wait until TV is in state 2 |
|
while StageA.m_Tv.m_State != 2 { |
|
*yield 0.0 # Stuck until condition true |
|
} |
|
|
|
# Check another condition.. this is a short-cut if 7 collectibles had not been collected already |
|
if :FsGetCollPickedUp() != 7 { |
|
|
|
# Destroy the door immediately (does that mean it will disappear?) |
|
Door:Die(&eggdoor.@@AID@@) |
|
goto cleanup |
|
|
|
} |
|
|
|
# Play a sound to confirm the easter-egg was activated |
|
:FsPlaySFX(StageA.m_Elevator.m_door2.m_portal, False) |
|
|
|
# Create a new trigger, waiting for player to be near "PE_tLngPsg" (Where is that? Long-passage maybe?) |
|
t_next.@@Reserved@@ = :FsTriggerBox("PLAYER", "PE_tLngPsg") |
|
|
|
# Wait for trigger to be hit |
|
while int(t_next.@@Reserved@@) == False { |
|
*yield 0.0 # Stuck until trigger is hit |
|
} |
|
|
|
# Wait 1 second (?) |
|
*yield 1.0 |
|
|
|
# Open the door |
|
Door:Open(&eggdoor.@@AID@@) |
|
|
|
# Create a trigger for when the egg is hit (5.0 damage?) |
|
t_hit.@@Reserved@@ = :FsTriggerHealth("tEgg", 5.0) |
|
|
|
# This is a no-operation (condition always true), I assume this was left for debugging purpose? |
|
while 1 != 0 { |
|
|
|
# Reset egg health (?) |
|
:FsSetTriggerHealth(t_hit.@@Reserved@@, 5.0) |
|
|
|
# Check if health trigger condition is met |
|
while int(t_hit.@@Reserved@@) == False { |
|
*yield 0.0 # Stuck until trigger is hit |
|
} |
|
|
|
# Play a sound when the easter-egg is hit |
|
:Play3dSound(&StageA.@@AID@@, StageA.m_Elevator.m_door2.m_bUsePortal, "tEgg", 100.0, 0.0)) |
|
|
|
# Do some egg animation |
|
:FsPlayAnimation("easter_egg", "on") |
|
|
|
# Yield at end of loop |
|
*yield 0.0 |
|
} |
|
|
|
# Destroy the egg door |
|
Door:Die(&eggdoor.@@AID@@) |
|
|
|
:cleanup |
|
|
|
# Keep track of the egg state |
|
StageA.aEgg = 2 |
|
|
|
} |