a87 @verb #3309:"sit" any none none rxd #8438 @program #3309:"sit" any none none "Syntax: sit - sit on a seat. If there is a real object with the seatname and a callable sit verb in the room, it will take precedence over the room seat." " sit - try to sit in the same seat as the specified player." realseat = $nothing for x in ({dobjstr, iobjstr, argstr}) if (valid(y = this:match_object(x)) && $object_utils:has_callable_verb(y, verb)) realseat = y endif endfor if (realseat == this) dobjstr = iobjstr = prepstr = argstr = "" args = {} realseat = dobj = iobj = $nothing endif if (valid(realseat)) realseat:sit(@args) else seatnumber = 0 if (length($string_utils:explode(argstr)) > 1) if (length(argstr) > 9 && argstr[1..7] == "down on") argstr = argstr[9..length(argstr)] elseif (length(argstr) > 4 && (argstr[1..3] == "on " || argstr[1..3] == "in " || argstr[1..3] == "at ")) argstr = argstr[4..length(argstr)] elseif (prepstr == "with" && valid(wwho = iobj)) if (!(seatnumber = wwho in this.sitters)) return player:tell(wwho.name, " isn't sitting down.") else seatnumber = this.seats[seatnumber] endif endif endif if (argstr == "down" || argstr == "") if (player in this.sitters) return player:tell("You're already seated.") endif seatnumber = this:default_seat(player) else if ((ms = this:match_seat(argstr)) == $ambiguous_match) return player:tell("I don't know which \"", argstr, "\" you mean.") elseif (!(seatnumber = ms || seatnumber)) return player:tell("There's no such seat around here; try somewhere else.") endif occupants = 0 for x in (this.seats) if (x == seatnumber) occupants = occupants + 1 endif endfor if (seatednumber = player in this.sitters) if (seatnumber == this.seats[seatednumber]) return player:tell("You're already sitting there.") else this:_stand(player) endif endif if (occupants == this:seatlist()[seatnumber][2]) return player:tell("You can't sit there; it's already full.") endif endif if (seatnumber == 0) return player:tell("You can't find anywhere to sit down comfortably.") endif if (!this:seat_accept(player, seatnumber)) return player:tell("You can't sit there.") endif player:sub_tell(this:sitlist_msgs()[seatnumber]) this:sub_announce(tostr("%n ", this:ositlist_msgs()[seatnumber])) this.seats = {@this.seats, seatnumber} this.sitters = {@this.sitters, player} endif . 0