Room Functions for Mocha


Sending a message to a room

void room_echo (room rm, string msg);
Sends a message to a room. Does nothing if msg is the empty string.


Finding general information

integer rm.num_lights;
Returns the number of light sources in the room rm, not counting the sun or the is_lit flag.

boolean rm.is_dark;
Returns true if the room rm is currently dark.

integer rm.num_players;
Returns the number of players visible in the room rm, disregarding any nohassle'd players.

integer rm.terrain;
void set_room_terrain (room rm, integer val);
Determine or set the terrain type for the room rm. The type must be a constant from the following list:

integer rm.num_exits;
Returns the number of exits in the room rm.

exit room_exit (room rm, integer which);
Returns the exit from the room with index which, where the indices run from 1 through the number of exits in the room.


Checking and setting flags

A group of boolean object members allows a handler to check for the presence of any particular room flag. As with all modifiable flags, those of level Eternal and higher may change a flag using the set_room_<member name> (room rm, boolean value) function, where is_<member name> is the flag's member name. The following list describes the members and functions.

boolean rm.is_arid;
Indicates that the room rm is very dry.

boolean rm.is_cold;
Indicates that the room rm is very cold.

boolean rm.is_death_trap;
Indicates that the room rm causes instant death for any mortal entering the room.

boolean rm.is_falling;
Indicates that the room rm is a falling room: anything falling in falls out, as does any object dropped.

boolean rm.is_hot;
Indicates that the room rm is very hot.

boolean rm.is_inside;
Indicates that the room rm is indoors.

boolean rm.is_light;
Indicates that the room rm is lit.

boolean rm.is_no_hunt;
Indicates that no person can hunt into or through the room rm.

boolean rm.is_no_magic;
Indicates that the room rm prevents the casting of magic.

boolean rm.is_no_mobile;
Indicates that typical mobiles can not wander into the room rm.

boolean rm.is_no_summon;
Indicates that the room rm prevents summoning in or out.

boolean rm.is_one_person;
Indicates that the room rm is small and holds only one person at a time.

boolean rm.is_peaceful;
Indicates that the room rm prevents combat.

boolean rm.is_soundproof;
Indicates that the room rm is soundproof: mortals cannot gossip or shout, nor can they hear such communications.

boolean rm.is_sunlit;
Indicates that the room rm is sunlit; rooms which are neither lit nor sunlit are always dark (unless, of course, someone casts a light spell or brings a light into the room).

boolean rm.is_spinner;
Indicates that the room rm confuses mortals.


Return to Mocha's Main Page