NAME
	water_room.c - a room with water functionality.

INHERITS
	/std/room.c (read room.doc for further details)
USES
	/std/special/water_obj.c 

SETUP FUNCTIONS

	set_surface
	set_bottom
	set_drown_time
	set_damage

QUERY FUNCTIONS

	query_surface
	query_bottom
	query_drown_time
	query_damage

SPECIAL PROPERTIES

	air_supply	- If an object has this property and a player carries
			  it, the player can breath under water.
	airy_water	- If the room has water that can be breath set this
			  property.
	do_damage	- If you want the player to be damaged when the player
			  has no air, set this property.
	floatable	- If an object has this property set, it will float to
			  the surface
	salt_water	- If the water is salt the player wont be able to
			  drink the water in the room.
	waterbreathing	- If a living has this property, it can breath under
			  water.
	waterfilled	- Activate the waterroom code, By default set!
	__remote	- see below

DESCRIPTION
	It may also be used as a normal room. Whether it is waterfilled or
	not is controlled by using properties: If the property "waterfilled"
	is set, the room's special behaviour will be activated. This makes
	it possible to simulate tides, airlocks, etc...
	The property is set by default. To remove it, do
	'remove_property("waterfilled");'

	In water_rooms the command drink is defined, and if you type drink
	water you drink some water. If you want diffrent functionallity
	you can redefine the function called cmd_drink_water.

	If something is dropped in the room, it can float or sink depending
	on among other things, weight and properties.

=======================================================================
NAME
	set_surface - set the room where the surface is

SYNTAX
	void set_surface(string room)

DESCRIPTION

	Set the room to where the player ends up in when he floats to
	the surface. 
	If set_surface() is not called, the room is considered a water
	surface, and there will be no risk of drowning.
=======================================================================
NAME
	set_bottom - set the room where the bottom is

SYNTAX
	void set_bottom(string room)

DESCRIPTION

	Set the room where the bottom is.
	If set_bottom() is not called, the room is supposed to have its own
	bottom,	and dropped items will not sink.
=======================================================================
NAME
	set_damage - set the damage a drowning player takes

SYNTAX
	void set_damage(int dam)

DESCRIPTION

	Set the damange a drowning player takes. You also need to call
	set_drown_time(), which decides how often the player will take
	drowning damage. Note that the argument should be positive.
	If you don't call this function, the default damage is 10.
========================================================================
NAME
	set_drown_time - set the time a player can be underwater

SYNTAX
	void set_drown_time(int i)

DESCRIPTION

	Sets the time after which the player is forced to
	the surface, and thus rescued from drowning.  
=======================================================================
NAME
	query_surface - ask what room is surface

SYNTAX
	string query_surface()

DESCRIPTION

	Returns the room that is this rooms surface.
	The surface variable is evaluated before it is returned.
=======================================================================
NAME
	query_bottom - ask what room is bottom

SYNTAX
	string query_bottom()

DESCRIPTION

	Returns the room that is this room's bottom.
	The bottom variable is evaluated before it is returned.	
=======================================================================
NAME
	query_damage - ask what the drowning damage is

SYNTAX
	int query_damage()

DESCRIPTION

	Returns the damage a player will take from drowning.
	The damage variable is evaluated before it is returned.
=======================================================================
NAME
	query_drown_time - ask how long time a player can stay in this room

SYNTAX
	int query_drown_time()

DESCRIPTION

	Returns the time a player can stay in this room without being
	forced to the surface.
	The drown time variable is evaluated before it is returned.
=======================================================================
NAME
        remote object
SYNTAX
        void add_property("__remote",string remote_file_name);
        void add_property("__remote",object remote_object);
DESCRIPTION
        The remote object is used to add side effect.
	The following functions are used:

	int remote_block_sink_search(object location)
	If you want to block the sinking and floating of objects
	return 1.

	int remote_block_rise(object room,object who,int has_air)
	If you want to block that  rises to the surface in ,
	simply return 1.  is 1 if  has air and 0 otherwise.

	void remote_do_rise(object room, object who, int air)
	This function is called after  has been moved to the
	surface.

	int remote_block_drown(object room,object who,int has_air)
	If you want to block that  gets hurt by lack of air in 
	simply return 1.  is 1 if  has air and 0 otherwise.

	void remote_do_drown(object room, object who, int air, int damage)
	This function is called after  has been damaged.  is
	how much damage was dealt to .

NOTE
        If the remote_object_file_name is given as a string, the functions
        are called in the master object. If you want them to be called in
        a clone, you must give an object.
=======================================================================

Help topics available:
basic_room.doc room.doc water_room.doc

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 91 since December 2019.
This file was last modified: June 2000.