fe158ff352d14f3b88831618adcd584b7ae83278
[mudsync.git] / worlds / bricabrac.scm
1 ;;; Mudsync --- Live hackable MUD
2 ;;; Copyright © 2016 Christopher Allan 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 parser)
23              (8sync systems actors)
24              (8sync agenda)
25              (oop goops)
26              (ice-9 control)
27              (ice-9 format)
28              (ice-9 match)
29              (rx irregex))
30
31
32 \f
33 ;;; Utilities, useful or otherwise
34 ;;; ==============================
35
36 (set! *random-state* (random-state-from-platform))
37
38 (define (random-choice lst)
39   (list-ref lst (random (length lst))))
40
41 ;; list of lists, lol.
42 (define-syntax-rule (lol (list-contents ...) ...)
43   (list (list list-contents ...) ...))
44
45 \f
46 ;;; Some simple object types.
47 ;;; =========================
48
49 (define readable-commands
50   (list
51    (direct-command "read" 'cmd-read)))
52
53 (define readable-commands*
54   (append readable-commands
55           thing-commands))
56
57 (define readable-actions
58   (build-actions
59    (cmd-read (wrap-apply readable-cmd-read))))
60
61 (define readable-actions*
62   (append readable-actions
63           thing-actions*))
64
65 (define-class <readable> (<thing>)
66   (read-text #:init-value "All it says is: \"Blah blah blah.\""
67              #:init-keyword #:read-text)
68   (commands
69    #:init-value readable-commands*)
70   (message-handler
71    #:init-value
72    (simple-dispatcher readable-actions*)))
73
74 (define (readable-cmd-read actor message)
75   (<- actor (message-from message) 'tell
76       #:text (string-append (slot-ref actor 'read-text) "\n")))
77
78
79 \f
80 ;;; Lobby
81 ;;; -----
82
83 (define-mhandler (npc-chat-randomly actor message)
84   (define text-to-send
85     (format #f "~a says: \"~a\"\n"
86             (slot-ref actor 'name)
87             (random-choice (slot-ref actor 'catchphrases))))
88   (<- actor (message-from message) 'tell
89       #:text text-to-send))
90
91 (define chat-commands
92   (list
93    (direct-command "chat" 'cmd-chat)
94    (direct-command "talk" 'cmd-chat)))
95 (define chat-actions
96   (build-actions
97    (cmd-chat (wrap-apply npc-chat-randomly))))
98
99 (define hotel-owner-grumps
100   '("Eight sinks!  Eight sinks!  And I couldn't unwind them..."
101     "Don't mind the mess.  I built this place on a dare, you
102 know?"
103     "(*tearfully*) Here, take this parenthesis.  May it serve
104 you well."
105     "I gotta get back to the goblin farm soon..."
106     "Oh, but I was going to make a mansion... a great,
107 beautiful mansion!  Full of ghosts!  Now all I have is this cruddy
108 mo... hotel.  Oh... If only I had more time!"
109     "I told them to paint more of the walls purple.
110 Why didn't they listen?"
111     "Listen to that overhead muzak.  Whoever made that doesn't
112 know how to compose very well!  Have you heard of the bands 'fmt'
113 or 'skribe'?  Now *that's* composition!"))
114
115 (define-class <chatty-npc> (<gameobj>)
116   (catchphrases #:init-value '("Blarga blarga blarga!")
117                 #:init-keyword #:catchphrases)
118   (commands
119    #:init-value chat-commands)
120   (message-handler
121    #:init-value
122    (simple-dispatcher (append gameobj-actions chat-actions))))
123
124 (define random-bricabrac
125   '("a creepy porcelain doll"
126     "assorted 1950s robots"
127     "an exquisite tea set"
128     "an antique mustard pot"
129     "the pickled head of Elvis"
130     "the pickled circuitboard of EVLIS"
131     "a scroll of teletype paper holding the software Four Freedoms"
132     "a telephone shaped like an orange cartoon cat"))
133
134 (define-class <sign-in-form> (<gameobj>)
135   (commands
136    #:init-value
137    (list
138     (prep-direct-command "sign" 'cmd-sign-form
139                              '("as"))))
140   (message-handler
141    #:init-value
142    (simple-dispatcher
143     (append
144      (build-actions
145       (cmd-sign-form (wrap-apply sign-cmd-sign-in)))
146      gameobj-actions))))
147
148
149 (define name-sre
150   (sre->irregex '(: alpha (** 1 14 (or alphanum "-" "_")))))
151
152 (define forbidden-words
153   (append article preposition
154           '("and" "or" "but" "admin")))
155
156 (define (valid-name? name)
157   (and (irregex-match name-sre name)
158        (not (member name forbidden-words))))
159
160 (define-mhandler (sign-cmd-sign-in actor message direct-obj indir-obj)
161   (define old-name
162     (message-ref
163      (<-wait actor (message-from message) 'get-name)
164      'val))
165   (define name indir-obj)
166   (if (valid-name? indir-obj)
167       (begin
168         (<-wait actor (message-from message) 'set-name!
169                 #:val name)
170         (<- actor (slot-ref actor 'loc) 'tell-room
171             #:text (format #f "~a signs the form!\n~a is now known as ~a\n"
172                            old-name old-name name)))
173       (<- actor (message-from message) 'tell
174           #:text "Sorry, that's not a valid name.
175 Alphanumerics, _ and - only, 2-15 characters, starts with an alphabetic
176 character.\n")))
177
178
179 (define summoning-bell-commands
180   (list
181    (direct-command "ring" 'cmd-ring)))
182 (define summoning-bell-commands*
183   (append summoning-bell-commands
184           thing-commands*))
185
186 (define summoning-bell-actions
187   (build-actions
188    (cmd-ring (wrap-apply summoning-bell-cmd-ring))))
189 (define summoning-bell-actions*
190   (append summoning-bell-actions
191           thing-actions*))
192
193 (define-class <summoning-bell> (<thing>)
194   (summons #:init-keyword #:summons)
195
196   (commands
197    #:init-value summoning-bell-commands*)
198   (message-handler
199    #:init-value
200    (simple-dispatcher summoning-bell-actions*)))
201
202 (define-mhandler (summoning-bell-cmd-ring bell message)
203   (define who-rang
204     (message-ref
205      (<-wait bell (message-from message) 'get-name)
206      'val))
207   (<- bell (message-from message) 'tell
208       #:text "*ring ring!*  You ring the bell!\n")
209   (<- bell (gameobj-loc bell) 'tell-room
210       #:text
211       (format #f "*ring ring!*  ~a rings the bell!\n"
212               who-rang)
213       #:exclude (message-from message))
214
215   (<- bell (dyn-ref bell (slot-ref bell 'summons)) 'be-summoned
216       #:who-summoned (message-from message)))
217
218
219 (define lobby
220   (lol
221    ('room:lobby
222     <room> #f
223     #:name "Hotel Lobby"
224     #:desc
225     "  You're in some sort of hotel lobby.  You see a large sign hanging
226 over the desk that says \"Hotel Bricabrac\".  On the desk is a bell
227 that says \"ring for service\".  Terrible music plays from a speaker
228 somewhere overhead.
229   The room is lined with various curio cabinets, filled with all sorts
230 of kitschy junk.  It looks like whoever decorated this place had great
231 ambitions, but actually assembled it all in a hurry and used whatever
232 kind of objects they found lying around.
233   There's a door to the north leading to some kind of hallway."
234     #:exits
235     (list (make <exit>
236             #:name "north"
237             #:to 'room:grand-hallway)))
238    ;; NPC: hotel owner
239    ('npc:lobby:hotel-owner
240     <chatty-npc> 'room:lobby
241     #:name "a frumpy fellow"
242     #:desc "  Whoever this is, they looks totally exhausted.  They're
243 collapsed into the only comfortable looking chair in the room and you
244 don't get the sense that they're likely to move any time soon.
245   You notice they're wearing a sticker badly adhesed to their clothing
246 which says \"Hotel Proprietor\", but they look so disorganized that you
247 think that can't possibly be true... can it?
248   Despite their exhaustion, you sense they'd be happy to chat with you,
249 though the conversation may be a bit one sided."
250     #:goes-by '("frumpy fellow" "fellow"
251                 "Chris Webber"  ; heh, did you rtfc?  or was it so obvious?
252                 "hotel proprietor" "proprietor")
253     #:catchphrases hotel-owner-grumps)
254    ;; NPC: desk clerk (comes when you ring the s)
255    ;;   impatient teenager, only stays around for a few minutes
256    ;;   complaining, then leaves.
257    
258    ;; Object: Sign
259    ('thing:lobby:sign
260     <readable> 'room:lobby
261     #:name "the Hotel Bricabrac sign"
262     #:desc "  It strikes you that there's something funny going on with this sign.
263 Sure enough, if you look at it hard enough, you can tell that someone
264 hastily painted over an existing sign and changed the \"M\" to an \"H\".
265 Classy!"
266     #:read-text "  All it says is \"Hotel Bricabrac\" in smudged, hasty text."
267     #:goes-by '("sign"
268                 "bricabrac sign"
269                 "hotel sign"
270                 "hotel bricabrac sign"
271                 "lobby sign"))
272
273    ('thing:lobby:bell
274     <summoning-bell> 'room:lobby
275     #:name "a shiny brass bell"
276     #:goes-by '("shiny brass bell" "shiny bell" "brass bell" "bell")
277     #:desc "  A shiny brass bell.  Inscribed on its wooden base is the text
278 \"ring me for service\".  You probably could \"ring the bell\" if you 
279 wanted to."
280     #:summons 'npc:break-room:desk-clerk)
281
282    ;; Object: curio cabinets
283    ('thing:lobby:cabinet
284     <gameobj> 'room:lobby
285     #:name "a curio cabinet"
286     #:goes-by '("curio cabinet" "cabinet" "bricabrac cabinet")
287     #:desc (lambda _
288              (format #f "  The curio cabinet is full of all sorts of oddities!
289 Something catches your eye!
290 Ooh, ~a!" (random-choice random-bricabrac))))
291    ('thing:lobby:sign-in-form
292     <sign-in-form> 'room:lobby
293     #:name "sign-in form"
294     #:goes-by '("sign-in form" "form" "signin form")
295     #:desc "It looks like you could sign this form and set your name.")
296    ;; Object: desk
297    ;;  - Object: bell
298    ;;  - Object: sign in form
299    ;;  - Object: pamphlet
300    ;; Object: <invisible bell>: reprimands that you want to ring the
301    ;;   bell on the desk
302    )
303   )
304
305
306 \f
307 ;;; Grand hallway
308 ;;; -------------
309
310 (define grand-hallway
311   (lol
312    ('room:grand-hallway
313     <room> #f
314     #:name "Grand Hallway"
315     #:desc "  A majestic red carpet runs down the center of the room.
316 Busts of serious looking people line the walls, but there's no
317 clear indication that they have any logical relation to this place.
318   In the center is a large statue of a bearded man.  You wonder what
319 that's all about?
320   To the south is the lobby.  A door to the east is labeled \"smoking
321 room\", while a door to the west is labeled \"playroom\"."
322     #:exits
323     (list (make <exit>
324             #:name "south"
325             #:to 'room:lobby)
326           (make <exit>
327             #:name "west"
328             #:to 'room:playroom)
329           (make <exit>
330             #:name "east"
331             #:to 'room:smoking-parlor)))
332    ('thing:ignucius-statue
333     <gameobj> 'room:grand-hallway
334     #:name "a statue"
335     #:desc "  The statue is of a serious-looking bearded man with long, flowing hair.
336 The inscription says \"St. Ignucius\".
337   It has a large physical halo.  Removing it is tempting, but it looks pretty
338 well fastened."
339     #:goes-by '("statue" "st ignucius" "st. ignucius"))))
340
341 \f
342 ;;; Playroom
343 ;;; --------
344
345 (define playroom
346   (lol
347    ('room:playroom
348     <room> #f
349     #:name "The Playroom"
350     #:desc "  There are toys scattered everywhere here.  It's really unclear
351 if this room is intended for children or child-like adults."
352     #:exits
353     (list (make <exit>
354             #:name "east"
355             #:to 'room:grand-hallway)))
356    ('thing:playroom:cubey
357     <thing> 'room:playroom
358     #:name "cubey"
359     #:takeable #t
360     #:desc "  It's a little foam cube with googly eyes on it.  So cute!")
361    ('thing:cuddles-plushie
362     <thing> 'room:playroom
363     #:name "a cuddles plushie"
364     #:goes-by '("plushie" "cuddles plushie")
365     #:takeable #t
366     #:desc "  A warm and fuzzy cuddles plushie!  It's a cuddlefish!")))
367
368
369 \f
370 ;;; Writing room
371 ;;; ------------
372
373 \f
374 ;;; Armory???
375 ;;; ---------
376
377 ;; ... full of NURPH weapons?
378
379 \f
380 ;;; Smoking parlor
381 ;;; --------------
382
383 (define-class <furniture> (<gameobj>)
384   (sit-phrase #:init-keyword #:sit-phrase)
385   (sit-phrase-third-person #:init-keyword #:sit-phrase-third-person)
386   (sit-name #:init-keyword #:sit-name)
387
388   (commands
389    #:init-value
390    (list
391     (direct-command "sit" 'cmd-sit-furniture)))
392   (message-handler
393    #:init-value
394    (simple-dispatcher
395     (append
396      (build-actions
397       (cmd-sit-furniture (wrap-apply furniture-cmd-sit)))
398      gameobj-actions))))
399
400 (define-mhandler (furniture-cmd-sit actor message direct-obj)
401   (define player-name
402     (message-ref
403      (<-wait actor (message-from message) 'get-name)
404      'val))
405   (<- actor (message-from message) 'tell
406       #:text (format #f "You ~a ~a.\n"
407                      (slot-ref actor 'sit-phrase)
408                      (slot-ref actor 'sit-name)))
409   (<- actor (slot-ref actor 'loc) 'tell-room
410       #:text (format #f "~a ~a on ~a.\n"
411                      player-name
412                      (slot-ref actor 'sit-phrase-third-person)
413                      (slot-ref actor 'sit-name))
414       #:exclude (message-from message)))
415
416
417 (define smoking-parlor
418   (lol
419    ('room:smoking-parlor
420     <room> #f
421     #:name "Smoking Parlor"
422     #:desc "  This room looks quite posh.  There are huge comfy seats you can sit in
423 if you like.
424   Strangely, you see a large sign saying \"No Smoking\".  The owners must
425 have installed this place and then changed their mind later.
426   There's a door to the west leading back to the grand hallway, and
427 a nondescript steel door to the south, leading apparently outside."
428     #:exits
429     (list (make <exit>
430             #:name "west"
431             #:to 'room:grand-hallway)
432           (make <exit>
433             #:name "south"
434             #:to 'room:break-room)))
435    ('thing:smoking-room:chair
436     <furniture> 'room:smoking-parlor
437     #:name "a comfy leather chair"
438     #:desc "  That leather chair looks really comfy!"
439     #:goes-by '("leather chair" "comfy leather chair" "chair")
440     #:sit-phrase "sink into"
441     #:sit-phrase-third-person "sinks into"
442     #:sit-name "the comfy leather chair")
443    ('thing:smoking-room:sofa
444     <furniture> 'room:smoking-parlor
445     #:name "a plush leather sofa"
446     #:desc "  That leather chair looks really comfy!"
447     #:goes-by '("leather sofa" "plush leather sofa" "sofa"
448                 "leather couch" "plush leather couch" "couch")
449     #:sit-phrase "sprawl out on"
450     #:sit-phrase-third-person "sprawls out on into"
451     #:sit-name "the plush leather couch")
452    ('thing:smoking-room:bar-stool
453     <furniture> 'room:smoking-parlor
454     #:name "a bar stool"
455     #:desc "  Conveniently located near the bar!  Not the most comfortable
456 seat in the room, though."
457     #:goes-by '("stool" "bar stool" "seat")
458     #:sit-phrase "hop on"
459     #:sit-phrase-third-person "hops onto"
460     #:sit-name "the bar stool")
461
462    ;; TODO: Cigar dispenser
463
464    ))
465
466 \f
467
468 ;;; Breakroom
469 ;;; ---------
470
471 (define clerk-commands
472   (list
473    (direct-command "talk" 'cmd-chat)
474    (direct-command "chat" 'cmd-chat)
475    (direct-command "ask" 'cmd-ask-incomplete)
476    (prep-direct-command "ask" 'cmd-ask-about)))
477 (define clerk-commands*
478   (append clerk-commands thing-commands*))
479
480 (define clerk-actions
481   (build-actions
482    (init (wrap-apply clerk-act-init))
483    (cmd-chat (wrap-apply clerk-cmd-chat))
484    (cmd-ask-incomplete (wrap-apply clerk-cmd-ask-incomplete))
485    (cmd-ask-about (wrap-apply clerk-cmd-ask))
486    (update-loop (wrap-apply clerk-act-update-loop))
487    (be-summoned (wrap-apply clerk-act-be-summoned))))
488 (define clerk-actions* (append clerk-actions
489                                thing-actions*))
490
491 (define-class <desk-clerk> (<thing>)
492   ;; The desk clerk has three states:
493   ;;  - on-duty: Arrived, and waiting for instructions (and losing patience
494   ;;    gradually)
495   ;;  - slacking: In the break room, probably smoking a cigarette
496   ;;    or checking text messages
497   (state #:init-value 'slacking)
498   (commands #:init-value clerk-commands*)
499   (patience #:init-value 0)
500   (message-handler
501    #:init-value
502    (simple-dispatcher clerk-actions*)))
503
504 (define-mhandler (clerk-act-init clerk message)
505   ;; call the gameobj main init method
506   (gameobj-act-init clerk message)
507   ;; start our main loop
508   (<- clerk (actor-id clerk) 'update-loop))
509
510 (define clerk-help-topics
511   '(("changing name" .
512      "Changing your name is easy!  We have a clipboard here at the desk
513 where you can make yourself known to other participants in the hotel
514 if you sign it.  Try 'sign form as <your-name>', replacing
515 <your-name>, obviously!")
516     ("common commands" .
517      "Here are some useful commands you might like to try: chat,
518 go, take, drop, say...")
519     ("hotel" .
520      "We hope you enjoy your stay at Hotel Bricabrac.  As you may see,
521 our hotel emphasizes interesting experiences over rest and lodging.
522 The origins of the hotel are... unclear... and it has recently come
523 under new... 'management'.  But at Hotel Bricabrac we believe these
524 aspects make the hotel into a fun and unique experience!  Please,
525 feel free to walk around and explore.")))
526
527
528 (define clerk-knows-about
529   "'changing name', 'common commands', and 'about the hotel'")
530
531 (define clerk-general-helpful-line
532   (string-append
533    "The clerk says, \"If you need help with anything, feel free to ask me about it.
534 For example, 'ask clerk about changing name'. You can ask me about the following:
535 " clerk-knows-about ".\"\n"))
536
537 (define clerk-slacking-complaints
538   '("The pay here is absolutely lousy."
539     "The owner here has no idea what they're doing."
540     "Some times you just gotta step away, you know?"
541     "You as exhausted as I am?"
542     "Yeah well, this is just temporary.  I'm studying to be a high
543 energy particle physicist.  But ya gotta pay the bills, especially
544 with tuition at where it is..."))
545
546 (define-mhandler (clerk-cmd-chat clerk message)
547   (match (slot-ref clerk 'state)
548     ('on-duty
549      (<- clerk (message-from message) 'tell
550          #:text clerk-general-helpful-line))
551     ('slacking
552      (<- clerk (message-from message) 'tell
553          #:text
554          (string-append
555           "The clerk says, \""
556           (random-choice clerk-slacking-complaints)
557           "\"\n")))))
558
559 (define-mhandler (clerk-cmd-ask-incomplete clerk message)
560   (<- clerk (message-from message) 'tell
561       #:text "The clerk says, \"Ask about what?\"\n"))
562
563 (define clerk-doesnt-know-text
564   "The clerk apologizes and says she doesn't know about that topic.\n")
565
566 (define-mhandler (clerk-cmd-ask clerk message indir-obj)
567   (match (slot-ref clerk 'state)
568     ('on-duty
569      (match (assoc (pk 'indir indir-obj) clerk-help-topics)
570        ((_ . info)
571            (<- clerk (message-from message) 'tell
572                #:text
573                (string-append "The clerk clears her throat and says:\n  \""
574                               info
575                               "\"\n")))
576        (#f
577         (<- clerk (message-from message) 'tell
578             #:text clerk-doesnt-know-text))))
579     ('slacking
580      (<- clerk (message-from message) 'tell
581          #:text "The clerk says, \"Sorry, I'm on my break.\"\n"))))
582
583 (define-mhandler (clerk-act-be-summoned clerk message who-summoned)
584   (match (slot-ref clerk 'state)
585     ('on-duty
586      (<- clerk who-summoned 'tell
587          #:text
588          "The clerk tells you as politely as she can that she's already here,
589 so there's no need to ring the bell.\n"))
590     ('slacking
591      (<- clerk (gameobj-loc clerk) 'tell-room
592          #:text
593          "The clerk's ears perk up, she stamps out a cigarette, and she
594 runs out of the room!\n")
595      (gameobj-set-loc! clerk (dyn-ref clerk 'room:lobby))
596      (slot-set! clerk 'patience 8)
597      (slot-set! clerk 'state 'on-duty)
598      (<- clerk (gameobj-loc clerk) 'tell-room
599          #:text
600          (string-append
601           "  Suddenly, a uniformed woman rushes into the room!  She's wearing a
602 badge that says \"Desk Clerk\".
603   \"Hello, yes,\" she says between breaths, \"welcome to Hotel Bricabrac!
604 We look forward to your stay.  If you'd like help getting acclimated,
605 feel free to ask me.  For example, 'ask clerk about changing name'.
606 You can ask me about the following:
607 " clerk-knows-about ".\"\n")))))
608
609 (define clerk-slacking-texts
610   '("The clerk takes a long drag on her cigarette.\n"
611     "The clerk scrolls through text messages on her phone.\n"
612     "The clerk coughs a few times.\n"
613     "The clerk checks her watch and justifies a few more minutes outside.\n"
614     "The clerk fumbles around for a lighter.\n"
615     "The clerk sighs deeply and exhaustedly.\n"
616     "The clerk fumbles around for a cigarette.\n"))
617
618 (define clerk-working-impatience-texts
619   '("The clerk struggles to retain an interested and polite smile.\n"
620     "The clerk checks the time on her phone.\n"
621     "The clerk taps her foot.\n"
622     "The clerk takes a deep breath.\n"
623     "The clerk yawns.\n"
624     "The clerk drums her nails on the counter.\n"
625     "The clerk clicks around on the desk computer.\n"))
626
627 (define clerk-slack-excuse-text
628   "The desk clerk excuses herself, claiming she has important things to
629 attend to.\n")
630
631 (define clerk-return-to-slacking-text
632   "The desk clerk enters and slams the door behind her.\n")
633
634 (define-mhandler (clerk-act-update-loop clerk message)
635   (define (tell-room text)
636     (<- clerk (gameobj-loc clerk) 'tell-room
637         #:text text))
638   (define (loop return)
639     (define (stop-if-destructed)
640       (if (slot-ref clerk 'destructed)
641           (return #f)))
642     (match (slot-ref clerk 'state)
643       ('slacking
644        (tell-room (random-choice clerk-slacking-texts))
645        (8sleep (+ (random 10) 10))
646        (stop-if-destructed)
647        (loop return))
648       ('on-duty
649        (if (> (slot-ref clerk 'patience) 0)
650            ;; Keep working but lose patience gradually
651            (begin
652              (tell-room (random-choice clerk-working-impatience-texts))
653              (slot-set! clerk 'patience (- (slot-ref clerk 'patience)
654                                            (+ (random 2) 1)))
655              (8sleep (+ (random 25) 20))
656              (stop-if-destructed)
657              (loop return))
658            ;; Back to slacking
659            (begin
660              (tell-room clerk-slack-excuse-text)
661              ;; back bto the break room
662              (gameobj-set-loc! clerk (pk 'break-room (dyn-ref clerk 'room:break-room)))
663              (tell-room clerk-return-to-slacking-text)
664              ;; annnnnd back to slacking
665              (slot-set! clerk 'state 'slacking)
666              (8sleep (+ (random 30) 15))
667              (stop-if-destructed)
668              (loop return))))))
669   (call/ec loop))
670
671 (define break-room
672   (lol
673    ('room:break-room
674     <room> #f
675     #:name "Employee Break Room"
676     #:desc "  This is less a room and more of an outdoor wire cage.  You get
677 a bit of a view of the brick exterior of the building, and a crisp wind blows,
678 whistling, through the openings of the fenced area.  Partly smoked cigarettes
679 and various other debris cover the floor.
680   Through the wires you can see... well... hm.  It looks oddly like
681 the scenery tapers off nothingness.  But that can't be right, can it?"
682     #:exits
683     (list (make <exit>
684             #:name "north"
685             #:to 'room:smoking-parlor))
686     )
687    ('npc:break-room:desk-clerk
688     <desk-clerk> 'room:break-room
689     #:name "the hotel desk clerk"
690     #:desc "  The hotel clerk is wearing a neatly pressed uniform bearing the
691 hotel insignia.  She looks like she'd much rather be somewhere else."
692     #:goes-by '("hotel desk clerk" "clerk" "desk clerk"))))
693
694
695 \f
696 ;;; Ennpie's Sea Lounge
697 ;;; -------------------
698
699 \f
700 ;;; Computer room
701 ;;; -------------
702
703 \f
704 ;;; Game
705 ;;; ----
706
707 (define game-spec
708   (append lobby grand-hallway smoking-parlor
709           playroom break-room))
710
711 ;; TODO: Provide command line args
712 (define (run-game . args)
713   (run-demo game-spec 'room:lobby #:repl-server #t))
714