Prev: 48382 Up: Map Next: 48417
48388: Decrease remaining time for current power and if zero, exit calling routine and run script data for removal of power
Used by the routines at 35689, 36542 and 48487.
48388 LD DE,(34224) Load remaining power time into DE
48392 LD A,E Increase E (number of game-cycles power has been in use in current block)...
48393 INC A ...
48394 LD E,A ...
48395 CP 15 If 16 game-cycles of power use have not yet elapsed...
48397 JR NZ,48402 ...then skip ahead to 48402
48399 LD E,0 Reset number of game-cycles power has been in use to zero...
48401 DEC D ...and decrease remaining number of 16-game-cycles
48402 LD (34224),DE Store updated remaining power time...
48406 RET NZ ...and return if this is not zero
48407 POP BC Remove top value from stack (i.e. return address to routine that called this routine)
48408 CALL 48417 Remove Berk's current power and reset sweet / mushroom / edible eyes / sausage to its original position
48411 LD HL,35275 Point HL at script data for Berk's power expiring...
48414 JP 48098 ...and execute
Prev: 48382 Up: Map Next: 48417