diff --git a/game/story.coffee b/game/story.coffee index 04a8678..0b24098 100644 --- a/game/story.coffee +++ b/game/story.coffee @@ -67,17 +67,40 @@ room "lair", bugg = obj "bugg-shoggog", dsc: "You see a particularly beautiful slimy {{bugg.}}" + takeable: false act: () => here().drop(@name) return "You eat the bugg mass. Delicious and raw." +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 "" + } lamp = obj "lamp", dsc: "You see a {{lamp.}}" takeable: true +lamp.put("shop-inside") + +room "merchdialogue", + choices: "#merchant", + content: """ + Nice day, isn't it? + """ + diff --git a/lib/room.coffee b/lib/room.coffee index 233941c..2dcac55 100644 --- a/lib/room.coffee +++ b/lib/room.coffee @@ -10,6 +10,8 @@ way_to = (content, ref) -> # jQuery was confused by this point where's the context so I did it vanilla-way print = (content) -> + if content == "" + return if typeof content == "function" content = content() block = document.getElementById("current-situation") @@ -141,7 +143,7 @@ class SaletRoom extends RaconteurSituation An internal function to get the room's description and the descriptions of every object in this room. ### - look: (character, system, f) => + look: (character, system, f) -> update_ways(@ways, @name) retval = "" @@ -158,7 +160,6 @@ class SaletRoom extends RaconteurSituation Puts an object in this room. ### take: (thing) => - console.log this @objects[thing.name] = thing # BUG: for some really weird reason if the call is made in init function or # during the initialization, this ALSO puts the thing in the start room. @@ -208,6 +209,7 @@ room = (name, spec) -> spec ?= {} spec.name = name retval = new SaletRoom(spec) - return retval.register() + retval.register() + return retval module.exports = room