room "world", tags: ["start"], optionText: "Enter the world", ways: ["plaza"] content: """ ### Rhinestone Room You're in a large room carved inside a giant milky rock mountain. The floor and walls are littered with signs and signatures of the previous visitors. A steep narrow #{textlink("well", "well")} proceeds upward. """ writers: well: "There is only one passage out. See the „Other rooms“ block popped up? Click it." room "plaza", title: (from) -> if from == "world" return "Upwards" else return "Town plaza" cycle_gallery: () -> # it needs to be a function if you want localization return [ "quirky", "distinct", "kooky", "crazy", "quaint" ] ways: ["shop"] before: (character, system, from) -> if from == 'world' """ You climb up the well and come out to a central plaza of a #{cyclelink("quaint")} little town. A plaque nearby says it's the town of *Innsmouth,* wherever that is. """ else "You quickly find the central plaza." content: (character, system) -> retval = "There are #{textlink("people shouting", "people")} nearby." unless character.sandbox.has_mark? retval += "\n\nYou could ask a policeman #{textlink("for directions.", "mark")}" return retval writers: cyclewriter: (character) -> cycle(this, character) mark: (character) -> if character.sandbox.has_mark? return "You already talked to him, no need to bug the man twice." character.sandbox.has_mark ?= true get_room("lair").destination() """ “Here, let me mark it on your map.” """ people: 'Just some weirdos shouting "Viva la Cthulhu!". Typical.' room "shop", title: "The Shop" ways: ["plaza", "shop-inside", "lair"] content: """ Being the only shop in town, this trendy establishment did not need a name. It's an open question why it had one, especially because its name was "Hung Crossing". You are standing in front of a picturesque sign. It's cold here. """ room "lair", title: "The Lair" before: "Finding The Lair is easy. Leaving it is impossible. Your game ends here." content: """ The Lair of Yog-Sothoth is a very *n'gai* cave, full of *buggs-shoggogs* and *n'ghaa ng'aa*. """ objects: { bugg: obj "bugg", dsc: "You see a particularly beautiful slimy {{bugg.}}" takeable: false act: () => here().drop(@name) return "You eat the bugg mass. Delicious and raw. Perhaps it's a good lair to live in." } dialogue "Yes", "merchant", "merchant", """ Yes. """ room "shop-inside", ways: ["shop"] tags: ["merchant"] optionText: "End the conversation" title: "Inside the Shop" content: """ The insides are painted pastel white, honouring The Great Milk Spill of 1985. """ objects: { merchant: obj "merchant", dsc: "A {{merchant}} eyes you warily." takeable: false act: (character, system) => undum.processClick("merchdialogue") return "" } ### I want to be able to do this but I can't because I'm lost in all the `this` and @objects and `new`. The chain of calls is very weird and this puts an object IN EVERY ROOM for God's sake. I need someone smarter than me to fix this. lamp = obj "lamp", dsc: "You see a {{lamp.}}" takeable: true lamp.put("shop-inside") ### room "merchdialogue", choices: "#merchant", content: """ Nice day, isn't it? """