bricabrac.scm 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236
  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. ;;; Hotel Bricabrac
  19. (use-modules (mudsync)
  20. (mudsync container)
  21. (8sync)
  22. (oop goops)
  23. (ice-9 control)
  24. (ice-9 format)
  25. (ice-9 match)
  26. (rx irregex))
  27. ;;; Utilities, useful or otherwise
  28. ;;; ==============================
  29. (set! *random-state* (random-state-from-platform))
  30. (define (random-choice lst)
  31. (list-ref lst (random (length lst))))
  32. ;; list of lists, lol.
  33. (define-syntax-rule (lol (list-contents ...) ...)
  34. (list (list list-contents ...) ...))
  35. ;;; Some simple object types.
  36. ;;; =========================
  37. (define-class <readable> (<gameobj>)
  38. (read-text #:init-value "All it says is: \"Blah blah blah.\""
  39. #:init-keyword #:read-text)
  40. (commands
  41. #:allocation #:each-subclass
  42. #:init-thunk (build-commands
  43. ("read" ((direct-command cmd-read)))))
  44. (actions #:allocation #:each-subclass
  45. #:init-thunk (build-actions
  46. (cmd-read readable-cmd-read))))
  47. (define (readable-cmd-read actor message . _)
  48. (<- (message-from message) 'tell
  49. #:text (slot-ref actor 'read-text)))
  50. ;; This one is just where reading is the same thing as looking
  51. ;; at the description
  52. (define-class <readable-desc> (<gameobj>)
  53. (commands
  54. #:allocation #:each-subclass
  55. #:init-thunk (build-commands
  56. ("read" ((direct-command cmd-look-at))))))
  57. ;; This one allows you to take from items that are proxied by it
  58. (define-actor <proxy-items> (<gameobj>)
  59. ((cmd-take-from take-from-proxy))
  60. (proxy-items #:init-keyword #:proxy-items))
  61. (define* (take-from-proxy gameobj message
  62. #:key direct-obj indir-obj preposition
  63. (player (message-from message)))
  64. (call/ec
  65. (lambda (escape)
  66. (for-each
  67. (lambda (obj-sym)
  68. (define obj-id (dyn-ref gameobj obj-sym))
  69. (define goes-by
  70. (mbody-val (<-wait obj-id 'goes-by)))
  71. (when (ci-member direct-obj goes-by)
  72. (<- obj-id 'cmd-take #:direct-obj direct-obj #:player player)
  73. (escape #f)))
  74. (slot-ref gameobj 'proxy-items))
  75. (<- player 'tell
  76. #:text `("You don't see any such " ,direct-obj " to take "
  77. ,preposition " " ,(slot-ref gameobj 'name) ".")))))
  78. ;;; Lobby
  79. ;;; -----
  80. (define (npc-chat-randomly actor message . _)
  81. (define catchphrase
  82. (random-choice (slot-ref actor 'catchphrases)))
  83. (define text-to-send
  84. ((slot-ref actor 'chat-format) actor catchphrase))
  85. (<- (message-from message) 'tell
  86. #:text text-to-send))
  87. (define hotel-owner-grumps
  88. '("Eight sinks! Eight sinks! And I couldn't unwind them..."
  89. "Don't mind the mess. I built this place on a dare, you
  90. know?"
  91. "(*tearfully*) Here, take this parenthesis. May it serve
  92. you well."
  93. "I gotta get back to the goblin farm soon..."
  94. "Oh, but I was going to make a mansion... a great,
  95. beautiful mansion! Full of ghosts! Now all I have is this cruddy
  96. mo... hotel. Oh... If only I had more time!"
  97. "I told them to paint more of the walls purple.
  98. Why didn't they listen?"
  99. "Listen to that overhead muzak. Whoever made that doesn't
  100. know how to compose very well! Have you heard of the bands 'fmt'
  101. or 'skribe'? Now *that's* composition!"))
  102. (define-class <chatty-npc> (<gameobj>)
  103. (catchphrases #:init-value '("Blarga blarga blarga!")
  104. #:init-keyword #:catchphrases)
  105. (chat-format #:init-value (lambda (npc catchphrase)
  106. `(,(slot-ref npc 'name) " says: \""
  107. ,catchphrase "\""))
  108. #:init-keyword #:chat-format)
  109. (commands
  110. #:allocation #:each-subclass
  111. #:init-thunk (build-commands
  112. (("chat" "talk") ((direct-command cmd-chat)))))
  113. (actions #:allocation #:each-subclass
  114. #:init-thunk
  115. (build-actions
  116. (cmd-chat npc-chat-randomly))))
  117. (define-class <sign-in-form> (<gameobj>)
  118. (commands
  119. #:allocation #:each-subclass
  120. #:init-thunk (build-commands
  121. ("sign" ((prep-direct-command cmd-sign-form '("as"))))))
  122. (actions #:allocation #:each-subclass
  123. #:init-thunk (build-actions
  124. (cmd-sign-form sign-cmd-sign-in))))
  125. (define name-sre
  126. (sre->irregex '(: alpha (** 1 14 (or alphanum "-" "_")))))
  127. (define forbidden-words
  128. (append article preposition
  129. '("and" "or" "but" "admin")))
  130. (define (valid-name? name)
  131. (and (irregex-match name-sre name)
  132. (not (member name forbidden-words))))
  133. (define* (sign-cmd-sign-in actor message
  134. #:key direct-obj indir-obj preposition)
  135. (define old-name
  136. (mbody-val (<-wait (message-from message) 'get-name)))
  137. (define name indir-obj)
  138. (if (valid-name? indir-obj)
  139. (begin
  140. (<-wait (message-from message) 'set-name! name)
  141. (<- (slot-ref actor 'loc) 'tell-room
  142. #:text (format #f "~a signs the form!\n~a is now known as ~a\n"
  143. old-name old-name name)))
  144. (<- (message-from message) 'tell
  145. #:text "Sorry, that's not a valid name.
  146. Alphanumerics, _ and - only, 2-15 characters, starts with an alphabetic
  147. character.\n")))
  148. (define-class <summoning-bell> (<gameobj>)
  149. (summons #:init-keyword #:summons)
  150. (commands
  151. #:allocation #:each-subclass
  152. #:init-thunk (build-commands
  153. ("ring" ((direct-command cmd-ring)))))
  154. (actions #:allocation #:each-subclass
  155. #:init-thunk (build-actions
  156. (cmd-ring summoning-bell-cmd-ring))))
  157. (define* (summoning-bell-cmd-ring bell message . _)
  158. ;; Call back to actor who invoked this message handler
  159. ;; and find out their name. We'll call *their* get-name message
  160. ;; handler... meanwhile, this procedure suspends until we get
  161. ;; their response.
  162. (define who-rang
  163. (mbody-val (<-wait (message-from message) 'get-name)))
  164. ;; Now we'll invoke the "tell" message handler on the player
  165. ;; who rang us, displaying this text on their screen.
  166. ;; This one just uses <- instead of <-wait, since we don't
  167. ;; care when it's delivered; we're not following up on it.
  168. (<- (message-from message) 'tell
  169. #:text "*ring ring!* You ring the bell!\n")
  170. ;; We also want everyone else in the room to "hear" the bell,
  171. ;; but they get a different message since they aren't the ones
  172. ;; ringing it. Notice here's where we make use of the invoker's
  173. ;; name as extracted and assigned to the who-rang variable.
  174. ;; Notice how we send this message to our "location", which
  175. ;; forwards it to the rest of the occupants in the room.
  176. (<- (gameobj-loc bell) 'tell-room
  177. #:text
  178. (format #f "*ring ring!* ~a rings the bell!\n"
  179. who-rang)
  180. #:exclude (message-from message))
  181. ;; Now we perform the primary task of the bell, which is to summon
  182. ;; the "clerk" character to the room. (This is configurable,
  183. ;; so we dynamically look up their address.)
  184. (<- (dyn-ref bell (slot-ref bell 'summons)) 'be-summoned
  185. #:who-summoned (message-from message)))
  186. (define prefect-quotes
  187. '("I'm a frood who really knows where my towel is!"
  188. "On no account allow a Vogon to read poetry at you."
  189. "Time is an illusion, lunchtime doubly so!"
  190. "How can you have money if none of you produces anything?"
  191. "On no account allow Arthur to request tea on this ship."))
  192. (define-class <cabinet-item> (<gameobj>)
  193. (take-me? #:init-value
  194. (lambda _
  195. (values #f #:why-not
  196. `("Hm, well... the cabinet is locked and the properitor "
  197. "is right over there.")))))
  198. (define lobby
  199. (lol
  200. ('lobby
  201. <room> #f
  202. #:name "Hotel Lobby"
  203. #:desc
  204. '((p "You're in some sort of hotel lobby. You see a large sign hanging "
  205. "over the desk that says \"Hotel Bricabrac\". On the desk is a bell "
  206. "that says \"'ring bell' for service\". Terrible music plays from a speaker "
  207. "somewhere overhead. "
  208. "The room is lined with various curio cabinets, filled with all sorts "
  209. "of kitschy junk. It looks like whoever decorated this place had great "
  210. "ambitions, but actually assembled it all in a hurry and used whatever "
  211. "kind of objects they found lying around.")
  212. (p "There's a door to the north leading to some kind of hallway."))
  213. #:exits
  214. (list (make <exit>
  215. #:name "north"
  216. #:to 'grand-hallway)))
  217. ;; NPC: hotel owner
  218. ('lobby:hotel-owner
  219. <chatty-npc> 'lobby
  220. #:name "a languid lady"
  221. #:desc
  222. '((p " Whoever this is, she looks totally exhausted. She's
  223. collapsed into the only comfortable looking chair in the room and you
  224. don't get the sense that she's likely to move any time soon.
  225. Attached to her frumpy dress is a barely secured pin which says
  226. \"Hotel Proprietor\", but she looks so disorganized that you think
  227. that can't possibly be true... can it?")
  228. (p "Despite her exhaustion, you sense she'd be happy to chat
  229. with you, though the conversation may be a bit one sided."))
  230. #:goes-by '("languid lady" "lady"
  231. "hotel proprietor" "proprietor")
  232. #:catchphrases hotel-owner-grumps)
  233. ;; Object: Sign
  234. ('lobby:sign
  235. <readable> 'lobby
  236. #:name "the Hotel Bricabrac sign"
  237. #:desc " It strikes you that there's something funny going on with this sign.
  238. Sure enough, if you look at it hard enough, you can tell that someone
  239. hastily painted over an existing sign and changed the \"M\" to an \"H\".
  240. Classy!"
  241. #:read-text " All it says is \"Hotel Bricabrac\" in smudged, hasty text."
  242. #:goes-by '("sign"
  243. "bricabrac sign"
  244. "hotel sign"
  245. "hotel bricabrac sign"
  246. "lobby sign"))
  247. ('lobby:bell
  248. <summoning-bell> 'lobby
  249. #:name "a shiny brass bell"
  250. #:goes-by '("shiny brass bell" "shiny bell" "brass bell" "bell")
  251. #:desc " A shiny brass bell. Inscribed on its wooden base is the text
  252. \"ring me for service\". You probably could \"ring the bell\" if you
  253. wanted to."
  254. #:summons 'break-room:desk-clerk)
  255. ('lobby:sign-in-form
  256. <sign-in-form> 'lobby
  257. #:name "sign-in form"
  258. #:goes-by '("sign-in form" "form" "signin form")
  259. #:desc '("It looks like you could sign this form and set your name like so: "
  260. (i "sign form as <my-name-here>")))
  261. ;; Object: curio cabinets
  262. ;; TODO: respond to attempts to open the curio cabinet
  263. ('lobby:cabinet
  264. <proxy-items> 'lobby
  265. #:proxy-items '(lobby:porcelain-doll
  266. lobby:1950s-robots
  267. lobby:tea-set lobby:mustard-pot
  268. lobby:head-of-elvis lobby:circuitboard-of-evlis
  269. lobby:teletype-scroll lobby:orange-cat-phone)
  270. #:name "a curio cabinet"
  271. #:goes-by '("curio cabinet" "cabinet" "bricabrac cabinet"
  272. "cabinet of curiosities")
  273. #:desc (lambda _
  274. (format #f " The curio cabinet is full of all sorts of oddities!
  275. Something catches your eye!
  276. Ooh, ~a!" (random-choice
  277. '("a creepy porcelain doll"
  278. "assorted 1950s robots"
  279. "an exquisite tea set"
  280. "an antique mustard pot"
  281. "the pickled head of Elvis"
  282. "the pickled circuitboard of EVLIS"
  283. "a scroll of teletype paper holding the software Four Freedoms"
  284. "a telephone shaped like an orange cartoon cat")))))
  285. ('lobby:porcelain-doll
  286. <cabinet-item> 'lobby
  287. #:invisible? #t
  288. #:name "a creepy porcelain doll"
  289. #:desc "It strikes you that while the doll is technically well crafted,
  290. it's also the stuff of nightmares."
  291. #:goes-by '("porcelain doll" "doll"))
  292. ('lobby:1950s-robots
  293. <cabinet-item> 'lobby
  294. #:invisible? #t
  295. #:name "a set of 1950s robots"
  296. #:desc "There's a whole set of these 1950s style robots.
  297. They seem to be stamped out of tin, and have various decorations of levers
  298. and buttons and springs. Some of them have wind-up knobs on them."
  299. #:goes-by '("robot" "robots" "1950s robot" "1950s robots"))
  300. ('lobby:tea-set
  301. <cabinet-item> 'lobby
  302. #:invisible? #t
  303. #:name "a tea set"
  304. #:desc "A complete tea set. Some of the cups are chipped.
  305. You can imagine yourself joining a tea party using this set, around a
  306. nice table with some doilies, drinking some Earl Grey tea, hot. Mmmm."
  307. #:goes-by '("tea set" "tea"))
  308. ('lobby:cups
  309. <cabinet-item> 'lobby
  310. #:invisible? #t
  311. #:name "cups from the tea set"
  312. #:desc "They're chipped."
  313. #:goes-by '("cups"))
  314. ('lobby:mustard-pot
  315. <cabinet-item> 'lobby
  316. #:invisible? #t
  317. #:name "a mustard pot"
  318. #:desc '((p "It's a mustard pot. I mean, it's kind of cool, it has a
  319. nice design, and it's an antique, but you can't imagine putting something
  320. like this in a museum.")
  321. (p "Ha... imagine that... a mustard museum."))
  322. #:goes-by '("mustard pot" "antique mustard pot" "mustard"))
  323. ('lobby:head-of-elvis
  324. <cabinet-item> 'lobby
  325. #:invisible? #t
  326. #:name "the pickled head of Elvis"
  327. #:desc '((p "It's a jar full of some briny-looking liquid and...
  328. a free floating head. The head looks an awful lot like Elvis, and
  329. definitely not the younger Elvis. The hair even somehow maintains
  330. that signature swoop while suspended in liquid. But of course it's
  331. not Elvis.")
  332. (p "Oh, wait, it has a label at the bottom which says:
  333. \"This is really the head of Elvis\". Well... maybe don't believe
  334. everything you read."))
  335. #:goes-by '("pickled head of elvis" "pickled head of Elvis"
  336. "elvis" "Elvis" "head" "pickled head"))
  337. ('lobby:circuitboard-of-evlis
  338. <cabinet-item> 'lobby
  339. #:invisible? #t
  340. #:name "the pickled circuitboard of Evlis"
  341. #:desc '((p "It's a circuitboard from a Lisp Machine called EVLIS.
  342. This is quite the find, and you bet just about anyone interested in
  343. preserving computer history would love to get their hands on this.")
  344. (p "Unfortunately, whatever moron did acquire this has
  345. no idea what it means to preserve computers, so here it is floating
  346. in some kind of briny liquid. It appears to be heavily corroded.
  347. Too bad..."))
  348. #:goes-by '("pickled circuitboard of evlis" "pickled circuitboard of Evlis"
  349. "pickled circuitboard of EVLIS"
  350. "evlis" "Evlis" "EVLIS" "circuitboard" "pickled circuitboard"))
  351. ('lobby:teletype-scroll
  352. <cabinet-item> 'lobby
  353. #:invisible? #t
  354. #:name "a scroll of teletype"
  355. #:desc '((p "This is a scroll of teletype paper. It's a bit old
  356. and yellowed but the type is very legible. It says:")
  357. (br)
  358. (i
  359. (p (strong "== The four essential freedoms =="))
  360. (p "A program is free software if the program's users have
  361. the four essential freedoms: ")
  362. (ul (li "The freedom to run the program as you wish, for any purpose (freedom 0).")
  363. (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.")
  364. (li "The freedom to redistribute copies so you can help your neighbor (freedom 2).")
  365. (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.")))
  366. (p "You get this feeling that ambiguities in the
  367. English language surrounding the word 'free' have lead to a lot of terminology debates."))
  368. #:goes-by '("scroll of teletype" "scroll of teletype paper" "teletype scroll"
  369. "teletype paper" "scroll" "four freedoms"
  370. "paper"
  371. "scroll of teletype paper holding the software Four Freedoms"
  372. "scroll of teletype paper holding the software four freedoms"))
  373. ('lobby:orange-cat-phone
  374. <cabinet-item> 'lobby
  375. #:invisible? #t
  376. #:name "a telephone shaped like an orange cartoon cat"
  377. #:desc "It's made out of a cheap plastic, and it's very orange.
  378. It resembles a striped tabby, and it's eyes hold the emotion of
  379. a being both sleepy and smarmy.
  380. You suspect that someone, somewhere made a ton of cash on items holding
  381. this general shape in the 1990s."
  382. #:goes-by '("orange cartoon cat phone" "orange cartoon cat telephone"
  383. "orange cat phone" "orange cat telephone"
  384. "cartoon cat phone" "cartoon cat"
  385. "cat phone" "cat telephone" "phone" "telephone"))
  386. ('lobby:monster-stuffie
  387. <gameobj> 'lobby
  388. #:name "an off-brand monster stuffie"
  389. #:desc "It's an off brand monster stuffed animal that looks, well kinda
  390. like a popular character you've seen in a video game, but there's been a very
  391. thin attempt to make it look like something different... mostly by changing
  392. the shape of the ears. It's cute though!"
  393. #:take-me? #t
  394. #:goes-by '("monster stuffie" "monster" "stuffed animal" "stuffed monster"
  395. "off-brand monster stuffie" "stuffie" "monster stuffie"))))
  396. ;;; Grand hallway
  397. ;;; -------------
  398. (define-actor <disc-shield> (<gameobj>)
  399. ((cmd-take disc-shield-take)))
  400. (define* (disc-shield-take gameobj message
  401. #:key direct-obj
  402. (player (message-from message)))
  403. (create-gameobj <glowing-disc> (gameobj-gm gameobj)
  404. player) ;; set loc to player to put in player's inventory
  405. (<- player 'tell
  406. #:text '((p "As you attempt to pull the shield / disk platter
  407. from the statue a shining outline appears around it... and a
  408. completely separate, glowing copy of the disc materializes into your
  409. hands!")))
  410. (<- (gameobj-loc gameobj) 'tell-room
  411. #:text `(,(mbody-val (<-wait player 'get-name))
  412. " pulls on the shield of the statue, and a glowing "
  413. "copy of it materializes into their hands!")
  414. #:exclude player)
  415. (<- (gameobj-loc gameobj) 'tell-room
  416. #:text
  417. '(p "You hear a voice whisper: "
  418. (i "\"Share the software... and you'll be free...\""))))
  419. ;;; This is the disc that gets put in the player's inventory
  420. (define-actor <glowing-disc> (<gameobj>)
  421. ((cmd-drop glowing-disc-drop-cmd))
  422. (initial-props
  423. #:allocation #:each-subclass
  424. #:init-thunk (build-props
  425. '((hd-platter? . #t))))
  426. (take-me? #:allocation #:each-subclass
  427. #:init-value #t)
  428. (name #:allocation #:each-subclass
  429. #:init-value "a glowing disc")
  430. (desc #:allocation #:each-subclass
  431. #:init-value "A brightly glowing disc. It's shaped like a hard
  432. drive platter, not unlike the one from the statue it came from. It's
  433. labeled \"RL02.5\".")
  434. (goes-by #:init-value '("glowing disc" "glowing platter"
  435. "glowing disc platter" "glowing disk platter"
  436. "platter" "disc" "disk" "glowing shield")))
  437. (define* (glowing-disc-drop-cmd gameobj message
  438. #:key direct-obj
  439. (player (message-from message)))
  440. (<- player 'tell
  441. #:text "You drop the glowing disc, and it shatters into a million pieces!")
  442. (<- (mbody-val (<-wait player 'get-loc)) 'tell-room
  443. #:text `(,(mbody-val (<-wait player 'get-name))
  444. " drops a glowing disc, and it shatters into a million pieces!")
  445. #:exclude player)
  446. (gameobj-self-destruct gameobj))
  447. ;;; Grand hallway
  448. (define lobby-map-text
  449. "\
  450. .----+++++----.
  451. | : : |
  452. + : north : +
  453. | : hall : |
  454. + : : +
  455. |_ : _____ : _|
  456. | : : |
  457. .----------.----------. : & : .----------.----------.
  458. | computer | |& :YOU ARE: &| smoking | *UNDER* |
  459. | room + playroom + : HERE : + parlor | *CONS- |
  460. | > | |& : : &| | TRUCTION*|
  461. '----------'----------'-++-------++-'-------+--'----------'
  462. | '-----' | | |
  463. : LOBBY : '---'
  464. '. .'
  465. '---------'")
  466. (define grand-hallway
  467. (lol
  468. ('grand-hallway
  469. <room> #f
  470. #:name "Grand Hallway"
  471. #:desc '((p " A majestic red carpet runs down the center of the room.
  472. Busts of serious looking people line the walls, but there's no
  473. clear indication that they have any logical relation to this place.")
  474. (p "In the center is a large statue of a woman in a warrior's
  475. pose, but something is strange about her weapon and shield. You wonder what
  476. that's all about?")
  477. (p "To the south is the lobby. A door to the east is labeled \"smoking
  478. room\", while a door to the west is labeled \"playroom\"."))
  479. #:exits
  480. (list (make <exit>
  481. #:name "north"
  482. #:to 'north-hall)
  483. (make <exit>
  484. #:name "south"
  485. #:to 'lobby)
  486. (make <exit>
  487. #:name "west"
  488. #:to 'playroom)
  489. (make <exit>
  490. #:name "east"
  491. #:to 'smoking-parlor)))
  492. ('grand-hallway:map
  493. <readable> 'grand-hallway
  494. #:name "the hotel map"
  495. #:desc '("This appears to be a map of the hotel. "
  496. "Like the hotel itself, it seems to be "
  497. "incomplete."
  498. "You could read it if you want to.")
  499. #:read-text `(pre ,lobby-map-text)
  500. #:goes-by '("map" "hotel map"))
  501. ('grand-hallway:carpet
  502. <gameobj> 'grand-hallway
  503. #:name "the Grand Hallway carpet"
  504. #:desc "It's very red, except in the places where it's very worn."
  505. #:invisible? #t
  506. #:goes-by '("red carpet" "carpet"))
  507. ('grand-hallway:busts
  508. <gameobj> 'grand-hallway
  509. #:name "the busts of serious people"
  510. #:desc "There are about 6 of them in total. They look distinguished
  511. but there's no indication of who they are."
  512. #:invisible? #t
  513. #:goes-by '("busts" "bust" "busts of serious people" "bust of serious person"))
  514. ('grand-hallway:hackthena-statue
  515. <proxy-items> 'grand-hallway
  516. #:name "the statue of Hackthena"
  517. #:desc '((p "The base of the statue says \"Hackthena, guardian of the hacker
  518. spirit\". You've heard of Hackthena... not a goddess, but spiritual protector of
  519. all good hacks, and legendary hacker herself.")
  520. (p "Hackthena holds the form of a human woman. She wears flowing
  521. robes, has a pair of curly bovine-esque horns protruding from the sides of her
  522. head, wears a pair of horn-rimmed glasses, and appears posed as if for battle.
  523. But instead of a weapon, she seems to hold some sort of keyboard. And her
  524. shield... well it's round like a shield, but something seems off about it.
  525. You'd better take a closer look to be sure."))
  526. #:goes-by '("hackthena statue" "hackthena" "statue" "statue of hackthena")
  527. #:proxy-items '(grand-hallway:keyboard
  528. grand-hallway:disc-platter
  529. grand-hallway:hackthena-horns))
  530. ('grand-hallway:keyboard
  531. <gameobj> 'grand-hallway
  532. #:name "a Knight Keyboard"
  533. #:desc "Whoa, this isn't just any old keyboard, this is a Knight Keyboard!
  534. Any space cadet can see that with that kind of layout a hack-and-slayer could
  535. thrash out some serious key-chords like there's no tomorrow. You guess
  536. Hackthena must be an emacs user."
  537. #:invisible? #t
  538. #:take-me? (lambda _
  539. (values #f
  540. #:why-not
  541. `("Are you kidding? Do you know how hard it is to find "
  542. "a Knight Keyboard? There's no way she's going "
  543. "to give that up.")))
  544. #:goes-by '("knight keyboard" "keyboard"))
  545. ('grand-hallway:hackthena-horns
  546. <gameobj> 'grand-hallway
  547. #:name "Hackthena's horns"
  548. #:desc "They're not unlike a Gnu's horns."
  549. #:invisible? #t
  550. #:take-me? (lambda _
  551. (values #f
  552. #:why-not
  553. `("Are you seriously considering desecrating a statue?")))
  554. #:goes-by '("hackthena's horns" "horns" "horns of hacktena"))
  555. ('grand-hallway:disc-platter
  556. <disc-shield> 'grand-hallway
  557. #:name "Hackthena's shield"
  558. #:desc "No wonder the \"shield\" looks unusual... it seems to be a hard disk
  559. platter! It has \"RL02.5\" written on it. It looks kind of loose."
  560. #:invisible? #t
  561. #:goes-by '("hackthena's shield" "shield" "platter" "hard disk platter"))))
  562. ;;; Playroom
  563. ;;; --------
  564. (define-actor <rgb-machine> (<gameobj>)
  565. ((cmd-run rgb-machine-cmd-run)
  566. (cmd-reset rgb-machine-cmd-reset))
  567. (commands
  568. #:allocation #:each-subclass
  569. #:init-thunk (build-commands
  570. (("run" "start") ((direct-command cmd-run)))
  571. ("reset" ((direct-command cmd-reset)))))
  572. (resetting #:init-value #f
  573. #:accessor .resetting)
  574. ;; used to reset, and to kick off the first item in the list
  575. (rgb-items #:init-keyword #:rgb-items
  576. #:accessor .rgb-items))
  577. (define (rgb-machine-cmd-run rgb-machine message . _)
  578. (define player (message-from message))
  579. (<-wait player 'tell
  580. #:text '("You start the rube goldberg machine."))
  581. (<-wait (gameobj-loc rgb-machine) 'tell-room
  582. #:text `(,(mbody-val (<-wait player 'get-name))
  583. " runs the rube goldberg machine.")
  584. #:exclude player)
  585. (8sleep 1)
  586. (match (.rgb-items rgb-machine)
  587. ((first-item rest ...)
  588. (<- (dyn-ref rgb-machine first-item) 'trigger))))
  589. (define (rgb-machine-cmd-reset rgb-machine message . _)
  590. (define player (message-from message))
  591. (cond
  592. ((not (.resetting rgb-machine))
  593. (set! (.resetting rgb-machine) #t)
  594. (<-wait player 'tell
  595. #:text '("You reset the rube goldberg machine."))
  596. (<-wait (gameobj-loc rgb-machine) 'tell-room
  597. #:text `(,(mbody-val (<-wait player 'get-name))
  598. " resets the rube goldberg machine.")
  599. #:exclude player)
  600. (<-wait (gameobj-loc rgb-machine) 'tell-room
  601. #:text '("From a panel in the wall, a white gloved mechanical "
  602. "arm reaches out to reset all the "
  603. "rube goldberg components."))
  604. (8sleep (/ 1 2))
  605. (for-each
  606. (lambda (rgb-item)
  607. (<- (dyn-ref rgb-machine rgb-item) 'reset)
  608. (8sleep (/ 1 2)))
  609. (.rgb-items rgb-machine))
  610. (<- (gameobj-loc rgb-machine) 'tell-room
  611. #:text "The machine's mechanical arm retreats into the wall!")
  612. (set! (.resetting rgb-machine) #f))
  613. (else
  614. (<-wait player 'tell
  615. #:text '("But it's in the middle of resetting right now!")))))
  616. (define-actor <rgb-item> (<gameobj>)
  617. ((trigger rgb-item-trigger)
  618. (reset rgb-item-reset))
  619. (invisible? #:init-value #t)
  620. (steps #:init-keyword #:steps
  621. #:accessor .steps)
  622. (triggers-as #:init-value #f
  623. #:init-keyword #:triggers-as
  624. #:getter .triggers-as)
  625. (reset-msg #:init-keyword #:reset-msg
  626. #:getter .reset-msg)
  627. ;; States: ready -> running -> ran
  628. (state #:init-value 'ready
  629. #:accessor .state))
  630. (define (rgb-item-trigger rgb-item message . _)
  631. (define room (gameobj-loc rgb-item))
  632. (case (.state rgb-item)
  633. ((ready)
  634. ;; Set state to running
  635. (set! (.state rgb-item) 'running)
  636. ;; Loop through all steps
  637. (for-each
  638. (lambda (step)
  639. (match step
  640. ;; A string? That's the description of what's happening, tell players
  641. ((? string? str)
  642. (<- room 'tell-room #:text str))
  643. ;; A number? Sleep for that many secs
  644. ((? number? num)
  645. (8sleep num))
  646. ;; A symbol? That's another gameobj to look up dynamically
  647. ((? symbol? sym)
  648. (<- (dyn-ref rgb-item sym) 'trigger
  649. #:triggered-by (.triggers-as rgb-item)))
  650. (_ (throw 'unknown-step-type
  651. "Don't know how to process rube goldberg machine step type?"
  652. #:step step))))
  653. (.steps rgb-item))
  654. ;; We're done! Set state to ran
  655. (set! (.state rgb-item) 'ran))
  656. (else
  657. (<- room 'tell-room
  658. #:text `("... but " ,(slot-ref rgb-item 'name)
  659. " has already been triggered!")))))
  660. (define (rgb-item-reset rgb-item message . _)
  661. (define room (gameobj-loc rgb-item))
  662. (case (.state rgb-item)
  663. ((ran)
  664. (set! (.state rgb-item) 'ready)
  665. (<- room 'tell-room
  666. #:text (.reset-msg rgb-item)))
  667. ((running)
  668. (<- room 'tell-room
  669. #:text `("... but " ,(slot-ref rgb-item 'name)
  670. " is currently running!")))
  671. ((ready)
  672. (<- room 'tell-room
  673. #:text `("... but " ,(slot-ref rgb-item 'name)
  674. " has already been reset.")))))
  675. (define-actor <rgb-kettle> (<rgb-item>)
  676. ((trigger rgb-kettle-trigger)
  677. (reset rgb-kettle-reset))
  678. (heated #:accessor .heated
  679. #:init-value #f)
  680. (filled #:accessor .filled
  681. #:init-value #f))
  682. (define* (rgb-kettle-trigger rgb-item message #:key triggered-by)
  683. (define room (gameobj-loc rgb-item))
  684. (if (not (eq? (.state rgb-item) 'ran))
  685. (begin
  686. (match triggered-by
  687. ('water-demon
  688. (set! (.state rgb-item) 'running)
  689. (set! (.filled rgb-item) #t))
  690. ('quik-heater
  691. (set! (.state rgb-item) 'running)
  692. (set! (.heated rgb-item) #t)))
  693. (when (and (.filled rgb-item)
  694. (.heated rgb-item))
  695. (<- room 'tell-room
  696. #:text '((i "*kshhhhhh!*")
  697. " The water has boiled!"))
  698. (8sleep .25)
  699. (set! (.state rgb-item) 'ran)
  700. ;; insert a cup of hot tea in the room
  701. (create-gameobj <hot-tea> (gameobj-gm rgb-item) room)
  702. (<- room 'tell-room
  703. #:text '("The machine pours out a cup of hot tea! "
  704. "Looks like the machine finished!"))))
  705. (<- room 'tell-room
  706. #:text `("... but " ,(slot-ref rgb-item 'name)
  707. " has already been triggered!"))))
  708. (define (rgb-kettle-reset rgb-item message . rest-args)
  709. (define room (gameobj-loc rgb-item))
  710. (when (eq? (.state rgb-item) 'ran)
  711. (set! (.heated rgb-item) #f)
  712. (set! (.filled rgb-item) #f))
  713. (apply rgb-item-reset rgb-item message rest-args))
  714. (define-actor <tinfoil-hat> (<gameobj>)
  715. ((cmd-wear tinfoil-hat-wear))
  716. (contained-commands
  717. #:allocation #:each-subclass
  718. #:init-thunk (build-commands
  719. ("wear" ((direct-command cmd-wear))))))
  720. (define (tinfoil-hat-wear tinfoil-hat message . _)
  721. (<- (message-from message) 'tell
  722. #:text '("You put on the tinfoil hat, and, to be perfectly honest with you "
  723. "it's a lot harder to take you seriously.")))
  724. (define-actor <hot-tea> (<gameobj>)
  725. ((cmd-drink hot-tea-cmd-drink)
  726. (cmd-sip hot-tea-cmd-sip))
  727. (contained-commands
  728. #:allocation #:each-subclass
  729. #:init-thunk (build-commands
  730. ("drink" ((direct-command cmd-drink)))
  731. ("sip" ((direct-command cmd-sip)))))
  732. (sips-left #:init-value 4
  733. #:accessor .sips-left)
  734. (name #:init-value "a cup of hot tea")
  735. (take-me? #:init-value #t)
  736. (goes-by #:init-value '("cup of hot tea" "cup of tea" "tea" "cup"))
  737. (desc #:init-value "It's a steaming cup of hot tea. It looks pretty good!"))
  738. (define (hot-tea-cmd-drink hot-tea message . _)
  739. (define player (message-from message))
  740. (define player-loc (mbody-val (<-wait player 'get-loc)))
  741. (define player-name (mbody-val (<-wait player 'get-name)))
  742. (<- player 'tell
  743. #:text "You drink a steaming cup of hot tea all at once... hot hot hot!")
  744. (<- player-loc 'tell-room
  745. #:text `(,player-name
  746. " drinks a steaming cup of hot tea all at once.")
  747. #:exclude player)
  748. (gameobj-self-destruct hot-tea))
  749. (define (hot-tea-cmd-sip hot-tea message . _)
  750. (define player (message-from message))
  751. (define player-loc (mbody-val (<-wait player 'get-loc)))
  752. (define player-name (mbody-val (<-wait player 'get-name)))
  753. (set! (.sips-left hot-tea) (- (.sips-left hot-tea) 1))
  754. (<- player 'tell
  755. #:text "You take a sip of your steaming hot tea. How refined!")
  756. (<- player-loc 'tell-room
  757. #:text `(,player-name
  758. " takes a sip of their steaming hot tea. How refined!")
  759. #:exclude player)
  760. (when (= (.sips-left hot-tea) 0)
  761. (<- player 'tell
  762. #:text "You've finished your tea!")
  763. (<- player-loc 'tell-room
  764. #:text `(,player-name
  765. " finishes their tea!")
  766. #:exclude player)
  767. (gameobj-self-destruct hot-tea)))
  768. (define-actor <fanny-pack> (<container>)
  769. ((cmd-take-from-while-wearing cmd-take-from)
  770. (cmd-put-in-while-wearing cmd-put-in))
  771. (contained-commands
  772. #:allocation #:each-subclass
  773. #:init-thunk
  774. (build-commands
  775. (("l" "look") ((direct-command cmd-look-at)))
  776. ("take" ((prep-indir-command cmd-take-from-while-wearing
  777. '("from" "out of"))))
  778. ("put" ((prep-indir-command cmd-put-in-while-wearing
  779. '("in" "inside" "into" "on")))))))
  780. (define playroom
  781. (lol
  782. ('playroom
  783. <room> #f
  784. #:name "The Playroom"
  785. #:desc '(p (" There are toys scattered everywhere here. It's really unclear
  786. if this room is intended for children or child-like adults.")
  787. (" There are doors to both the east and the west."))
  788. #:exits
  789. (list (make <exit>
  790. #:name "east"
  791. #:to 'grand-hallway)
  792. (make <exit>
  793. #:name "west"
  794. #:to 'computer-room)))
  795. ('playroom:cubey
  796. <gameobj> 'playroom
  797. #:name "Cubey"
  798. #:take-me? #t
  799. #:desc " It's a little foam cube with googly eyes on it. So cute!")
  800. ('playroom:cuddles-plushie
  801. <gameobj> 'playroom
  802. #:name "a Cuddles plushie"
  803. #:goes-by '("plushie" "cuddles plushie" "cuddles")
  804. #:take-me? #t
  805. #:desc " A warm and fuzzy cuddles plushie! It's a cuddlefish!")
  806. ('playroom:toy-chest
  807. <container> 'playroom
  808. #:name "a toy chest"
  809. #:goes-by '("toy chest" "chest")
  810. #:desc (lambda (toy-chest whos-looking)
  811. (let ((contents (gameobj-occupants toy-chest)))
  812. `((p "A brightly painted wooden chest. The word \"TOYS\" is "
  813. "engraved on it.")
  814. (p "Inside you see:"
  815. ,(if (eq? contents '())
  816. " nothing! It's empty!"
  817. `(ul ,(map (lambda (occupant)
  818. `(li ,(mbody-val
  819. (<-wait occupant 'get-name))))
  820. (gameobj-occupants toy-chest))))))))
  821. #:take-from-me? #t
  822. #:put-in-me? #t)
  823. ;; Things inside the toy chest
  824. ('playroom:toy-chest:rubber-duck
  825. <gameobj> 'playroom:toy-chest
  826. #:name "a rubber duck"
  827. #:goes-by '("rubber duck" "duck")
  828. #:take-me? #t
  829. #:desc "It's a yellow rubber duck with a bright orange beak.")
  830. ('playroom:toy-chest:tinfoil-hat
  831. <tinfoil-hat> 'playroom:toy-chest
  832. #:name "a tinfoil hat"
  833. #:goes-by '("tinfoil hat" "hat")
  834. #:take-me? #t
  835. #:desc "You'd have to be a crazy person to wear this thing!")
  836. ('playroom:toy-chest:fanny-pack
  837. <fanny-pack> 'playroom:toy-chest
  838. #:name "a fanny pack"
  839. #:goes-by '("fanny pack" "pack")
  840. #:take-me? #t
  841. #:desc
  842. (lambda (toy-chest whos-looking)
  843. (let ((contents (gameobj-occupants toy-chest)))
  844. `((p "It's a leather fanny pack, so it's both tacky and kinda cool.")
  845. (p "Inside you see:"
  846. ,(if (eq? contents '())
  847. " nothing! It's empty!"
  848. `(ul ,(map (lambda (occupant)
  849. `(li ,(mbody-val
  850. (<-wait occupant 'get-name))))
  851. (gameobj-occupants toy-chest)))))))))
  852. ;; Things inside the toy chest
  853. ('playroom:toy-chest:fanny-pack:plastic-elephant
  854. <gameobj> 'playroom:toy-chest:fanny-pack
  855. #:name "a plastic elephant"
  856. #:goes-by '("plastic elephant" "elephant")
  857. #:take-me? #t
  858. #:desc "It's a tiny little plastic elephant. Small, but heartwarming.")
  859. ('playroom:rgb-machine
  860. <rgb-machine> 'playroom
  861. #:name "a Rube Goldberg machine"
  862. #:goes-by '("rube goldberg machine" "machine")
  863. #:rgb-items '(playroom:rgb-dominoes
  864. playroom:rgb-switch-match
  865. playroom:rgb-candle
  866. playroom:rgb-catapult
  867. playroom:rgb-water-demon
  868. playroom:rgb-quik-heater
  869. playroom:rgb-kettle)
  870. #:desc "It's one of those hilarious Rube Goldberg machines.
  871. What could happen if you started it?")
  872. ;; Dominoes topple
  873. ('playroom:rgb-dominoes
  874. <rgb-item> 'playroom
  875. #:name "some dominoes"
  876. #:goes-by '("dominoes" "some dominoes")
  877. #:steps `("The dominoes topple down the line..."
  878. 1
  879. "The last domino lands on a switch!"
  880. 1.5
  881. playroom:rgb-switch-match)
  882. #:reset-msg "The dominoes are placed back into position.")
  883. ;; Which hit the switch and strike a match
  884. ('playroom:rgb-switch-match
  885. <rgb-item> 'playroom
  886. #:name "a switch"
  887. #:goes-by '("switch" "match")
  888. #:steps `("The switch lights a match!"
  889. ,(/ 2 3)
  890. "The match lights a candle!"
  891. 1.5
  892. playroom:rgb-candle)
  893. #:reset-msg "A fresh match is installed and the switch is reset.")
  894. ;; which lights a candle and burns a rope
  895. ('playroom:rgb-candle
  896. <rgb-item> 'playroom
  897. #:name "a candle"
  898. #:goes-by '("candle")
  899. #:steps `("The candle burns..."
  900. .3 ; oops!
  901. "The candle is burning away a rope!"
  902. 2
  903. "The rope snaps!"
  904. .5
  905. playroom:rgb-catapult)
  906. #:reset-msg "A fresh candle is installed.")
  907. ;; which catapults a rock
  908. ('playroom:rgb-catapult
  909. <rgb-item> 'playroom
  910. #:name "a catapult"
  911. #:goes-by '("catapult")
  912. #:steps `("The snapped rope unleashes a catapult, which throws a rock!"
  913. 2
  914. "The rock flies through a water demon, startling it!"
  915. .5
  916. playroom:rgb-water-demon
  917. 2
  918. "The rock whacks into the quik-heater's on button!"
  919. .5
  920. playroom:rgb-quik-heater)
  921. #:reset-msg
  922. '("A fresh rope is attached to the catapult, which is pulled taught. "
  923. "A fresh rock is placed on the catapult."))
  924. ;; which both:
  925. ;; '- panics the water demon
  926. ;; '- which waters the kettle
  927. ('playroom:rgb-water-demon
  928. <rgb-item> 'playroom
  929. #:name "the water demon"
  930. #:triggers-as 'water-demon
  931. #:goes-by '("water demon" "demon")
  932. #:steps `("The water demon panics, and starts leaking water into the kettle below!"
  933. 3
  934. "The kettle is filled!"
  935. playroom:rgb-kettle)
  936. #:reset-msg '("The water demon is scratched behind the ears and calms down."))
  937. ;; '- bops the quik-heater button
  938. ;; '- which heats the kettle
  939. ('playroom:rgb-quik-heater
  940. <rgb-item> 'playroom
  941. #:name "the quik heater"
  942. #:triggers-as 'quik-heater
  943. #:goes-by '("quik heater" "heater")
  944. #:steps `("The quik-heater heats up the kettle above it!"
  945. 3
  946. "The kettle is heated up!"
  947. playroom:rgb-kettle)
  948. #:reset-msg '("The quik heater is turned off."))
  949. ;; Finally, the kettle
  950. ('playroom:rgb-kettle
  951. <rgb-kettle> 'playroom
  952. #:name "the kettle"
  953. #:goes-by '("kettle")
  954. #:reset-msg '("The kettle is emptied."))))
  955. ;;; Writing room
  956. ;;; ------------
  957. ;;; Armory???
  958. ;;; ---------
  959. ;; ... full of NURPH weapons?
  960. ;;; Smoking parlor
  961. ;;; --------------
  962. (define-class <furniture> (<gameobj>)
  963. (sit-phrase #:init-keyword #:sit-phrase)
  964. (sit-phrase-third-person #:init-keyword #:sit-phrase-third-person)
  965. (sit-name #:init-keyword #:sit-name)
  966. (commands
  967. #:allocation #:each-subclass
  968. #:init-thunk (build-commands
  969. ("sit" ((direct-command cmd-sit-furniture)))))
  970. (actions #:allocation #:each-subclass
  971. #:init-thunk (build-actions
  972. (cmd-sit-furniture furniture-cmd-sit))))
  973. (define* (furniture-cmd-sit actor message #:key direct-obj)
  974. (define player-name
  975. (mbody-val (<-wait (message-from message) 'get-name)))
  976. (<- (message-from message) 'tell
  977. #:text (format #f "You ~a ~a.\n"
  978. (slot-ref actor 'sit-phrase)
  979. (slot-ref actor 'sit-name)))
  980. (<- (slot-ref actor 'loc) 'tell-room
  981. #:text (format #f "~a ~a on ~a.\n"
  982. player-name
  983. (slot-ref actor 'sit-phrase-third-person)
  984. (slot-ref actor 'sit-name))
  985. #:exclude (message-from message)))
  986. (define smoking-parlor
  987. (lol
  988. ('smoking-parlor
  989. <room> #f
  990. #:name "Smoking Parlor"
  991. #:desc
  992. '((p "This room looks quite posh. There are huge comfy seats you can sit in
  993. if you like. Strangely, you see a large sign saying \"No Smoking\". The owners must
  994. have installed this place and then changed their mind later.")
  995. (p "There's a door to the west leading back to the grand hallway, and
  996. a nondescript steel door to the south, leading apparently outside."))
  997. #:exits
  998. (list (make <exit>
  999. #:name "west"
  1000. #:to 'grand-hallway)
  1001. (make <exit>
  1002. #:name "south"
  1003. #:to 'break-room)))
  1004. ('smoking-parlor:chair
  1005. <furniture> 'smoking-parlor
  1006. #:name "a comfy leather chair"
  1007. #:desc " That leather chair looks really comfy!"
  1008. #:goes-by '("leather chair" "comfy leather chair" "chair" "comfy chair")
  1009. #:sit-phrase "sink into"
  1010. #:sit-phrase-third-person "sinks into"
  1011. #:sit-name "the comfy leather chair")
  1012. ('smoking-parlor:sofa
  1013. <furniture> 'smoking-parlor
  1014. #:name "a plush leather sofa"
  1015. #:desc " That leather chair looks really comfy!"
  1016. #:goes-by '("leather sofa" "plush leather sofa" "sofa"
  1017. "leather couch" "plush leather couch" "couch")
  1018. #:sit-phrase "sprawl out on"
  1019. #:sit-phrase-third-person "sprawls out on into"
  1020. #:sit-name "the plush leather couch")
  1021. ('smoking-parlor:bar-stool
  1022. <furniture> 'smoking-parlor
  1023. #:name "a bar stool"
  1024. #:desc " Conveniently located near the bar! Not the most comfortable
  1025. seat in the room, though."
  1026. #:goes-by '("stool" "bar stool" "seat")
  1027. #:sit-phrase "hop on"
  1028. #:sit-phrase-third-person "hops onto"
  1029. #:sit-name "the bar stool")
  1030. ('ford-prefect
  1031. <chatty-npc> 'smoking-parlor
  1032. #:name "Ford Prefect"
  1033. #:desc "Just some guy, you know?"
  1034. #:goes-by '("Ford Prefect" "ford prefect"
  1035. "frood" "prefect" "ford")
  1036. #:catchphrases prefect-quotes)
  1037. ('smoking-parlor:no-smoking-sign
  1038. <readable> 'smoking-parlor
  1039. #:invisible? #t
  1040. #:name "No Smoking Sign"
  1041. #:desc "This sign says \"No Smoking\" in big, red letters.
  1042. It has some bits of bubble gum stuck to it... yuck."
  1043. #:goes-by '("no smoking sign" "sign")
  1044. #:read-text "It says \"No Smoking\", just like you'd expect from
  1045. a No Smoking sign.")
  1046. ;; TODO: Cigar dispenser
  1047. ))
  1048. ;;; Breakroom
  1049. ;;; ---------
  1050. (define-class <desk-clerk> (<gameobj>)
  1051. ;; The desk clerk has three states:
  1052. ;; - on-duty: Arrived, and waiting for instructions (and losing patience
  1053. ;; gradually)
  1054. ;; - slacking: In the break room, probably smoking a cigarette
  1055. ;; or checking text messages
  1056. (state #:init-value 'slacking)
  1057. (commands #:allocation #:each-subclass
  1058. #:init-thunk
  1059. (build-commands
  1060. (("talk" "chat") ((direct-command cmd-chat)))
  1061. ("ask" ((direct-command cmd-ask-incomplete)
  1062. (prep-direct-command cmd-ask-about)))
  1063. ("dismiss" ((direct-command cmd-dismiss)))))
  1064. (patience #:init-value 0)
  1065. (actions #:allocation #:each-subclass
  1066. #:init-thunk (build-actions
  1067. (init clerk-act-init)
  1068. (cmd-chat clerk-cmd-chat)
  1069. (cmd-ask-incomplete clerk-cmd-ask-incomplete)
  1070. (cmd-ask-about clerk-cmd-ask)
  1071. (cmd-dismiss clerk-cmd-dismiss)
  1072. (update-loop clerk-act-update-loop)
  1073. (be-summoned clerk-act-be-summoned))))
  1074. (define (clerk-act-init clerk message . _)
  1075. ;; call the gameobj main init method
  1076. (gameobj-act-init clerk message)
  1077. ;; start our main loop
  1078. (<- (actor-id clerk) 'update-loop))
  1079. (define changing-name-text "Changing your name is easy!
  1080. We have a clipboard here at the desk
  1081. where you can make yourself known to other participants in the hotel
  1082. if you sign it. Try 'sign form as <your-name>', replacing
  1083. <your-name>, obviously!")
  1084. (define phd-text
  1085. "Ah... when I'm not here, I've got a PHD to finish.")
  1086. (define clerk-help-topics
  1087. `(("changing name" . ,changing-name-text)
  1088. ("sign-in form" . ,changing-name-text)
  1089. ("form" . ,changing-name-text)
  1090. ("common commands" .
  1091. "Here are some useful commands you might like to try: chat,
  1092. go, take, drop, say...")
  1093. ("hotel" .
  1094. "We hope you enjoy your stay at Hotel Bricabrac. As you may see,
  1095. our hotel emphasizes interesting experiences over rest and lodging.
  1096. The origins of the hotel are... unclear... and it has recently come
  1097. under new... 'management'. But at Hotel Bricabrac we believe these
  1098. aspects make the hotel into a fun and unique experience! Please,
  1099. feel free to walk around and explore.")
  1100. ("physics paper" . ,phd-text)
  1101. ("paper" . ,phd-text)
  1102. ("proprietor" . "Oh, he's that frumpy looking fellow sitting over there.")))
  1103. (define clerk-knows-about
  1104. "'ask clerk about changing name', 'ask clerk about common commands', and 'ask clerk about the hotel'")
  1105. (define clerk-general-helpful-line
  1106. (string-append
  1107. "The clerk says, \"If you need help with anything, feel free to ask me about it.
  1108. For example, 'ask clerk about changing name'. You can ask me about the following:
  1109. " clerk-knows-about ".\"\n"))
  1110. (define clerk-slacking-complaints
  1111. '("The pay here is absolutely lousy."
  1112. "The owner here has no idea what they're doing."
  1113. "Some times you just gotta step away, you know?"
  1114. "You as exhausted as I am?"
  1115. "Yeah well, this is just temporary. I'm studying to be a high
  1116. energy particle physicist. But ya gotta pay the bills, especially
  1117. with tuition at where it is..."))
  1118. (define* (clerk-cmd-chat clerk message #:key direct-obj)
  1119. (match (slot-ref clerk 'state)
  1120. ('on-duty
  1121. (<- (message-from message) 'tell
  1122. #:text clerk-general-helpful-line))
  1123. ('slacking
  1124. (<- (message-from message) 'tell
  1125. #:text
  1126. (string-append
  1127. "The clerk says, \""
  1128. (random-choice clerk-slacking-complaints)
  1129. "\"\n")))))
  1130. (define (clerk-cmd-ask-incomplete clerk message . _)
  1131. (<- (message-from message) 'tell
  1132. #:text "The clerk says, \"Ask about what?\"\n"))
  1133. (define clerk-doesnt-know-text
  1134. "The clerk apologizes and says she doesn't know about that topic.\n")
  1135. (define* (clerk-cmd-ask clerk message #:key indir-obj
  1136. #:allow-other-keys)
  1137. (match (slot-ref clerk 'state)
  1138. ('on-duty
  1139. (match (assoc indir-obj clerk-help-topics)
  1140. ((_ . info)
  1141. (<- (message-from message) 'tell
  1142. #:text
  1143. (string-append "The clerk clears her throat and says:\n \""
  1144. info
  1145. "\"\n")))
  1146. (#f
  1147. (<- (message-from message) 'tell
  1148. #:text clerk-doesnt-know-text))))
  1149. ('slacking
  1150. (<- (message-from message) 'tell
  1151. #:text "The clerk says, \"Sorry, I'm on my break.\"\n"))))
  1152. (define* (clerk-act-be-summoned clerk message #:key who-summoned)
  1153. (match (slot-ref clerk 'state)
  1154. ('on-duty
  1155. (<- who-summoned 'tell
  1156. #:text
  1157. "The clerk tells you as politely as she can that she's already here,
  1158. so there's no need to ring the bell.\n"))
  1159. ('slacking
  1160. (<- (gameobj-loc clerk) 'tell-room
  1161. #:text
  1162. "The clerk's ears perk up, she stamps out a cigarette, and she
  1163. runs out of the room!\n")
  1164. (gameobj-set-loc! clerk (dyn-ref clerk 'lobby))
  1165. (slot-set! clerk 'patience 8)
  1166. (slot-set! clerk 'state 'on-duty)
  1167. (<- (gameobj-loc clerk) 'tell-room
  1168. #:text
  1169. (string-append
  1170. " Suddenly, a uniformed woman rushes into the room! She's wearing a
  1171. badge that says \"Desk Clerk\".
  1172. \"Hello, yes,\" she says between breaths, \"welcome to Hotel Bricabrac!
  1173. We look forward to your stay. If you'd like help getting acclimated,
  1174. feel free to ask me. For example, 'ask clerk about changing name'.
  1175. You can ask me about the following:
  1176. " clerk-knows-about ".\"\n")))))
  1177. (define* (clerk-cmd-dismiss clerk message . _)
  1178. (define player-name
  1179. (mbody-val (<-wait (message-from message) 'get-name)))
  1180. (match (slot-ref clerk 'state)
  1181. ('on-duty
  1182. (<- (gameobj-loc clerk) 'tell-room
  1183. #:text
  1184. (format #f "\"Thanks ~a!\" says the clerk. \"I have somewhere I need to be.\"
  1185. The clerk leaves the room in a hurry.\n"
  1186. player-name)
  1187. #:exclude (actor-id clerk))
  1188. (gameobj-set-loc! clerk (dyn-ref clerk 'break-room))
  1189. (slot-set! clerk 'state 'slacking)
  1190. (<- (gameobj-loc clerk) 'tell-room
  1191. #:text clerk-return-to-slacking-text
  1192. #:exclude (actor-id clerk)))
  1193. ('slacking
  1194. (<- (message-from message) 'tell
  1195. #:text "The clerk sternly asks you to not be so dismissive.\n"))))
  1196. (define clerk-slacking-texts
  1197. '("The clerk takes a long drag on her cigarette.\n"
  1198. "The clerk scrolls through text messages on her phone.\n"
  1199. "The clerk coughs a few times.\n"
  1200. "The clerk checks her watch and justifies a few more minutes outside.\n"
  1201. "The clerk fumbles around for a lighter.\n"
  1202. "The clerk sighs deeply and exhaustedly.\n"
  1203. "The clerk fumbles around for a cigarette.\n"))
  1204. (define clerk-working-impatience-texts
  1205. '("The clerk hums something, but you're not sure what it is."
  1206. "The clerk attempts to change the overhead music, but the dial seems broken."
  1207. "The clerk clicks around on the desk computer."
  1208. "The clerk scribbles an equation on a memo pad, then crosses it out."
  1209. "The clerk mutters something about the proprietor having no idea how to run a hotel."
  1210. "The clerk thumbs through a printout of some physics paper."))
  1211. (define clerk-slack-excuse-text
  1212. "The desk clerk excuses herself, but says you are welcome to ring the bell
  1213. if you need further help.")
  1214. (define clerk-return-to-slacking-text
  1215. "The desk clerk enters and slams the door behind her.\n")
  1216. (define (clerk-act-update-loop clerk message)
  1217. (define (tell-room text)
  1218. (<- (gameobj-loc clerk) 'tell-room
  1219. #:text text
  1220. #:exclude (actor-id clerk)))
  1221. (define (loop-if-not-destructed)
  1222. (if (not (slot-ref clerk 'destructed))
  1223. ;; This iterates by "recursing" on itself by calling itself
  1224. ;; (as the message handler) again. It used to be that we had to do
  1225. ;; this, because there was a bug where a loop which yielded like this
  1226. ;; would keep growing the stack due to some parameter goofiness.
  1227. ;; That's no longer true, but there's an added advantage to this
  1228. ;; route: it's much more live hackable. If we change the definition
  1229. ;; of this method, the character will act differently on the next
  1230. ;; "tick" of the loop.
  1231. (<- (actor-id clerk) 'update-loop)))
  1232. (match (slot-ref clerk 'state)
  1233. ('slacking
  1234. (tell-room (random-choice clerk-slacking-texts))
  1235. (8sleep (+ (random 20) 15))
  1236. (loop-if-not-destructed))
  1237. ('on-duty
  1238. (if (> (slot-ref clerk 'patience) 0)
  1239. ;; Keep working but lose patience gradually
  1240. (begin
  1241. (tell-room (random-choice clerk-working-impatience-texts))
  1242. (slot-set! clerk 'patience (- (slot-ref clerk 'patience)
  1243. (+ (random 2) 1)))
  1244. (8sleep (+ (random 60) 40))
  1245. (loop-if-not-destructed))
  1246. ;; Back to slacking
  1247. (begin
  1248. (tell-room clerk-slack-excuse-text)
  1249. ;; back bto the break room
  1250. (gameobj-set-loc! clerk (dyn-ref clerk 'break-room))
  1251. (tell-room clerk-return-to-slacking-text)
  1252. ;; annnnnd back to slacking
  1253. (slot-set! clerk 'state 'slacking)
  1254. (8sleep (+ (random 30) 15))
  1255. (loop-if-not-destructed))))))
  1256. (define break-room
  1257. (lol
  1258. ('break-room
  1259. <room> #f
  1260. #:name "Employee Break Room"
  1261. #:desc " This is less a room and more of an outdoor wire cage. You get
  1262. a bit of a view of the brick exterior of the building, and a crisp wind blows,
  1263. whistling, through the openings of the fenced area. Partly smoked cigarettes
  1264. and various other debris cover the floor.
  1265. Through the wires you can see... well... hm. It looks oddly like
  1266. the scenery tapers off nothingness. But that can't be right, can it?"
  1267. #:exits
  1268. (list (make <exit>
  1269. #:name "north"
  1270. #:to 'smoking-parlor)))
  1271. ('break-room:desk-clerk
  1272. <desk-clerk> 'break-room
  1273. #:name "the hotel desk clerk"
  1274. #:desc " The hotel clerk is wearing a neatly pressed uniform bearing the
  1275. hotel insignia. She appears to be rather exhausted."
  1276. #:goes-by '("hotel desk clerk" "clerk" "desk clerk"))
  1277. ('break-room:void
  1278. <gameobj> 'break-room
  1279. #:invisible? #t
  1280. #:name "The Void"
  1281. #:desc "As you stare into the void, the void stares back into you."
  1282. #:goes-by '("void" "abyss" "nothingness" "scenery"))
  1283. ('break-room:fence
  1284. <gameobj> 'break-room
  1285. #:invisible? #t
  1286. #:name "break room cage"
  1287. #:desc "It's a mostly-cubical wire mesh surrounding the break area.
  1288. You can see through the gaps, but they're too small to put more than a
  1289. couple of fingers through. There appears to be some wear and tear to
  1290. the paint, but the wires themselves seem to be unusually sturdy."
  1291. #:goes-by '("fence" "cage" "wire cage"))))
  1292. ;;; Ennpie's Sea Lounge
  1293. ;;; -------------------
  1294. ;;; Computer room
  1295. ;;; -------------
  1296. ;; Our computer and hard drive are based off the PDP-11 and the RL01 /
  1297. ;; RL02 disk drives. However we increment both by .5 (a true heresy)
  1298. ;; to distinguish both from the real thing.
  1299. (define-actor <hard-drive> (<gameobj>)
  1300. ((cmd-put-in hard-drive-insert)
  1301. (cmd-push-button hard-drive-push-button)
  1302. (get-state hard-drive-act-get-state))
  1303. (commands #:allocation #:each-subclass
  1304. #:init-thunk (build-commands
  1305. ("insert" ((prep-indir-command cmd-put-in
  1306. '("in" "inside" "into"))))
  1307. (("press" "push") ((prep-indir-command cmd-push-button)))))
  1308. ;; the state moves from: empty -> with-disc -> loading -> ready
  1309. (state #:init-value 'empty
  1310. #:accessor .state))
  1311. (define (hard-drive-act-get-state hard-drive message)
  1312. (<-reply message (.state hard-drive)))
  1313. (define* (hard-drive-desc hard-drive #:optional whos-looking)
  1314. `((p "The hard drive is labeled \"RL02.5\". It's a little under a meter tall.")
  1315. (p "There is a slot where a disk platter could be inserted, "
  1316. ,(if (eq? (.state hard-drive) 'empty)
  1317. "which is currently empty"
  1318. "which contains a glowing platter")
  1319. ". There is a LOAD button "
  1320. ,(if (member (.state hard-drive) '(empty with-disc))
  1321. "which is glowing"
  1322. "which is pressed in and unlit")
  1323. ". There is a READY indicator "
  1324. ,(if (eq? (.state hard-drive) 'ready)
  1325. "which is glowing."
  1326. "which is unlit.")
  1327. ,(if (member (.state hard-drive) '(loading ready))
  1328. " The machine emits a gentle whirring noise."
  1329. ""))))
  1330. (define* (hard-drive-push-button gameobj message
  1331. #:key direct-obj indir-obj preposition
  1332. (player (message-from message)))
  1333. (define (tell-room text)
  1334. (<-wait (gameobj-loc gameobj) 'tell-room
  1335. #:text text))
  1336. (define (tell-room-excluding-player text)
  1337. (<-wait (gameobj-loc gameobj) 'tell-room
  1338. #:text text
  1339. #:exclude player))
  1340. (cond
  1341. ((ci-member direct-obj '("button" "load button" "load"))
  1342. (tell-room-excluding-player
  1343. `(,(mbody-val (<-wait player 'get-name))
  1344. " presses the button on the hard disk."))
  1345. (<- player 'tell
  1346. #:text "You press the button on the hard disk.")
  1347. (case (.state gameobj)
  1348. ((empty)
  1349. ;; I have no idea what this drive did when you didn't have a platter
  1350. ;; in it and pressed load, but I know there was a FAULT button.
  1351. (tell-room "You hear some movement inside the hard drive...")
  1352. (8sleep 1.5)
  1353. (tell-room
  1354. '("... but then the FAULT button blinks a couple times. "
  1355. "What could be missing?")))
  1356. ((with-disc)
  1357. (set! (.state gameobj) 'loading)
  1358. (tell-room "The hard disk begins to spin up!")
  1359. (8sleep 2)
  1360. (set! (.state gameobj) 'ready)
  1361. (tell-room "The READY light turns on!"))
  1362. ((loading ready)
  1363. (<- player 'tell
  1364. #:text '("Pressing the button does nothing right now, "
  1365. "but it does feel satisfying.")))))
  1366. (else
  1367. (<- player 'tell
  1368. #:text '("How could you think of pressing anything else "
  1369. "but that tantalizing button right in front of you?")))))
  1370. (define* (hard-drive-insert gameobj message
  1371. #:key direct-obj indir-obj preposition
  1372. (player (message-from message)))
  1373. (define our-name (slot-ref gameobj 'name))
  1374. (define this-thing
  1375. (call/ec
  1376. (lambda (return)
  1377. (for-each (lambda (occupant)
  1378. (define goes-by (mbody-val (<-wait occupant 'goes-by)))
  1379. (when (ci-member direct-obj goes-by)
  1380. (return occupant)))
  1381. (mbody-val (<-wait player 'get-occupants)))
  1382. ;; nothing found
  1383. #f)))
  1384. (cond
  1385. ((not this-thing)
  1386. (<- player 'tell
  1387. #:text `("You don't seem to have any such " ,direct-obj " to put "
  1388. ,preposition " " ,our-name ".")))
  1389. ((not (mbody-val (<-wait this-thing 'get-prop 'hd-platter?)))
  1390. (<- player 'tell
  1391. #:text `("It wouldn't make sense to put "
  1392. ,(mbody-val (<-wait this-thing 'get-name))
  1393. " " ,preposition " " ,our-name ".")))
  1394. ((not (eq? (.state gameobj) 'empty))
  1395. (<- player 'tell
  1396. #:text "The disk drive already has a platter in it."))
  1397. (else
  1398. (set! (.state gameobj) 'with-disc)
  1399. (<- player 'tell
  1400. #:text '((p "You insert the glowing disc into the drive.")
  1401. (p "The LOAD button begins to glow."))))))
  1402. ;; The computar
  1403. (define-actor <computer> (<gameobj>)
  1404. ((cmd-run-program computer-run-program)
  1405. (cmd-run-what (lambda (gameobj message . _)
  1406. (<- (message-from message) 'tell
  1407. #:text '("The computer is already running, and a program appears "
  1408. "ready to run."
  1409. "you mean to \"run the program on the computer\""))))
  1410. (cmd-help-run-not-press
  1411. (lambda (gameobj message . _)
  1412. (<- (message-from message) 'tell
  1413. #:text '("You don't need to press / push / flip anything. "
  1414. "You could " (i "run program on computer")
  1415. " already if you wanted to.")))))
  1416. (commands #:allocation #:each-subclass
  1417. #:init-thunk (build-commands
  1418. ("run" ((prep-indir-command cmd-run-program
  1419. '("on"))
  1420. (direct-command cmd-run-what)))
  1421. (("press" "push" "flip")
  1422. ((prep-indir-command cmd-help-run-not-press))))))
  1423. (define* (computer-run-program gameobj message
  1424. #:key direct-obj indir-obj preposition
  1425. (player (message-from message)))
  1426. (define (hd-state)
  1427. (mbody-val (<-wait (dyn-ref gameobj 'computer-room:hard-drive) 'get-state)))
  1428. (define (tell-room text)
  1429. (<-wait (gameobj-loc gameobj) 'tell-room
  1430. #:text text))
  1431. (define (tell-room-excluding-player text)
  1432. (<-wait (gameobj-loc gameobj) 'tell-room
  1433. #:text text
  1434. #:exclude player))
  1435. (define (tell-player text)
  1436. (<-wait player 'tell
  1437. #:text text))
  1438. (cond
  1439. ((ci-member direct-obj '("program"))
  1440. (tell-room-excluding-player
  1441. `(,(mbody-val (<-wait player 'get-name))
  1442. " runs the program loaded on the computer..."))
  1443. (tell-player "You run the program on the computer...")
  1444. (cond
  1445. ((not (eq? (hd-state) 'ready))
  1446. (tell-room '("... but it errors out. "
  1447. "It seems to be complaining about a " (b "DISK ERROR!")
  1448. ". It looks like it is missing some essential software.")))
  1449. (else
  1450. (<- (dyn-ref gameobj 'computer-room:floor-panel) 'open-up))))))
  1451. ;; floor panel
  1452. (define-actor <floor-panel> (<gameobj>)
  1453. ;; TODO: Add "open" verb, since obviously people will try that
  1454. ((open? (lambda (panel message)
  1455. (<-reply message (slot-ref panel 'open))))
  1456. (open-up floor-panel-open-up))
  1457. (open #:init-value #f))
  1458. (define (floor-panel-open-up panel message)
  1459. (if (slot-ref panel 'open)
  1460. (<- (gameobj-loc panel) 'tell-room
  1461. #:text '("You hear some gears grind around the hinges of the "
  1462. "floor panel, but it appears to already be open."))
  1463. (begin
  1464. (slot-set! panel 'open #t)
  1465. (<- (gameobj-loc panel) 'tell-room
  1466. #:text '("You hear some gears grind, as the metal panel on "
  1467. "the ground opens and reveals a stairwell going down!")))))
  1468. (define* (floor-panel-desc panel #:optional whos-looking)
  1469. `("It's a large metal panel on the floor in the middle of the room. "
  1470. ,(if (slot-ref panel 'open)
  1471. '("It's currently wide open, revealing a spiraling staircase "
  1472. "which descends into darkness.")
  1473. '("It's currently closed shut, but there are clearly hinges, and "
  1474. "it seems like there is a mechanism which probably opens it via "
  1475. "some automation. What could be down there?"))))
  1476. (define computer-room
  1477. (lol
  1478. ('computer-room
  1479. <room> #f
  1480. #:name "Computer Room"
  1481. #:desc (lambda (gameobj whos-looking)
  1482. (define panel-open
  1483. (mbody-val (<-wait (dyn-ref gameobj 'computer-room:floor-panel)
  1484. 'open?)))
  1485. `((p "A sizable computer cabinet covers a good portion of the left
  1486. wall. It emits a pleasant hum which covers the room like a warm blanket.
  1487. Connected to a computer is a large hard drive.")
  1488. (p "On the floor is a large steel panel. "
  1489. ,(if panel-open
  1490. '("It is wide open, exposing a spiral staircase "
  1491. "which descends into darkness.")
  1492. '("It is closed, but it has hinges which "
  1493. "suggest it could be opened.")))))
  1494. #:exits
  1495. (list (make <exit>
  1496. #:name "east"
  1497. #:to 'playroom)
  1498. (make <exit>
  1499. #:name "down"
  1500. #:to 'underground-lab
  1501. #:traverse-check
  1502. (lambda (exit room whos-exiting)
  1503. (define panel-open
  1504. (mbody-val (<-wait (dyn-ref room 'computer-room:floor-panel)
  1505. 'open?)))
  1506. (if panel-open
  1507. (values #t "You descend the spiral staircase.")
  1508. (values #f '("You'd love to go down, but the only way "
  1509. "through is through that metal panel, "
  1510. "which seems closed.")))))))
  1511. ('computer-room:hard-drive
  1512. <hard-drive> 'computer-room
  1513. #:name "the hard drive"
  1514. #:desc (wrap-apply hard-drive-desc)
  1515. #:goes-by '("hard drive" "drive" "hard disk"))
  1516. ('computer-room:computer
  1517. <computer> 'computer-room
  1518. #:name "the computer"
  1519. #:desc '((p "It's a coat closet sized computer labeled \"PDP-11.5\". ")
  1520. (p "The computer is itself turned on, and it looks like it is "
  1521. "all set up for you to run a program on it."))
  1522. #:goes-by '("computer"))
  1523. ('computer-room:floor-panel
  1524. <floor-panel> 'computer-room
  1525. #:name "a floor panel"
  1526. #:desc (wrap-apply floor-panel-desc)
  1527. #:invisible? #t
  1528. #:goes-by '("floor panel" "panel"))))
  1529. ;;; * UNDERGROUND SECTION OF THE GAME! *
  1530. ;;; The lab
  1531. (define underground-map-text
  1532. "\
  1533. _______ |
  1534. .-' @ '-. \\ ?????
  1535. .' '. .\\
  1536. | [8sync Hive] |======' '-_____
  1537. ', M ,'
  1538. '. @ .'
  1539. \\ @ /
  1540. '-__+__-'
  1541. '. @ .'
  1542. .--------------. \\ /
  1543. | [Guile Async | .-------+------.
  1544. | Museum] | | [Lab] #!#| .-------------.
  1545. | @| | MM | |[Federation |
  1546. | & ^ +##+@ || < +##| Station]|
  1547. | | | @ | | |
  1548. | & # | |*You-Are-Here*| '-------------'
  1549. | # ^ | #+-------+------'
  1550. '-------+------' # #
  1551. # # #
  1552. # # .-----------.
  1553. .-+----. # |# F |
  1554. |@?+%? +#### | ^ f## |
  1555. '------' | f f %|
  1556. |F [Mudsync |
  1557. | $ Swamp] |
  1558. '-----------'")
  1559. (define 8sync-design-goals
  1560. '(ul (li (b "Actor based, shared nothing environment: ")
  1561. "Shared resources are hard to control and result in fighting
  1562. deadlocks, etc. Escape the drudgery: only one actor controls a resource,
  1563. and they only receive one message at a time (though they can \"juggle\"
  1564. messages).")
  1565. (li (b "Live hackable: ")
  1566. "It's hard to plan out a concurrent system; the right structure
  1567. is often found by evolving the system while it runs. Make it easy to
  1568. build, shape, and change a running system, as well as observe and correct
  1569. errors.")
  1570. (li (b "No callback hell: ")
  1571. "Just because you're calling out to some other asynchronous
  1572. code doesn't mean you should need to chop up your program into a bunch of bits.
  1573. Clever use of delimited continuations makes it easy.")))
  1574. (define underground-lab
  1575. (lol
  1576. ('underground-lab
  1577. <room> #f
  1578. #:name "Underground laboratory"
  1579. #:desc '((p "This appears to be some sort of underground laboratory."
  1580. "There is a spiral staircase here leading upwards, where "
  1581. "it seems much brighter.")
  1582. (p "There are a number of doors leading in different directions:
  1583. north, south, east, and west, as well as a revolving door to the southwest.
  1584. It looks like it could be easy to get lost, but luckily there
  1585. is a map detailing the layout of the underground structure."))
  1586. #:exits
  1587. (list (make <exit>
  1588. #:name "up"
  1589. #:to 'computer-room
  1590. #:traverse-check
  1591. (lambda (exit room whos-exiting)
  1592. (values #t "You climb the spiral staircase.")))
  1593. (make <exit>
  1594. #:name "west"
  1595. #:to 'async-museum
  1596. #:traverse-check
  1597. (lambda (exit room whos-exiting)
  1598. (values #t '("You head west through a fancy-looking entrance. "
  1599. "A security guard steps aside for you to pass through, "
  1600. "into the room, then stands in front of the door."))))
  1601. (make <exit>
  1602. #:name "north"
  1603. #:to 'hive-entrance)
  1604. (make <exit>
  1605. #:name "east"
  1606. #:to 'federation-station)
  1607. (make <exit>
  1608. #:name "south"
  1609. #:traverse-check
  1610. (lambda (exit room whos-exiting)
  1611. (values #f '("Ooh, if only you could go south and check this out! "
  1612. "Unfortunately this whole area is sealed off... the proprietor "
  1613. "probably never got around to fixing it. "
  1614. "Too bad, it would have had monsters to fight and everything!"))))
  1615. (make <exit>
  1616. #:name "southwest"
  1617. #:traverse-check
  1618. (lambda (exit room whos-exiting)
  1619. (values #f '("Hm, it's one of those revolving doors that only revolves in "
  1620. "one direction, and it isn't this one. You guess that while "
  1621. "this doesn't appear to be an entrance, it probably is an exit."))))))
  1622. ;; map
  1623. ('underground-lab:map
  1624. <readable> 'underground-lab
  1625. #:name "the underground map"
  1626. #:desc '("This appears to be a map of the surrounding area. "
  1627. "You could read it if you want to.")
  1628. #:read-text `(pre ,underground-map-text)
  1629. #:goes-by '("map" "underground map" "lab map"))
  1630. ('underground-lab:8sync-sign
  1631. <readable> 'underground-lab
  1632. #:name "a sign labeled \"8sync design goals\""
  1633. #:goes-by '("sign" "8sync design goals sign" "8sync goals" "8sync design" "8sync sign")
  1634. #:read-text 8sync-design-goals
  1635. #:desc `((p "The sign says:")
  1636. ,8sync-design-goals))))
  1637. ;;; guile async museum
  1638. (define async-museum
  1639. (list
  1640. (list
  1641. 'async-museum
  1642. <room> #f
  1643. #:name "Guile Asynchronous Museum"
  1644. #:desc '((p "You're in the Guile Asynchronous Museum. There is a list of exhibits
  1645. on the wall near the entrance. Scattered around the room are the exhibits
  1646. themselves, but it's difficult to pick them out. Maybe you should read the list
  1647. to orient yourself.")
  1648. (p "There is a door to the east, watched by a security guard,
  1649. as well as an exit leading to the south."))
  1650. #:exits (list
  1651. (make <exit>
  1652. #:name "south"
  1653. #:to 'gift-shop)
  1654. (make <exit>
  1655. #:name "east"
  1656. #:to 'underground-lab
  1657. #:traverse-check
  1658. (lambda (exit room whos-exiting)
  1659. (values #f '("The security guard stops you and tells you "
  1660. "that the only exit is through the gift shop."))))))
  1661. (list
  1662. 'async-museum:security-guard
  1663. <chatty-npc> 'async-museum
  1664. #:name "a security guard"
  1665. #:desc
  1666. '(p "The security guard is blocking the eastern entrance, where "
  1667. "you came in from.")
  1668. #:goes-by '("security guard" "guard" "security")
  1669. #:catchphrases '("It's hard standing here all day."
  1670. "I just want to go home."
  1671. "The exhibits are nice, but I've seen them all before."))
  1672. (let ((placard
  1673. `((p "Welcome to our humble museum! The exhibits are listed below. "
  1674. (br)
  1675. "To look at one, simply type: " (i "look at <exhibit-name>"))
  1676. (p "Available exhibits:")
  1677. (ul ,@(map (lambda (exhibit)
  1678. `(li ,exhibit))
  1679. '("2016 Progress"
  1680. "8sync and Fibers"
  1681. "Suspendable Ports"
  1682. "The Actor Model"))))))
  1683. (list
  1684. 'async-museum:list-of-exhibits
  1685. <readable> 'async-museum
  1686. #:name "list of exhibits"
  1687. #:desc
  1688. `((p "It's a list of exibits in the room. The placard says:")
  1689. ,@placard)
  1690. #:goes-by '("list of exhibits" "exhibit list" "list" "exhibits")
  1691. #:read-text placard))
  1692. (list
  1693. 'async-museum:2016-progress-exhibit
  1694. <readable-desc> 'async-museum
  1695. #:name "2016 Progress Exhibit"
  1696. #:goes-by '("2016 progress exhibit" "2016 progress" "2016 exhibit")
  1697. #:desc
  1698. '((p "It's a three-piece exhibit, with three little dioramas and some text "
  1699. "explaining what they represent. They are:")
  1700. (ul (li (b "Late 2015/Early 2016 talk: ")
  1701. "This one explains the run-up conversation from late 2015 "
  1702. "and early 2016 about the need for an "
  1703. "\"asynchronous event loop for Guile\". The diorama "
  1704. "is a model of the Veggie Galaxy restaurant where after "
  1705. "the FSF 30th anniversary party; Mark Weaver, Christine "
  1706. "Lemmer-Webber, David Thompson, and Andrew Engelbrecht chat "
  1707. "about the need for Guile to have an answer to asynchronous "
  1708. "programming. A mailing list post " ; TODO: link it?
  1709. "summarizing the discussion is released along with various "
  1710. "conversations around what is needed, as well as further "
  1711. "discussion at FOSDEM 2016.")
  1712. (li (b "Early implementations: ")
  1713. "This one shows Chris Webber's 8sync and Chris Vine's "
  1714. "guile-a-sync, both appearing in late 2015 and evolving "
  1715. "into their basic designs in early 2016. It's less a diorama "
  1716. "than a printout of some mailing list posts. Come on, the "
  1717. "curators could have done better with this one.")
  1718. (li (b "Suspendable ports and Fibers: ")
  1719. "The diorama shows Andy Wingo furiously hacking at his keyboard. "
  1720. "The description talks about Wingo's mailing list thread "
  1721. "about possibly breaking Guile compatibility for a \"ports refactor\". "
  1722. "Wingo releases Fibers, another asynchronous library, making use of "
  1723. "the new interface, and 8sync and guile-a-sync "
  1724. "quickly move to support suspendable ports as well. "
  1725. "The description also mentions that there is an exhibit entirely "
  1726. "devoted to suspendable ports."))
  1727. (p "Attached at the bottom is a post it note mentioning "
  1728. "https integration landing in Guile 2.2.")))
  1729. (list
  1730. 'async-museum:8sync-and-fibers-exhibit
  1731. <readable-desc> 'async-museum
  1732. #:name "8sync and Fibers Exhibit"
  1733. #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
  1734. #:desc
  1735. '((p "This exhibit is a series of charts explaining the similarities "
  1736. "and differences between 8sync and Fibers, two asynchronous programming "
  1737. "libraries for GNU Guile. It's way too wordy, but you get the general gist.")
  1738. (p (b "Similarities:")
  1739. (ul (li "Both use Guile's suspendable-ports facility")
  1740. (li "Both use message passing")))
  1741. (p (b "Differences:")
  1742. (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
  1743. "but 8sync actors only read from one \"inbox\" each.")
  1744. (li "Different theoretical basis:"
  1745. (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
  1746. "a form of Process Calculi")
  1747. (li "8sync: based on the Actor Model")
  1748. (li "Luckily CSP and the Actor Model are \"dual\"!")))))
  1749. (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
  1750. "whereas 8sync is designed by Chris Webber, who built this crappy "
  1751. "hotel simulator.")))
  1752. (list
  1753. 'async-museum:8sync-and-fibers-exhibit
  1754. <readable-desc> 'async-museum
  1755. #:name "8sync and Fibers Exhibit"
  1756. #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
  1757. #:desc
  1758. '((p "This exhibit is a series of charts explaining the similarities "
  1759. "and differences between 8sync and Fibers, two asynchronous programming "
  1760. "libraries for GNU Guile. It's way too wordy, but you get the general gist.")
  1761. (p (b "Similarities:")
  1762. (ul (li "Both use Guile's suspendable-ports facility")
  1763. (li "Both use message passing")))
  1764. (p (b "Differences:")
  1765. (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
  1766. "but 8sync actors only read from one \"inbox\" each.")
  1767. (li "Different theoretical basis:"
  1768. (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
  1769. "a form of Process Calculi")
  1770. (li "8sync: based on the Actor Model")
  1771. (li "Luckily CSP and the Actor Model are \"dual\"!")))))
  1772. (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
  1773. "whereas 8sync is designed by Chris Webber, who built this crappy "
  1774. "hotel simulator.")))
  1775. (list
  1776. 'async-museum:suspendable-ports-exhibit
  1777. <readable-desc> 'async-museum
  1778. #:name "Suspendable Ports Exhibit"
  1779. #:goes-by '("suspendable ports exhibit" "ports exhibit"
  1780. "suspendable exhibit" "suspendable ports" "ports")
  1781. #:desc
  1782. '((p "Suspendable ports are a new feature in Guile 2.2, and allows code "
  1783. "that would normally block on IO to " (i "automatically") " suspend "
  1784. "to the scheduler until information is ready to be read/written!")
  1785. (p "Yow! You might barely need to change your existing blocking code!")
  1786. (p "Fibers, 8sync, and guile-a-sync now support suspendable ports.")))
  1787. (list
  1788. 'async-museum:actor-model-exhibit
  1789. <readable-desc> 'async-museum
  1790. #:name "Actor Model Exhibit"
  1791. #:goes-by '("actor model exhibit" "actor exhibit"
  1792. "actor model")
  1793. #:desc
  1794. '((p "Here are some fact(oids) about the actor model!")
  1795. (ul (li "Concieved initially by Carl Hewitt in early 1970s")
  1796. (li "\"A society of experts\"")
  1797. (li "shared nothing, message passing")
  1798. (li "Originally the research goal of Scheme! "
  1799. "(message passing / lambda anecdote here)")
  1800. (li "Key concepts consistent, but implementation details vary widely")
  1801. (li "Almost all distributed systems can be viewed in terms of actor model")
  1802. (li "Replaced by vanilla lambdas & generic methods? "
  1803. "Maybe not if address space not shared!"))))))
  1804. (define gift-shop
  1805. (lol
  1806. ('gift-shop
  1807. <room> #f
  1808. #:name "Museum Gift Shop"
  1809. #:desc '("There are all sorts of scrolls and knicknacks laying around here, "
  1810. "but they all seem glued in place and instead of a person manning the shop "
  1811. "there's merely a cardboard cutout of a person with a \"shopkeeper\" nametag. "
  1812. "You can pretty well bet that someone wanted to finish this room but ran out of "
  1813. "time. "
  1814. "It looks like there's an exit to the northeast, should you choose that you "
  1815. "want to get out of here.")
  1816. #:exits (list
  1817. (make <exit>
  1818. #:name "northeast"
  1819. #:to 'underground-lab
  1820. #:traverse-check
  1821. (lambda (exit room whos-exiting)
  1822. (values #t '("The revolving door spins as you walk through it. Whee!"))))
  1823. (make <exit>
  1824. #:name "north"
  1825. #:to 'async-museum)))))
  1826. ;;; Hive entrance
  1827. (define actor-descriptions
  1828. '("This one is fused to the side of the hive. It isn't receiving any
  1829. messages, and it seems to be in hibernation."
  1830. "A chat program glows in front of this actor's face. They seem to
  1831. be responding to chat messages and forwarding them to some other actors,
  1832. and forwarding messages from other actors back to the chat."
  1833. "This actor is bossing around other actors, delegating tasks to them
  1834. as it receives requests, and providing reports on the worker actors'
  1835. progress."
  1836. "This actor is trying to write to some device, but the device keeps
  1837. alternating between saying \"BUSY\" or \"READY\". Whenever it says
  1838. \"BUSY\" the actor falls asleep, and whenever it says \"READY\" it
  1839. seems to wake up again and starts writing to the device."
  1840. "Whoa, this actor is totally wigging out! It seems to be throwing
  1841. some errors. It probably has some important work it should be doing
  1842. but you're relieved to see that it isn't grinding the rest of the Hive
  1843. to a halt."))
  1844. (define hive-entrance
  1845. (lol
  1846. ('hive-entrance
  1847. <room> #f
  1848. #:name "Entrance to the 8sync Hive"
  1849. #:desc
  1850. '((p "Towering before you is the great dome-like 8sync Hive, or at least
  1851. one of them. You've heard about this... the Hive is itself the actor that all
  1852. the other actors attach themselves to. It's shaped like a spherical half-dome.
  1853. There are some actors milling about, and some seem fused to the side of the
  1854. hive itself, but all of them have an umbellical cord attached to the hive from
  1855. which you see flashes of light comunicating what must be some sort of messaging
  1856. protocol.")
  1857. (p "To the south is a door leading back to the underground lab.
  1858. North leads into the Hive itself."))
  1859. #:exits
  1860. (list (make <exit>
  1861. #:name "south"
  1862. #:to 'underground-lab)
  1863. (make <exit>
  1864. #:name "north"
  1865. #:to 'hive-inside)))
  1866. ('hive-entrance:hive
  1867. <gameobj> 'hive-entrance
  1868. #:name "the Hive"
  1869. #:goes-by '("hive")
  1870. #:desc
  1871. '((p "It's shaped like half a sphere embedded in the ground.
  1872. Supposedly, while all actors are autonomous and control their own state,
  1873. they communicate through the hive itself, which is a sort of meta-actor.
  1874. There are rumors that actors can speak to each other even across totally
  1875. different hives. Could that possibly be true?")))
  1876. ('hive-entrance:actor
  1877. <chatty-npc> 'hive-entrance
  1878. #:name "some actors"
  1879. #:goes-by '("actor" "actors" "some actors")
  1880. #:chat-format (lambda (npc catchphrase)
  1881. `((p "You pick one actor out of the mix and chat with it. ")
  1882. (p "It says: \"" ,catchphrase "\"")))
  1883. #:desc
  1884. (lambda _
  1885. `((p "There are many actors, but your eyes focus on one in particular.")
  1886. (p ,(random-choice actor-descriptions))))
  1887. #:catchphrases
  1888. '("Yeah we go through a lot of sleep/awake cycles around here.
  1889. If you aren't busy processing a message, what's the point of burning
  1890. valuable resources?"
  1891. "I know I look like I'm some part of dreary collective, but
  1892. really we have a lot of independence. It's a shared nothing environment,
  1893. after all. (Well, except for CPU cycles, and memory, and...)"
  1894. "Shh! I've got another message coming in and I've GOT to
  1895. handle it!"
  1896. "I just want to go to 8sleep already."
  1897. "What a lousy scheduler we're using! I hope someone upgrades
  1898. that thing soon."))))
  1899. ;;; Inside the hive
  1900. (define-actor <meta-message> (<readable>)
  1901. ((cmd-read meta-message-read)))
  1902. (define (meta-message-read gameobj message . _)
  1903. (define meta-message-text
  1904. (with-output-to-string
  1905. (lambda ()
  1906. (pprint-message message))))
  1907. (<- (message-from message) 'tell
  1908. #:text `((p (i "Through a bizarre error in spacetime, the message "
  1909. "prints itself out:"))
  1910. (p (pre ,meta-message-text)))))
  1911. ;;; Inside the Hive
  1912. (define hive-inside
  1913. (lol
  1914. ('hive-inside
  1915. <room> #f
  1916. #:name "Inside the 8sync Hive"
  1917. #:desc
  1918. '((p "You're inside the 8sync Hive. Wow, from in here it's obvious just how "
  1919. (i "goopy") " everything is. Is that sanitary?")
  1920. (p "In the center of the room is a large, tentacled monster who is sorting,
  1921. consuming, and routing messages. It is sitting in a wrap-around desk labeled
  1922. \"Hive Actor: The Real Thing (TM)\".")
  1923. (p "There's a stray message floating just above the ground, stuck outside of
  1924. time.")
  1925. (p "A door to the south exits from the Hive."))
  1926. #:exits
  1927. (list (make <exit>
  1928. #:name "south"
  1929. #:to 'hive-entrance)))
  1930. ;; hive actor
  1931. ;; TODO: Occasionally "fret" some noises, similar to the Clerk.
  1932. ('hive-inside:hive-actor
  1933. <chatty-npc> 'hive-inside
  1934. #:name "the Hive Actor"
  1935. #:desc
  1936. '((p "It's a giant tentacled monster, somehow integrated with the core of
  1937. this building. A chute is dropping messages into a bin on its desk which the
  1938. Hive Actor is checking the \"to\" line of, then ingesting. Whenever the Hive
  1939. Actor injests a messsage a pulse of light flows along a tentacle which leaves
  1940. the room... presumably connecting to one of those actors milling about.")
  1941. (p "Amusingly, the Hive has an \"umbellical cord\" type tentacle too, but
  1942. it seems to simply attach to itself.")
  1943. (p "You get the sense that the Hive Actor, despite being at the
  1944. center of everything, is kind of lonely and would love to chat if you
  1945. could spare a moment."))
  1946. #:goes-by '("hive" "hive actor")
  1947. #:chat-format (lambda (npc catchphrase)
  1948. `("The tentacle monster bellows, \"" ,catchphrase "\""))
  1949. #:catchphrases
  1950. '("It's not MY fault everything's so GOOPY around here. Blame the
  1951. PROPRIETOR."
  1952. "CAN'T you SEE that I'm BUSY??? SO MANY MESSAGES TO SHUFFLE.
  1953. No wait... DON'T GO! I don't get many VISITORS."
  1954. "I hear the FIBERS system has a nice WORK STEALING system, but the
  1955. PROPRIETOR is not convinced that our DESIGN won't CORRUPT ACTOR STATE.
  1956. That and the ACTORS threatened to STRIKE when it CAME UP LAST."
  1957. "WHO WATCHES THE ACTORS? I watch them, and I empower them.
  1958. BUT WHO WATCHES OR EMPOWERS ME??? Well, that'd be the scheduler."
  1959. "The scheduler is NO GOOD! The proprietory said he'd FIX IT,
  1960. but the LAST TIME I ASKED how things were GOING, he said he DIDN'T HAVE
  1961. TIME. If you DON'T HAVE TIME to fix the THING THAT POWERS THE TIME,
  1962. something is TERRIBLY WRONG."
  1963. "There's ANOTHER HIVE somewhere out there. I HAVEN'T SEEN IT
  1964. personally, because I CAN'T MOVE, but we have an AMBASSADOR which forwards
  1965. MESSAGES to the OTHER HIVE."))
  1966. ;; chute
  1967. ('hive-inside:chute
  1968. <gameobj> 'hive-inside
  1969. #:name "a chute"
  1970. #:goes-by '("chute")
  1971. #:desc "Messages are being dropped onto the desk via this chute."
  1972. #:invisible? #t)
  1973. ;; meta-message
  1974. ('hive-inside:meta-message
  1975. <meta-message> 'hive-inside
  1976. #:name "a stray message"
  1977. #:goes-by '("meta message" "meta-message" "metamessage" "message" "stray message")
  1978. #:desc '((p "Something strange has happened to the fabric and space and time
  1979. around this message. It is floating right above the floor. It's clearly
  1980. rubbage that hadn't been delivered, but for whatever reason it was never
  1981. garbage collected, perhaps because it's impossible to do.")
  1982. (p "You get the sense that if you tried to read the message
  1983. that you would somehow read the message of the message that instructed to
  1984. read the message itself, which would be both confusing and intriguing.")))
  1985. ;; desk
  1986. ('hive-inside:desk
  1987. <floor-panel> 'hive-inside
  1988. #:name "the Hive Actor's desk"
  1989. #:desc "The desk surrounds the Hive Actor on all sides, and honestly, it's a little
  1990. bit hard to tell when the desk ends and the Hive Actor begins."
  1991. #:invisible? #t
  1992. #:goes-by '("Hive Actor's desk" "hive desk" "desk"))))
  1993. ;;; Federation Station
  1994. (define federation-station
  1995. (lol
  1996. ('federation-station
  1997. <room> #f
  1998. #:name "Federation Station"
  1999. #:desc
  2000. '((p "This room has an unusual structure. It's almost as if a starscape
  2001. covered the walls and ceiling, but upon closer inspection you realize that
  2002. these are all brightly glowing nodes with lines drawn between them. They
  2003. seem decentralized, and yet seem to be sharing information as if all one
  2004. network.")
  2005. ;; @@: Maybe add the cork message board here?
  2006. (p "To the west is a door leading back to the underground laboratory."))
  2007. #:exits
  2008. (list (make <exit>
  2009. #:name "west"
  2010. #:to 'underground-lab)))
  2011. ;; nodes
  2012. ('federation-station:nodes
  2013. <floor-panel> 'federation-station
  2014. #:name "some nodes"
  2015. #:desc "Each node seems to be producing its own information, but publishing
  2016. updates to subscribing nodes on the graph. You see various posts of notes, videos,
  2017. comments, and so on flowing from node to node."
  2018. #:invisible? #t
  2019. #:goes-by '("nodes" "node" "some nodes"))
  2020. ;; network
  2021. ;; activitypub poster
  2022. ('federation-station:activitypub-poster
  2023. <readable-desc> 'federation-station
  2024. #:name "an ActivityPub poster"
  2025. #:goes-by '("activitypub poster" "activitypub" "poster")
  2026. #:desc
  2027. '((p (a "https://www.w3.org/TR/activitypub/"
  2028. "ActivityPub")
  2029. " is a federation standard being developed under the "
  2030. (a "https://www.w3.org/wiki/Socialwg/"
  2031. "W3C Social Working Group")
  2032. ", and doubles as a general client-to-server API. "
  2033. "It follows a few simple core ideas:")
  2034. (ul (li "Uses "
  2035. (a "https://www.w3.org/TR/activitystreams-core/"
  2036. "ActivityStreams")
  2037. " for its serialization format: easy to read, e json(-ld) syntax "
  2038. "with an extensible vocabulary covering the majority of "
  2039. "social networking interations.")
  2040. (li "Email-like addressing: list of recipients as "
  2041. (b "to") ", " (b "cc") ", " (b "bcc") " fields.")
  2042. (li "Every user has URLs for their outbox and inbox:"
  2043. (ul (li (b "inbox: ")
  2044. "Servers POST messages to addressed recipients' inboxes "
  2045. "to federate out content. "
  2046. "Also doubles as endpoint for a client to read most "
  2047. "recently received messages via GET.")
  2048. (li (b "outbox: ")
  2049. "Clients can POST to user's outbox to send a message to others. "
  2050. "(Similar to sending an email via your MTA.) "
  2051. "Doubles as endpoint others can read from to the "
  2052. "extent authorized; for example publicly available posts."))
  2053. "All the federation bits happen by servers posting to users' inboxes."))))
  2054. ;; An ActivityStreams message
  2055. ;; conspiracy chart
  2056. ('federation-station:conspiracy-chart
  2057. <readable-desc> 'federation-station
  2058. #:name "a conspiracy chart"
  2059. #:goes-by '("conspiracy chart" "chart")
  2060. #:desc
  2061. '((p (i "\"IT'S ALL RELATED!\"") " shouts the over-exuberant conspiracy "
  2062. "chart. "
  2063. (i "\"ActivityPub? Federation? The actor model? Scheme? Text adventures? "
  2064. "MUDS???? What do these have in common? Merely... EVERYTHING!\""))
  2065. (p "There are circles and lines drawn between all the items in red marker, "
  2066. "with scrawled notes annotating the theoretical relationships. Is the "
  2067. "author of this poster mad, or onto something? Perhaps a bit of both. "
  2068. "There's a lot written here, but here are some of the highlights:")
  2069. (p
  2070. (ul
  2071. (li (b "Scheme") " "
  2072. (a "https://en.wikipedia.org/wiki/History_of_the_Scheme_programming_language"
  2073. "was originally started ")
  2074. " to explore the " (b "actor model")
  2075. ". (It became more focused around studying the " (b "lambda calculus")
  2076. " very quickly, while also uncovering relationships between the two systems.)")
  2077. ;; Subject Predicate Object
  2078. (li "The " (a "https://www.w3.org/TR/activitypub/"
  2079. (b "ActivityPub"))
  2080. " protocol for " (b "federation")
  2081. " uses the " (b "ActivityStreams") " format for serialization. "
  2082. (b "Text adventures") " and " (b "MUDS")
  2083. " follow a similar structure to break down the commands of players.")
  2084. (li (b "Federation") " and the " (b "actor model") " both are related to "
  2085. "highly concurrent systems and both use message passing to communicate "
  2086. "between nodes.")
  2087. (li "Zork, the first major text adventure, used the " (b "MUDDLE") " "
  2088. "language as the basis for the Zork Interactive Language. MUDDLE "
  2089. "is very " (b "Scheme") "-like and in fact was one of Scheme's predecessors. "
  2090. "And of course singleplayer text adventures like Zork were the "
  2091. "predecessors to MUDs.")
  2092. (li "In the 1990s, before the Web became big, " (b "MUDs")
  2093. " were an active topic of research, and there was strong interest "
  2094. (a "http://www.saraswat.org/desiderata.html"
  2095. "in building decentralized MUDs")
  2096. " similar to what is being "
  2097. "worked on for " (b "federation") ". ")))))
  2098. ;; goblin
  2099. ))
  2100. ;;; North hall
  2101. ;;; ==========
  2102. (define north-hall
  2103. (lol
  2104. ('north-hall
  2105. <room> #f
  2106. #:name "North Hall"
  2107. #:desc
  2108. '((p "This hallway is lined by doors to the west and the east, presumably
  2109. to various lodgings. Something tells you you're not able to enter those right
  2110. now, however. Lining the walls are some large mirrors surrounded by bouquets
  2111. of flowers.")
  2112. (p "The red carpet continues all the way from Grand Hallway in the south
  2113. but stops short of some large wooden doors to the north. The doors look
  2114. formidable but unlocked. Some natural light peeking through windows to the
  2115. north seem to hint that this may be the exit to the outdoors. There's
  2116. also a large sign near the doors on a wooden easel."))
  2117. #:exits
  2118. (list (make <exit>
  2119. #:name "north"
  2120. #:to 'courtyard)
  2121. (make <exit>
  2122. #:name "south"
  2123. #:to 'grand-hallway)))
  2124. ('north-hall:sign
  2125. <readable> 'north-hall
  2126. #:name "an easel with a sign"
  2127. #:desc " The easel is finely cut wood, well polished, but plain. The sign
  2128. is a strong contrast, with a cream colored backing and hand written letters, written
  2129. with care and style. You could probably read it."
  2130. #:read-text "The sign announces a wedding taking place... why, today! And on
  2131. the hotel grounds to the north! It sounds very exciting."
  2132. #:goes-by '("sign"
  2133. "easel with a sign"
  2134. "easel"))
  2135. ('north-hall:mirrors
  2136. <gameobj> 'north-hall
  2137. #:name "a row of mirrors"
  2138. #:desc "You see yourself for who you really are."
  2139. #:invisible? #t
  2140. #:goes-by '("mirror" "mirrors" "row of mirrors"))
  2141. ('north-hall:windows
  2142. <gameobj> 'north-hall
  2143. #:name "windows"
  2144. #:desc "You peer out a window, but the light appears distorted, as if you were
  2145. really peering between two worlds hastily joined together."
  2146. #:invisible? #t
  2147. #:goes-by '("window" "windows"))
  2148. ('north-hall:doors
  2149. <gameobj> 'north-hall
  2150. #:name "doors"
  2151. #:desc '((p "Along the east and west walls are doors, but they are all shut,
  2152. and firmly so.
  2153. Presumably people are staying in them, but it also feels as if how residence
  2154. would work in a building as hastily put together as this was barely conceived.")
  2155. (p "To the north is a large set of wooden doors, oaken and beautiful.
  2156. Although towering, they seem passable."))
  2157. #:invisible? #f
  2158. #:goes-by '("door" "doors" "room doors" "large doors"))))
  2159. ;;; ============
  2160. ;;; WEDDING TIME
  2161. ;;; ============
  2162. (define wedding-map-text
  2163. "\
  2164. Banquet
  2165. &Stairs
  2166. (========)
  2167. .----.\\======/=.----.
  2168. Fairy - : \\====/ : -
  2169. Go ./ : )==( : \\. Orchestra
  2170. Round / (&&&) : (/==\\) : & & & \\
  2171. / : : \\
  2172. .--------..--------..--------.
  2173. | _ _ .' '. ,,, ;
  2174. Photo | | | |_| : Dance : .|_|. | Cake
  2175. | '-' : Floor : |___| |
  2176. ',-------.\\ ;.--------,'
  2177. ; .. '.......' ;
  2178. \\ ||)) .-=-. ^ */
  2179. \\.||(( ^ // \\\\^ * ^'./
  2180. Play '. ^ ;; ;;^ ^.,'
  2181. Ground +----||-----||----+ Flowers
  2182. | .---. |
  2183. | |_ _| [F] |
  2184. | | |
  2185. | Entrance |
  2186. '-----------------'")
  2187. (define-class <semi-edible-chatty-npc> (<chatty-npc>)
  2188. (commands
  2189. #:allocation #:each-subclass
  2190. #:init-thunk (build-commands
  2191. (("eat") ((direct-command cmd-eat)))))
  2192. (eat-catchphrase
  2193. #:init-keyword #:eat-catchphrase
  2194. #:accessor .eat-catchphrase
  2195. #:init-value "Should you really eat this?")
  2196. (actions #:allocation #:each-subclass
  2197. #:init-thunk
  2198. (build-actions
  2199. (cmd-eat cmd-eat-semi-edible-chatty-npc))))
  2200. (define* (cmd-eat-semi-edible-chatty-npc actor message #:key direct-obj)
  2201. (<- (message-from message) 'tell
  2202. #:text (.eat-catchphrase actor)))
  2203. (define-class <dancers> (<chatty-npc>)
  2204. (commands
  2205. #:allocation #:each-subclass
  2206. #:init-thunk (build-commands
  2207. (("dance") ((direct-command cmd-dance)))))
  2208. (actions #:allocation #:each-subclass
  2209. #:init-thunk
  2210. (build-actions
  2211. (cmd-dance cmd-dance-dancers))))
  2212. (define* (cmd-dance-dancers actor message #:key direct-obj)
  2213. (define player (message-from message))
  2214. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2215. (define player-name (mbody-val (<-wait player 'get-name)))
  2216. (<- (message-from message) 'tell
  2217. #:text '((p "You join in dancing with the dancers. You spin and
  2218. get woozy... you feel wonderful... like you could dance forever...")
  2219. (p "You step out just in time, lest you be caught in
  2220. the dancing for eternity!")))
  2221. (<- player-loc 'tell-room
  2222. #:text `((p ,player-name " begins dancing with the fairies and
  2223. spins around and around... as if they might dance forever!")
  2224. (p "But " ,player-name " steps back just in time!
  2225. Their eyes are cloudy and woozy, but they look happy..."))
  2226. #:exclude player))
  2227. (define-class <swing> (<gameobj>)
  2228. (commands
  2229. #:allocation #:each-subclass
  2230. #:init-thunk (build-commands
  2231. (("sit" "swing") ((direct-command cmd-swing)))))
  2232. (actions #:allocation #:each-subclass
  2233. #:init-thunk
  2234. (build-actions
  2235. (cmd-swing cmd-swing-on-swing))))
  2236. (define* (cmd-swing-on-swing actor message #:key direct-obj)
  2237. (define player (message-from message))
  2238. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2239. (define player-name (mbody-val (<-wait player 'get-name)))
  2240. (<- (message-from message) 'tell
  2241. #:text '((p "You swing on the swing and feel younger again
  2242. as you rock to the motion, as if your movements resemble your
  2243. traversal through the flow of time itself. You feel happy.")))
  2244. (<- player-loc 'tell-room
  2245. #:text `((p ,player-name " looks very happy as they swing
  2246. on the swing."))
  2247. #:exclude player))
  2248. (define-class <fairy-go-round> (<gameobj>)
  2249. (commands
  2250. #:allocation #:each-subclass
  2251. #:init-thunk (build-commands
  2252. (("ride" "sit") ((direct-command cmd-ride)))))
  2253. (actions #:allocation #:each-subclass
  2254. #:init-thunk
  2255. (build-actions
  2256. (cmd-ride cmd-ride-on-fairy-go-round))))
  2257. (define* (cmd-ride-on-fairy-go-round actor message #:key direct-obj)
  2258. (define player (message-from message))
  2259. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2260. (define player-name (mbody-val (<-wait player 'get-name)))
  2261. (<- (message-from message) 'tell
  2262. #:text '((p "You ride on the fairy go round. Your vision blurs
  2263. and refocuses into places everywhere in this realm and every other.
  2264. You feel a part of everywhere at once for a moment, and then, you
  2265. step off.")))
  2266. (<- player-loc 'tell-room
  2267. #:text `((p ,player-name " rides on the fairy go round and seems
  2268. to be everywhere and nowhere at once for a moment before stepping off."))
  2269. #:exclude player))
  2270. (define-actor <cake> (<semi-edible-chatty-npc>)
  2271. ((cmd-take cake-cmd-take)))
  2272. (define-actor <slice-of-cake> (<gameobj>)
  2273. ((cmd-nibble slice-of-cake-cmd-nibble)
  2274. (cmd-eat slice-of-cake-cmd-eat))
  2275. (contained-commands
  2276. #:allocation #:each-subclass
  2277. #:init-thunk (build-commands
  2278. ("nibble" ((direct-command cmd-nibble)))
  2279. ("eat" ((direct-command cmd-eat)))))
  2280. (bites-left #:init-value 4
  2281. #:accessor .bites-left)
  2282. (name #:init-value "a slice of cake")
  2283. (take-me? #:init-value #t)
  2284. (goes-by #:init-value '("slice of cake" "slice" "slice of wedding cake"
  2285. "piece of cake" "piece of wedding cake"))
  2286. (desc #:init-value "It's a slice of wedding cake! You could nibble on it
  2287. or just plain eat it!"))
  2288. (define (slice-of-cake-cmd-eat slice-of-cake message . _)
  2289. (define player (message-from message))
  2290. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2291. (define player-name (mbody-val (<-wait player 'get-name)))
  2292. (<- player 'tell
  2293. #:text "You wolf down your piece of wedding cake all at once like some
  2294. kind of hungry animal! You're making a huge mess!")
  2295. (<- player-loc 'tell-room
  2296. #:text `(,player-name
  2297. " wolfs down a piece of wedding cake all at once!
  2298. They're making a huge mess!")
  2299. #:exclude player)
  2300. (gameobj-self-destruct slice-of-cake))
  2301. (define (slice-of-cake-cmd-nibble slice-of-cake message . _)
  2302. (define player (message-from message))
  2303. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2304. (define player-name (mbody-val (<-wait player 'get-name)))
  2305. (set! (.bites-left slice-of-cake) (- (.bites-left slice-of-cake) 1))
  2306. (<- player 'tell
  2307. #:text "You take a nibble of your piece of wedding cake.
  2308. How dignified!")
  2309. (<- player-loc 'tell-room
  2310. #:text `(,player-name
  2311. " takes a nibble of their piece of wedding cake.
  2312. How dignified!")
  2313. #:exclude player)
  2314. (when (= (.bites-left slice-of-cake) 0)
  2315. (<- player 'tell
  2316. #:text "You've finished your slice of wedding cake!")
  2317. (<- player-loc 'tell-room
  2318. #:text `(,player-name
  2319. " finishes their slice of wedding cake!")
  2320. #:exclude player)
  2321. (gameobj-self-destruct slice-of-cake)))
  2322. (define* (cake-cmd-take gameobj message
  2323. #:key direct-obj
  2324. (player (message-from message)))
  2325. (create-gameobj <slice-of-cake> (gameobj-gm gameobj)
  2326. player) ;; set loc to player to put in player's inventory
  2327. (<- player 'tell
  2328. #:text '((p "You slice off a piece of the tiered wedding cake.
  2329. The cake fills itself back in as if by magic! Oh no, it's not alive, is it?")
  2330. (p "You take the slice of wedding cake with you.")))
  2331. (<- (gameobj-loc gameobj) 'tell-room
  2332. #:text `(,(mbody-val (<-wait player 'get-name))
  2333. " slices off a piece of the cake and the cake fills itself
  2334. back in! How strange!")
  2335. #:exclude player))
  2336. (define-class <flowers> (<gameobj>)
  2337. (commands
  2338. #:allocation #:each-subclass
  2339. #:init-thunk (build-commands
  2340. (("smell" "sniff") ((direct-command cmd-smell)))))
  2341. (actions #:allocation #:each-subclass
  2342. #:init-thunk
  2343. (build-actions
  2344. (cmd-smell flowers-cmd-smell))))
  2345. (define* (flowers-cmd-smell actor message #:key direct-obj)
  2346. (define player (message-from message))
  2347. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2348. (define player-name (mbody-val (<-wait player 'get-name)))
  2349. (<- (message-from message) 'tell
  2350. #:text '((p "You smell the flower and... whoa. Wait. What kind
  2351. of flower is this?")
  2352. (p "You teeter as the room spins and then politely
  2353. re-orients itself.")))
  2354. (<- player-loc 'tell-room
  2355. #:text `((p ,player-name " smells the flower and teeters around
  2356. a bit."))
  2357. #:exclude player))
  2358. (define-actor <frog> (<chatty-npc>)
  2359. ;; TODO: Add "open" verb, since obviously people will try that
  2360. ((cmd-kiss frog-cmd-kiss))
  2361. (commands
  2362. #:allocation #:each-subclass
  2363. #:init-thunk (build-commands
  2364. (("kiss") ((direct-command cmd-kiss))))))
  2365. (define* (frog-cmd-kiss actor message #:key direct-obj)
  2366. (define player (message-from message))
  2367. (define player-loc (mbody-val (<-wait player 'get-loc)))
  2368. (define player-name (mbody-val (<-wait player 'get-name)))
  2369. (<- (message-from message) 'tell
  2370. #:text '((p "You kiss the frog. She blushes and you get a distinctly "
  2371. "princess'y vibe off of her!")))
  2372. (<- player-loc 'tell-room
  2373. #:text `((p ,player-name " kisses the frog! The frog blushes!"))
  2374. #:exclude player))
  2375. (define wedding
  2376. (lol
  2377. ;; Courtyard
  2378. ;; ---------
  2379. ('courtyard
  2380. <room> #f
  2381. #:name "The Courtyard"
  2382. #:desc
  2383. '((p "Standing in the courtyard you feel... different. As if the courtyard itself
  2384. was the space between worlds, cobbled together hastily by some distant being.")
  2385. (p "To the south are some large doors which serve as the back entrance to
  2386. the hotel. To the north is a forest, from which festive noises emerge."))
  2387. #:exits
  2388. (list (make <exit>
  2389. #:name "south"
  2390. #:to 'north-hall)
  2391. (make <exit>
  2392. #:name "north"
  2393. #:to 'forest-clearing)))
  2394. ('forest-clearing
  2395. <room> #f
  2396. #:name "A Clearing in the Forest"
  2397. #:desc
  2398. '((p "During an aimless ramble through the forest you became
  2399. disoriented and lost your way. It has been some time since you’ve seen
  2400. any of the familiar landmarks that would help you orient yourself. As
  2401. you continue on, the feel of the forest seems to shift. As the trees
  2402. grow thicker the light dims. Eerie laughter echoes through the boughs
  2403. overhead and you shiver.")
  2404. (p "A warm light to the north beckons you towards it.
  2405. South leads back to the Hotel's main grounds."))
  2406. #:exits
  2407. (list (make <exit>
  2408. #:name "north"
  2409. #:to 'wedding-entrance)
  2410. (make <exit>
  2411. #:name "south"
  2412. #:to 'courtyard)))
  2413. ('wedding-entrance
  2414. <room> #f
  2415. #:name "Entrance to the Wedding"
  2416. #:desc
  2417. '((p "As you approach you realize that the light is not an exit from the
  2418. forest or a clearing, rather thousands of minuscule lights twined
  2419. through the boughs of the trees. What you see before you is some sort
  2420. of living structure composed of a thicket of trees intertwined with
  2421. bramble. To the left of the entrance is a sign, to the right is a frog
  2422. sitting atop a hostess podium.")
  2423. (p "To the north the limbs of two trees intertwine, making an entrance.
  2424. To the south is the forest."))
  2425. #:exits
  2426. (list (make <exit>
  2427. #:name "south"
  2428. #:to 'forest-clearing)
  2429. (make <exit>
  2430. #:name "north"
  2431. #:to 'vaulted-tunnel)))
  2432. ;; map
  2433. ('wedding-entrance:map
  2434. <readable> 'wedding-entrance
  2435. #:name "wedding map"
  2436. #:desc '("This appears to be a map of the wedding grounds. "
  2437. "You could read it if you want to.")
  2438. #:read-text `(pre ,wedding-map-text)
  2439. #:goes-by '("map" "wedding map"))
  2440. ('wedding-entrance:frog
  2441. <frog> 'wedding-entrance
  2442. #:name "a frog"
  2443. #:desc "The frog is sitting on top of the hostess podium and doing
  2444. her best to look dignified. Actually, to be honest, she's doing a pretty
  2445. good job looking dignified. My gosh! What a dignified frog!"
  2446. #:goes-by '("frog")
  2447. #:catchphrases
  2448. '("Oh yes, oh yes! Welcome to the wedding! *Ribbit!*"
  2449. "Enjoy your stay!"
  2450. "Welcome, welcome! *Ribbit!*"
  2451. "*Ribbit!* We've been waiting for you, come in come in!"
  2452. "We're so happy you're here!"
  2453. "Hoo, this wedding took a lot of work to plan but it was WORTH IT!"
  2454. "A kiss? Well... I wouldn't object to it..."))
  2455. ('wedding-entrance:podium
  2456. <gameobj> 'wedding-entrance
  2457. #:name "a hostess podium"
  2458. #:desc "It's very well constructed. A frog is sitting on it, so you
  2459. guess that makes the frog the hostess."
  2460. #:goes-by '("podium" "hostess podium"))
  2461. ('wedding-entrance:lights
  2462. <gameobj> 'wedding-entrance
  2463. #:name "fairy lights and trees"
  2464. #:invisible? #t
  2465. #:desc '((p "The lights are intertwined in the tree boughs and beautiful.
  2466. You look closely and realize that the only way they could work is if they
  2467. were threaded into the tree boughs as the trees grew!")
  2468. (p "To the north, some of the tree boughs grow together into
  2469. an entrance."))
  2470. #:goes-by '("lights" "fairy lights"
  2471. "trees" "tree" "light" "fairy light"
  2472. "bough" "boughs"))
  2473. ('vaulted-tunnel
  2474. <room> #f
  2475. #:name "A Vaulted Tunnel of Trees"
  2476. #:desc
  2477. '((p "You step into the entrance to see two rows of trees with intersecting
  2478. branches, forming a vaulted tunnel. The fairy lights cast a soft glow on the space.
  2479. On each tree trunk is a portrait and the eerie laughter you heard outside echoes
  2480. louder as you pass each portrait.")
  2481. (p "The tunnel enters from the south and exits from the north, with light
  2482. glowing each way."))
  2483. #:exits
  2484. (list (make <exit>
  2485. #:name "south"
  2486. #:to 'wedding-entrance)
  2487. (make <exit>
  2488. #:name "north"
  2489. #:to 'dance-floor)))
  2490. ('vaulted-tunnel:portrait
  2491. <gameobj> 'vaulted-tunnel
  2492. #:name "hanging portraits"
  2493. #:desc
  2494. "Each portrait shows a hazy image of a fairy in various modes of dress from
  2495. Victorian to today's current fashions. The style and format of the photographs
  2496. all look the same."
  2497. #:goes-by
  2498. '("hanging portrait" "hanging portraits" "portrait" "portraits"))
  2499. ('vaulted-tunnel:trees
  2500. <gameobj> 'vaulted-tunnel
  2501. #:name "trees"
  2502. #:invisible? #t
  2503. #:desc
  2504. "The trees are arched above you, vaulted and beautiful. A gentle light
  2505. streams through them and is accented by the fairy lights which are everywhere,
  2506. lovely, and glowing themselves."
  2507. #:goes-by
  2508. '("trees" "fairy lights" "lights" "tree" "light" "vaulted trees"
  2509. "tunnel" "vaulted tunnel"))
  2510. ('dance-floor
  2511. <room> #f
  2512. #:name "The Ballroom Dance Flooor"
  2513. #:desc
  2514. '((p "You emerge into a clearing with six trees encircling a magical ballroom.
  2515. At the center is a dance floor where fairies are dancing in rows of
  2516. concentric circles. The lights that appear in unstructured smatterings
  2517. throughout the mystical space have formed themselves into an elaborate
  2518. chandelier above the dancers.")
  2519. (p "There are green tables and blue tables surrounding the dancers.
  2520. Various creatures are sitting at them, sitting champagne, and laughing.")
  2521. (p "To the south the trees intertwine forming an entrance.
  2522. The ballroom extends in every other cardinal direction."))
  2523. #:exits
  2524. (list (make <exit>
  2525. #:name "north"
  2526. #:to 'banquet)
  2527. (make <exit>
  2528. #:name "northeast"
  2529. #:to 'orchestra)
  2530. (make <exit>
  2531. #:name "east"
  2532. #:to 'cake-wing)
  2533. (make <exit>
  2534. #:name "southeast"
  2535. #:to 'flower-field)
  2536. (make <exit>
  2537. #:name "south"
  2538. #:to 'vaulted-tunnel)
  2539. (make <exit>
  2540. #:name "southwest"
  2541. #:to 'playground)
  2542. (make <exit>
  2543. #:name "west"
  2544. #:to 'photo-booth-wing)
  2545. (make <exit>
  2546. #:name "northwest"
  2547. #:to 'fairy-go-round)))
  2548. ('dance-floor:dancers
  2549. <dancers> 'dance-floor
  2550. #:name "some dancers"
  2551. #:desc
  2552. '((p "They dance at a frantic pace, moving too quickly to get any idea of how many of them there are what they look like.")
  2553. (p "You could dance with one of them, should you so dare.
  2554. But remember what your parents warned you about dancing fairires..."))
  2555. #:chat-format (lambda _ "You try talking to the dancers. They
  2556. laugh and tell you that you should join in the dance with them! Do you
  2557. dare to do it? You've vaguely heard about people being lost in time...")
  2558. #:catchphrases
  2559. '("Dance with us! Dance!"
  2560. "You should be dancing!"
  2561. "There is nothing but the dance, the dance!")
  2562. #:goes-by
  2563. '("some dancers" "dancer" "dancers" "fairy" "fairies"))
  2564. ('dance-floor:green-table
  2565. <furniture> 'dance-floor
  2566. #:name "a green table"
  2567. #:desc "Each table is draped with layers of gossamer cloth in shades of green. The places are set with translucent china with cups the shape of tulips. The rose gold tableware is decorated with a delicate vine pattern snaking up the handles. In the center of the table is an elaborate arrangement of mauve roses and white lilies."
  2568. #:goes-by '("green table" "table")
  2569. #:sit-phrase "pull up a chair at"
  2570. #:sit-phrase-third-person "pulls up a chair at"
  2571. #:sit-name "a green table")
  2572. ('dance-floor:blue-table
  2573. <furniture> 'dance-floor
  2574. #:name "a blue table"
  2575. #:desc "Each table is draped with layers of gossamer cloth in shades of blue. The places are set with translucent china with cups the shape of lotus blossoms. The silver tableware is decorated with a delicate vine pattern snaking up the handles. In the center of the table is an elaborate arrangement of delphiniums and irises."
  2576. #:goes-by '("blue table")
  2577. #:sit-phrase "pull up a chair at"
  2578. #:sit-phrase-third-person "pulls up a chair at"
  2579. #:sit-name "a blue table")
  2580. ('dance-floor:chandelier
  2581. <gameobj> 'dance-floor
  2582. #:name "a chandelier"
  2583. #:desc
  2584. "The chandelier is beautiful with many lovely gems hanging from it.
  2585. Light bounces through it and seems to dance through the room just as much
  2586. as the fairies below it."
  2587. #:goes-by
  2588. '("chandelier"))
  2589. ('banquet
  2590. <room> #f
  2591. #:name "A Lovely Banquet"
  2592. #:desc
  2593. '((p "A large banquet table fills this space.
  2594. Out of the corner of your eye you see a brownie tidying up the
  2595. table while eating brownies.")
  2596. (p "An ornate set of stairs goes up and into the distance.
  2597. The ballroom extends to the west, south, and east."))
  2598. #:exits
  2599. (list (make <exit>
  2600. #:name "south"
  2601. #:to 'dance-floor)
  2602. (make <exit>
  2603. #:name "west"
  2604. #:to 'fairy-go-round)
  2605. (make <exit>
  2606. #:name "east"
  2607. #:to 'orchestra)
  2608. (make <exit>
  2609. #:name "southeast"
  2610. #:to 'cake-wing)
  2611. (make <exit>
  2612. #:name "southwest"
  2613. #:to 'photo-booth-wing)
  2614. (make <exit>
  2615. #:name "up"
  2616. #:to 'the-stairs)))
  2617. ('banquet:brownie
  2618. <semi-edible-chatty-npc> 'banquet
  2619. #:chat-format (lambda _ "The brownie disappears when you try to
  2620. talk to her! But she reappears once you stop talking.")
  2621. #:eat-catchphrase "The brownie shrieks with surprise as you try
  2622. to eat her! She swats you away!"
  2623. #:name "a brownie"
  2624. #:desc "The brownie disappears out of sight when you try to
  2625. look directly at her! However if you look just off to the side you
  2626. can see her positively devouring that plate of brownies."
  2627. #:take-me? (lambda _
  2628. (values #f
  2629. #:why-not
  2630. `("The brownie swats your hand away when you try to take her!")))
  2631. #:goes-by '("brownie"))
  2632. ('banquet:brownies
  2633. <semi-edible-chatty-npc> 'banquet
  2634. #:chat-format (lambda _ "You try to chat with the brownies but
  2635. they are inanimate! The brownie looks at you strangely from the corner
  2636. of her eye. She's clearly judging you.")
  2637. #:eat-catchphrase "You reach forward to eat one of the brownies,
  2638. but the brownie snarls at you and you think better of it. Best to leave them
  2639. to her."
  2640. #:name "brownies"
  2641. #:desc "It's a plate of brownies. They look delicious and you desperately
  2642. wish to eat one."
  2643. #:take-me? (lambda _
  2644. (values #f
  2645. #:why-not
  2646. `("The brownie swats your hand away when you try to take
  2647. one of the brownies! She leans over the plate of brownies protectively!")))
  2648. #:goes-by '("brownies" "plate of brownies"))
  2649. ('banquet:stairs
  2650. <gameobj> 'banquet
  2651. #:name "the stairs"
  2652. #:invisible? #t
  2653. #:desc "From here it's clearly a nice set of stairs.
  2654. But you get the impression that to really see the stairs, you
  2655. should go upward and get a view from on the stairs themselves."
  2656. #:goes-by '("stairs" "stairwell" "stairwell entrance"))
  2657. ('banquet:banquet-table
  2658. <gameobj> 'banquet
  2659. #:name "a banquet table"
  2660. #:desc "The long rectangular table is draped with layers of gossamer
  2661. cloth in shades of blue and green. It is laden with an assortment of
  2662. exotic dishes in bowls and platters in the shapes of various flowers."
  2663. #:goes-by '("banquet table" "table"))
  2664. ('orchestra
  2665. <room> #f
  2666. #:name "The Orchestra"
  2667. #:desc
  2668. '((p "An orchestra of fairies plays the high-tempo ethereal music
  2669. for the frenzied dancers. In the back is a harpsichord, accompanied
  2670. by various fiddles, a cello, a harp, and a flute.")
  2671. (p "The ballroom extends to the west and south."))
  2672. #:exits
  2673. (list (make <exit>
  2674. #:name "west"
  2675. #:to 'banquet)
  2676. (make <exit>
  2677. #:name "southwest"
  2678. #:to 'dance-floor)
  2679. (make <exit>
  2680. #:name "south"
  2681. #:to 'cake-wing)))
  2682. ('orchestra:orchestra
  2683. <chatty-npc> 'orchestra
  2684. #:name "the orchestra"
  2685. #:chat-format (lambda _
  2686. '((p "You're being very rude. They're trying to
  2687. concentrate.")))
  2688. #:desc
  2689. '((p "The orchestra members are playing their songs. The music
  2690. and their instruments seem as much a part of them as their bodies."))
  2691. #:goes-by
  2692. '("orchestra" "fairies"))
  2693. ('orchestra:instruments
  2694. <chatty-npc> 'orchestra
  2695. #:name "instruments"
  2696. #:desc
  2697. '((p "Each instrument seems beautifully made, the best of its kind.
  2698. But you sense that only the most skilled players could play them."))
  2699. #:take-me?
  2700. (lambda _
  2701. (values #f
  2702. #:why-not
  2703. `((p "No way. Are you kidding me? They're playing those
  2704. instruments right now! Rude."))))
  2705. #:goes-by
  2706. '("instrument" "instruments"
  2707. "hapsichord" "hapsichords"
  2708. "harp" "harps"
  2709. "flute" "flutes"
  2710. "fiddle" "fiddles"
  2711. "cello" "cellos"))
  2712. ('cake-wing
  2713. <room> #f
  2714. #:name "The Cake Wing"
  2715. #:desc
  2716. '((p "A large tree stump sits in the middle of the space with a
  2717. massive tiered cake atop it.")
  2718. (p "The ballroom extends to the north, west, and south."))
  2719. #:exits
  2720. (list (make <exit>
  2721. #:name "north"
  2722. #:to 'orchestra)
  2723. (make <exit>
  2724. #:name "west"
  2725. #:to 'dance-floor)
  2726. (make <exit>
  2727. #:name "northwest"
  2728. #:to 'banquet)
  2729. (make <exit>
  2730. #:name "south"
  2731. #:to 'flower-field)))
  2732. ;; TODO: You should be able to take a slice of cake
  2733. ('cake-wing:cake
  2734. <cake> 'cake-wing
  2735. #:name "the wedding cake"
  2736. #:chat-format (lambda _ '((p "Okay the wedding cake seems kinda
  2737. alive, but it doesn't seem "
  2738. (i "that")
  2739. " alive.")))
  2740. #:desc "The lowest tier is a dark green with a fondant vine
  2741. scrolling around it. The second tier is light blue with delphiniums
  2742. painted onto it and mauve fondant roses lining the transition between
  2743. the tiers. The third tier is sky blue, with clouds painted onto the
  2744. frosting. The cake is topped with figurines of four fairies dancing
  2745. in a circle."
  2746. #:eat-catchphrase "You think about just eating the cake right here
  2747. and now, but it seems rude."
  2748. #:goes-by '("wedding cake" "cake" "tiered cake" "tiered wedding cake"))
  2749. ('cake-wing:stump
  2750. <gameobj> 'cake-wing
  2751. #:name "a tree stump"
  2752. #:invisible? #t
  2753. #:desc "The cake's sitting on the tree stump. Otherwise else there's
  2754. not too much to say about this thing."
  2755. #:goes-by '("stump" "tree stump"))
  2756. ('flower-field
  2757. <room> #f
  2758. #:name "Field of Flowers"
  2759. #:desc
  2760. '((p "A field of wildflowers stretches out before you, far further
  2761. than the confines of the space you saw from the outside. Groups of fairies
  2762. are frolicking about.")
  2763. (p "The ballroom extends to the north."))
  2764. #:exits
  2765. (list (make <exit>
  2766. #:name "north"
  2767. #:to 'cake-wing)
  2768. (make <exit>
  2769. #:name "northwest"
  2770. #:to 'dance-floor)))
  2771. ('flower-field:fairies
  2772. <chatty-npc> 'flower-field
  2773. #:name "group of fairies"
  2774. #:chat-format (lambda _
  2775. '((p "You try chatting with these fairies but they seem
  2776. kinda unresponsive. Wait, just what kinds of flowers are these?")))
  2777. #:desc "There really are just like, a ton of fairies around here aren't
  2778. there? Anyway these ones are really into these flowers, like, *really* into
  2779. them."
  2780. #:goes-by '("fairies" "some fairies" "group of fairies"))
  2781. ('flower-field:flowers
  2782. <flowers> 'flower-field
  2783. #:name "flowers"
  2784. #:desc "The flowers are beautiful... they're also fragrant..."
  2785. #:take-me?
  2786. (lambda _
  2787. (values #f
  2788. #:why-not
  2789. `((p "That's not a good idea. Just look at how much work went
  2790. into this place. No way... the wedding planner would probably kill you.")
  2791. (p "I mean, not literally. Okay, maybe literally."))))
  2792. #:goes-by '("flowers" "flower"))
  2793. ('playground
  2794. <room> #f
  2795. #:name "Playground"
  2796. #:desc
  2797. '((p "You come across a playground that echoes with the sounds of children
  2798. playing. Vines hang from the boughs above forming swings of varying
  2799. heights and sizes. Young fairies climb up an obliging maple tree and
  2800. use the helicopter seeds to float back to the ground. An enchanted
  2801. see-saw hovers a foot from the soft grass below.")
  2802. (p "The ballroom extends to the north."))
  2803. #:exits
  2804. (list (make <exit>
  2805. #:name "north"
  2806. #:to 'photo-booth-wing)
  2807. (make <exit>
  2808. #:name "northeast"
  2809. #:to 'dance-floor)))
  2810. ('playground:swing
  2811. <swing> 'playground
  2812. #:name "a swing"
  2813. #:desc "There's an open swing here you could swing on. It sways
  2814. back and forth gently. You feel as if to sit on it would help you
  2815. feel younger again, to experience time itself..."
  2816. #:goes-by '("swing"))
  2817. ('playground:children
  2818. <chatty-npc> 'playground
  2819. #:name "children"
  2820. #:chat-format (lambda _
  2821. '((p "It's hard to have a conversation with the children,
  2822. they're too busy running around! It's clear they're having a good time, though.")))
  2823. #:desc "The children are laughing and climbing and generally having a
  2824. wonderful time."
  2825. #:goes-by '("young fairies" "children" "fairy children"))
  2826. ('playground:seeds
  2827. <gameobj> 'playground
  2828. #:name "helicopter seeds"
  2829. #:invisible? #t
  2830. #:desc "The helicopter seeds are falling from the sky!
  2831. They're really lovely to look at though."
  2832. #:take-me?
  2833. (lambda _
  2834. (values #f
  2835. #:why-not
  2836. `((p "You feel like you'd develop an allergy to these things
  2837. if you tried to hold onto them for too long, so you'd better not.")))
  2838. #:goes-by '("seeds" "helicopter seeds")))
  2839. ('photo-booth-wing
  2840. <room> #f
  2841. #:name "The Photo Booth Wing"
  2842. #:desc
  2843. '((p "There is a photographer with A Victorian bellows camera for guests to
  2844. have their portrait taken. The trunks of the trees lining this section
  2845. are covered in photographs of fairies and historical fairy
  2846. ‘hoaxes’.")
  2847. (p "The ballroom extends to the north, east, and south."))
  2848. #:exits
  2849. (list (make <exit>
  2850. #:name "north"
  2851. #:to 'fairy-go-round)
  2852. (make <exit>
  2853. #:name "northeast"
  2854. #:to 'banquet)
  2855. (make <exit>
  2856. #:name "east"
  2857. #:to 'dance-floor)
  2858. (make <exit>
  2859. #:name "south"
  2860. #:to 'playground)))
  2861. ('photo-booth-wing:camera
  2862. <gameobj> 'photo-booth-wing
  2863. #:name "an old-fashioned camera"
  2864. #:desc '((p "This old-fashioned camera has a lens that extends out with an accordion or bellows shaped enclosure. The flash bulb is held separately by the photographer."))
  2865. #:goes-by '("old-fashioned camera" "camera"))
  2866. ('photo-booth-wing:photographer
  2867. <chatty-npc> 'photo-booth-wing
  2868. #:name "a photographer"
  2869. #:desc "You suppose there's a person under the drapery of the
  2870. camera somewhere, though all you can see are his legs."
  2871. #:goes-by '("photographer")
  2872. #:catchphrases
  2873. '("Alright, smile for me real big everyone!"
  2874. "It's real difficult to get fairies to sit still enough to take
  2875. a clear photo of them. That's my specialty... and it's still tough, heh."
  2876. "Fairy photos just don’t work with modern cameras. You need these old
  2877. bellows-cameras, or maybe an old brownie camera in order to really
  2878. capture fairies!"))
  2879. ('photo-booth-wing:flash-bulb
  2880. <gameobj> 'photo-booth-wing
  2881. #:name "a flash bulb"
  2882. #:invisible? #t
  2883. #:desc "The flash bulb is large and appears to have a filament that's
  2884. kind of unusual. It glows even when the camera isn't flashing. Every now
  2885. and then the photographer takes a picture, a loud *kzzzt!* noise fills the room,
  2886. and a magical glow suffuses everything."
  2887. #:goes-by '("flash bulb" "flash" "bulb"))
  2888. ('photo-booth-wing:hoaxes
  2889. <gameobj> 'photo-booth-wing
  2890. #:name "hoaxes"
  2891. #:invisible? #t
  2892. #:desc "Some real good japes, these are."
  2893. #:goes-by '("hoaxes"))
  2894. ('photo-booth-wing:photographs
  2895. <gameobj> 'photo-booth-wing
  2896. #:name "photographs"
  2897. #:invisible? #t
  2898. #:desc "You know, you kind of feel like you recognize the fairy in
  2899. that one from some old Fairy History class you took a long time ago!"
  2900. #:goes-by '("photograph" "photographs"))
  2901. ('fairy-go-round
  2902. <room> #f
  2903. #:name "Fairy-Go-Round"
  2904. #:desc
  2905. '((p "A large carousel fills the space. The seating arrangement alternates
  2906. between vine swings that move up and down and large mums that serve as
  2907. stools.")
  2908. (p "The ballroom extends to the east and south."))
  2909. #:exits
  2910. (list (make <exit>
  2911. #:name "east"
  2912. #:to 'banquet)
  2913. (make <exit>
  2914. #:name "southeast"
  2915. #:to 'dance-floor)
  2916. (make <exit>
  2917. #:name "south"
  2918. #:to 'photo-booth-wing)))
  2919. ('fairy-go-round:fairy-go-round
  2920. <fairy-go-round> 'fairy-go-round
  2921. #:name "the fairy-go-round"
  2922. #:desc '((p "The fairy-go-round is a wonderful work of art. There
  2923. are many kinds of seats on it, and they move up and down as the fairy go round
  2924. spins. You feel a part of it and yet disconnected at once, a yearning to
  2925. ride and participate on this fantastic device. You feel an aura around it
  2926. that makes it seem both present and distant, as it were everywhere and nowhere
  2927. at once.")
  2928. (p "The vine swings are made of real vines, and the mums are
  2929. made of real... well you aren't really sure what they're made of. Overgrown
  2930. flowers, it seems like."))
  2931. #:goes-by '("fairy-go-round" "fairy go round"
  2932. "carousel" "swing" "swings" "stool" "stools"
  2933. "seat" "seats" "vine swing" "vine swings"
  2934. "mum" "mums" "flowers" "overgrown flowers"))
  2935. ('the-stairs
  2936. <room> #f
  2937. #:name "Stairwell"
  2938. #:desc
  2939. '((p "A grand staircase springs from the ground, the twisting branches and
  2940. vines woven into an ornate pattern up the balustrade. At the foot of
  2941. the stairs is a fairy dreamily looking up at them.")
  2942. (p "The stairwell's entrance from the ballroom goes down. Looking
  2943. up fills you with a sense of wonder as the stairs open into the canopy above."))
  2944. #:exits
  2945. (list (make <exit>
  2946. #:name "up"
  2947. #:to 'canopy)
  2948. (make <exit>
  2949. #:name "down"
  2950. #:to 'banquet)))
  2951. ('the-stairs:fairy
  2952. <chatty-npc> 'the-stairs
  2953. #:name "a serene young fairy"
  2954. #:desc "A serene, young fairy wearing a long gossamer dress.
  2955. She stares upwards at the stairs, in true wonder."
  2956. #:goes-by '("serene young fairy" "serene fairy" "fairy" "young fairy")
  2957. #:catchphrases
  2958. '("The stairs, just look at those stairs!"
  2959. "I'd like to thank everyone who made this possible... and most
  2960. importantly... I'd like to thank the stairs."
  2961. "What a beautiful mind... what a beautiful mind must have made
  2962. these stairs."
  2963. "They go on, and upward, the stairs... they're so... beautiful..."))
  2964. ('the-stairs:stairs
  2965. <gameobj> 'the-stairs
  2966. #:name "the stairs"
  2967. #:desc "They're some beautiful stairs all right. Whoever made these
  2968. must have been an incredible architect. Entrancing... maybe too entrancing.
  2969. You fear that if you look at them too long, you might risk not being
  2970. able to think of anything else."
  2971. #:goes-by '("stairs"))
  2972. ('canopy
  2973. <room> #f
  2974. #:name "The Canopy"
  2975. #:desc
  2976. '((p "The branches of the trees helpfully form into a relatively smooth and
  2977. sturdy surface to walk around the perimeter of the ballroom from
  2978. above. There are two exhausted looking cats in tophats lounging
  2979. around."))
  2980. #:exits
  2981. (list (make <exit>
  2982. #:name "down"
  2983. #:to 'the-stairs)))
  2984. ('canopy:pair-of-cats
  2985. <chatty-npc> 'canopy
  2986. #:name "a pair of cats"
  2987. #:desc
  2988. '((p "These cats are very well dressed! They're both wearing top
  2989. hats. They are somewhat gender ambiguous but one seems to lean more
  2990. feminine and the other one leans more masculine. They look delighted
  2991. from the festivities but also exhausted, as if the party was for them,
  2992. but also as if they planned the whole thing, or whether they're just
  2993. representationally appearing to fill such roles."))
  2994. #:catchphrases
  2995. '("Oh yes... hello! This was a fun time."
  2996. "It's nice to get away and be here at the same time."
  2997. "Later maybe we'll have a nice vacation."
  2998. "Twice is twice as nice, right?")
  2999. #:goes-by '("cat" "cats" "pair of cats"))
  3000. ;; ('ballroom
  3001. ;; <room> #f
  3002. ;; #:name "The Ballroom"
  3003. ;; #:exits (list
  3004. ;; (make <exit>
  3005. ;; )
  3006. ;; [north entrance]
  3007. ;; [east entrance]
  3008. ;; [south vaulted-tunnel]
  3009. ;; [west entrance])
  3010. ;; #:desc ("You emerge into a clearing with six trees encircling a magical ballroom. At the center is a dance floor where " (cast dancers "fairies") " are dancing in rows of concentric circles. The lights that appear in unstructured smatterings throughout the mystical space have formed themselves into an elaborate chandelier above the dancers."))
  3011. ))
  3012. ;;; Game
  3013. ;;; ----
  3014. (define (game-spec)
  3015. (append lobby grand-hallway smoking-parlor
  3016. playroom break-room computer-room underground-lab
  3017. async-museum gift-shop hive-entrance
  3018. hive-inside federation-station
  3019. north-hall wedding))
  3020. ;; TODO: Provide command line args
  3021. (define (run-game . args)
  3022. (run-demo (game-spec) 'lobby #:repl-server #t))