Routines |
Prev: CF0B | Up: Map | Next: CF58 |
Used by the routine at CDD7.
|
||||
Goblin warriors become apprehensive of Maroc if he's cast any slightly powerful spell (also see Trivia - Creatures spooked by Maroc's magic. This affects their movement patterns and can keep them at bay.
|
||||
CF3E | LD A,($EB4E) | (Creature) properties byte | ||
CF41 | AND $01 | Bit 0 (1) indicates whether the creature is visible on-screen | ||
CF43 | JR Z,$CF0B | If not, don't need to do anything to change the creature's movement (yet) | ||
CF45 | LD A,($EAEC) | Get the currently active spell | ||
CF48 | CP $05 | Check if spell number >=5 | ||
CF4A | JP NC,$CE4F | If so, goblin will be nervous..! Change goblin movement pattern | ||
Maroc is not wielding powerful magic, so the goblin can continue its standard movement pattern - this is a continuous horizontal movement, with vertical movement zig-zagging every 8th game cycle:
|
||||
CF4D | LD A,($EAAA) | Game timer/counter | ||
CF50 | AND $07 | Check bits 0-2 (values 0-7) | ||
CF52 | JP Z,$CF0B | If zero, it's an 8th game cycle so change vertical direction | ||
CF55 | JP $D04B | ...Otherwise continue in same direction |
Prev: CF0B | Up: Map | Next: CF58 |