Prev: 36253 Up: Map Next: 36562
36485: Action: Check The Object Flags
Used by the routines at Action_Direction and Action_LeaveIfTheWayIsOpen.
Checks the object's attributes and volume against the move volume at ActionMoveVolume and the current location at ActionLocationID before a move is allowed.
Action_CheckTheObjectFlags 36485 AND A Jump to Action_CheckTheObjectFlags_ReadTheLocation if A is zero.
36486 JR Z,Action_CheckTheObjectFlags_ReadTheLocation
Find the object's record.
36488 CALL LocateObject Call LocateObject to locate object.
36491 LD A,(IX+7) Read the attribute flags from the object record.
36494 AND 40 Keep bits 3, 5.
36496 JR Z,Action_CheckTheObjectFlags_ReturnFlagValueOne Jump to Action_CheckTheObjectFlags_ReturnFlagValueOne when the object is neither broken nor open.
Test whose turn it is.
36498 LD A,(46826) Jump to Action_CheckTheObjectFlags_ReadTheMoveVolume if *CurrentCharacter is not zero.
36501 AND A
36502 JR NZ,Action_CheckTheObjectFlags_ReadTheMoveVolume
36504 BIT 7,(IX+4) Jump to Action_CheckTheObjectFlags_ReturnFlagValueOne if bit 7 of the object's second flag is set.
36508 JR NZ,Action_CheckTheObjectFlags_ReturnFlagValueOne
Action_CheckTheObjectFlags_ReadTheMoveVolume 36510 LD A,(36252) Read the move volume.
36513 LD B,(IX+2) Read the volume from the object record.
36516 SUB B Jump to Action_CheckTheObjectFlags_ReturnFlagValueTwo if the move volume is not below the object's volume.
36517 JR NC,Action_CheckTheObjectFlags_ReturnFlagValueTwo
Action_CheckTheObjectFlags_ReadTheLocation 36519 LD A,(36251) Read the current location.
36522 LD B,A Copy the result into B.
Find the location's record.
36523 CALL LocateLocation Call LocateLocation to locate location.
36526 LD (36249),IX Save the location record pointer at ActionLocationData, and jump to Action_CheckTheObjectFlags_ReturnZero if this location's volume byte is 255.
36530 LD A,255
36532 CP (IX+1)
36535 JR Z,Action_CheckTheObjectFlags_ReturnZero
36537 LD A,B Use the current location again.
36538 CALL TableFindAnExit Call TableFindAnExit to find an exit.
36541 LD C,A Jump to Action_CheckTheObjectFlags_ReturnFlagValueThree if the move volume is not below the current location.
36542 LD A,(36252)
36545 SUB C
36546 JR NC,Action_CheckTheObjectFlags_ReturnFlagValueThree
Action_CheckTheObjectFlags_ReturnZero 36548 XOR A Return zero.
36549 RET Return.
Action_CheckTheObjectFlags_ReturnFlagValueThree 36550 LD A,3 The flag value to return is 3.
36552 AND A Set the flags from 3. The zero flag is clear.
36553 RET Return.
Action_CheckTheObjectFlags_ReturnFlagValueTwo 36554 LD A,2 The flag value to return is 2.
36556 AND A Set the flags from 2. The zero flag is clear.
36557 RET Return.
Action_CheckTheObjectFlags_ReturnFlagValueOne 36558 LD A,1 The flag value to return is 1.
36560 AND A Set the flags from 1. The zero flag is clear.
36561 RET Return.
Prev: 36253 Up: Map Next: 36562