From 853b1bd5a0885a765f48056c96266e7b8ac3523c Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 13 Jan 2019 14:21:15 -0500 Subject: [PATCH] Added some to the tech demo --- stories/demo.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/stories/demo.js b/stories/demo.js index 4e0d494..52badea 100644 --- a/stories/demo.js +++ b/stories/demo.js @@ -7,7 +7,8 @@ stories.push({ "intro": { "start": "Home", "setup": state => { - + state.info.time = 0; + state.player.stats.oofs = {name: "Oofs", type: "meter", value: 0, max: 10, color: "rgb(255,0,0)"}; }, "intro": state => { print(["don't fall down the stairs ok"]); @@ -17,6 +18,11 @@ stories.push({ "sfx/oof.ogg" ], "world": { + "Stairs": { + "id": "Stairs", + "name": "Stairs", + "desc": "You can't actually get here" + }, "Home": { "id": "Home", "name": "Home", @@ -70,6 +76,16 @@ stories.push({ return state.player.rooms[room.id].squinted; } ] + }, + "descend": { + "target": "Stairs", + "desc": "Dare you go down the stiars?", + "hooks": [ + (room, state) => { + print(["You're very concerned that you'll fall down all these stairs."]); + return false; + } + ] } }, "hooks": [ @@ -91,7 +107,14 @@ stories.push({ name: "Oof", desc: "Oof", execute: (room, state) => { - print(["Oof"]); + state.player.stats.oofs.value += 1; + + if (state.player.stats.oofs.value >= state.player.stats.oofs.max) { + state.player.stats.oofs.value = state.player.stats.oofs.max; + print(["Big oof"]); + } else { + print(["Oof"]); + } playSfx("sfx/oof.ogg"); } }