Prev: 52142 Up: Map Next: 52193
52148: Move Drutt, or entity he is pushing right one character and start pushed entity falling if appropriate
Drutt will only push other entities when he is under player control. If he is not, then he will just pass through pushable entities.
Used by the routine at 52142.
Input
IX Address of complex state data (current level) for Drutt
52148 CALL 54569 Check Drutt for collision with another impassable / pushable entity immediately to the right...
52151 JR C,52182 ...and if a collision has not occurred, then skip ahead to 52182
At this point, a collision has occurred, so IY points to the complex state data entry of the entity with which Drutt has collided
52153 CP 22 If collision was with an entity of class 22 or greater (can't be picked up)...
52155 JR NC,52171 ...then skip ahead to 52171
52157 BIT 1,(IX+9) If Drutt's under-player-control flag is reset...
52161 JR Z,52182 ...then skip ahead to 52182 (move Drutt right without pushing anything)
52163 PUSH IX Store IX (address of current level's complex state data for Drutt)
52165 CALL 52193 Advance position of entity pushed right by Drutt
52168 POP IX Restore IX (address of current level's complex state data for Drutt)
52170 RET Return
Collision with entity of class 22 or greater
52171 CP 129 If collision was with entity of class 129 (causes other entities to start falling)...
52173 JR Z,52182 ...then skip ahead to 52182
At this point, the entity to Drutt's right is neither passable nor pushable.
52175 POP BC Remove top value from stack (i.e. return address to routine that called this routine)
52176 LD HL,51630 Point HL at script data for Drutt swapping depth levels...
52179 JP 48098 ...and execute
No collision, not under player control or collision with entity of class 129
52182 CALL 54313 Move Drutt into room to the right, if appropriate...
52185 RET NC ...and if Drutt can't enter new room then return
52186 INC (IX+5) Move Drutt right one character...
52189 INC (IX+7) ...
52192 RET Return
Prev: 52142 Up: Map Next: 52193