chest

obj
OBJECT
	/obj/chest


SYNOPSIS
	#include <lock.h>
	#include <rooms.h>
	inherit "/obj/chest";

	  OR

	clone_object ("/obj/chest");

LAST UPDATE
	Mateese, 07-Oct-94 20:20 MET


DESCRIPTION
	The /obj/chest is a simple generic chest. It can be opened,
	closed, and even configured to be lockable using the standard
	lock. The lock is here the combination of 'true' lock and the
	chest's lid. Additionally, it can be equipped with items the
	same way a room can.

	If /obj/chest is just cloned, it's preconfigured to be a
	'chest' of 200 coins worth, 8 kg weight and an volume of
	another 8 kg.

	The chest may be opened and closed:

	  open chest
	  close chest

	If it is lockable, it may also be locked and unlocked:

	  lock chest with <key>
	  unlock chest with <key>

	If an open chest is locked, it is closed first.
	The commands

	  open chest with <key>
	  close chest with <key>

	would unlock&open, or close&lock the chest.

	In all cases, the chest must be visible to the player (visible
	in its environment, or carried in its inventory). The key is
	searched in the inventory only.

	The chest utilizes just the functions from /std/lock for the
	commands.

	The chest is a upright descendant of /std/container, /std/lock
	and /std/room/items.

	The following functions of /std/container are overloaded:

	string InvShort (string what)
	  Returns the container::InvShort(), modified by
	  lock::ModifyInvShort().

	string Long (string what)
	string IntLong (string what)
	  Return the chests long description as returned by
	  container::Long()/IntLong(), modified by lock:ModifyLong().

	string Content (string what, void|mixed exclude)
	  If the chest is open or the player is inside, return the
	  inventory description as returned by /std/container.
	  Else (chest closed 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, 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.
	  The only exception is when ghosts try to leave a closed
	  chest, this is possible.

	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.
	  The only exception is when ghosts try to enter a closed
	  chest, this is possible.

	object *Locate (void|mixed what, void|int mode)
	  If the chest is closed, it returns just an empty array resp. 0, 
	  else the /std/container's result.
	  The only exception is when ghosts try to look into a closed
	  chest, this is possible.


INHERITANCE TREE
	chest
	  |-std/room/items
	  |-std/lock
	  `-std/container
	      |-std/container
		  |-std/base
		  |-std/thing/properties
		  |-std/room/description
		  |-std/thing/description
		  |-std/thing/moving
		  `-std/container/restrictions
		      |-std/thing/restrictions
		      `-std/room/restrictions



SEE ALSO
	locks(C), container(S), lock(S), room(S), thing(S), door(O)