Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Typedefs | Functions
DOOR

Door Control System. More...

Data Structures

struct  T_doorGroupHandleStruct
 
struct  T_doorTag
 

Macros

#define DOOR_DELETE_TAG
 
#define DOOR_IS_LOCKED   DOOR_ABSOLUTE_LOCK
 
#define DOOR_IS_UNLOCKED   0
 
#define DOOR_SOUND_MAX_VOLUME   255
 
#define DOOR_SOUND_NUMBER   5000
 
#define DOOR_SOUND_RADIUS   1500
 
#define DOOR_TAG
 
#define MAX_DOOR_LOCK   0xFF
 

Typedefs

typedef struct T_doorTag T_door
 

Functions

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)
 

Detailed Description

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

Macro Definition Documentation

#define DOOR_DELETE_TAG
Value:
((((T_word32)'D') << 0) | \
(((T_word32)'D') << 8) | \
(((T_word32)'e') << 16) | \
(((T_word32)'l') << 24))
#define DOOR_IS_LOCKED   DOOR_ABSOLUTE_LOCK
#define DOOR_IS_UNLOCKED   0
#define DOOR_SOUND_MAX_VOLUME   255
#define DOOR_SOUND_NUMBER   5000
#define DOOR_SOUND_RADIUS   1500
#define DOOR_TAG
Value:
((((T_word32)'D') << 0) | \
(((T_word32)'O') << 8) | \
(((T_word32)'o') << 16) | \
(((T_word32)'R') << 24))
#define MAX_DOOR_LOCK   0xFF

Typedef Documentation

typedef struct T_doorTag T_door

Function Documentation

T_void DoorClose ( T_word16  sector)

DoorClose closes a door and starts the appropriate slider.

Parameters
sector– Sector with door to close
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 
)

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
T_void DoorDecreaseLock ( T_word16  sector,
T_word16  amount 
)

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.
T_void DoorFinish ( T_void  )

DoorFinish cleans up the door module and unloads all memory.

T_void DoorForceOpen ( T_word16  sector)

DoorForceOpen opens a door whether or not it is locked.

Parameters
sector– Sector with door to open.
T_word16 DoorGetLockValue ( T_word16  sector)

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
T_word16 DoorGetPercentOpen ( T_word16  sector)

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
T_word16 DoorGetRequiredItem ( T_word16  doorSector)

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
T_void DoorIncreaseLock ( T_word16  sector,
T_word16  amount 
)

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.
T_void DoorInitialize ( T_void  )

DoorInitialize starts up all the information needed for handling doors.

E_Boolean DoorIsAtSector ( T_word16  sector)

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
E_Boolean DoorIsLock ( T_word16  sector)

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
T_void DoorLoad ( T_word32  mapNumber)

DoorLoad loads the appropriate map door file.

T_void DoorLock ( T_word16  sector)

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.

E_Boolean DoorOpen ( T_word16  sector)

DoorOpen opens a door and starts the appropriate slider unless the the door is locked.

Parameters
sector– Sector with door to open.
T_void DoorSetRequiredItem ( T_word16  doorSector,
T_word16  itemType 
)

DoorSetRequiredItem makes a door that is locked become a door that requires a particular item.

Parameters
doorSector– Sector containing door
itemType– Required item
T_void DoorUnlock ( T_word16  sector)

DoorUnlock unlocks a door. If it is already unlocked, nothing happens.