This child of the Generic Seated Room allows you to drop objects on seats, and program special messages for when this happens. Type 'help #2061' for more details.
     
     By means of a simple (if slightly clunky) graft, this child of the Generic Room with
Seats (#955) enables you to simulate any number of surfaces in a room, on which objects
may be placed and people sit. Essentially, you can now drop objects on, and take
them from, seats -- except that these seats are not just for sitting any more.
     
     For information on adding seats and the messages associated with players occupying
and vacating these seats, type 'help #955'. In fact, if you are not already familiar
with #955, you should read its help before proceeding with this message.
     
     This room adds two main features:
     
      1) The verb d*rop/th*row can now be typed: "drop
VERB SOURCE CODE:
d*rop th*row put place:
if (dobj in player.contents)
seat = this:match_seat(iobjstr);
if (seat)
if (length(this.seat_types) >= seat)
if ($object_utils:isa(dobj, toobj(this.seat_types[seat])))
typeOK = 1;
else
typeOK = 0;
endif
else
typeOK = 1;
endif
if (typeOK)
if (length(this.sitting[seat]) < this.seats[seat][2])
message = (length(this.place_msg) >= length(this.seats)) ? this.place_msg[seat]
| "You set %d down on the %seat.";
omessage = (length(this.oplace_msg) >= length(this.seats)) ? this.oplace_msg[seat]
| "You set %d down on the %seat.";
player:tell($string_utils:pronoun_sub(strsub(message, "%seat", this.seats[seat][1][1])));
this:announce($string_utils:pronoun_sub(strsub(omessage, "%seat",
this.seats[seat][1][1])));
dobj:moveto(this);
sitlist = this.sitting;
sitlist[seat] = setadd(sitlist[seat], dobj);
this:set_sitting(sitlist);
else
player:tell("There isn't enough room to put ", dobj.name, " there.");
endif
else
player:tell("That location will only take descendants of ", toobj(this.seat_types[seat]).name);
endif
else
player:tell("You can't put things there.");
endif
else
player:tell("You don't have that!");
endif
.
"Copied from Generic Room with Seats (#955):@sit by Dred (#100) Sat Oct 8 15:41:37
1994 EDT";
"Usage: @sit/@osit/@stand/@ostand/@ositting is [message|default]";
"";
"Use this command to see and set the messages for your seats. With no indirect object
string (i.e. `@sit is'), you will be told the current message. If you use
the word `default' as the message, the message will be cleared back to default values.
Otherwise, the new [message] is set for that seat. Note that in addition to standard
pronoun substitutions, the word %seat will be replaced with the name of the seat
in your message.";
if ((!$perm_utils:controls(valid(cp = caller_perms()) ? cp | player, this)) && (caller
!= this))
return E_PERM;
endif
if (seat = this:match_seat(dobjstr))
mesnam = tostr(verb[2..length(verb)], "_msg");
if (iobjstr)
if (iobjstr == "default")
player:tell("You clear the \"", mesnam[1..length(mesnam) - 4], "\" message
of seat \"", this.seats[seat][1][1], "\" back to default values.");
this.(mesnam)[seat] = "";
else
player:tell("You set the \"", mesnam[1..length(mesnam) - 4], "\" message
of seat \"", this.seats[seat][1][1], "\".");
this.(mesnam)[seat] = iobjstr;
endif
else
player:tell("The \"", mesnam[1..length(mesnam) - 4], "\" message of seat
\"", this.seats[seat][1][1], "\":");
if (!(msg = this.(mesnam)[seat]))
vlist = $string_utils:words(verb_info(#955, mesnam)[3]);
vind = mesnam in vlist;
msg = this.defaults[vind];
endif
player:tell(msg);
endif
else
player:tell("Seat \"", dobjstr, "\" not found.");
endif
.
@add-seat:
nseats = length(this.seats);
player:tell("Seat to hold what kind of object: (type # or $; blank to default to any kind)");
type = $command_utils:read();
type = toobj(type);
if (!valid(toobj(type)))
type = #1;
endif
pass(@args);
if (length(this.seats) > nseats)
this.place_msg = {@this.place_msg, "You place %d down on the %seat."};
while (length(this.seat_types) < length(this.seats))
this.seat_types = {@this.seat_types, ""};
endwhile
this.seat_types[length(this.seat_types)] = type;
this.oplace_msg = {@this.oplace_msg, "%N places %d down on the %seat."};
endif
.