Prev: 43810 Up: Map Next: 43850
43831: Action: Set Turn Counter
Writes the second operand into the turn counter selected by the first operand.
Input
F The zero flag is set when the conditions hold
IX Pointer to the script entry (opcode, counter, value)
When the condition failed, skip this action.
Action_SetTurnCounter 43831 JP NZ,RunScript_SkipAction_ThreeBytes Jump to RunScript_SkipAction_ThreeBytes if the condition failed.
The first operand selects a counter at TurnEventCounters; the second is the new value.
43834 LD HL,41161 Point HL at the turn-event counters at TurnEventCounters.
43837 LD E,(IX+1) Add the counter index from *IX+1.
43840 LD D,0
43842 ADD HL,DE Point HL at that counter.
43843 LD A,(IX+2) Fetch the new value from *IX+2 into A.
43846 LD (HL),A Store it in the selected counter.
43847 JP RunScript_SkipAction_ThreeBytes Jump to RunScript_SkipAction_ThreeBytes.
Prev: 43810 Up: Map Next: 43850