Routines |
Prev: EA43 | Up: Map | Next: EAF6 |
|
|||||||||||||||||||||
Event_Landed | EA9C | LD A,($D24B) | Jump to Landed_CheckControls if *Active_MonsterActionCountdown is equal to 19. | ||||||||||||||||||
EA9F | CP $19 | ||||||||||||||||||||
EAA1 | JR Z,Landed_CheckControls | ||||||||||||||||||||
EAA3 | DEC A | Decrease *Active_MonsterActionCountdown by one. | |||||||||||||||||||
EAA4 | LD ($D24B),A | ||||||||||||||||||||
EAA7 | JR NZ,Landed_OnAss | Jump to Landed_OnAss if *Active_MonsterActionCountdown is not yet zero. | |||||||||||||||||||
Not sure if this is a bug or not but this is why the player monster continually "sits down" after landing if you don't touch the controls. Then again, maybe it's intentional given EA9C checks if this is 19.
|
|||||||||||||||||||||
EAA9 | LD A,$19 | Reset *Active_MonsterActionCountdown to 19. | |||||||||||||||||||
EAAB | LD ($D24B),A | ||||||||||||||||||||
EAAE | LD A,($D252) | Jump to Landed_GetUp if *Active_MonsterControlType is set to "computer controlled". | |||||||||||||||||||
EAB1 | AND A | ||||||||||||||||||||
EAB2 | JR Z,Landed_GetUp | ||||||||||||||||||||
This monster isn't computer controlled so check if any controls have been pressed.
|
|||||||||||||||||||||
Landed_CheckControls | EAB4 | CALL Controls | Call Controls. | ||||||||||||||||||
EAB7 | AND A | Jump to Landed_OnAss if no controls are being pressed. | |||||||||||||||||||
EAB8 | JR Z,Landed_OnAss | ||||||||||||||||||||
Either a monster player control has been pressed, or this is a computer controlled monster.
|
|||||||||||||||||||||
Landed_GetUp | EABA | LD A,($D247) | A=*Flag_Orientation. | ||||||||||||||||||
Moves the orientation flag into the carry flag.
|
|||||||||||||||||||||
EABD | RRCA | Rotate A right one position, setting the carry flag if bit 0 was set. | |||||||||||||||||||
EABE | CALL NC,Handler_DecreaseMonsterXPosition | Call Handler_DecreaseMonsterXPosition if the carry flag is not set. | |||||||||||||||||||
Restart the actions jump table back to the beginning.
|
|||||||||||||||||||||
EAC1 | XOR A | A=00. | |||||||||||||||||||
EAC2 | LD ($D244),A | Reset *JumpTable_Pointer back to 00. | |||||||||||||||||||
Set the monster flags back to "normal" states.
|
|||||||||||||||||||||
EAC5 | LD ($D246),A | Write "not climbing" (00) to *Flag_MonsterClimbing. | |||||||||||||||||||
EAC8 | LD ($D248),A | Write "not jumping" (00) to *Flag_MonsterJumping. | |||||||||||||||||||
EACB | JP Action_JumpTable | Jump to Action_JumpTable. | |||||||||||||||||||
No controls are being pressed and *Active_MonsterActionCountdown is not yet zero, so the monster is still flat on their ass.
The routine at DrawMonsterSprite handles which monster to display.
|
|||||||||||||||||||||
Landed_OnAss | EACE | LD A,$07 | A=sprite ID 07.
|
||||||||||||||||||
Set the co-ordinates for where to draw.
|
|||||||||||||||||||||
EAD0 | LD BC,($D24D) | BC=*Active_MonsterXPosition/Active_MonsterYPosition. | |||||||||||||||||||
EAD4 | CALL DrawMonsterSprite | Call DrawMonsterSprite. | |||||||||||||||||||
Again, set the co-ordinates for where to draw.
|
|||||||||||||||||||||
EAD7 | LD BC,($D24D) | BC=*Active_MonsterXPosition/Active_MonsterYPosition. | |||||||||||||||||||
EADB | INC B | Increment the Y position by two and the X position by one, to target drawing the mouth/ fist section. | |||||||||||||||||||
EADC | INC B | ||||||||||||||||||||
EADD | INC C | ||||||||||||||||||||
Adjust the Y position for which way the monster is facing.
|
|||||||||||||||||||||
EADE | LD A,($D247) | A=*Flag_Orientation. | |||||||||||||||||||
EAE1 | XOR %00000001 | Flip bit 0. | |||||||||||||||||||
EAE3 | ADD A,C | A+=C. | |||||||||||||||||||
EAE4 | LD C,A | C=A. | |||||||||||||||||||
The routine at DrawMonsterSprite handles which monster to display.
|
|||||||||||||||||||||
EAE5 | LD A,$1B | A=sprite ID 1B.
|
|||||||||||||||||||
EAE7 | CALL DrawMonsterSprite | Call DrawMonsterSprite. | |||||||||||||||||||
EAEA | LD A,($D244) | Return if *JumpTable_Pointer is not equal to 20. | |||||||||||||||||||
EAED | CP $20 | ||||||||||||||||||||
EAEF | RET NZ | ||||||||||||||||||||
EAF0 | LD A,$21 | Write 21 to *JumpTable_Pointer. | |||||||||||||||||||
EAF2 | LD ($D244),A | ||||||||||||||||||||
EAF5 | RET | Return. |
Prev: EA43 | Up: Map | Next: EAF6 |