Prev: 92ED Up: Map Next: 93DA
939E: Action: Give
Used by the routine at Event_GiveTheLunch.
Gives the current object to the second character. Reached through the action table at ActionTable, dispatched by Turn_RunTheHandlerIfPresent.
Action_Give 939E LD IY,($B70A) Read *B70A.
Test whether the object is being carried.
93A2 CALL ConditionIsTheObjectCarried Call ConditionIsTheObjectCarried to test whether the object is carried.
93A5 LD HL,$ADF1 Point at the message "You are not carrying it[0x15]" (ADF1).
93A8 JP NC,PrintMessage Jump back to PrintMessage if ConditionIsTheObjectCarried found the object not carried, to print "You are not carrying it".
93AB LD A,($B6E9) Read *B6E9.
93AE CALL Condition_TotalTheMassInside Call Condition_TotalTheMassInside to total the mass inside the object.
93B1 LD IX,($B708) Read *B708.
93B5 ADD A,(IX+$03) Add the object's mass onto the second object.
93B8 PUSH AF Read the mass from IY.
93B9 POP BC
93BA LD A,(IY+$03)
93BD SUB B Point HL at AE0C and jump to PrintMessage if the total in B is more than the mass of the object at IY.
93BE LD HL,$AE0C
93C1 JP C,PrintMessage
93C4 CALL ConditionSuppressTheMessage Call ConditionSuppressTheMessage. If the message is held back, the object is not given.
93C7 LD A,($B6E9) Read *B6E9.
93CA LD (IX+$01),A Update where this object is.
93CD LD A,(IY+$10) Read the location from IY.
93D0 LD (IX+$10),A Copy the second object's location.
93D3 LD B,A Copy the result into B.
93D4 LD A,($B6E8) Read *CurrentObject.
93D7 JP Object_MoveContents_0 Jump to Object_MoveContents_0 to move what is inside the current object to the other character's location.
Prev: 92ED Up: Map Next: 93DA