OBJECT
/obj/inroom
SYNOPSIS
#include <lock.h>
#include <rooms.h>
#include <properties.h>
inherit "/obj/inroom";
OR
clone_object ("/obj/inroom");
LAST UPDATE
Mateese, 07-Jan-96 19:30 MET
DESCRIPTION
The /obj/inroom is a room, which can be moved into other
rooms. Such a behaviour is useful e.g. for cars, ferries or
Klingon Birds Of Prey.
The /obj/inroom may closed or locked, but normally it is open.
The object is a descendant of /std/room, /std/container,
/std/thing and /std/lock, so you can use all their functions.
The /obj/inroom implements one own builtin property:
int P_USE_LOCK "UseLock"
When set to non-zero, the lock is activated.
This should be set just once during initialization.
When set to zero, all lock related values and functions
behave as if there is no lock.
If /obj/inroom is just cloned, it's preconfigured to be a
'room' of 0 coins worth, 0 kg weight, maximal volume and using
no lock.
If the lock is activated, the room may be opened/closed/locked
with the usual commands (see /obj/chest, /std/lock).
An inroom is by default fully transparent, unless P_USE_LOCK
is set to non-zero, activating the lock, and the P_LOCK_STATE is
set to LOCK_CLOSED or LOCK_LOCKED. In this case the
P_TRANSPARENCY set to the room takes effect.
Programming an inroom is a bit tricky - especially the exits
and commands have to check where the command giver is: outside
or inside.
Note that room details/noises/smells are accessible from the
inside only. Same applies to normal exits (such given by
destination path/object only).
The following inherited functions are overloaded:
void create ()
Initializes the inroom.
void init ()
If the lock is activated, the lock commands are added.
The room commands/exits are always added.
int id (string str)
Checks the given id <str> with both the description::id() as
with the room::id(). Returns non-zero if at least one of
both triggers.
int QueryLockState()
If the lock is inactive, LOCK_OPEN is returned, else the
current state of the lock.
string InvShort (string what)
Returns the containers InvShort(), modified by
lock::ModifyInvShort() if the lock is active.
string IntLong (string what)
Return the inrooms internal long description, modified by
lock:ModifyLong() if the lock is active.
string Long (string what)
string ExaLong (string what)
If <what> is not set, or the viewer is outside of the
inroom, the inrooms Long() description is returned, modified
by lock:ModifyLong() if the lock is active.
Else the appropriate detail description.
string Smell (string what)
string Noise (string what)
string Read (string what)
If <what> is not defined, or the viewer is outside of the
inroom, the inrooms smell/noise/readmsg is returned, else
the appropriate detail smell/noise/readmsg.
string Content (string what, void|mixed exclude)
If the inroom is open or the player is inside, return the
inventory description as returned by /std/container.
Else (chest inroom and player outside) 0 is returned.
int QueryTransparency(int flag)
If <flag> is non-zero, the containers ('closed')
P_TRANSPARENCY is returned.
Else, if the chest is open (determined by calling
QueryLockState()), 1000 is returned, else the containers
P_TRANSPARENCEY.
int prevent_leave (mixed dest, int method, mixed extra)
If the chest is closed, taking things from it is not possible.
In that case, ME_NO_LEAVE is returned.
int allow_enter (int method, mixed extra)
If the chest is closed, putting things into it is not possible.
In that case, ME_NO_ENTER is returned.
object *Locate (void|mixed what, void|int mode)
If the inroom is closed, it returns just an empty array resp. 0,
else the /std/container's result.
int clean_up (int ref)
The call is passed to the rooms clean_up(), to ensure a
proper handling of items.
Additionally, any inroom with environment() does not clean
up unless asked by its environment() (ref given as -1).
INHERITANCE TREE
inroom
|-std/lock
|-std/container/restrictions
| |-std/thing/restrictions
| `-std/room/restrictions
|-std/thing/description
|-std/room
| |-std/base
| |-std/room/cleaning
| |-std/room/items
| |-std/room/details
| |-std/room/exits
| |-std/room/description
| `-std/room/restrictions
`-std/thing/moving
SEE ALSO
locks(C), container(S), lock(S), thing(S), room(S)