OBJECT
/obj/door
SYNOPSIS
#include <doors.h>
inherit "/obj/door";
OR
clone_object ("/obj/door");
LAST UPDATE
Mateese, 20-Jul-96 01:30 MET
DESCRIPTION
The /obj/door is a simple generic door, usable for everydays
life. It can be opened and closed, and even be configured to
be lockable using the standard lock. Per default it hides the
exit it controls when closed.
It is a descendant from /std/door and /std/thing.
If /obj/door is just cloned, it's preconfigured to be a
'door' of 100..200 coins worth and 40 kg weight with no lock.
By default, it can't be taken.
The door intercepts the moving command set as P_DIRECTION.
The door may be opened and closed:
open door
close door
If it is lockable, it may also be locked and unlocked:
lock door with <key>
unlock door with <key>
If an open door is locked, it is closed first.
The commands
open door with <key>
close door with <key>
would unlock&open, or close&lock the door.
The command
knock door
knock at door
lets the player knock at the door.
In all cases, the door must be visible to the player (visible
in its environment, or carried in its inventory). However, it
is not possible to open a door which is not in its room.
The key is searched in the inventory only.
The door is a upright descendant of /std/thing and /std/door.
It offers additionally:
mixed P_CHECKOBJ "CheckObj"
If the doors activity is to be checked (see P_CHECKDOOR of
/std/door), the function CheckAction() is called in the
object denoted by this property.
Acceptable values are:
0 : the function is called in the door object.
string : the function is called in the object with the
given filename.
object : the function is called in the given object.
closure: the closure is the function to be called.
See the doc for the builtin CheckAction() the calling
conventions.
mixed P_CHECKNOTIFY "CheckNotify"
If this value is set to a string or closure, and a checked
action tested by CheckAction() fails, this value is set as
argument to notify_fail().
int fblock (string str)
This is the interception function for the moving command.
int fknock (string str)
Implements the 'knock' command.
For checking the commands, this function may be overloaded:
int CheckAction (string action, string verb, string arg)
The command '<verb> <arg>' is applied to the door, with
its type determined by <action>:
<action> = 'block': the door attempts to block a way.
= 'door' : the door shall be opened or closed.
= 'lock' : the door shall be locked or unlocked.
= 'knock': someone tries to knock on the door.
The function has to return non-zero if the action shall
succeed, and zero if the action shall fail.
Default is that every action succeeds, unless it's the
action 'block' and the player is a ghost (i.e. ghosts are
not blocked).
If the door has no checking enabled, this function is not called.
The following functions of the parents are overloaded:
string InvShort()
Returns the capitalized short description (modified by
/std/lock::ModifyInvShort()) only if the door
is not active. This way the door doesn't show up in a
rooms inventory listing in that state.
string Long (string what)
Return the door's long description as returned by
thing::Long(), expanded to include the locking state and a
hint to the lock (if it has one).
string QueryStatusString ()
Returns a descriptional string of the door, useable for
a room's GetExits().
This is just a nicer variant of the default in /std/door.
mixed HandleIDP (int msg, mixed state)
This function generates approbiate messages for the
receiving door depending on the msg.
int fopen (string str)
Catches the case that an inactive door is opened or closed.
int flock (string str)
Checks if locking/unlocking is allowed.
int DoActionFor ( int action, int type, void|object *keys
, void|int kix)
Outputs extra non-vis messages to the room if the door is
opened or closed.
If the door is not active, no open/close messages are
issued.
void init ()
Adds the commands for the direction and 'knock'.
int move (mixed dest, int method, mixed extra)
Calls first thing::move() and then if successfull also
door::move().
int remove()
Calls first door::remove() (to keep this_object() valid
during the IDP) and then thing::remove().
int clean_up (int ref)
A wrapper which blocks SendIDP() in case of a remove(),
because the door object is not removed in a game sense.
INHERITANCE TREE
door
|-std/door
| `-std/lock
`-std/thing
|-std/base
|-std/thing/moving
|-std/thing/properties
`-std/thing/description
SEE ALSO
locks(C), container(S), door(S), lock(S), thing(S), chest(O)