OBJECT
/room/shore
SYNOPSIS
inherit "/room/shore";
LAST UPDATE
Thragor, 04-Dec-96, 19:00 MET
DESCRIPTION
The /room/shore handles all you need for the following rooms:
- a beach
- a flat
- a sea
Well, if it is a beach (Underwater: 0, Flats: 1), players may
watch the tides changing, but they won't feel any effect.
If it is a flat (Underwater: 1, Flats: 1), the room will be
below the waterline, when it is high tide and above the
waterline when it is low tide. The states of the tide are
queried from the /obj/shorenightday-server.
If it is a sea, you can be either above the sea (swimming) or
below it. If you're swimming, use the same settings as for the
beach. But if the room shall be always under water, you have
to choose Underwater: 1 and Flats: 0!
To prevent a player from getting out of air under water, the
flag P_WATERBREATHING has to be set to 1.
Now the functions you may use to modify the room:
status SetFlats(status i)
status QueryFlats()
If this room shall receive the messages about changing
tides, etc. the flats-property has to be set to true (= 1).
If (in addition) QueryUnderwater() returns true, the room
will be below water on high tide and above on low tide.
The default-value is 0.
status SetUnderwater(status i)
status QueryUnderwater()
This is a flag, if the room shall ever be under water. If
QueryFlats() is true, this depends on the tide. Otherwise
the room will be always under water, if set to true.
The default-value is 1.
status QueryFlooded()
This actually returns, if the room is filled with water or
not. This function is also internally use, to e. g. see, if
a player has to receive damage because of lack of air.
int cmd_swim(string str)
If the room is flooded, a player might swim or dive in this
room. The commands are defined in create(). They call this
function and <str> should hold the direction a player wants
to swim to. Actually, the player is just forced to execute
the normal direction-command, so doors, etc. are checked
normally.
void log_homarid(object pl)
As it isn't implemented yet, that properties might get set
on login via the race-master, homarids, which don't have the
P_WATERBREATHING-flag set get corrected and logged. If there
are other races which by default can breathe underwater, the
function underwater_damage() has to be adjusted.
void underwater_damage(object pl)
If players are under water for a too long time (depending on
their constitiution) and they can't breath under water,
they'll receive more and more damage the longer they are
below water. Ghosts and netdead players are not affected.
BUT NPCs ARE!!! So if you write any fishes give them
P_WATERBREATHING!!!!
void check_light(object pl)
This function checks the inventory for torches (which aren't
in a bag) and other lamps. They will be replaced by
worthless /std/things.
This check is executed everytime a player moves from a
room over the water to a flooded room.
void Enter(object pl,mixed oldenv,int method,mixed extra)
This function is called from notify_enter(), when the object
is a living. It will execute the check for lamps, the
underwater_damage() and it will set a heartbeat-object to do
damage regulary. In this case the interval is set to 5
before the next time underwater_damage() is called. This
will handle players standing in a room on and on.
void Exit(object pl,mixed dest,int method,mixed extra)
This function is called by notify_leave, when the object is
a living. It will only remove the time-flag how long a
player has been under water.
Overwritten functions from /std/room:
int UseExit(...)
If a player is under water he or she will swim instead of
enter, etc. So the move-messages get changed.
string *QueryExitStrings()
If a room is below water, the exit-strings change to 'You
can swim into ... directions'
void create()
Sets some defaults:
Short: A Room Under Water
Long: You're underwater.
Outdoors: The special nightday-server.
Underwater: 1
Commands: swim, dive -> cmd_swim()
INHERITANCE TREE
room/shore
`-std/room
SEE ALSO
room(S)