Prev: A317 Up: Map Next: A378
A325: Handler: World Object
Route a fuel pod, bomb or pickup through collect, drop and action-key tests.
Input
IX Actor slot
Reset the drop bit unless the action key is held.
Handler_WorldObject A325 CALL TestActionKey Jump to Handler_WorldObject_DispatchFlags if the action key is pressed.
A328 JR NZ,Handler_WorldObject_DispatchFlags
A32A RES 1,(IX+$08) Reset bit 1 of the actor flags.
Dispatch on carried, attached or free-in-world.
Handler_WorldObject_DispatchFlags A32E BIT 2,(IX+$08) Jump to Handler_HeldObject if bit 2 of the actor flags is set.
A332 JP NZ,Handler_HeldObject
A335 BIT 0,(IX+$08) Jump to PlaceCarriedItem if bit 0 of the actor flags is set.
A339 JP NZ,PlaceCarriedItem
Settle the object on the ground, then attach it if the rover is free and in range.
A33C CALL ClampObjectToGround Call ClampObjectToGround.
A33F LD A,($5EA3) Fetch RoverCargoFlag.
A342 AND A Jump to Handler_WorldObject_TestAction if the rover is already carrying.
A343 JR NZ,Handler_WorldObject_TestAction
A345 CALL CompareActorDistance Call CompareActorDistance.
A348 JR C,AttachCarriedItem Jump to AttachCarriedItem if the object is in range.
On action, attach this object if Jetman can collect it.
Handler_WorldObject_TestAction A34A BIT 1,(IX+$08) Jump to Handler_WorldObject_Loop if bit 1 of the actor flags is set.
A34E JR NZ,Handler_WorldObject_Loop
A350 CALL TestActionKey Call TestActionKey.
A353 JR Z,Handler_WorldObject_Loop Jump to Handler_WorldObject_Loop if the action key is not pressed.
A355 LD A,($6078) Fetch Jetman_Slot.
Type 11 and above means Jetman is not on foot.
A358 CP $11 Jump to Handler_WorldObject_Loop if Jetman's type is at least 11.
A35A JR NC,Handler_WorldObject_Loop
A35C CALL TestJetmanAction_ComparePosition Call TestJetmanAction_ComparePosition.
A35F JR NC,Handler_WorldObject_Loop Jump to Handler_WorldObject_Loop if the object is out of range.
Mark Jetman as carrying and flag the object as held.
A361 LD HL,$6080 HL=Jetman_Flags.
A364 BIT 0,(HL) Jump to Handler_WorldObject_Loop if bit 0 is set.
A366 JR NZ,Handler_WorldObject_Loop
A368 SET 0,(HL) Set bit 0 of Jetman_Flags.
A36A SET 0,(IX+$08) Set bit 0 of the actor flags.
A36E SET 1,(IX+$08) Set bit 1 of the actor flags.
A372 CALL SoundsTakeObject Call SoundsTakeObject.
This entry point is used by the routines at ReleaseCarriedItem, AttachCarriedItem and PlaceCarriedItem.
Handler_WorldObject_Loop A375 JP DrawCurrentActor_Draw Jump to DrawCurrentActor_Draw.
Prev: A317 Up: Map Next: A378