Prev: 44449 Up: Map Next: 44801
44748: Handle Berk Action
Used by the routines at Update_Berk_State and Update_Timed_Events.
Flash the status attribute strip, play a stinger, clear messaging attrs, then count down Pointer_BerkHeldEntity / score.
Handle_Berk_Action 44748 LD HL,23225 Point HL at attribute-file address 23225 (attribute buffer).
44751 LD B,6 Load B with 6 as a loop counter.
Paint the status attribute strip bright, play Berk's action stinger, then clear messaging attrs.
Handle_Berk_Action_FillAttributes 44753 LD (HL),120 Write attribute/value 120 through the pointer in HL.
44755 INC HL Advance 23225 (attribute buffer) by one byte.
44756 DJNZ Handle_Berk_Action_FillAttributes Decrease the loop counter in B and jump to Handle_Berk_Action_FillAttributes if more iterations remain.
44758 LD A,2 Load A with sound index 2.
44760 CALL Queue_Sound Call Queue_Sound to queue a sound effect.
44763 CALL Play_QueuedSound Call Play_QueuedSound to play a fanfare / stinger.
44766 CALL Clear_Messaging_Attributes Call Clear_Messaging_Attributes to clear messaging attributes.
Count down the held-entity pointer and bump the score while Pointer_BerkHeldEntity is non-zero.
Handle_Berk_Action_ScoreHeldCountdown 44769 LD HL,(29403) Load HL with the pointer to the entity Berk is holding (Pointer_BerkHeldEntity).
44772 LD A,H Copy the high byte of the pointer into A.
44773 OR L OR L into A to test whether Pointer_BerkHeldEntity is zero.
44774 JP Z,Initialise_Room_Display If the result was zero, jump to Initialise_Room_Display.
44777 DEC HL Step pointer to the entity Berk is holding back by one byte.
44778 LD (29403),HL Store HL in the pointer to the entity Berk is holding (Pointer_BerkHeldEntity).
44781 LD HL,(29405) Load HL with the score (Score).
44784 INC HL Advance score by one byte.
44785 LD (29405),HL Store HL in the score (Score).
44788 CALL Initialise_Room_Display Call Initialise_Room_Display to initialise the room display.
44791 LD A,1 Load A with sound index 1.
44793 CALL Queue_Sound Call Queue_Sound to queue a sound effect.
44796 CALL Play_QueuedSound Call Play_QueuedSound to play a fanfare / stinger.
44799 JR Handle_Berk_Action_ScoreHeldCountdown Jump to Handle_Berk_Action_ScoreHeldCountdown to keep scanning held-entity slots.
Prev: 44449 Up: Map Next: 44801