4 0 1 88 92 10 level (0) 4 0 0 5 . owner (#1) 4 0 0 5 . pubread (1) 4 0 0 5 . pubwrite (0) 4 0 0 5 . fertile (1) 4 0 0 5 . description ("You are amazed by the genericity of this room.") 4 0 0 5 . exits (()) 4 0 0 5 . name ("Generic Room") 4 0 0 5 . contents (()) 4 0 0 5 . entrances (()) 7 0 0 5 . 14 look (do (echo self.name) (echo (try (self:description) ("(No description set.)"))) (echo (self:get-exit-str)) (let ((cts (setremove self.contents caller))) (if (= 0 (len cts)) "Nothing" (do (echo "You see " ($strutils:joinlist (map (lambda (obj) obj.name) cts) "and" "nothing") "."))))) . 7 0 oNone pNone oNone 5 . trymove (let ((dir (get args 0)) (exits self.exits) (good-exits (#0:filter (lambda (exit) ($strutils:starts-with exit.dir dir)) exits))) (if (= 0 (len good-exits)) (echo "You cannot go that way.") (let ((chosen-exit (get good-exits 0)) (dest chosen-exit.destination)) (if (valid dest) (do (move caller dest) (dest:look)) (caller:tell "Exit didn't work! Room was invalid."))))) . 7 0 oThis pNone oThis 5 . n*orth e*ast s*outh w*est u*p d*own (verbcall caller.location "trymove" (verb)) . 7 0 oNone pNone oNone 5 . get-exit-str (let ((exits self.exits) (exit-names ($listutils:unique (map (lambda (exit) exit.dir) exits)))) (do (cat "You can go " ($strutils:joinlist exit-names "or" "nowhere") "."))) . 7 0 oThis pNone oThis 5 . announce (let ((announcer (get args 0)) (msg (get args 1)) (who (setremove self.contents announcer))) (map (lambda (obj) (obj:tell msg)) who)) . 7 0 oThis pNone oThis 5 . say (do (caller:tell "You say, \"" argstr "\"") (self:announce caller (cat caller.name " says, \"" argstr "\""))) . 7 0 oAny pAny oAny 5 . accept . 7 0 oNone pNone oNone 5 . huh (caller:tell "Huh?") . 7 0 oNone pNone oNone 5 . recycle (do (settaskperms caller) (map (lambda (ex) (let ((dest ex.destination)) (dest:rm-entrance ex))) self.exits)) . 7 0 oThis pNone oThis 5 . has-exit-dir? (let ((exit-dir (get args 0))) (< -1 (in (map (lambda (ex) (getprop ex "dir")) self.exits) exit-dir))) . 7 0 oThis pNone oThis 5 . add-exit (do (settaskperms caller) (let ((new-exit (get args 0)) (exits self.exits)) (setprop self "exits" (setadd exits new-exit)))) . 7 0 oThis pNone oThis 5 . rm-exit (do (settaskperms caller) (let ((new-exit (get args 0)) (exits self.exits)) (setprop self "exits" (setremove exits new-exit)))) . 7 0 oThis pNone oThis 5 . rm-entrance (do (settaskperms caller) (let ((entrance-to-remove (get args 0)) (entrances self.entrances)) (setprop self "entrances" (setremove entrances entrance-to-remove)))) . 7 0 oThis pNone oThis 5 . add-entrance (do (settaskperms caller) (let ((new-entrance (get args 0)) (entrances self.entrances)) (setprop self "entrances" (setadd entrances new-entrance)))) . 7 0 oThis pNone oThis 5 .