Prev: 58388 Up: Map Next: 58677
58439: Human 7-12: Human With Rifle (Shooter)
Human_Shooter 58439 POP HL Restore human table pointer from the stack.
Shooter_DecreaseCountdown 58440 LD A,(HL) Decrease the humans action countdown by one.
58441 DEC A
58442 LD (HL),A
58443 CP 200 Jump to Shooter_AboutToHide if the humans action countdown (A) is higher than 200.
58445 JP NC,Shooter_AboutToHide
58448 CP 20 Jump to Shooter_EndCycle if the humans action countdown (A) is lower than 20.
58450 JR C,Shooter_EndCycle
58452 AND %00011111 Keep only bits 0-4.
58454 JR Z,Shooter_Action Jump to Shooter_Action if the result is zero.
58456 LD A,(HL) A=*HL.
58457 RLCA RLCA.
58458 RLCA
58459 RLCA
58460 AND %00000011 Keep only bits 0-1.
58462 CALL 56281 Call 56281.
58465 JR Human_Shooter_0 Jump to Human_Shooter_0.
Handle the action, but also give a small chance the human should hide.
Shooter_Action 58467 CALL ShouldHumanHide Call ShouldHumanHide.
58470 JR C,Shooter_DecreaseCountdown Jump to Shooter_DecreaseCountdown if the human is set to start hiding.
58472 CALL TargetMonster Call TargetMonster.
58475 EX AF,AF' Exchange the AF register with the shadow AF register.
58476 AND %00000011 Keep only bits 0-1.
58478 RRCA Rotate A right three positions (bits 0 to 2 are now in positions 5 to 7).
58479 RRCA
58480 RRCA
58481 OR %00011111 Set bits 0-4.
58483 LD (HL),A Write A to *HL.
Human_Shooter_0 58484 INC HL Increment HL by one.
58485 LD A,(HL) A=*HL.
58486 CP B Compare A with B.
58487 INC HL Increment HL by one.
58488 LD A,(HL) A=*HL.
58489 DEC HL Decrease HL by two.
58490 DEC HL
58491 JR Z,Human_Shooter_1 Jump to Human_Shooter_1 if HL is zero.
58493 JR NC,Human_Shooter_2 Jump to Human_Shooter_2 if {} is higher.
58495 CP C Jump to Human_Shooter_5 if A is equal to C.
58496 JR Z,Human_Shooter_5
58498 JR C,Human_Shooter_4 Jump to Human_Shooter_4 if A is lower than C.
58500 JR Human_Shooter_6 Jump to Human_Shooter_6.
Human_Shooter_1 58502 CP C Jump to Human_Shooter_3 if A is lower than C.
58503 JR C,Human_Shooter_3
58505 JR Human_Shooter_11 Jump to Human_Shooter_11.
Human_Shooter_2 58507 CP C Jump to Human_Shooter_9 if A is equal to C.
58508 JR Z,Human_Shooter_9
58510 JR C,Human_Shooter_8 Jump to Human_Shooter_8 if A is lower than C.
58512 JR Human_Shooter_10 Jump to Human_Shooter_10.
Human_Shooter_3 58514 LD B,202
ID Sprite
202 human-202-left
58516 JR Human_Shooter_12 Jump to Human_Shooter_12.
Human_Shooter_4 58518 LD B,204
ID Sprite
204 human-204-left
58520 JR Human_Shooter_7 Jump to Human_Shooter_7.
Human_Shooter_5 58522 LD B,206
ID Sprite
206 human-206-left
58524 JR Human_Shooter_7 Jump to Human_Shooter_7.
Human_Shooter_6 58526 LD B,208
ID Sprite
208 human-208-left
Human_Shooter_7 58528 CALL RandomNumber Call RandomNumber.
58531 CP 4 Compare A with 4.
58533 LD A,B A=B.
58534 JP NC,Draw_Human_Sprite Jump to Draw_Human_Sprite if {} is higher.
58537 LD C,0 C=0.
58539 CALL Human_Shooter_13 Call Human_Shooter_13.
58542 JP Draw_Human_Sprite Jump to Draw_Human_Sprite.
Human_Shooter_8 58545 LD B,204
ID Sprite
204 human-204-left
58547 JR Human_Shooter_12 Jump to Human_Shooter_12.
Human_Shooter_9 58549 LD B,206
ID Sprite
206 human-206-left
58551 JR Human_Shooter_12 Jump to Human_Shooter_12.
Human_Shooter_10 58553 LD B,208
ID Sprite
208 human-208-left
58555 JR Human_Shooter_12 Jump to Human_Shooter_12.
Human_Shooter_11 58557 LD B,210
ID Sprite
210 human-210-left
58559 JR Human_Shooter_7 Jump to Human_Shooter_7.
Human_Shooter_12 58561 CALL RandomNumber Call RandomNumber.
58564 CP 4 Compare A with 4...
58566 LD A,B A=B.
58567 JP NC,Draw_Human_Sprite_Mirrored Jump to Draw_Human_Sprite_Mirrored if A is higher than 4.
58570 LD C,128 C=128.
58572 CALL Human_Shooter_13 Call Human_Shooter_13.
58575 JP Draw_Human_Sprite_Mirrored Jump to Draw_Human_Sprite_Mirrored.
When the countdown reaches 10 (from 128), jump to Shooter_Action to start a new cycle.
Shooter_EndCycle 58578 CP 10 Jump to Shooter_Action if A is equal to 10.
58580 JR Z,Shooter_Action
The countdown between 206-201 handles the delay before 200 will hide the human.
Shooter_AboutToHide 58582 LD A,192
ID Sprite
192 human-192-left
58584 JP NZ,Draw_Human_Sprite Jump to Draw_Human_Sprite until the countdown equals 200 (from line 58443).
58587 JP Handler_Human_Hide Jump to Handler_Human_Hide.
Human_Shooter_13 58590 LD A,(54264) Compare *NumberBullets with 8...
58593 CP 8
58595 LD A,B A=B.
58596 RET Z Return if *NumberBullets is equal to 8 on line 58593.
58597 LD DE,53948 DE=53948.
58600 EX AF,AF' Exchange the AF register with the shadow AF register.
Human_Shooter_14 58601 INC DE Increment DE by three.
58602 INC DE
58603 INC DE
58604 LD A,(DE) Jump to Human_Shooter_14 if *DE is not zero.
58605 AND A
58606 JR NZ,Human_Shooter_14
58608 LD A,B A=B.
58609 SUB 200 A-=200.
58611 RRCA RRCA.
58612 OR C Set the bits from C.
58613 LD (DE),A Write A to *DE.
58614 INC DE Increment DE by one.
58615 INC HL Increment HL by one.
58616 LD C,(HL) C=*HL.
58617 INC HL Increment HL by one.
58618 LD B,(HL) B=*HL.
58619 CP 4 Jump to Human_Shooter_15 if A is not equal to 4.
58621 JR NZ,Human_Shooter_15
58623 INC C Increment C by one.
58624 JR Human_Shooter_19 Jump to Human_Shooter_19.
Human_Shooter_15 58626 CP 130 Jump to Human_Shooter_16 if A is not equal to 130.
58628 JR NZ,Human_Shooter_16
58630 INC B Increment B by one.
58631 JR Human_Shooter_19 Jump to Human_Shooter_19.
Human_Shooter_16 58633 CP 2 Jump to Human_Shooter_17 if A is equal to 2.
58635 JR Z,Human_Shooter_17
58637 CP 1 Jump to Human_Shooter_17 if A is equal to 1.
58639 JR Z,Human_Shooter_17
58641 CP 133 Jump to Human_Shooter_18 if A is not equal to 133.
58643 JR NZ,Human_Shooter_18
Human_Shooter_17 58645 INC B Increment B by one.
58646 INC C Increment C by one.
58647 JR Human_Shooter_19 Jump to Human_Shooter_19.
Human_Shooter_18 58649 AND %00000011 Keep only bits 0-1.
58651 CP 3 Jump to Human_Shooter_19 if A is not equal to 3.
58653 JR NZ,Human_Shooter_19
58655 INC B Increment B by one.
Human_Shooter_19 58656 LD A,C Write C to *DE.
58657 LD (DE),A
58658 INC DE Increment DE by one.
58659 LD A,B Write B to *DE.
58660 LD (DE),A
58661 DEC HL Decrease HL by two.
58662 DEC HL
58663 LD A,(54264) Increment *NumberBullets by one.
58666 INC A
58667 LD (54264),A
58670 LD A,2 Write melody ID 2 to *MelodyID.
58672 LD (65421),A
58675 EX AF,AF' Exchange the AF register with the shadow AF register.
58676 RET Return.
Prev: 58388 Up: Map Next: 58677