From 407305a54ca904ce58e3baabdd3a00987914a3d9 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Mon, 18 Jan 2016 18:29:34 +0700 Subject: [PATCH] Rewritten using more OOP --- game/story.coffee | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/game/story.coffee b/game/story.coffee index 6f7c51a..c900769 100644 --- a/game/story.coffee +++ b/game/story.coffee @@ -7,11 +7,11 @@ room "world", 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." + objects: + well: obj "well", + dsc: "A steep narrow {{well}} proceeds upward." + act: "There is only one passage out. See the „Other rooms“ block popped up? Click it." room "plaza", title: (from) -> @@ -32,22 +32,22 @@ room "plaza", """ else "You quickly find the central plaza." - dsc: (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.' + objects: + policeman: obj "policeman", + dsc: "There is a policeman nearby. You could ask him {{for directions.}}" + act: (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: obj "people", + dsc: "There are {{people shouting}} nearby." + act: 'Just some weirdos shouting "Viva la Cthulhu!". Typical.' room "shop", title: "The Shop"