Prev: 41916 Up: Map Next: 42056
41958: Action: Capture
Captures the current creature. Reached through the action table at ActionTable, dispatched by Turn_RunTheHandlerIfPresent.
ActionCapture 41958 LD IX,(46856) Read *46856.
41962 LD A,(IX+4) Read the second flag from the object record.
41965 AND 112 Keep bits 4-6 of the flags, save IX, and point IX at the object in *Pointer_CurrentCharacter.
41967 PUSH IX
41969 LD IX,(46860)
41973 AND (IX+4) Test these bits of the object's second flag.
41976 POP IX Restore the object record from the stack and jump to ResponseThatWillNotWork if those flag bits were set.
41978 JP NZ,ResponseThatWillNotWork
41981 BIT 6,(IX+7) Jump back to ResponseThatWillNotWork if the object is not an animal.
41985 JP Z,ResponseThatWillNotWork
41988 LD A,(46826) Read *CurrentCharacter.
41991 LD B,31 Use location 31 and jump to ActionCapture_TestTheLocation if this character is 64.
41993 CP 64
41995 JR Z,ActionCapture_TestTheLocation
41997 CP 66 Jump to ActionCapture_TestTheLocation if the character whose turn it is is 66.
41999 JR Z,ActionCapture_TestTheLocation
42001 LD B,13 Use location 13 for any other character.
ActionCapture_TestTheLocation 42003 LD A,(46838) Read *46838.
42006 CP B Jump back to ResponseThatWillNotWork if the script location is the location in B.
42007 JP Z,ResponseThatWillNotWork
If the message is held back, the creature is not captured.
42010 CALL ConditionSuppressTheMessage Call ConditionSuppressTheMessage. If the message is held back, the creature is not captured.
42013 LD IX,(46856) Read *46856.
42017 LD (IX+16),B Update the object's location.
42020 LD (IX+1),255 Mark where this object is as unset.
42024 LD A,(46824) Read *CurrentObject.
42027 CALL Object_MoveContents_0 Call Object_MoveContents_0 to move what is inside the current object to the capture location.
42030 LD A,(46824) Read *CurrentObject.
42033 CP 0 Return if the current object is not zero.
42035 RET NZ
42036 LD (46826),A Update *CurrentCharacter.
42039 LD HL,49435 Point *Pointer_CurrentCharacter at "You".
42042 LD (46860),HL
Test whether the location is lit.
42045 CALL LocationLit Call LocationLit to test whether the location is lit.
42048 RET C Return if the location is dark (carry set).
42049 LD A,B Take the capture location into A.
42050 LD HL,45052 Point HL at "You are in".
42053 JP YouSee_Wrapper Jump to YouSee_Wrapper to print the location text.
Prev: 41916 Up: Map Next: 42056