Door Control System.
More...
|
T_void | DoorClose (T_word16 sector) |
|
T_void | DoorCreate (T_word16 sector, T_sword16 floor, T_sword16 ceiling, T_word16 timeOpen, T_word16 timePause, T_word16 lockLevel, T_sword16 soundX, T_sword16 soundY) |
|
T_void | DoorDecreaseLock (T_word16 sector, T_word16 amount) |
|
T_void | DoorFinish (T_void) |
|
T_void | DoorForceOpen (T_word16 sector) |
|
T_word16 | DoorGetLockValue (T_word16 sector) |
|
T_word16 | DoorGetPercentOpen (T_word16 sector) |
|
T_word16 | DoorGetRequiredItem (T_word16 doorSector) |
|
T_void | DoorIncreaseLock (T_word16 sector, T_word16 amount) |
|
T_void | DoorInitialize (T_void) |
|
E_Boolean | DoorIsAtSector (T_word16 sector) |
|
E_Boolean | DoorIsLock (T_word16 sector) |
|
T_void | DoorLoad (T_word32 mapNumber) |
|
T_void | DoorLock (T_word16 sector) |
|
E_Boolean | DoorOpen (T_word16 sector) |
|
T_void | DoorSetRequiredItem (T_word16 doorSector, T_word16 itemType) |
|
T_void | DoorUnlock (T_word16 sector) |
|
Door Control System.
The Door system controls the opening and closing of doors. It also handles locked doors (either opened through knock or by item).
- See Also
- http://www.amuletsandarmor.com/AALicense.txt
#define DOOR_IS_UNLOCKED 0 |
#define DOOR_SOUND_MAX_VOLUME 255 |
#define DOOR_SOUND_NUMBER 5000 |
#define DOOR_SOUND_RADIUS 1500 |
#define MAX_DOOR_LOCK 0xFF |
DoorClose closes a door and starts the appropriate slider.
- Parameters
-
sector | – Sector with door to close |
DoorCreate makes another door out of a sector.
- Parameters
-
sector | – Sector containing door |
floor | – Floor height to go between |
ceiling | – Ceiling height to go between |
timeOpen | – Time taken to open and close door |
timePause | – Time to pause with door open |
lockLevel | – Level of lock, 0=unlock, 255=permanent |
soundX | – X Position of door sound |
soundY | – Y Position of door sound |
DoorDecreaseLock makes the door have an easier chance to be opened.
- Parameters
-
sector | – Sector containing door |
amount | – Amount to lock the door. A value of 0-255 is expected, or 0xFFFF. |
DoorFinish cleans up the door module and unloads all memory.
DoorForceOpen opens a door whether or not it is locked.
- Parameters
-
sector | – Sector with door to open. |
DoorGetLockValue returns the lockedness of the door.
- Parameters
-
sector | – Sector containing door |
- Returns
- Amount to door is locked. A value of 0-255 is normal, else DOOR_ABSOLUTE_LOCK
DoorGetPercentOpen returns the percentage that the door is open in a range of 0 to 256 (0% to 100%).
- Parameters
-
sector | – Sector containing door |
- Returns
- 0=0%, 256=100% open
DoorGetRequiredItem returns the object type that the door requires or 0 if no object is required.
- Parameters
-
doorSector | – Sector containing door |
- Returns
- Object type required, or 0 for none
DoorDecreaseLock makes the door have an easier chance to be opened.
- Parameters
-
sector | – Sector containing door |
amount | – Amount to open the door. A value of 0-255 is expected, or 0xFFFF. |
DoorInitialize starts up all the information needed for handling doors.
DoorIsAtSector checks to see if the given sector is a door. If it is, TRUE is returned, else FALSE.
- Parameters
-
sector | – Sector to check if door |
- Returns
- TRUE=is door, else FALSE
DoorIsLock return TRUE if the door is locked, or return FALSE.
NOTE: DoorIsLock pretty much assumes the given sector is a door, else will always return FALSE.
- Returns
- TRUE if locked, else FALSE
DoorLoad loads the appropriate map door file.
DoorLock locks a door. If it is already locked, it stays locked.
NOTE: A door is only locked when it is fully closed. A locked open door reacts normally until fully closed – then it is truly locked.
DoorOpen opens a door and starts the appropriate slider unless the the door is locked.
- Parameters
-
sector | – Sector with door to open. |
DoorSetRequiredItem makes a door that is locked become a door that requires a particular item.
- Parameters
-
doorSector | – Sector containing door |
itemType | – Required item |
DoorUnlock unlocks a door. If it is already unlocked, nothing happens.