Generic Room with Surfaces (#2061)(an instance of Generic Room with Seats made by Trismegistos)     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. Go to location of this object, wooden box. HELP MANUAL:            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
.
g*et,t*ake:
if (oldseat = this:find_sitter(dobj))
sitlist = this.sitting;
sitlist[oldseat] = setremove(sitlist[oldseat], dobj);
this:set_sitting(sitlist);
endif
pass(@args);
.
@place @oplace: "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 @add-seat:
nseats = length(this.seats);
player:tell("Seat to hold what kind of object: (type #
@rm-seat:
nseats = length(this.seats);
seat = this:match_seat(dobjstr);
pass(@args);
if ((length(this.seats) < nseats) && (length(this.place_msg) == nseats))
this.place_msg = listdelete(this.place_msg, seat);
this.oplace_msg = listdelete(this.oplace_msg, seat);
endif
if ((length(this.seats) < nseats) && (length(this.seat_types) == nseats))
this.seat_types = listdelete(this.seat_types, seat);
endif
.
PROPERTY DATA:       place_msg       oplace_msg       seat_types       seat_types; CHILDREN: River's Edge AnArchie Bunker Filling Station ramshackle hut Temple of Corwin aghari's hollow Ipsol's Alley Machine Shop crate |