Prev: C000 Up: Map Next: C06E
C027: Script Routine: (27) Task-two entity action
Spawn or refresh a helper entity from the current task-two state.
Input
IX Address of complex state data for an entity
ScriptRoutine_TaskTwoSpawnHelper C027 LD A,(IX+$04) Load A with the current entity's room index.
C02A LD B,(IX+$06) Load B with the current entity's y-extent.
C02D LD C,(IX+$07) Load C with the current entity's x-coordinate.
C030 LD IY,$8FD7 Point IY at the spawned-helper entity (StateData_Complex_17).
C034 LD (IY+$00),$06 Write 06 to the referenced entity's entity type.
C038 LD (IY+$04),A Set the referenced entity's room index.
C03B INC C Advance the helper's x-coordinate in C by one.
C03C LD (IY+$07),C Store C in the referenced entity's x-coordinate.
C03F INC C Advance the helper's x-extent base in C by one.
C040 LD (IY+$08),C Store C in the referenced entity's x-extent.
C043 INC B Step the Y value in B on by one.
C044 LD (IY+$05),B Store B in the referenced entity's y-coordinate.
C047 INC B Step the Y value in B on by one.
C048 LD (IY+$06),B Store B in the referenced entity's y-extent.
C04B SET 7,(IY+$01) Set bit 07 of the referenced entity's flags byte 1.
C04F LD A,($72B3) Load A with the game event flags (GameEventFlags).
C052 SET 0,A Set bit 00 of game event flags.
C054 LD ($72B3),A Set the game event flags (GameEventFlags).
C057 LD A,($72C0) Load A with the entity spawn timer (EntitySpawnTimer).
C05A INC A Advance entity spawn timer by one.
C05B LD ($72C0),A Set the entity spawn timer (EntitySpawnTimer).
C05E CP $04 Is entity spawn timer equal to 04? If not, jump to AdvanceScriptInstruction.
C060 JP NZ,AdvanceScriptInstruction
C063 LD A,($72B5) Load A with the task-two flags (TaskTwoFlags).
C066 SET 2,A Set bit 02 of task-two flags.
C068 LD ($72B5),A Set the task-two flags (TaskTwoFlags).
C06B JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
Prev: C000 Up: Map Next: C06E