SYNOPSIS
mapping P_SMELLS "Smells"
mapping Set(P_SMELLS, mapping value)
mapping Query(P_SMELLS)
or
mapping SetSmells(mapping value)
mapping QuerySmells()
Accessible via:
void AddSmell(string|string * id, string desc)
void AddSmell(string|string * id, string * desc)
void AddSmell(string|string * id, closure desc)
void RemoveSmell(string|string * id)
string|string* GetSmell(string id)
DESCRIPTION
This property implements the smells of a room, i.e. things which
can be sniffed at, but need not be represented with an own object.
The value of the property is a mapping of the smell descriptions,
with the id of each smell indexing its description.
The description may be:
- a single string with the description,
- a closure returning the description string.
The closure will be called with the id of the smell as
argument.
The smells cooperate with /std/room/description::DoExplore() to
implement the explorer facilities.
The smells should be accessed via AddSmell(), RemoveSmell() and
GetSmell().
string|string* GetSmell(string id)
Return the description for smell <id>, or 0 if it isn't
defined. This takes care of closure evaluation.
void AddSmell(string|string * id, string desc)
Add/redefine a smell <id> with the description <desc>.
If an array of ids is given, each of the smells gets the same
description (this is also valid for the other AddSmell()
forms).
void AddSmell(string|string * id, string * desc)
Add/redefine a smell <id> with the description <desc>.
<desc> is of the form ({ "#call_other", <object>, "functionname", ... }),
which will be compiled into a closure and stored as such.
void AddSmell(string|string * id, closure desc)
Add/redefine a smell <id> with the closure <desc> returning the
actual description.
void RemoveSmell(string id)
Remove the smell <id> if existing.
void RemoveSmell(string * ids)
Remove the smells <ids> if existing.
EXAMPLE
// Add a smell to sniff at.
AddSmell("tree", "It smells of dark nights.\n");
// Add a smell to resolved by a local function 'theoak()'.
AddSmell("oak", #'theoak);
// Remove all the smells added above.
RemoveSmell(({"tree", "oak"}));
AVAILABILITY
Include: <properties.h>
Availability: /std/room/(details), /std/npc and descendants.
SEE ALSO
room(S), explorable(P), details(P), noises(P), readmsgs(P)