Fix the time on the candle
[mudsync.git] / worlds / bricabrac.scm
1 ;;; Mudsync --- Live hackable MUD
2 ;;; Copyright © 2016, 2017 Christine Lemmer-Webber <cwebber@dustycloud.org>
3 ;;;
4 ;;; This file is part of Mudsync.
5 ;;;
6 ;;; Mudsync is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or
9 ;;; (at your option) any later version.
10 ;;;
11 ;;; Mudsync is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ;;; General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with Mudsync.  If not, see <http://www.gnu.org/licenses/>.
18
19 ;;; Hotel Bricabrac
20
21 (use-modules (mudsync)
22              (mudsync container)
23              (8sync)
24              (oop goops)
25              (ice-9 control)
26              (ice-9 format)
27              (ice-9 match)
28              (rx irregex))
29
30
31 \f
32 ;;; Utilities, useful or otherwise
33 ;;; ==============================
34
35 (set! *random-state* (random-state-from-platform))
36
37 (define (random-choice lst)
38   (list-ref lst (random (length lst))))
39
40 ;; list of lists, lol.
41 (define-syntax-rule (lol (list-contents ...) ...)
42   (list (list list-contents ...) ...))
43
44 \f
45 ;;; Some simple object types.
46 ;;; =========================
47
48 (define-class <readable> (<gameobj>)
49   (read-text #:init-value "All it says is: \"Blah blah blah.\""
50              #:init-keyword #:read-text)
51   (commands
52    #:allocation #:each-subclass
53    #:init-thunk (build-commands
54                  ("read" ((direct-command cmd-read)))))
55   (actions #:allocation #:each-subclass
56            #:init-thunk (build-actions
57                          (cmd-read readable-cmd-read))))
58
59 (define (readable-cmd-read actor message . _)
60   (<- (message-from message) 'tell
61       #:text (slot-ref actor 'read-text)))
62
63
64 ;; This one is just where reading is the same thing as looking
65 ;; at the description
66 (define-class <readable-desc> (<gameobj>)
67   (commands
68    #:allocation #:each-subclass
69    #:init-thunk (build-commands
70                  ("read" ((direct-command cmd-look-at))))))
71
72 ;; This one allows you to take from items that are proxied by it
73 (define-actor <proxy-items> (<gameobj>)
74   ((cmd-take-from take-from-proxy))
75   (proxy-items #:init-keyword #:proxy-items))
76
77 (define* (take-from-proxy gameobj message
78                           #:key direct-obj indir-obj preposition
79                           (player (message-from message)))
80   (call/ec
81    (lambda (escape)
82      (for-each
83       (lambda (obj-sym)
84         (define obj-id (dyn-ref gameobj obj-sym))
85         (define goes-by
86           (mbody-val (<-wait obj-id 'goes-by)))
87         (when (ci-member direct-obj goes-by)
88           (<- obj-id 'cmd-take #:direct-obj direct-obj #:player player)
89           (escape #f)))
90       (slot-ref gameobj 'proxy-items))
91
92      (<- player 'tell
93         #:text `("You don't see any such " ,direct-obj " to take "
94                  ,preposition " " ,(slot-ref gameobj 'name) ".")))))
95
96
97 \f
98 ;;; Lobby
99 ;;; -----
100
101 (define (npc-chat-randomly actor message . _)
102   (define catchphrase
103     (random-choice (slot-ref actor 'catchphrases)))
104   (define text-to-send
105     ((slot-ref actor 'chat-format) actor catchphrase))
106   (<- (message-from message) 'tell
107       #:text text-to-send))
108
109 (define hotel-owner-grumps
110   '("Eight sinks!  Eight sinks!  And I couldn't unwind them..."
111     "Don't mind the mess.  I built this place on a dare, you
112 know?"
113     "(*tearfully*) Here, take this parenthesis.  May it serve
114 you well."
115     "I gotta get back to the goblin farm soon..."
116     "Oh, but I was going to make a mansion... a great,
117 beautiful mansion!  Full of ghosts!  Now all I have is this cruddy
118 mo... hotel.  Oh... If only I had more time!"
119     "I told them to paint more of the walls purple.
120 Why didn't they listen?"
121     "Listen to that overhead muzak.  Whoever made that doesn't
122 know how to compose very well!  Have you heard of the bands 'fmt'
123 or 'skribe'?  Now *that's* composition!"))
124
125 (define-class <chatty-npc> (<gameobj>)
126   (catchphrases #:init-value '("Blarga blarga blarga!")
127                 #:init-keyword #:catchphrases)
128   (chat-format #:init-value (lambda (npc catchphrase)
129                               `(,(slot-ref npc 'name) " says: \""
130                                 ,catchphrase "\""))
131                #:init-keyword #:chat-format)
132   (commands
133    #:allocation #:each-subclass
134    #:init-thunk (build-commands
135                  (("chat" "talk") ((direct-command cmd-chat)))))
136   (actions #:allocation #:each-subclass
137            #:init-thunk
138            (build-actions
139             (cmd-chat npc-chat-randomly))))
140
141 (define-class <sign-in-form> (<gameobj>)
142   (commands
143    #:allocation #:each-subclass
144    #:init-thunk (build-commands
145                  ("sign" ((prep-direct-command cmd-sign-form '("as"))))))
146
147   (actions #:allocation #:each-subclass
148            #:init-thunk (build-actions
149                          (cmd-sign-form sign-cmd-sign-in))))
150
151
152 (define name-sre
153   (sre->irregex '(: alpha (** 1 14 (or alphanum "-" "_")))))
154
155 (define forbidden-words
156   (append article preposition
157           '("and" "or" "but" "admin")))
158
159 (define (valid-name? name)
160   (and (irregex-match name-sre name)
161        (not (member name forbidden-words))))
162
163 (define* (sign-cmd-sign-in actor message
164                            #:key direct-obj indir-obj preposition)
165   (define old-name
166     (mbody-val (<-wait (message-from message) 'get-name)))
167   (define name indir-obj)
168   (if (valid-name? indir-obj)
169       (begin
170         (<-wait (message-from message) 'set-name! name)
171         (<- (slot-ref actor 'loc) 'tell-room
172             #:text (format #f "~a signs the form!\n~a is now known as ~a\n"
173                            old-name old-name name)))
174       (<- (message-from message) 'tell
175           #:text "Sorry, that's not a valid name.
176 Alphanumerics, _ and - only, 2-15 characters, starts with an alphabetic
177 character.\n")))
178
179
180 (define-class <summoning-bell> (<gameobj>)
181   (summons #:init-keyword #:summons)
182
183   (commands
184    #:allocation #:each-subclass
185    #:init-thunk (build-commands
186                  ("ring" ((direct-command cmd-ring)))))
187   (actions #:allocation #:each-subclass
188            #:init-thunk (build-actions
189                          (cmd-ring summoning-bell-cmd-ring))))
190
191 (define* (summoning-bell-cmd-ring bell message . _)
192   ;; Call back to actor who invoked this message handler
193   ;; and find out their name.  We'll call *their* get-name message
194   ;; handler... meanwhile, this procedure suspends until we get
195   ;; their response.
196   (define who-rang
197     (mbody-val (<-wait (message-from message) 'get-name)))
198
199   ;; Now we'll invoke the "tell" message handler on the player
200   ;; who rang us, displaying this text on their screen.
201   ;; This one just uses <- instead of <-wait, since we don't
202   ;; care when it's delivered; we're not following up on it.
203   (<- (message-from message) 'tell
204       #:text "*ring ring!*  You ring the bell!\n")
205   ;; We also want everyone else in the room to "hear" the bell,
206   ;; but they get a different message since they aren't the ones
207   ;; ringing it.  Notice here's where we make use of the invoker's
208   ;; name as extracted and assigned to the who-rang variable.
209   ;; Notice how we send this message to our "location", which
210   ;; forwards it to the rest of the occupants in the room.
211   (<- (gameobj-loc bell) 'tell-room
212       #:text
213       (format #f "*ring ring!*  ~a rings the bell!\n"
214               who-rang)
215       #:exclude (message-from message))
216   ;; Now we perform the primary task of the bell, which is to summon
217   ;; the "clerk" character to the room.  (This is configurable,
218   ;; so we dynamically look up their address.)
219   (<- (dyn-ref bell (slot-ref bell 'summons)) 'be-summoned
220       #:who-summoned (message-from message)))
221
222
223 (define prefect-quotes
224   '("I'm a frood who really knows where my towel is!"
225     "On no account allow a Vogon to read poetry at you."
226     "Time is an illusion, lunchtime doubly so!"
227     "How can you have money if none of you produces anything?"
228     "On no account allow Arthur to request tea on this ship."))
229
230 (define-class <cabinet-item> (<gameobj>)
231   (take-me? #:init-value
232             (lambda _
233               (values #f #:why-not
234                       `("Hm, well... the cabinet is locked and the properitor "
235                         "is right over there.")))))
236
237 (define lobby
238   (lol
239    ('lobby
240     <room> #f
241     #:name "Hotel Lobby"
242     #:desc
243     '((p "You're in some sort of hotel lobby.  You see a large sign hanging "
244          "over the desk that says \"Hotel Bricabrac\".  On the desk is a bell "
245          "that says \"'ring bell' for service\".  Terrible music plays from a speaker "
246          "somewhere overhead.  "
247          "The room is lined with various curio cabinets, filled with all sorts "
248          "of kitschy junk.  It looks like whoever decorated this place had great "
249          "ambitions, but actually assembled it all in a hurry and used whatever "
250          "kind of objects they found lying around.")
251       (p "There's a door to the north leading to some kind of hallway."))
252     #:exits
253     (list (make <exit>
254             #:name "north"
255             #:to 'grand-hallway)))
256    ;; NPC: hotel owner
257    ('lobby:hotel-owner
258     <chatty-npc> 'lobby
259     #:name "a languid lady"
260     #:desc
261     '((p "  Whoever this is, she looks totally exhausted.  She's
262 collapsed into the only comfortable looking chair in the room and you
263 don't get the sense that she's likely to move any time soon.
264   Attached to her frumpy dress is a barely secured pin which says
265 \"Hotel Proprietor\", but she looks so disorganized that you think
266 that can't possibly be true... can it?
267   Despite her exhaustion, you sense she'd be happy to chat with you,
268 though the conversation may be a bit one sided."))
269     #:goes-by '("languid lady" "lady"
270                 "hotel proprietor" "proprietor")
271     #:catchphrases hotel-owner-grumps)
272    ;; Object: Sign
273    ('lobby:sign
274     <readable> 'lobby
275     #:name "the Hotel Bricabrac sign"
276     #:desc "  It strikes you that there's something funny going on with this sign.
277 Sure enough, if you look at it hard enough, you can tell that someone
278 hastily painted over an existing sign and changed the \"M\" to an \"H\".
279 Classy!"
280     #:read-text "  All it says is \"Hotel Bricabrac\" in smudged, hasty text."
281     #:goes-by '("sign"
282                 "bricabrac sign"
283                 "hotel sign"
284                 "hotel bricabrac sign"
285                 "lobby sign"))
286
287    ('lobby:bell
288     <summoning-bell> 'lobby
289     #:name "a shiny brass bell"
290     #:goes-by '("shiny brass bell" "shiny bell" "brass bell" "bell")
291     #:desc "  A shiny brass bell.  Inscribed on its wooden base is the text
292 \"ring me for service\".  You probably could \"ring the bell\" if you 
293 wanted to."
294     #:summons 'break-room:desk-clerk)
295
296    ('lobby:sign-in-form
297     <sign-in-form> 'lobby
298     #:name "sign-in form"
299     #:goes-by '("sign-in form" "form" "signin form")
300     #:desc '("It looks like you could sign this form and set your name like so: "
301              (i "sign form as <my-name-here>")))
302
303    ;; Object: curio cabinets
304    ;; TODO: respond to attempts to open the curio cabinet
305    ('lobby:cabinet
306     <proxy-items> 'lobby
307     #:proxy-items '(lobby:porcelain-doll
308                     lobby:1950s-robots
309                     lobby:tea-set lobby:mustard-pot
310                     lobby:head-of-elvis lobby:circuitboard-of-evlis
311                     lobby:teletype-scroll lobby:orange-cat-phone)
312     #:name "a curio cabinet"
313     #:goes-by '("curio cabinet" "cabinet" "bricabrac cabinet"
314                 "cabinet of curiosities")
315     #:desc (lambda _
316              (format #f "  The curio cabinet is full of all sorts of oddities!
317 Something catches your eye!
318 Ooh, ~a!" (random-choice
319            '("a creepy porcelain doll"
320              "assorted 1950s robots"
321              "an exquisite tea set"
322              "an antique mustard pot"
323              "the pickled head of Elvis"
324              "the pickled circuitboard of EVLIS"
325              "a scroll of teletype paper holding the software Four Freedoms"
326              "a telephone shaped like an orange cartoon cat")))))
327
328    ('lobby:porcelain-doll
329     <cabinet-item> 'lobby
330     #:invisible? #t
331     #:name "a creepy porcelain doll"
332     #:desc "It strikes you that while the doll is technically well crafted,
333 it's also the stuff of nightmares."
334     #:goes-by '("porcelain doll" "doll"))
335    ('lobby:1950s-robots
336     <cabinet-item> 'lobby
337     #:invisible? #t
338     #:name "a set of 1950s robots"
339     #:desc "There's a whole set of these 1950s style robots.
340 They seem to be stamped out of tin, and have various decorations of levers
341 and buttons and springs.  Some of them have wind-up knobs on them."
342     #:goes-by '("robot" "robots" "1950s robot" "1950s robots"))
343    ('lobby:tea-set
344     <cabinet-item> 'lobby
345     #:invisible? #t
346     #:name "a tea set"
347     #:desc "A complete tea set.  Some of the cups are chipped.
348 You can imagine yourself joining a tea party using this set, around a
349 nice table with some doilies, drinking some Earl Grey tea, hot.  Mmmm."
350     #:goes-by '("tea set" "tea"))
351    ('lobby:cups
352     <cabinet-item> 'lobby
353     #:invisible? #t
354     #:name "cups from the tea set"
355     #:desc "They're chipped."
356     #:goes-by '("cups"))
357    ('lobby:mustard-pot
358     <cabinet-item> 'lobby
359     #:invisible? #t
360     #:name "a mustard pot"
361     #:desc '((p "It's a mustard pot.  I mean, it's kind of cool, it has a
362 nice design, and it's an antique, but you can't imagine putting something
363 like this in a museum.")
364              (p "Ha... imagine that... a mustard museum."))
365     #:goes-by '("mustard pot" "antique mustard pot" "mustard"))
366    ('lobby:head-of-elvis
367     <cabinet-item> 'lobby
368     #:invisible? #t
369     #:name "the pickled head of Elvis"
370     #:desc '((p "It's a jar full of some briny-looking liquid and...
371 a free floating head.  The head looks an awful lot like Elvis, and
372 definitely not the younger Elvis.  The hair even somehow maintains
373 that signature swoop while suspended in liquid.  But of course it's
374 not Elvis.")
375              (p "Oh, wait, it has a label at the bottom which says:
376 \"This is really the head of Elvis\".  Well... maybe don't believe
377 everything you read."))
378     #:goes-by '("pickled head of elvis" "pickled head of Elvis"
379                 "elvis" "Elvis" "head" "pickled head"))
380    ('lobby:circuitboard-of-evlis
381     <cabinet-item> 'lobby
382     #:invisible? #t
383     #:name "the pickled circuitboard of Evlis"
384     #:desc '((p "It's a circuitboard from a Lisp Machine called EVLIS.
385 This is quite the find, and you bet just about anyone interested in
386 preserving computer history would love to get their hands on this.")
387              (p "Unfortunately, whatever moron did acquire this has
388 no idea what it means to preserve computers, so here it is floating
389 in some kind of briny liquid.  It appears to be heavily corroded.
390 Too bad..."))
391     #:goes-by '("pickled circuitboard of evlis" "pickled circuitboard of Evlis"
392                 "pickled circuitboard of EVLIS"
393                 "evlis" "Evlis" "EVLIS" "circuitboard" "pickled circuitboard"))
394    ('lobby:teletype-scroll
395     <cabinet-item> 'lobby
396     #:invisible? #t
397     #:name "a scroll of teletype"
398     #:desc '((p "This is a scroll of teletype paper.  It's a bit old
399 and yellowed but the type is very legible.  It says:")
400              (br)
401              (i
402               (p (strong "== The four essential freedoms =="))
403               (p "A program is free software if the program's users have
404 the four essential freedoms: ")
405               (ul (li "The freedom to run the program as you wish, for any purpose (freedom 0).")
406                   (li "The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.")
407                   (li "The freedom to redistribute copies so you can help your neighbor (freedom 2).")
408                   (li "The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.")))
409              (p "You get this feeling that ambiguities in the
410 English language surrounding the word 'free' have lead to a lot of terminology debates."))
411     #:goes-by '("scroll of teletype" "scroll of teletype paper" "teletype scroll"
412                 "teletype paper" "scroll" "four freedoms"
413                 "scroll of teletype paper holding the software Four Freedoms"
414                 "scroll of teletype paper holding the software four freedoms"))
415    ('lobby:orange-cat-phone
416     <cabinet-item> 'lobby
417     #:invisible? #t
418     #:name "a telephone shaped like an orange cartoon cat"
419     #:desc "It's made out of a cheap plastic, and it's very orange.
420 It resembles a striped tabby, and it's eyes hold the emotion of
421 a being both sleepy and smarmy.
422 You suspect that someone, somewhere made a ton of cash on items holding
423 this general shape in the 1990s."
424     #:goes-by '("orange cartoon cat phone" "orange cartoon cat telephone"
425                 "orange cat phone" "orange cat telephone"
426                 "cartoon cat phone" "cartoon cat"
427                 "cat phone" "cat telephone" "phone" "telephone"))))
428
429
430 \f
431 ;;; Grand hallway
432 ;;; -------------
433
434 (define-actor <disc-shield> (<gameobj>)
435   ((cmd-take disc-shield-take)))
436
437 (define* (disc-shield-take gameobj message
438                            #:key direct-obj
439                            (player (message-from message)))
440   (create-gameobj <glowing-disc> (gameobj-gm gameobj)
441                   player)  ;; set loc to player to put in player's inventory
442   (<- player 'tell
443       #:text '((p "As you attempt to pull the shield / disk platter
444 from the statue a shining outline appears around it... and a
445 completely separate, glowing copy of the disc materializes into your
446 hands!")))
447   (<- (gameobj-loc gameobj) 'tell-room
448         #:text `(,(mbody-val (<-wait player 'get-name))
449                  " pulls on the shield of the statue, and a glowing "
450                  "copy of it materializes into their hands!")
451         #:exclude player)
452   (<- (gameobj-loc gameobj) 'tell-room
453       #:text
454       '(p "You hear a voice whisper: "
455           (i "\"Share the software... and you'll be free...\""))))
456
457 ;;; This is the disc that gets put in the player's inventory
458 (define-actor <glowing-disc> (<gameobj>)
459   ((cmd-drop glowing-disc-drop-cmd))
460   (initial-props
461    #:allocation #:each-subclass
462    #:init-thunk (build-props
463                  '((hd-platter? . #t))))
464   (name #:allocation #:each-subclass
465         #:init-value "a glowing disc")
466   (desc #:allocation #:each-subclass
467         #:init-value "A brightly glowing disc.  It's shaped like a hard
468 drive platter, not unlike the one from the statue it came from.  It's
469 labeled \"RL02.5\".")
470   (goes-by #:init-value '("glowing disc" "glowing platter"
471                           "glowing disc platter" "glowing disk platter"
472                           "platter" "disc" "disk" "glowing shield")))
473
474 (define* (glowing-disc-drop-cmd gameobj message
475                    #:key direct-obj
476                    (player (message-from message)))
477   (<- player 'tell
478       #:text "You drop the glowing disc, and it shatters into a million pieces!")
479   (<- (mbody-val (<-wait player 'get-loc)) 'tell-room
480       #:text `(,(mbody-val (<-wait player 'get-name))
481                " drops a glowing disc, and it shatters into a million pieces!")
482       #:exclude player)
483   (gameobj-self-destruct gameobj))
484
485 \f
486 ;;; Grand hallway
487
488 (define lobby-map-text
489   "\
490
491                         .----+++++----.
492                         |  :       :  |
493                         +  : north :  +
494                         |  :  hall :  |
495                         +  :       :  +
496                         |_ : _____ : _|
497                         |  :       :  |
498   .----------.----------.  :   &   :  .----------.----------.
499   | computer |          |& :YOU ARE: &|  smoking | *UNDER*  |
500   | room     + playroom +  : HERE  :  +  parlor  | *CONS-   |
501   |    >     |          |& :       : &|          | TRUCTION*|
502   '----------'----------'-++-------++-'-------+--'----------'
503                        |    '-----'    |     |   |
504                        :     LOBBY     :     '---'
505                         '.           .'
506                           '---------'")
507
508 (define grand-hallway
509
510   (lol
511    ('grand-hallway
512     <room> #f
513     #:name "Grand Hallway"
514     #:desc '((p "  A majestic red carpet runs down the center of the room.
515 Busts of serious looking people line the walls, but there's no
516 clear indication that they have any logical relation to this place.")
517              (p "In the center is a large statue of a woman in a warrior's
518 pose, but something is strange about her weapon and shield.  You wonder what
519 that's all about?")
520              (p "To the south is the lobby.  A door to the east is labeled \"smoking
521 room\", while a door to the west is labeled \"playroom\"."))
522     #:exits
523     (list (make <exit>
524             #:name "north"
525             #:to 'north-hall)
526           (make <exit>
527             #:name "south"
528             #:to 'lobby)
529           (make <exit>
530             #:name "west"
531             #:to 'playroom)
532           (make <exit>
533             #:name "east"
534             #:to 'smoking-parlor)))
535    ('grand-hallway:map
536     <readable> 'grand-hallway
537     #:name "the hotel map"
538     #:desc '("This appears to be a map of the hotel. "
539              "Like the hotel itself, it seems to be "
540              "incomplete."
541              "You could read it if you want to.")
542     #:read-text `(pre ,lobby-map-text)
543     #:goes-by '("map" "hotel map"))
544    ('grand-hallway:carpet
545     <gameobj> 'grand-hallway
546     #:name "the Grand Hallway carpet"
547     #:desc "It's very red, except in the places where it's very worn."
548     #:invisible? #t
549     #:goes-by '("red carpet" "carpet"))
550    ('grand-hallway:busts
551     <gameobj> 'grand-hallway
552     #:name "the busts of serious people"
553     #:desc "There are about 6 of them in total.  They look distinguished
554 but there's no indication of who they are."
555     #:invisible? #t
556     #:goes-by '("busts" "bust" "busts of serious people" "bust of serious person"))
557    ('grand-hallway:hackthena-statue
558     <proxy-items> 'grand-hallway
559     #:name "the statue of Hackthena"
560     #:desc '((p "The base of the statue says \"Hackthena, guardian of the hacker
561 spirit\".  You've heard of Hackthena... not a goddess, but spiritual protector of
562 all good hacks, and legendary hacker herself.")
563              (p "Hackthena holds the form of a human woman.  She wears flowing
564 robes, has a pear of curly bovine-esque horns protruding from the sides of her
565 head, wears a pair of horn-rimmed glasses, and appears posed as if for battle.
566 But instead of a weapon, she seems to hold some sort of keyboard.  And her
567 shield... well it's round like a shield, but something seems off about it.
568 You'd better take a closer look to be sure."))
569     #:goes-by '("hackthena statue" "hackthena" "statue" "statue of hackthena")
570     #:proxy-items '(grand-hallway:keyboard
571                     grand-hallway:disc-platter
572                     grand-hallway:hackthena-horns))
573    ('grand-hallway:keyboard
574     <gameobj> 'grand-hallway
575     #:name "a Knight Keyboard"
576     #:desc "Whoa, this isn't just any old keyboard, this is a Knight Keyboard!
577 Any space cadet can see that with that kind of layout a hack-and-slayer could
578 thrash out some serious key-chords like there's no tomorrow.  You guess
579 Hackthena must be an emacs user."
580     #:invisible? #t
581     #:take-me? (lambda _
582                  (values #f
583                          #:why-not
584                          `("Are you kidding?  Do you know how hard it is to find "
585                               "a Knight Keyboard?  There's no way she's going "
586                               "to give that up.")))
587     #:goes-by '("knight keyboard" "keyboard"))
588    ('grand-hallway:hackthena-horns
589     <gameobj> 'grand-hallway
590     #:name "Hackthena's horns"
591     #:desc "They're not unlike a Gnu's horns."
592     #:invisible? #t
593     #:take-me? (lambda _
594                  (values #f
595                          #:why-not
596                          `("Are you seriously considering desecrating a statue?")))
597     #:goes-by '("hackthena's horns" "horns" "horns of hacktena"))
598    ('grand-hallway:disc-platter
599     <disc-shield> 'grand-hallway
600     #:name "Hackthena's shield"
601     #:desc "No wonder the \"shield\" looks unusual... it seems to be a hard disk
602 platter!  It has \"RL02.5\" written on it.  It looks kind of loose."
603     #:invisible? #t
604     #:goes-by '("hackthena's shield" "shield" "platter" "hard disk platter"))))
605
606 \f
607 ;;; Playroom
608 ;;; --------
609
610 (define-actor <rgb-machine> (<gameobj>)
611   ((cmd-run rgb-machine-cmd-run)
612    (cmd-reset rgb-machine-cmd-reset))
613   (commands
614    #:allocation #:each-subclass
615    #:init-thunk (build-commands
616                  (("run" "start") ((direct-command cmd-run)))
617                  ("reset" ((direct-command cmd-reset)))))
618   (resetting #:init-value #f
619              #:accessor .resetting)
620   ;; used to reset, and to kick off the first item in the list
621   (rgb-items #:init-keyword #:rgb-items
622              #:accessor .rgb-items))
623
624 (define (rgb-machine-cmd-run rgb-machine message . _)
625   (define player (message-from message))
626   (<-wait player 'tell
627           #:text '("You start the rube goldberg machine."))
628   (<-wait (gameobj-loc rgb-machine) 'tell-room
629           #:text `(,(mbody-val (<-wait player 'get-name))
630                    " runs the rube goldberg machine.")
631           #:exclude player)
632   (8sleep 1)
633   (match (.rgb-items rgb-machine)
634     ((first-item rest ...)
635      (<- (dyn-ref rgb-machine first-item) 'trigger))))
636
637 (define (rgb-machine-cmd-reset rgb-machine message . _)
638   (define player (message-from message))
639   (cond
640    ((not (.resetting rgb-machine))
641     (set! (.resetting rgb-machine) #t)
642     (<-wait player 'tell
643             #:text '("You reset the rube goldberg machine."))
644     (<-wait (gameobj-loc rgb-machine) 'tell-room
645             #:text `(,(mbody-val (<-wait player 'get-name))
646                      " resets the rube goldberg machine.")
647             #:exclude player)
648     (<-wait (gameobj-loc rgb-machine) 'tell-room
649             #:text '("From a panel in the wall, a white gloved mechanical "
650                      "arm reaches out to reset all the "
651                      "rube goldberg components."))
652     (8sleep (/ 1 2))
653     (for-each
654      (lambda (rgb-item)
655        (<- (dyn-ref rgb-machine rgb-item) 'reset)
656        (8sleep (/ 1 2)))
657      (.rgb-items rgb-machine))
658     (<- (gameobj-loc rgb-machine) 'tell-room
659         #:text "The machine's mechanical arm retreats into the wall!")
660     (set! (.resetting rgb-machine) #f))
661    (else
662     (<-wait player 'tell
663             #:text '("But it's in the middle of resetting right now!")))))
664
665 (define-actor <rgb-item> (<gameobj>)
666   ((trigger rgb-item-trigger)
667    (reset rgb-item-reset))
668   (invisible? #:init-value #t)
669   (steps #:init-keyword #:steps
670          #:accessor .steps)
671   (triggers-as #:init-value #f
672                #:init-keyword #:triggers-as
673                #:getter .triggers-as)
674   (reset-msg #:init-keyword #:reset-msg
675              #:getter .reset-msg)
676   ;; States: ready -> running -> ran
677   (state #:init-value 'ready
678          #:accessor .state))
679
680
681 (define (rgb-item-trigger rgb-item message . _)
682   (define room (gameobj-loc rgb-item))
683   (case (.state rgb-item)
684     ((ready)
685      ;; Set state to running
686      (set! (.state rgb-item) 'running)
687
688      ;; Loop through all steps
689      (for-each
690       (lambda (step)
691         (match step
692           ;; A string?  That's the description of what's happening, tell players
693           ((? string? str)
694            (<- room 'tell-room #:text str))
695           ;; A number?  Sleep for that many secs
696           ((? number? num)
697            (8sleep num))
698           ;; A symbol?  That's another gameobj to look up dynamically
699           ((? symbol? sym)
700            (<- (dyn-ref rgb-item sym) 'trigger
701                #:triggered-by (.triggers-as rgb-item)))
702           (_ (throw 'unknown-step-type
703                     "Don't know how to process rube goldberg machine step type?"
704                     #:step step))))
705       (.steps rgb-item))
706
707      ;; We're done! Set state to ran
708      (set! (.state rgb-item) 'ran))
709
710     (else
711      (<- room 'tell-room
712          #:text `("... but " ,(slot-ref rgb-item 'name)
713                   " has already been triggered!")))))
714
715 (define (rgb-item-reset rgb-item message . _)
716   (define room (gameobj-loc rgb-item))
717   (case (.state rgb-item)
718     ((ran)
719      (set! (.state rgb-item) 'ready)
720      (<- room 'tell-room
721          #:text (.reset-msg rgb-item)))
722     ((running)
723      (<- room 'tell-room
724          #:text `("... but " ,(slot-ref rgb-item 'name)
725                   " is currently running!")))
726     ((ready)
727      (<- room 'tell-room
728          #:text `("... but " ,(slot-ref rgb-item 'name)
729                   " has already been reset.")))))
730
731 (define-actor <rgb-kettle> (<rgb-item>)
732   ((trigger rgb-kettle-trigger)
733    (reset rgb-kettle-reset))
734   (heated #:accessor .heated
735           #:init-value #f)
736   (filled #:accessor .filled
737           #:init-value #f))
738
739 (define* (rgb-kettle-trigger rgb-item message #:key triggered-by)
740   (define room (gameobj-loc rgb-item))
741   (if (not (eq? (.state rgb-item) 'ran))
742       (begin
743         (match triggered-by
744           ('water-demon
745            (set! (.state rgb-item) 'running)
746            (set! (.filled rgb-item) #t))
747           ('quik-heater
748            (set! (.state rgb-item) 'running)
749            (set! (.heated rgb-item) #t)))
750         (when (and (.filled rgb-item)
751                    (.heated rgb-item))
752           (<- room 'tell-room
753               #:text '((i "*kshhhhhh!*")
754                        " The water has boiled!"))
755           (8sleep .25)
756           (set! (.state rgb-item) 'ran)
757           ;; insert a cup of hot tea in the room
758           (create-gameobj <hot-tea> (gameobj-gm rgb-item) room)
759           (<- room 'tell-room
760               #:text '("The machine pours out a cup of hot tea! "
761                        "Looks like the machine finished!"))))
762       (<- room 'tell-room
763          #:text `("... but " ,(slot-ref rgb-item 'name)
764                   " has already been triggered!"))))
765
766 (define (rgb-kettle-reset rgb-item message . rest-args)
767   (define room (gameobj-loc rgb-item))
768   (when (eq? (.state rgb-item) 'ran)
769     (set! (.heated rgb-item) #f)
770     (set! (.filled rgb-item) #f))
771   (apply rgb-item-reset rgb-item message rest-args))
772
773 (define-actor <tinfoil-hat> (<gameobj>)
774   ((cmd-wear tinfoil-hat-wear))
775   (contained-commands
776    #:allocation #:each-subclass
777    #:init-thunk (build-commands
778                  ("wear" ((direct-command cmd-wear))))))
779
780 (define (tinfoil-hat-wear tinfoil-hat message . _)
781   (<- (message-from message) 'tell
782       #:text '("You put on the tinfoil hat, and, to be perfectly honest with you "
783                "it's a lot harder to take you seriously.")))
784
785
786 (define-actor <hot-tea> (<gameobj>)
787   ((cmd-drink hot-tea-cmd-drink)
788    (cmd-sip hot-tea-cmd-sip))
789   (contained-commands
790    #:allocation #:each-subclass
791    #:init-thunk (build-commands
792                  ("drink" ((direct-command cmd-drink)))
793                  ("sip" ((direct-command cmd-sip)))))
794   
795   (sips-left #:init-value 4
796              #:accessor .sips-left)
797   (name #:init-value "a cup of hot tea")
798   (take-me? #:init-value #t)
799   (goes-by #:init-value '("cup of hot tea" "cup of tea" "tea" "cup"))
800   (desc #:init-value "It's a steaming cup of hot tea.  It looks pretty good!"))
801
802 (define (hot-tea-cmd-drink hot-tea message . _)
803   (define player (message-from message))
804   (define player-loc (mbody-val (<-wait player 'get-loc)))
805   (define player-name (mbody-val (<-wait player 'get-name)))
806   (<- player 'tell
807       #:text "You drink a steaming cup of hot tea all at once... hot hot hot!")
808   (<- player-loc 'tell-room
809       #:text `(,player-name
810                " drinks a steaming cup of hot tea all at once.")
811       #:exclude player)
812   (gameobj-self-destruct hot-tea))
813
814 (define (hot-tea-cmd-sip hot-tea message . _)
815   (define player (message-from message))
816   (define player-loc (mbody-val (<-wait player 'get-loc)))
817   (define player-name (mbody-val (<-wait player 'get-name)))
818   (set! (.sips-left hot-tea) (- (.sips-left hot-tea) 1))
819   (<- player 'tell
820       #:text "You take a sip of your steaming hot tea.  How refined!")
821   (<- player-loc 'tell-room
822       #:text `(,player-name
823                " takes a sip of their steaming hot tea.  How refined!")
824       #:exclude player)
825   (when (= (.sips-left hot-tea) 0)
826     (<- player 'tell
827         #:text "You've finished your tea!")
828     (<- player-loc 'tell-room
829         #:text `(,player-name
830                  " finishes their tea!")
831         #:exclude player)
832     (gameobj-self-destruct hot-tea)))
833
834 (define-actor <fanny-pack> (<container>)
835   ((cmd-take-from-while-wearing cmd-take-from)
836    (cmd-put-in-while-wearing cmd-put-in))
837   (contained-commands
838    #:allocation #:each-subclass
839    #:init-thunk
840    (build-commands
841     (("l" "look") ((direct-command cmd-look-at)))
842     ("take" ((prep-indir-command cmd-take-from-while-wearing
843                                  '("from" "out of"))))
844     ("put" ((prep-indir-command cmd-put-in-while-wearing
845                                 '("in" "inside" "into" "on")))))))
846
847 (define playroom
848   (lol
849    ('playroom
850     <room> #f
851     #:name "The Playroom"
852     #:desc '(p ("  There are toys scattered everywhere here.  It's really unclear
853 if this room is intended for children or child-like adults.")
854                ("  There are doors to both the east and the west."))
855     #:exits
856     (list (make <exit>
857             #:name "east"
858             #:to 'grand-hallway)
859           (make <exit>
860             #:name "west"
861             #:to 'computer-room)))
862    ('playroom:cubey
863     <gameobj> 'playroom
864     #:name "Cubey"
865     #:take-me? #t
866     #:desc "  It's a little foam cube with googly eyes on it.  So cute!")
867    ('playroom:cuddles-plushie
868     <gameobj> 'playroom
869     #:name "a Cuddles plushie"
870     #:goes-by '("plushie" "cuddles plushie" "cuddles")
871     #:take-me? #t
872     #:desc "  A warm and fuzzy cuddles plushie!  It's a cuddlefish!")
873
874    ('playroom:toy-chest
875     <container> 'playroom
876     #:name "a toy chest"
877     #:goes-by '("toy chest" "chest")
878     #:desc (lambda (toy-chest whos-looking)
879              (let ((contents (gameobj-occupants toy-chest)))
880                `((p "A brightly painted wooden chest.  The word \"TOYS\" is "
881                     "engraved on it.")
882                  (p "Inside you see:"
883                     ,(if (eq? contents '())
884                          " nothing!  It's empty!"
885                          `(ul ,(map (lambda (occupant)
886                                       `(li ,(mbody-val
887                                              (<-wait occupant 'get-name))))
888                                     (gameobj-occupants toy-chest))))))))
889     #:take-from-me? #t
890     #:put-in-me? #t)
891
892    ;; Things inside the toy chest
893    ('playroom:toy-chest:rubber-duck
894     <gameobj> 'playroom:toy-chest
895     #:name "a rubber duck"
896     #:goes-by '("rubber duck" "duck")
897     #:take-me? #t
898     #:desc "It's a yellow rubber duck with a bright orange beak.")
899
900    ('playroom:toy-chest:tinfoil-hat
901     <tinfoil-hat> 'playroom:toy-chest
902     #:name "a tinfoil hat"
903     #:goes-by '("tinfoil hat" "hat")
904     #:take-me? #t
905     #:desc "You'd have to be a crazy person to wear this thing!")
906
907    ('playroom:toy-chest:fanny-pack
908     <fanny-pack> 'playroom:toy-chest
909     #:name "a fanny pack"
910     #:goes-by '("fanny pack" "pack")
911     #:take-me? #t
912     #:desc
913     (lambda (toy-chest whos-looking)
914       (let ((contents (gameobj-occupants toy-chest)))
915         `((p "It's a leather fanny pack, so it's both tacky and kinda cool.")
916           (p "Inside you see:"
917              ,(if (eq? contents '())
918                   " nothing!  It's empty!"
919                   `(ul ,(map (lambda (occupant)
920                                `(li ,(mbody-val
921                                       (<-wait occupant 'get-name))))
922                              (gameobj-occupants toy-chest)))))))))
923
924    ;; Things inside the toy chest
925    ('playroom:toy-chest:fanny-pack:plastic-elephant
926     <gameobj> 'playroom:toy-chest:fanny-pack
927     #:name "a plastic elephant"
928     #:goes-by '("plastic elephant" "elephant")
929     #:take-me? #t
930     #:desc "It's a tiny little plastic elephant.  Small, but heartwarming.")
931
932    ('playroom:rgb-machine
933     <rgb-machine> 'playroom
934     #:name "a Rube Goldberg machine"
935     #:goes-by '("rube goldberg machine" "machine")
936     #:rgb-items '(playroom:rgb-dominoes
937                   playroom:rgb-switch-match
938                   playroom:rgb-candle
939                   playroom:rgb-catapult
940                   playroom:rgb-water-demon
941                   playroom:rgb-quik-heater
942                   playroom:rgb-kettle)
943     #:desc "It's one of those hilarious Rube Goldberg machines.
944 What could happen if you started it?")
945
946    ;; Dominoes topple
947    ('playroom:rgb-dominoes
948     <rgb-item> 'playroom
949     #:name "some dominoes"
950     #:goes-by '("dominoes" "some dominoes")
951     #:steps `("The dominoes topple down the line..."
952               1
953               "The last domino lands on a switch!"
954               1.5
955               playroom:rgb-switch-match)
956     #:reset-msg "The dominoes are placed back into position.")
957
958    ;; Which hit the switch and strike a match
959    ('playroom:rgb-switch-match
960     <rgb-item> 'playroom
961     #:name "a switch"
962     #:goes-by '("switch" "match")
963     #:steps `("The switch lights a match!"
964               ,(/ 2 3)
965               "The match lights a candle!"
966               1.5
967               playroom:rgb-candle)
968     #:reset-msg "A fresh match is installed and the switch is reset.")
969    ;; which lights a candle and burns a rope
970    ('playroom:rgb-candle
971     <rgb-item> 'playroom
972     #:name "a candle"
973     #:goes-by '("candle")
974     #:steps `("The candle burns..."
975               .3  ; oops!
976               "The candle is burning away a rope!"
977               2
978               "The rope snaps!"
979               .5
980               playroom:rgb-catapult)
981     #:reset-msg "A fresh candle is installed.")
982    ;; which catapults a rock
983    ('playroom:rgb-catapult
984     <rgb-item> 'playroom
985     #:name "a catapult"
986     #:goes-by '("catapult")
987     #:steps `("The snapped rope unleashes a catapult, which throws a rock!"
988               2
989               "The rock flies through a water demon, startling it!"
990               .5
991               playroom:rgb-water-demon
992               2
993               "The rock whacks into the quik-heater's on button!"
994               .5
995               playroom:rgb-quik-heater)
996     #:reset-msg
997     '("A fresh rope is attached to the catapult, which is pulled taught. "
998       "A fresh rock is placed on the catapult."))
999    ;; which both:
1000    ;;   '- panics the water demon
1001    ;;      '- which waters the kettle
1002    ('playroom:rgb-water-demon
1003     <rgb-item> 'playroom
1004     #:name "the water demon"
1005     #:triggers-as 'water-demon
1006     #:goes-by '("water demon" "demon")
1007     #:steps `("The water demon panics, and starts leaking water into the kettle below!"
1008               3
1009               "The kettle is filled!"
1010               playroom:rgb-kettle)
1011     #:reset-msg '("The water demon is scratched behind the ears and calms down."))
1012    ;;   '- bops the quik-heater button
1013    ;;      '- which heats the kettle
1014    ('playroom:rgb-quik-heater
1015     <rgb-item> 'playroom
1016     #:name "the quik heater"
1017     #:triggers-as 'quik-heater
1018     #:goes-by '("quik heater" "heater")
1019     #:steps `("The quik-heater heats up the kettle above it!"
1020               3
1021               "The kettle is heated up!"
1022               playroom:rgb-kettle)
1023     #:reset-msg '("The quik heater is turned off."))
1024    ;; Finally, the kettle
1025    ('playroom:rgb-kettle
1026     <rgb-kettle> 'playroom
1027     #:name "the kettle"
1028     #:goes-by '("kettle")
1029     #:reset-msg '("The kettle is emptied."))))
1030
1031
1032 \f
1033 ;;; Writing room
1034 ;;; ------------
1035
1036 \f
1037 ;;; Armory???
1038 ;;; ---------
1039
1040 ;; ... full of NURPH weapons?
1041
1042 \f
1043 ;;; Smoking parlor
1044 ;;; --------------
1045
1046 (define-class <furniture> (<gameobj>)
1047   (sit-phrase #:init-keyword #:sit-phrase)
1048   (sit-phrase-third-person #:init-keyword #:sit-phrase-third-person)
1049   (sit-name #:init-keyword #:sit-name)
1050
1051   (commands
1052    #:allocation #:each-subclass
1053    #:init-thunk (build-commands
1054                  ("sit" ((direct-command cmd-sit-furniture)))))
1055   (actions #:allocation #:each-subclass
1056            #:init-thunk (build-actions
1057                          (cmd-sit-furniture furniture-cmd-sit))))
1058
1059 (define* (furniture-cmd-sit actor message #:key direct-obj)
1060   (define player-name
1061     (mbody-val (<-wait (message-from message) 'get-name)))
1062   (<- (message-from message) 'tell
1063       #:text (format #f "You ~a ~a.\n"
1064                      (slot-ref actor 'sit-phrase)
1065                      (slot-ref actor 'sit-name)))
1066   (<- (slot-ref actor 'loc) 'tell-room
1067       #:text (format #f "~a ~a on ~a.\n"
1068                      player-name
1069                      (slot-ref actor 'sit-phrase-third-person)
1070                      (slot-ref actor 'sit-name))
1071       #:exclude (message-from message)))
1072
1073
1074 (define smoking-parlor
1075   (lol
1076    ('smoking-parlor
1077     <room> #f
1078     #:name "Smoking Parlor"
1079     #:desc
1080     '((p "This room looks quite posh.  There are huge comfy seats you can sit in
1081 if you like. Strangely, you see a large sign saying \"No Smoking\".  The owners must
1082 have installed this place and then changed their mind later.")
1083       (p "There's a door to the west leading back to the grand hallway, and
1084 a nondescript steel door to the south, leading apparently outside."))
1085     #:exits
1086     (list (make <exit>
1087             #:name "west"
1088             #:to 'grand-hallway)
1089           (make <exit>
1090             #:name "south"
1091             #:to 'break-room)))
1092    ('smoking-parlor:chair
1093     <furniture> 'smoking-parlor
1094     #:name "a comfy leather chair"
1095     #:desc "  That leather chair looks really comfy!"
1096     #:goes-by '("leather chair" "comfy leather chair" "chair")
1097     #:sit-phrase "sink into"
1098     #:sit-phrase-third-person "sinks into"
1099     #:sit-name "the comfy leather chair")
1100    ('smoking-parlor:sofa
1101     <furniture> 'smoking-parlor
1102     #:name "a plush leather sofa"
1103     #:desc "  That leather chair looks really comfy!"
1104     #:goes-by '("leather sofa" "plush leather sofa" "sofa"
1105                 "leather couch" "plush leather couch" "couch")
1106     #:sit-phrase "sprawl out on"
1107     #:sit-phrase-third-person "sprawls out on into"
1108     #:sit-name "the plush leather couch")
1109    ('smoking-parlor:bar-stool
1110     <furniture> 'smoking-parlor
1111     #:name "a bar stool"
1112     #:desc "  Conveniently located near the bar!  Not the most comfortable
1113 seat in the room, though."
1114     #:goes-by '("stool" "bar stool" "seat")
1115     #:sit-phrase "hop on"
1116     #:sit-phrase-third-person "hops onto"
1117     #:sit-name "the bar stool")
1118    ('ford-prefect
1119     <chatty-npc> 'smoking-parlor
1120     #:name "Ford Prefect"
1121     #:desc "Just some guy, you know?"
1122     #:goes-by '("Ford Prefect" "ford prefect"
1123                 "frood" "prefect" "ford")
1124     #:catchphrases prefect-quotes)
1125
1126    ('smoking-parlor:no-smoking-sign
1127     <readable> 'smoking-parlor
1128     #:invisible? #t
1129     #:name "No Smoking Sign"
1130     #:desc "This sign says \"No Smoking\" in big, red letters.
1131 It has some bits of bubble gum stuck to it... yuck."
1132     #:goes-by '("no smoking sign" "sign")
1133     #:read-text "It says \"No Smoking\", just like you'd expect from
1134 a No Smoking sign.")
1135    ;; TODO: Cigar dispenser
1136    ))
1137
1138 \f
1139
1140 ;;; Breakroom
1141 ;;; ---------
1142
1143 (define-class <desk-clerk> (<gameobj>)
1144   ;; The desk clerk has three states:
1145   ;;  - on-duty: Arrived, and waiting for instructions (and losing patience
1146   ;;    gradually)
1147   ;;  - slacking: In the break room, probably smoking a cigarette
1148   ;;    or checking text messages
1149   (state #:init-value 'slacking)
1150   (commands #:allocation #:each-subclass
1151             #:init-thunk
1152             (build-commands
1153              (("talk" "chat") ((direct-command cmd-chat)))
1154              ("ask" ((direct-command cmd-ask-incomplete)
1155                      (prep-direct-command cmd-ask-about)))
1156              ("dismiss" ((direct-command cmd-dismiss)))))
1157   (patience #:init-value 0)
1158   (actions #:allocation #:each-subclass
1159            #:init-thunk (build-actions
1160                          (init clerk-act-init)
1161                          (cmd-chat clerk-cmd-chat)
1162                          (cmd-ask-incomplete clerk-cmd-ask-incomplete)
1163                          (cmd-ask-about clerk-cmd-ask)
1164                          (cmd-dismiss clerk-cmd-dismiss)
1165                          (update-loop clerk-act-update-loop)
1166                          (be-summoned clerk-act-be-summoned))))
1167
1168 (define (clerk-act-init clerk message . _)
1169   ;; call the gameobj main init method
1170   (gameobj-act-init clerk message)
1171   ;; start our main loop
1172   (<- (actor-id clerk) 'update-loop))
1173
1174 (define changing-name-text "Changing your name is easy!
1175 We have a clipboard here at the desk
1176 where you can make yourself known to other participants in the hotel
1177 if you sign it.  Try 'sign form as <your-name>', replacing
1178 <your-name>, obviously!")
1179
1180 (define phd-text
1181   "Ah... when I'm not here, I've got a PHD to finish.")
1182
1183 (define clerk-help-topics
1184   `(("changing name" . ,changing-name-text)
1185     ("sign-in form" . ,changing-name-text)
1186     ("form" . ,changing-name-text)
1187     ("common commands" .
1188      "Here are some useful commands you might like to try: chat,
1189 go, take, drop, say...")
1190     ("hotel" .
1191      "We hope you enjoy your stay at Hotel Bricabrac.  As you may see,
1192 our hotel emphasizes interesting experiences over rest and lodging.
1193 The origins of the hotel are... unclear... and it has recently come
1194 under new... 'management'.  But at Hotel Bricabrac we believe these
1195 aspects make the hotel into a fun and unique experience!  Please,
1196 feel free to walk around and explore.")
1197     ("physics paper" . ,phd-text)
1198     ("paper" . ,phd-text)
1199     ("proprietor" . "Oh, he's that frumpy looking fellow sitting over there.")))
1200
1201
1202 (define clerk-knows-about
1203   "'ask clerk about changing name', 'ask clerk about common commands', and 'ask clerk about the hotel'")
1204
1205 (define clerk-general-helpful-line
1206   (string-append
1207    "The clerk says, \"If you need help with anything, feel free to ask me about it.
1208 For example, 'ask clerk about changing name'. You can ask me about the following:
1209 " clerk-knows-about ".\"\n"))
1210
1211 (define clerk-slacking-complaints
1212   '("The pay here is absolutely lousy."
1213     "The owner here has no idea what they're doing."
1214     "Some times you just gotta step away, you know?"
1215     "You as exhausted as I am?"
1216     "Yeah well, this is just temporary.  I'm studying to be a high
1217 energy particle physicist.  But ya gotta pay the bills, especially
1218 with tuition at where it is..."))
1219
1220 (define* (clerk-cmd-chat clerk message #:key direct-obj)
1221   (match (slot-ref clerk 'state)
1222     ('on-duty
1223      (<- (message-from message) 'tell
1224          #:text clerk-general-helpful-line))
1225     ('slacking
1226      (<- (message-from message) 'tell
1227          #:text
1228          (string-append
1229           "The clerk says, \""
1230           (random-choice clerk-slacking-complaints)
1231           "\"\n")))))
1232
1233 (define (clerk-cmd-ask-incomplete clerk message . _)
1234   (<- (message-from message) 'tell
1235       #:text "The clerk says, \"Ask about what?\"\n"))
1236
1237 (define clerk-doesnt-know-text
1238   "The clerk apologizes and says she doesn't know about that topic.\n")
1239
1240 (define* (clerk-cmd-ask clerk message #:key indir-obj
1241                         #:allow-other-keys)
1242   (match (slot-ref clerk 'state)
1243     ('on-duty
1244      (match (assoc indir-obj clerk-help-topics)
1245        ((_ . info)
1246            (<- (message-from message) 'tell
1247                #:text
1248                (string-append "The clerk clears her throat and says:\n  \""
1249                               info
1250                               "\"\n")))
1251        (#f
1252         (<- (message-from message) 'tell
1253             #:text clerk-doesnt-know-text))))
1254     ('slacking
1255      (<- (message-from message) 'tell
1256          #:text "The clerk says, \"Sorry, I'm on my break.\"\n"))))
1257
1258 (define* (clerk-act-be-summoned clerk message #:key who-summoned)
1259   (match (slot-ref clerk 'state)
1260     ('on-duty
1261      (<- who-summoned 'tell
1262          #:text
1263          "The clerk tells you as politely as she can that she's already here,
1264 so there's no need to ring the bell.\n"))
1265     ('slacking
1266      (<- (gameobj-loc clerk) 'tell-room
1267          #:text
1268          "The clerk's ears perk up, she stamps out a cigarette, and she
1269 runs out of the room!\n")
1270      (gameobj-set-loc! clerk (dyn-ref clerk 'lobby))
1271      (slot-set! clerk 'patience 8)
1272      (slot-set! clerk 'state 'on-duty)
1273      (<- (gameobj-loc clerk) 'tell-room
1274          #:text
1275          (string-append
1276           "  Suddenly, a uniformed woman rushes into the room!  She's wearing a
1277 badge that says \"Desk Clerk\".
1278   \"Hello, yes,\" she says between breaths, \"welcome to Hotel Bricabrac!
1279 We look forward to your stay.  If you'd like help getting acclimated,
1280 feel free to ask me.  For example, 'ask clerk about changing name'.
1281 You can ask me about the following:
1282 " clerk-knows-about ".\"\n")))))
1283
1284 (define* (clerk-cmd-dismiss clerk message . _)
1285   (define player-name
1286     (mbody-val (<-wait (message-from message) 'get-name)))
1287   (match (slot-ref clerk 'state)
1288     ('on-duty
1289      (<- (gameobj-loc clerk) 'tell-room
1290          #:text
1291          (format #f "\"Thanks ~a!\" says the clerk. \"I have somewhere I need to be.\"
1292 The clerk leaves the room in a hurry.\n"
1293                  player-name)
1294          #:exclude (actor-id clerk))
1295      (gameobj-set-loc! clerk (dyn-ref clerk 'break-room))
1296      (slot-set! clerk 'state 'slacking)
1297      (<- (gameobj-loc clerk) 'tell-room
1298          #:text clerk-return-to-slacking-text
1299          #:exclude (actor-id clerk)))
1300     ('slacking
1301      (<- (message-from message) 'tell
1302          #:text "The clerk sternly asks you to not be so dismissive.\n"))))
1303
1304 (define clerk-slacking-texts
1305   '("The clerk takes a long drag on her cigarette.\n"
1306     "The clerk scrolls through text messages on her phone.\n"
1307     "The clerk coughs a few times.\n"
1308     "The clerk checks her watch and justifies a few more minutes outside.\n"
1309     "The clerk fumbles around for a lighter.\n"
1310     "The clerk sighs deeply and exhaustedly.\n"
1311     "The clerk fumbles around for a cigarette.\n"))
1312
1313 (define clerk-working-impatience-texts
1314   '("The clerk hums something, but you're not sure what it is."
1315     "The clerk attempts to change the overhead music, but the dial seems broken."
1316     "The clerk clicks around on the desk computer."
1317     "The clerk scribbles an equation on a memo pad, then crosses it out."
1318     "The clerk mutters something about the proprietor having no idea how to run a hotel."
1319     "The clerk thumbs through a printout of some physics paper."))
1320
1321 (define clerk-slack-excuse-text
1322   "The desk clerk excuses herself, but says you are welcome to ring the bell
1323 if you need further help.")
1324
1325 (define clerk-return-to-slacking-text
1326   "The desk clerk enters and slams the door behind her.\n")
1327
1328
1329 (define (clerk-act-update-loop clerk message)
1330   (define (tell-room text)
1331     (<- (gameobj-loc clerk) 'tell-room
1332         #:text text
1333         #:exclude (actor-id clerk)))
1334   (define (loop-if-not-destructed)
1335     (if (not (slot-ref clerk 'destructed))
1336         ;; This iterates by "recursing" on itself by calling itself
1337         ;; (as the message handler) again.  It used to be that we had to do
1338         ;; this, because there was a bug where a loop which yielded like this
1339         ;; would keep growing the stack due to some parameter goofiness.
1340         ;; That's no longer true, but there's an added advantage to this
1341         ;; route: it's much more live hackable.  If we change the definition
1342         ;; of this method, the character will act differently on the next
1343         ;; "tick" of the loop.
1344         (<- (actor-id clerk) 'update-loop)))
1345   (match (slot-ref clerk 'state)
1346     ('slacking
1347      (tell-room (random-choice clerk-slacking-texts))
1348      (8sleep (+ (random 20) 15))
1349      (loop-if-not-destructed))
1350     ('on-duty
1351      (if (> (slot-ref clerk 'patience) 0)
1352          ;; Keep working but lose patience gradually
1353          (begin
1354            (tell-room (random-choice clerk-working-impatience-texts))
1355            (slot-set! clerk 'patience (- (slot-ref clerk 'patience)
1356                                          (+ (random 2) 1)))
1357            (8sleep (+ (random 60) 40))
1358            (loop-if-not-destructed))
1359          ;; Back to slacking
1360          (begin
1361            (tell-room clerk-slack-excuse-text)
1362            ;; back bto the break room
1363            (gameobj-set-loc! clerk (dyn-ref clerk 'break-room))
1364            (tell-room clerk-return-to-slacking-text)
1365            ;; annnnnd back to slacking
1366            (slot-set! clerk 'state 'slacking)
1367            (8sleep (+ (random 30) 15))
1368            (loop-if-not-destructed))))))
1369
1370
1371 (define break-room
1372   (lol
1373    ('break-room
1374     <room> #f
1375     #:name "Employee Break Room"
1376     #:desc "  This is less a room and more of an outdoor wire cage.  You get
1377 a bit of a view of the brick exterior of the building, and a crisp wind blows,
1378 whistling, through the openings of the fenced area.  Partly smoked cigarettes
1379 and various other debris cover the floor.
1380   Through the wires you can see... well... hm.  It looks oddly like
1381 the scenery tapers off nothingness.  But that can't be right, can it?"
1382     #:exits
1383     (list (make <exit>
1384             #:name "north"
1385             #:to 'smoking-parlor)))
1386    ('break-room:desk-clerk
1387     <desk-clerk> 'break-room
1388     #:name "the hotel desk clerk"
1389     #:desc "  The hotel clerk is wearing a neatly pressed uniform bearing the
1390 hotel insignia.  She appears to be rather exhausted."
1391     #:goes-by '("hotel desk clerk" "clerk" "desk clerk"))
1392    ('break-room:void
1393     <gameobj> 'break-room
1394     #:invisible? #t
1395     #:name "The Void"
1396     #:desc "As you stare into the void, the void stares back into you."
1397     #:goes-by '("void" "abyss" "nothingness" "scenery"))
1398    ('break-room:fence
1399     <gameobj> 'break-room
1400     #:invisible? #t
1401     #:name "break room cage"
1402     #:desc "It's a mostly-cubical wire mesh surrounding the break area.
1403 You can see through the gaps, but they're too small to put more than a
1404 couple of fingers through.  There appears to be some wear and tear to
1405 the paint, but the wires themselves seem to be unusually sturdy."
1406     #:goes-by '("fence" "cage" "wire cage"))))
1407
1408
1409 \f
1410 ;;; Ennpie's Sea Lounge
1411 ;;; -------------------
1412
1413 \f
1414 ;;; Computer room
1415 ;;; -------------
1416
1417 ;; Our computer and hard drive are based off the PDP-11 and the RL01 /
1418 ;; RL02 disk drives.  However we increment both by .5 (a true heresy)
1419 ;; to distinguish both from the real thing.
1420
1421 (define-actor <hard-drive> (<gameobj>)
1422   ((cmd-put-in hard-drive-insert)
1423    (cmd-push-button hard-drive-push-button)
1424    (get-state hard-drive-act-get-state))
1425   (commands #:allocation #:each-subclass
1426             #:init-thunk (build-commands
1427                           ("insert" ((prep-indir-command cmd-put-in
1428                                                          '("in" "inside" "into"))))
1429                           (("press" "push") ((prep-indir-command cmd-push-button)))))
1430   ;; the state moves from: empty -> with-disc -> loading -> ready
1431   (state #:init-value 'empty
1432          #:accessor .state))
1433
1434 (define (hard-drive-act-get-state hard-drive message)
1435   (<-reply message (.state hard-drive)))
1436
1437 (define* (hard-drive-desc hard-drive #:optional whos-looking)
1438   `((p "The hard drive is labeled \"RL02.5\".  It's a little under a meter tall.")
1439     (p "There is a slot where a disk platter could be inserted, "
1440        ,(if (eq? (.state hard-drive) 'empty)
1441             "which is currently empty"
1442             "which contains a glowing platter")
1443        ". There is a LOAD button "
1444        ,(if (member (.state hard-drive) '(empty with-disc))
1445             "which is glowing"
1446             "which is pressed in and unlit")
1447        ". There is a READY indicator "
1448        ,(if (eq? (.state hard-drive) 'ready)
1449             "which is glowing."
1450             "which is unlit.")
1451        ,(if (member (.state hard-drive) '(loading ready))
1452             "  The machine emits a gentle whirring noise."
1453             ""))))
1454
1455 (define* (hard-drive-push-button gameobj message
1456                                  #:key direct-obj indir-obj preposition
1457                                  (player (message-from message)))
1458   (define (tell-room text)
1459     (<-wait (gameobj-loc gameobj) 'tell-room
1460             #:text text))
1461   (define (tell-room-excluding-player text)
1462     (<-wait (gameobj-loc gameobj) 'tell-room
1463             #:text text
1464             #:exclude player))
1465   (cond
1466    ((ci-member direct-obj '("button" "load button" "load"))
1467     (tell-room-excluding-player
1468      `(,(mbody-val (<-wait player 'get-name))
1469        " presses the button on the hard disk."))
1470     (<- player 'tell
1471         #:text "You press the button on the hard disk.")
1472
1473     (case (.state gameobj)
1474       ((empty)
1475        ;; I have no idea what this drive did when you didn't have a platter
1476        ;; in it and pressed load, but I know there was a FAULT button.
1477        (tell-room "You hear some movement inside the hard drive...")
1478        (8sleep 1.5)
1479        (tell-room
1480         '("... but then the FAULT button blinks a couple times. "
1481           "What could be missing?")))
1482       ((with-disc)
1483        (set! (.state gameobj) 'loading)
1484        (tell-room "The hard disk begins to spin up!")
1485        (8sleep 2)
1486        (set! (.state gameobj) 'ready)
1487        (tell-room "The READY light turns on!"))
1488       ((loading ready)
1489        (<- player 'tell
1490            #:text '("Pressing the button does nothing right now, "
1491                     "but it does feel satisfying.")))))
1492    (else
1493     (<- player 'tell
1494         #:text '("How could you think of pressing anything else "
1495                  "but that tantalizing button right in front of you?")))))
1496
1497 (define* (hard-drive-insert gameobj message
1498                             #:key direct-obj indir-obj preposition
1499                             (player (message-from message)))
1500   (define our-name (slot-ref gameobj 'name))
1501   (define this-thing
1502     (call/ec
1503      (lambda (return)
1504        (for-each (lambda (occupant)
1505                    (define goes-by (mbody-val (<-wait occupant 'goes-by)))
1506                    (when (ci-member direct-obj goes-by)
1507                      (return occupant)))
1508                  (mbody-val (<-wait player 'get-occupants)))
1509        ;; nothing found
1510        #f)))
1511   (cond
1512    ((not this-thing)
1513     (<- player 'tell
1514         #:text `("You don't seem to have any such " ,direct-obj " to put "
1515                  ,preposition " " ,our-name ".")))
1516    ((not (mbody-val (<-wait this-thing 'get-prop 'hd-platter?)))
1517     (<- player 'tell
1518         #:text `("It wouldn't make sense to put "
1519                  ,(mbody-val (<-wait this-thing 'get-name))
1520                  " " ,preposition " " ,our-name ".")))
1521    ((not (eq? (.state gameobj) 'empty))
1522     (<- player 'tell
1523         #:text "The disk drive already has a platter in it."))
1524    (else
1525     (set! (.state gameobj) 'with-disc)
1526     (<- player 'tell
1527         #:text '((p "You insert the glowing disc into the drive.")
1528                  (p "The LOAD button begins to glow."))))))
1529
1530 ;; The computar
1531 (define-actor <computer> (<gameobj>)
1532   ((cmd-run-program computer-run-program)
1533    (cmd-run-what (lambda (gameobj message . _)
1534                    (<- (message-from message) 'tell
1535                        #:text '("The computer is already running, and a program appears "
1536                                 "ready to run."
1537                                 "you mean to \"run the program on the computer\""))))
1538    (cmd-help-run-not-press
1539     (lambda (gameobj message . _)
1540       (<- (message-from message) 'tell
1541           #:text '("You don't need to press / push / flip anything. "
1542                    "You could " (i "run program on computer")
1543                    " already if you wanted to.")))))
1544   (commands #:allocation #:each-subclass
1545             #:init-thunk (build-commands
1546                           ("run" ((prep-indir-command cmd-run-program
1547                                                       '("on"))
1548                                   (direct-command cmd-run-what)))
1549                           (("press" "push" "flip")
1550                            ((prep-indir-command cmd-help-run-not-press))))))
1551
1552 (define* (computer-run-program gameobj message
1553                                #:key direct-obj indir-obj preposition
1554                                (player (message-from message)))
1555   (define (hd-state)
1556     (mbody-val (<-wait (dyn-ref gameobj 'computer-room:hard-drive) 'get-state)))
1557   (define (tell-room text)
1558     (<-wait (gameobj-loc gameobj) 'tell-room
1559         #:text text))
1560   (define (tell-room-excluding-player text)
1561     (<-wait (gameobj-loc gameobj) 'tell-room
1562             #:text text
1563             #:exclude player))
1564   (define (tell-player text)
1565     (<-wait player 'tell
1566             #:text text))
1567   (cond
1568    ((ci-member direct-obj '("program"))
1569     (tell-room-excluding-player
1570      `(,(mbody-val (<-wait player 'get-name))
1571        " runs the program loaded on the computer..."))
1572     (tell-player "You run the program on the computer...")
1573
1574     (cond
1575      ((not (eq? (hd-state) 'ready))
1576       (tell-room '("... but it errors out. "
1577                    "It seems to be complaining about a " (b "DISK ERROR!")
1578                    ". It looks like it is missing some essential software.")))
1579      (else
1580       (<- (dyn-ref gameobj 'computer-room:floor-panel) 'open-up))))))
1581
1582
1583 ;; floor panel
1584 (define-actor <floor-panel> (<gameobj>)
1585   ;; TODO: Add "open" verb, since obviously people will try that
1586   ((open? (lambda (panel message)
1587             (<-reply message (slot-ref panel 'open))))
1588    (open-up floor-panel-open-up))
1589   (open #:init-value #f))
1590
1591 (define (floor-panel-open-up panel message)
1592   (if (slot-ref panel 'open)
1593       (<- (gameobj-loc panel) 'tell-room
1594           #:text '("You hear some gears grind around the hinges of the "
1595                    "floor panel, but it appears to already be open."))
1596       (begin
1597         (slot-set! panel 'open #t)
1598         (<- (gameobj-loc panel) 'tell-room
1599             #:text '("You hear some gears grind, as the metal panel on "
1600                      "the ground opens and reveals a stairwell going down!")))))
1601
1602 (define* (floor-panel-desc panel #:optional whos-looking)
1603   `("It's a large metal panel on the floor in the middle of the room. "
1604     ,(if (slot-ref panel 'open)
1605          '("It's currently wide open, revealing a spiraling staircase "
1606            "which descends into darkness.")
1607          '("It's currently closed shut, but there are clearly hinges, and "
1608            "it seems like there is a mechanism which probably opens it via "
1609            "some automation.  What could be down there?"))))
1610
1611 (define computer-room
1612   (lol
1613    ('computer-room
1614     <room> #f
1615     #:name "Computer Room"
1616     #:desc (lambda (gameobj whos-looking)
1617              (define panel-open
1618                (mbody-val (<-wait (dyn-ref gameobj 'computer-room:floor-panel)
1619                                   'open?)))
1620              `((p "A sizable computer cabinet covers a good portion of the left
1621  wall.  It emits a pleasant hum which covers the room like a warm blanket.
1622  Connected to a computer is a large hard drive.")
1623                (p "On the floor is a large steel panel.  "
1624                   ,(if panel-open
1625                        '("It is wide open, exposing a spiral staircase "
1626                          "which descends into darkness.")
1627                        '("It is closed, but it has hinges which "
1628                          "suggest it could be opened.")))))
1629     #:exits
1630     (list (make <exit>
1631             #:name "east"
1632             #:to 'playroom)
1633           (make <exit>
1634             #:name "down"
1635             #:to 'underground-lab
1636             #:traverse-check
1637             (lambda (exit room whos-exiting)
1638               (define panel-open
1639                 (mbody-val (<-wait (dyn-ref room 'computer-room:floor-panel)
1640                                    'open?)))
1641               (if panel-open
1642                   (values #t "You descend the spiral staircase.")
1643                   (values #f '("You'd love to go down, but the only way "
1644                                "through is through that metal panel, "
1645                                "which seems closed.")))))))
1646    ('computer-room:hard-drive
1647     <hard-drive> 'computer-room
1648     #:name "the hard drive"
1649     #:desc (wrap-apply hard-drive-desc)
1650     #:goes-by '("hard drive" "drive" "hard disk"))
1651    ('computer-room:computer
1652     <computer> 'computer-room
1653     #:name "the computer"
1654     #:desc '((p "It's a coat closet sized computer labeled \"PDP-11.5\". ")
1655              (p "The computer is itself turned on, and it looks like it is "
1656                 "all set up for you to run a program on it."))
1657     #:goes-by '("computer"))
1658    ('computer-room:floor-panel
1659     <floor-panel> 'computer-room
1660     #:name "a floor panel"
1661     #:desc (wrap-apply floor-panel-desc)
1662     #:invisible? #t
1663     #:goes-by '("floor panel" "panel"))))
1664
1665 \f
1666 ;;; * UNDERGROUND SECTION OF THE GAME! *
1667
1668 \f
1669 ;;; The lab
1670
1671 (define underground-map-text
1672   "\
1673                             _______           |
1674                          .-' @     '-.         \\   ?????
1675                        .'             '.       .\\             
1676                        |  [8sync Hive] |======'  '-_____
1677                        ',      M      ,'
1678                         '.         @ .'                                  
1679                           \\   @     /                    
1680                            '-__+__-'                
1681                             '.  @ .'
1682      .--------------.         \\ /
1683      | [Guile Async |  .-------+------.
1684      |    Museum]   |  |     [Lab] #!#|  .-------------.
1685      |             @|  |  MM          |  |[Federation  |
1686      | &      ^     +##+@ ||     <    +##|     Station]|
1687      |              |  |           @  |  |             |
1688      |         &  # |  |*You-Are-Here*|  '-------------'
1689      | #   ^        | #+-------+------'
1690      '-------+------' #        #
1691              #        #        #
1692              #        #   .-----------.
1693            .-+----.   #   |#       F  |
1694            |@?+%? +####   | ^   f##   |
1695            '------'       |  f    f  %|
1696                           |F [Mudsync |
1697                           | $  Swamp] |
1698                           '-----------'")
1699
1700 (define 8sync-design-goals
1701   '(ul (li (b "Actor based, shared nothing environment: ")
1702            "Shared resources are hard to control and result in fighting
1703 deadlocks, etc.  Escape the drudgery: only one actor controls a resource,
1704 and they only receive one message at a time (though they can \"juggle\"
1705 messages).")
1706        (li (b "Live hackable: ")
1707            "It's hard to plan out a concurrent system; the right structure
1708 is often found by evolving the system while it runs.  Make it easy to
1709 build, shape, and change a running system, as well as observe and correct
1710 errors.")
1711        (li (b "No callback hell: ")
1712            "Just because you're calling out to some other asynchronous 
1713 code doesn't mean you should need to chop up your program into a bunch of bits.
1714 Clever use of delimited continuations makes it easy.")))
1715
1716 (define underground-lab
1717   (lol
1718    ('underground-lab
1719     <room> #f
1720     #:name "Underground laboratory"
1721     #:desc '((p "This appears to be some sort of underground laboratory."
1722                 "There is a spiral staircase here leading upwards, where "
1723                 "it seems much brighter.")
1724              (p "There are a number of doors leading in different directions:
1725 north, south, east, and west, as well as a revolving door to the southwest.
1726 It looks like it could be easy to get lost, but luckily there
1727 is a map detailing the layout of the underground structure."))
1728     #:exits
1729     (list (make <exit>
1730             #:name "up"
1731             #:to 'computer-room
1732             #:traverse-check
1733             (lambda (exit room whos-exiting)
1734               (values #t "You climb the spiral staircase.")))
1735           (make <exit>
1736             #:name "west"
1737             #:to 'async-museum
1738             #:traverse-check
1739             (lambda (exit room whos-exiting)
1740               (values #t '("You head west through a fancy-looking entrance. "
1741                            "A security guard steps aside for you to pass through, "
1742                            "into the room, then stands in front of the door."))))
1743           (make <exit>
1744             #:name "north"
1745             #:to 'hive-entrance)
1746           (make <exit>
1747             #:name "east"
1748             #:to 'federation-station)
1749           (make <exit>
1750             #:name "south"
1751             #:traverse-check
1752             (lambda (exit room whos-exiting)
1753               (values #f '("Ooh, if only you could go south and check this out! "
1754                            "Unfortunately this whole area is sealed off... the proprietor "
1755                            "probably never got around to fixing it. "
1756                            "Too bad, it would have had monsters to fight and everything!"))))
1757           (make <exit>
1758             #:name "southwest"
1759             #:traverse-check
1760             (lambda (exit room whos-exiting)
1761               (values #f '("Hm, it's one of those revolving doors that only revolves in "
1762                            "one direction, and it isn't this one.  You guess that while "
1763                            "this doesn't appear to be an entrance, it probably is an exit."))))))
1764    ;; map
1765    ('underground-lab:map
1766     <readable> 'underground-lab
1767     #:name "the underground map"
1768     #:desc '("This appears to be a map of the surrounding area. "
1769              "You could read it if you want to.")
1770     #:read-text `(pre ,underground-map-text)
1771     #:goes-by '("map" "underground map" "lab map"))
1772
1773    ('underground-lab:8sync-sign
1774     <readable> 'underground-lab
1775     #:name "a sign labeled \"8sync design goals\""
1776     #:goes-by '("sign" "8sync design goals sign" "8sync goals" "8sync design" "8sync sign")
1777     #:read-text 8sync-design-goals
1778     #:desc `((p "The sign says:")
1779              ,8sync-design-goals))))
1780
1781 \f
1782 ;;; guile async museum
1783
1784 (define async-museum
1785   (list
1786    (list
1787     'async-museum
1788     <room> #f
1789     #:name "Guile Asynchronous Museum"
1790     #:desc '((p "You're in the Guile Asynchronous Museum.  There is a list of exhibits
1791 on the wall near the entrance.  Scattered around the room are the exhibits
1792 themselves, but it's difficult to pick them out.  Maybe you should read the list
1793 to orient yourself.")
1794              (p "There is a door to the east, watched by a security guard,
1795 as well as an exit leading to the south."))
1796     #:exits (list
1797              (make <exit>
1798                #:name "south"
1799                #:to 'gift-shop)
1800              (make <exit>
1801                #:name "east"
1802                #:to 'underground-lab
1803                #:traverse-check
1804                (lambda (exit room whos-exiting)
1805                  (values #f '("The security guard stops you and tells you "
1806                               "that the only exit is through the gift shop."))))))
1807    (list
1808     'async-museum:security-guard
1809     <chatty-npc> 'async-museum
1810     #:name "a security guard"
1811     #:desc
1812     '(p "The security guard is blocking the eastern entrance, where "
1813         "you came in from.")
1814     #:goes-by '("security guard" "guard" "security")
1815     #:catchphrases '("It's hard standing here all day."
1816                      "I just want to go home."
1817                      "The exhibits are nice, but I've seen them all before."))
1818    (let ((placard
1819           `((p "Welcome to our humble museum!  The exhibits are listed below. "
1820                (br)
1821                "To look at one, simply type: " (i "look at <exhibit-name>"))
1822             (p "Available exhibits:")
1823             (ul ,@(map (lambda (exhibit)
1824                          `(li ,exhibit))
1825                        '("2016 Progress"
1826                          "8sync and Fibers"
1827                          "Suspendable Ports"
1828                          "The Actor Model"))))))
1829      (list
1830       'async-museum:list-of-exhibits
1831       <readable> 'async-museum
1832       #:name "list of exhibits"
1833       #:desc
1834       `((p "It's a list of exibits in the room.  The placard says:")
1835         ,@placard)
1836       #:goes-by '("list of exhibits" "exhibit list" "list" "exhibits")
1837       #:read-text placard))
1838    (list
1839     'async-museum:2016-progress-exhibit
1840     <readable-desc> 'async-museum
1841     #:name "2016 Progress Exhibit"
1842     #:goes-by '("2016 progress exhibit" "2016 progress" "2016 exhibit")
1843     #:desc
1844     '((p "It's a three-piece exhibit, with three little dioramas and some text "
1845          "explaining what they represent.  They are:")
1846       (ul (li (b "Late 2015/Early 2016 talk: ")
1847               "This one explains the run-up conversation from late 2015 "
1848               "and early 2016 about the need for an "
1849               "\"asynchronous event loop for Guile\".  The diorama "
1850               "is a model of the Veggie Galaxy restaurant where after "
1851               "the FSF 30th anniversary party; Mark Weaver, Christine "
1852               "Lemmer-Webber, David Thompson, and Andrew Engelbrecht chat "
1853               "about the need for Guile to have an answer to asynchronous "
1854               "programming.  A mailing list post " ; TODO: link it?
1855               "summarizing the discussion is released along with various "
1856               "conversations around what is needed, as well as further "
1857               "discussion at FOSDEM 2016.")
1858           (li (b "Early implementations: ")
1859               "This one shows Chris Webber's 8sync and Chris Vine's "
1860               "guile-a-sync, both appearing in late 2015 and evolving "
1861               "into their basic designs in early 2016.  It's less a diorama "
1862               "than a printout of some mailing list posts.  Come on, the "
1863               "curators could have done better with this one.")
1864           (li (b "Suspendable ports and Fibers: ")
1865               "The diorama shows Andy Wingo furiously hacking at his keyboard. "
1866               "The description talks about Wingo's mailing list thread "
1867               "about possibly breaking Guile compatibility for a \"ports refactor\". "
1868               "Wingo releases Fibers, another asynchronous library, making use of "
1869               "the new interface, and 8sync and guile-a-sync "
1870               "quickly move to support suspendable ports as well. "
1871               "The description also mentions that there is an exhibit entirely "
1872               "devoted to suspendable ports."))
1873       (p "Attached at the bottom is a post it note mentioning "
1874          "https integration landing in Guile 2.2.")))
1875    (list
1876     'async-museum:8sync-and-fibers-exhibit
1877     <readable-desc> 'async-museum
1878     #:name "8sync and Fibers Exhibit"
1879     #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
1880     #:desc
1881     '((p "This exhibit is a series of charts explaining the similarities "
1882          "and differences between 8sync and Fibers, two asynchronous programming "
1883          "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
1884       (p (b "Similarities:")
1885          (ul (li "Both use Guile's suspendable-ports facility")
1886              (li "Both use message passing")))
1887       (p (b "Differences:")
1888          (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
1889                  "but 8sync actors only read from one \"inbox\" each.")
1890              (li "Different theoretical basis:"
1891                  (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
1892                          "a form of Process Calculi")
1893                      (li "8sync: based on the Actor Model")
1894                      (li "Luckily CSP and the Actor Model are \"dual\"!")))))
1895       (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
1896          "whereas 8sync is designed by Chris Webber, who built this crappy "
1897          "hotel simulator.")))
1898    (list
1899     'async-museum:8sync-and-fibers-exhibit
1900     <readable-desc> 'async-museum
1901     #:name "8sync and Fibers Exhibit"
1902     #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
1903     #:desc
1904     '((p "This exhibit is a series of charts explaining the similarities "
1905          "and differences between 8sync and Fibers, two asynchronous programming "
1906          "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
1907       (p (b "Similarities:")
1908          (ul (li "Both use Guile's suspendable-ports facility")
1909              (li "Both use message passing")))
1910       (p (b "Differences:")
1911          (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
1912                  "but 8sync actors only read from one \"inbox\" each.")
1913              (li "Different theoretical basis:"
1914                  (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
1915                          "a form of Process Calculi")
1916                      (li "8sync: based on the Actor Model")
1917                      (li "Luckily CSP and the Actor Model are \"dual\"!")))))
1918       (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
1919          "whereas 8sync is designed by Chris Webber, who built this crappy "
1920          "hotel simulator.")))
1921    (list
1922     'async-museum:suspendable-ports-exhibit
1923     <readable-desc> 'async-museum
1924     #:name "Suspendable Ports Exhibit"
1925     #:goes-by '("suspendable ports exhibit" "ports exhibit"
1926                 "suspendable exhibit" "suspendable ports" "ports")
1927     #:desc
1928     '((p "Suspendable ports are a new feature in Guile 2.2, and allows code "
1929          "that would normally block on IO to " (i "automatically") " suspend "
1930          "to the scheduler until information is ready to be read/written!")
1931       (p "Yow!  You might barely need to change your existing blocking code!")
1932       (p "Fibers, 8sync, and guile-a-sync now support suspendable ports.")))
1933    (list
1934     'async-museum:actor-model-exhibit
1935     <readable-desc> 'async-museum
1936     #:name "Actor Model Exhibit"
1937     #:goes-by '("actor model exhibit" "actor exhibit"
1938                 "actor model")
1939     #:desc
1940     '((p "Here are some fact(oids) about the actor model!")
1941       (ul (li "Concieved initially by Carl Hewitt in early 1970s")
1942           (li "\"A society of experts\"")
1943           (li "shared nothing, message passing")
1944           (li "Originally the research goal of Scheme!  "
1945               "(message passing / lambda anecdote here)")
1946           (li "Key concepts consistent, but implementation details vary widely")
1947           (li "Almost all distributed systems can be viewed in terms of actor model")
1948           (li "Replaced by vanilla lambdas & generic methods? "
1949               "Maybe not if address space not shared!"))))))
1950
1951 (define gift-shop
1952   (lol
1953    ('gift-shop
1954     <room> #f
1955     #:name "Museum Gift Shop"
1956     #:desc '("There are all sorts of scrolls and knicknacks laying around here, "
1957              "but they all seem glued in place and instead of a person manning the shop "
1958              "there's merely a cardboard cutout of a person with a \"shopkeeper\" nametag. "
1959              "You can pretty well bet that someone wanted to finish this room but ran out of "
1960              "time.")
1961     #:exits (list
1962              (make <exit>
1963                #:name "northeast"
1964                #:to 'underground-lab
1965                #:traverse-check
1966                (lambda (exit room whos-exiting)
1967                  (values #t '("The revolving door spins as you walk through it.  Whee!"))))
1968              (make <exit>
1969                #:name "north"
1970                #:to 'async-museum)))))
1971
1972 \f
1973 ;;; Hive entrance
1974
1975 (define actor-descriptions
1976   '("This one is fused to the side of the hive.  It isn't receiving any
1977 messages, and it seems to be in hibernation."
1978     "A chat program glows in front of this actor's face.  They seem to
1979 be responding to chat messages and forwarding them to some other actors,
1980 and forwarding messages from other actors back to the chat."
1981     "This actor is bossing around other actors, delegating tasks to them
1982 as it receives requests, and providing reports on the worker actors'
1983 progress."
1984     "This actor is trying to write to some device, but the device keeps
1985 alternating between saying \"BUSY\" or \"READY\".  Whenever it says
1986 \"BUSY\" the actor falls asleep, and whenever it says \"READY\" it
1987 seems to wake up again and starts writing to the device."
1988     "Whoa, this actor is totally wigging out!  It seems to be throwing
1989 some errors.  It probably has some important work it should be doing
1990 but you're relieved to see that it isn't grinding the rest of the Hive
1991 to a halt."))
1992
1993 (define hive-entrance
1994   (lol
1995    ('hive-entrance
1996     <room> #f
1997     #:name "Entrance to the 8sync Hive"
1998     #:desc
1999     '((p "Towering before you is the great dome-like 8sync Hive, or at least
2000 one of them.  You've heard about this... the Hive is itself the actor that all
2001 the other actors attach themselves to.  It's shaped like a spherical half-dome.
2002 There are some actors milling about, and some seem fused to the side of the
2003 hive itself, but all of them have an umbellical cord attached to the hive from
2004 which you see flashes of light comunicating what must be some sort of messaging
2005 protocol.")
2006       (p "To the south is a door leading back to the underground lab.
2007 North leads into the Hive itself."))
2008     #:exits
2009     (list (make <exit>
2010             #:name "south"
2011             #:to 'underground-lab)
2012           (make <exit>
2013             #:name "north"
2014             #:to 'hive-inside)))
2015    ('hive-entrance:hive
2016     <gameobj> 'hive-entrance
2017     #:name "the Hive"
2018     #:goes-by '("hive")
2019     #:desc
2020     '((p "It's shaped like half a sphere embedded in the ground.
2021 Supposedly, while all actors are autonomous and control their own state,
2022 they communicate through the hive itself, which is a sort of meta-actor.
2023 There are rumors that actors can speak to each other even across totally
2024 different hives.  Could that possibly be true?")))
2025    ('hive-entrance:actor
2026     <chatty-npc> 'hive-entrance
2027     #:name "some actors"
2028     #:goes-by '("actor" "actors" "some actors")
2029     #:chat-format (lambda (npc catchphrase)
2030                     `((p "You pick one actor out of the mix and chat with it. ")
2031                       (p "It says: \"" ,catchphrase "\"")))
2032     #:desc
2033     (lambda _
2034       `((p "There are many actors, but your eyes focus on one in particular.")
2035         (p ,(random-choice actor-descriptions))))
2036     #:catchphrases
2037     '("Yeah we go through a lot of sleep/awake cycles around here.
2038 If you aren't busy processing a message, what's the point of burning
2039 valuable resources?"
2040       "I know I look like I'm some part of dreary collective, but
2041 really we have a lot of independence.  It's a shared nothing environment,
2042 after all.  (Well, except for CPU cycles, and memory, and...)"
2043       "Shh!  I've got another message coming in and I've GOT to
2044 handle it!"
2045       "I just want to go to 8sleep already."
2046       "What a lousy scheduler we're using!  I hope someone upgrades
2047 that thing soon."))))
2048
2049 ;;; Inside the hive
2050
2051 (define-actor <meta-message> (<readable>)
2052   ((cmd-read meta-message-read)))
2053
2054 (define (meta-message-read gameobj message . _)
2055   (define meta-message-text
2056     (with-output-to-string
2057       (lambda ()
2058         (pprint-message message))))
2059   (<- (message-from message) 'tell
2060       #:text `((p (i "Through a bizarre error in spacetime, the message "
2061                      "prints itself out:"))
2062                (p (pre ,meta-message-text)))))
2063
2064 \f
2065 ;;; Inside the Hive
2066
2067 (define hive-inside
2068   (lol
2069    ('hive-inside
2070     <room> #f
2071     #:name "Inside the 8sync Hive"
2072     #:desc
2073     '((p "You're inside the 8sync Hive.  Wow, from in here it's obvious just how "
2074          (i "goopy") " everything is.  Is that sanitary?")
2075       (p "In the center of the room is a large, tentacled monster who is sorting,
2076 consuming, and routing messages.  It is sitting in a wrap-around desk labeled
2077 \"Hive Actor: The Real Thing (TM)\".")
2078       (p "There's a stray message floating just above the ground, stuck outside of
2079 time.")
2080       (p "A door to the south exits from the Hive."))
2081     #:exits
2082     (list (make <exit>
2083             #:name "south"
2084             #:to 'hive-entrance)))
2085    ;; hive actor
2086    ;; TODO: Occasionally "fret" some noises, similar to the Clerk.
2087    ('hive-inside:hive-actor
2088     <chatty-npc> 'hive-inside
2089     #:name "the Hive Actor"
2090     #:desc
2091     '((p "It's a giant tentacled monster, somehow integrated with the core of
2092 this building.  A chute is dropping messages into a bin on its desk which the
2093 Hive Actor is checking the \"to\" line of, then ingesting.  Whenever the Hive
2094 Actor injests a messsage a pulse of light flows along a tentacle which leaves
2095 the room... presumably connecting to one of those actors milling about.")
2096       (p "Amusingly, the Hive has an \"umbellical cord\" type tentacle too, but
2097 it seems to simply attach to itself.")
2098       (p "You get the sense that the Hive Actor, despite being at the
2099 center of everything, is kind of lonely and would love to chat if you
2100 could spare a moment."))
2101     #:goes-by '("hive" "hive actor")
2102     #:chat-format (lambda (npc catchphrase)
2103                     `("The tentacle monster bellows, \"" ,catchphrase "\""))
2104     #:catchphrases
2105     '("It's not MY fault everything's so GOOPY around here.  Blame the
2106 PROPRIETOR."
2107       "CAN'T you SEE that I'm BUSY???  SO MANY MESSAGES TO SHUFFLE.
2108 No wait... DON'T GO!  I don't get many VISITORS."
2109       "I hear the FIBERS system has a nice WORK STEALING system, but the
2110 PROPRIETOR is not convinced that our DESIGN won't CORRUPT ACTOR STATE.
2111 That and the ACTORS threatened to STRIKE when it CAME UP LAST."
2112       "WHO WATCHES THE ACTORS?  I watch them, and I empower them.  
2113 BUT WHO WATCHES OR EMPOWERS ME???  Well, that'd be the scheduler."
2114       "The scheduler is NO GOOD!  The proprietory said he'd FIX IT,
2115 but the LAST TIME I ASKED how things were GOING, he said he DIDN'T HAVE
2116 TIME.  If you DON'T HAVE TIME to fix the THING THAT POWERS THE TIME,
2117 something is TERRIBLY WRONG."
2118       "There's ANOTHER HIVE somewhere out there.  I HAVEN'T SEEN IT
2119 personally, because I CAN'T MOVE, but we have an AMBASSADOR which forwards
2120 MESSAGES to the OTHER HIVE."))
2121    ;; chute
2122    ('hive-inside:chute
2123     <gameobj> 'hive-inside
2124     #:name "a chute"
2125     #:goes-by '("chute")
2126     #:desc "Messages are being dropped onto the desk via this chute."
2127     #:invisible? #t)
2128    ;; meta-message
2129    ('hive-inside:meta-message
2130     <meta-message> 'hive-inside
2131     #:name "a stray message"
2132     #:goes-by '("meta message" "meta-message" "metamessage" "message" "stray message")
2133     #:desc '((p "Something strange has happened to the fabric and space and time
2134 around this message.  It is floating right above the floor.  It's clearly
2135 rubbage that hadn't been delivered, but for whatever reason it was never
2136 garbage collected, perhaps because it's impossible to do.")
2137              (p "You get the sense that if you tried to read the message
2138 that you would somehow read the message of the message that instructed to
2139 read the message itself, which would be both confusing and intriguing.")))
2140    ;; desk
2141    ('hive-inside:desk
2142     <floor-panel> 'hive-inside
2143     #:name "the Hive Actor's desk"
2144     #:desc "The desk surrounds the Hive Actor on all sides, and honestly, it's a little
2145 bit hard to tell when the desk ends and the Hive Actor begins."
2146     #:invisible? #t
2147     #:goes-by '("Hive Actor's desk" "hive desk" "desk"))))
2148
2149 \f
2150 ;;; Federation Station
2151 (define federation-station
2152   (lol
2153    ('federation-station
2154     <room> #f
2155     #:name "Federation Station"
2156     #:desc
2157     '((p "This room has an unusual structure.  It's almost as if a starscape
2158 covered the walls and ceiling, but upon closer inspection you realize that
2159 these are all brightly glowing nodes with lines drawn between them.  They
2160 seem decentralized, and yet seem to be sharing information as if all one
2161 network.")
2162       ;; @@: Maybe add the cork message board here?
2163       (p "To the west is a door leading back to the underground laboratory."))
2164     #:exits
2165     (list (make <exit>
2166             #:name "west"
2167             #:to 'underground-lab)))
2168    ;; nodes
2169    ('federation-station:nodes
2170     <floor-panel> 'federation-station
2171     #:name "some nodes"
2172     #:desc "Each node seems to be producing its own information, but publishing 
2173 updates to subscribing nodes on the graph.  You see various posts of notes, videos,
2174 comments, and so on flowing from node to node."
2175     #:invisible? #t
2176     #:goes-by '("nodes" "node" "some nodes"))
2177    ;; network
2178    ;; activitypub poster
2179    ('federation-station:activitypub-poster
2180     <readable-desc> 'federation-station
2181     #:name "an ActivityPub poster"
2182     #:goes-by '("activitypub poster" "activitypub" "poster")
2183     #:desc
2184     '((p (a "https://www.w3.org/TR/activitypub/"
2185             "ActivityPub")
2186          " is a federation standard being developed under the "
2187          (a "https://www.w3.org/wiki/Socialwg/"
2188             "w3C Social Working Group")
2189          ", and doubles as a general client-to-server API. "
2190          "It follows a few simple core ideas:")
2191       (ul (li "Uses "
2192               (a "https://www.w3.org/TR/activitystreams-core/"
2193                  "ActivityStreams")
2194               " for its serialization format: easy to read, e json(-ld) syntax "
2195               "with an extensible vocabulary covering the majority of "
2196               "social networking interations.")
2197           (li "Email-like addressing: list of recipients as "
2198               (b "to") ", " (b "cc") ", " (b "bcc") " fields.")
2199           (li "Every user has URLs for their outbox and inbox:"
2200               (ul (li (b "inbox: ")
2201                       "Servers POST messages to addressed recipients' inboxes "
2202                       "to federate out content. "
2203                       "Also doubles as endpoint for a client to read most "
2204                       "recently received messages via GET.")
2205                   (li (b "outbox: ")
2206                       "Clients can POST to user's outbox to send a message to others. "
2207                       "(Similar to sending an email via your MTA.) "
2208                       "Doubles as endpoint others can read from to the "
2209                       "extent authorized; for example publicly available posts."))
2210               "All the federation bits happen by servers posting to users' inboxes."))))
2211    ;; An ActivityStreams message
2212
2213    ;; conspiracy chart
2214    ('federation-station:conspiracy-chart
2215     <readable-desc> 'federation-station
2216     #:name "a conspiracy chart"
2217     #:goes-by '("conspiracy chart" "chart")
2218     #:desc
2219     '((p (i "\"IT'S ALL RELATED!\"") " shouts the over-exuberant conspiracy "
2220          "chart. "
2221          (i "\"ActivityPub?  Federation?  The actor model?  Scheme?  Text adventures? "
2222             "MUDS????  What do these have in common?  Merely... EVERYTHING!\""))
2223       (p "There are circles and lines drawn between all the items in red marker, "
2224          "with scrawled notes annotating the theoretical relationships.  Is the "
2225          "author of this poster mad, or onto something?  Perhaps a bit of both. "
2226          "There's a lot written here, but here are some of the highlights:")
2227       (p
2228        (ul
2229         (li (b "Scheme") " "
2230             (a "http://cs.au.dk/~hosc/local/HOSC-11-4-pp399-404.pdf"
2231                "was originally started ")
2232             " to explore the " (b "actor model")
2233             ". (It became more focused around studying the " (b "lambda calculus")
2234             " very quickly, while also uncovering relationships between the two systems.)")
2235         ;; Subject Predicate Object
2236         (li "The " (a "https://www.w3.org/TR/activitypub/"
2237                       (b "ActivityPub"))
2238             " protocol for " (b "federation")
2239             " uses the " (b "ActivityStreams") " format for serialization.  "
2240             (b "Text adventures") " and " (b "MUDS")
2241             " follow a similar structure to break down the commands of players.")
2242         (li (b "Federation") " and the " (b "actor model") " both are related to "
2243             "highly concurrent systems and both use message passing to communicate "
2244             "between nodes.")
2245         (li "Zork, the first major text adventure, used the " (b "MUDDLE") " "
2246             "language as the basis for the Zork Interactive Language.  MUDDLE "
2247             "is very " (b "Scheme") "-like and in fact was one of Scheme's predecessors. "
2248             "And of course singleplayer text adventures like Zork were the "
2249             "predecessors to MUDs.")
2250         (li "In the 1990s, before the Web became big, " (b "MUDs")
2251             " were an active topic of research, and there was strong interest "
2252             (a "http://www.saraswat.org/desiderata.html"
2253                "in building decentralized MUDs")
2254             " similar to what is being "
2255             "worked on for " (b "federation") ". ")))))
2256
2257    ;; goblin
2258
2259    ))
2260
2261
2262 \f
2263 ;;; North hall
2264 ;;; ==========
2265 (define north-hall
2266   (lol
2267    ('north-hall
2268     <room> #f
2269     #:name "North Hall"
2270     #:desc
2271     '((p "This hallway is lined by doors to the west and the east, presumably
2272 to various lodgings.  Something tells you you're not able to enter those right
2273 now, however.  Lining the walls are some large mirrors surrounded by bouquets
2274 of flowers.")
2275       (p "The red carpet continues all the way from Grand Hallway in the south
2276 but stops short of some large wooden doors to the north.  The doors look
2277 formidable but unlocked.  Some natural light peeking through windows to the
2278 north seem to hint that this may be the exit to the outdoors.  There's
2279 also a large sign near the doors on a wooden easel."))
2280     #:exits
2281     (list (make <exit>
2282             #:name "south"
2283             #:to 'grand-hallway)))
2284    ('north-hall:sign
2285     <readable> 'north-hall
2286     #:name "an easel with a sign"
2287     #:desc "  The easel is finely cut wood, well polished, but plain.  The sign
2288 is a strong contrast, with a cream colored backing and hand written letters, written
2289 with care and style.  You could probably read it."
2290     #:read-text "The sign announces a wedding taking place... why, today!  And on
2291 the hotel grounds to the north!  It sounds very exciting."
2292     #:goes-by '("sign"
2293                 "easel with a sign"
2294                 "easel"))
2295    ('north-hall:mirrors
2296     <gameobj> 'north-hall
2297     #:name "a row of mirrors"
2298     #:desc "You see yourself for who you really are."
2299     #:invisible? #t
2300     #:goes-by '("mirror" "mirrors" "row of mirrors"))
2301    ('north-hall:windows
2302     <gameobj> 'north-hall
2303     #:name "windows"
2304     #:desc "You peer out a window, but the light appears distorted, as if you were
2305 really peering between two worlds hastily joined together."
2306     #:invisible? #t
2307     #:goes-by '("window" "windows"))
2308    ('north-hall:doors
2309     <gameobj> 'north-hall
2310     #:name "doors"
2311     #:desc '((p "Along the east and west walls are doors, but they are all shut,
2312 and firmly so.
2313 Presumably people are staying in them, but it also feels as if how residence
2314 would work in a building as hastily put together as this was barely conceived.")
2315              (p "To the north is a large set of wooden doors, oaken and beautiful.
2316 Although towering, they seem passable."))
2317     #:invisible? #f
2318     #:goes-by '("door" "doors" "room doors" "large doors"))))
2319
2320
2321 \f
2322 ;;; Game
2323 ;;; ----
2324
2325 (define (game-spec)
2326   (append lobby grand-hallway smoking-parlor
2327           playroom break-room computer-room underground-lab
2328           async-museum gift-shop hive-entrance
2329           hive-inside federation-station
2330           north-hall))
2331
2332 ;; TODO: Provide command line args
2333 (define (run-game . args)
2334   (run-demo (game-spec) 'lobby #:repl-server #t))
2335