Prev: EBBB Up: Map Next: EC43
EBBC: Room Event : Savage Plants.
Used by the routine at Update_Room00.
Input
Output
Bucket of water stops Wally from being hit.
Handler_SavagePlant EBBC LD A,(Flag_BaddyInit) See if plants have been initialised.
EBBF OR A
EBC0 JR NZ,Handler_SavagePlant_0
Initialise
EBC2 LD A,$01 Set as initialised.
EBC4 LD (Flag_BaddyInit),A
EBC7 LD A,(SavagePlants_Bmp) Get bitmap.
EBCA LD L,$48 Set position for plant 1.
EBCC LD H,$A8
EBCE LD (BitmapX),HL
EBD1 CALL Bitmap16Draw
EBD4 LD L,$A8 Shift position for plant 2.
EBD6 LD (BitmapX),HL
EBD9 CALL Bitmap16Draw Check for bucket being full.
EBDC RET
Animate
Handler_SavagePlant_0 EBDD LD A,(Flag_WaterBucket)
EBE0 OR A
EBE1 JR Z,Handler_SavagePlant_1
EBE3 LD A,(Pocket1) See if bucket is being carried or is in the room.. If so then freeze plants by not animating them or checking for hitting wally.
EBE6 CP $10
EBE8 RET Z
EBE9 LD A,(Pocket2)
EBEC CP $10
EBEE RET Z
EBEF LD A,(ObjSlot05_Bmp)
EBF2 CP $10
EBF4 RET Z
Handler_SavagePlant_1 EBF5 LD A,(SavagePlants_Bmp) Get the current bitmap index.
EBF8 LD L,$48 Set position for plant 1.
EBFA LD H,$A8
EBFC LD (BitmapX),HL Erase plant.
EBFF CALL Bitmap16Draw
EC02 LD L,$A8 Offset for position of plant 2.
EC04 LD (BitmapX),HL Erase plant.
EC07 CALL Bitmap16Draw
EC0A INC A Increase animation frame.
EC0B CP $7A Check for animation loop.
EC0D JR NZ,Handler_SavagePlant_2
EC0F LD A,$75
Handler_SavagePlant_2 EC11 LD B,$08 Amount of hit points if Wally hits plant.
EC13 LD (SavagePlants_Bmp),A Update animation index.
EC16 LD L,$48 Draw both plants and check if Wally hits them.
EC18 LD H,$A8
EC1A LD (BitmapX),HL
EC1D CALL Bitmap16Draw
EC20 PUSH AF
EC21 CALL Wally_HitTest
EC24 POP AF
EC25 LD L,$A8
EC27 LD (BitmapX),HL
EC2A CALL Bitmap16Draw
EC2D CALL Wally_HitTest
EC30 LD A,(SavagePlants_Bmp)
EC33 CP $75 Make a noise for every new animation loop.
EC35 RET NZ
EC36 LD BC,$1408
EC39 LD DE,$0108
EC3C LD HL,$7F82
EC3F CALL Beep_Effect
EC42 RET
Prev: EBBB Up: Map Next: EC43