| @@ -1,5 +1,5 @@ | |||||
| (() => { | (() => { | ||||
| function checkSuspicion(state, add=0) { | |||||
| function checkSuspicion(state, add = 0) { | |||||
| state.player.stats.suspicion.value += add; | state.player.stats.suspicion.value += add; | ||||
| if (state.player.stats.suspicion.value >= 100) { | if (state.player.stats.suspicion.value >= 100) { | ||||
| print(["Geta spots you!", "You're snatched up and tossed into the fox's bowl of cereal."]); | print(["Geta spots you!", "You're snatched up and tossed into the fox's bowl of cereal."]); | ||||
| @@ -20,17 +20,57 @@ | |||||
| "intro": { | "intro": { | ||||
| "start": "pepper-grinder", | "start": "pepper-grinder", | ||||
| "setup": state => { | "setup": state => { | ||||
| state.player.stats.suspicion = {name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)"}; | |||||
| state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)" }; | |||||
| state.info.time.value = 60 * 60 * 7 + 60 * 17; | |||||
| state.player.flags.caught = false; | |||||
| startTimer({ | |||||
| id: "clock", | |||||
| func: state => { | |||||
| state.info.time.value += 1; | |||||
| state.info.time.value %= 86000; | |||||
| return true; | |||||
| }, | |||||
| delay: 1000, | |||||
| loop: true, | |||||
| classes: [ | |||||
| ] | |||||
| }, state); | |||||
| startTimer({ | |||||
| id: "timeout", | |||||
| func: state => { | |||||
| if (state.info.time.value == 60 * 60 * 7 + 60 * 19) { | |||||
| print(["The fox is almost done with his breakfast..."]); | |||||
| } | |||||
| if (state.info.time.value >= 60 * 60 * 7 + 60 * 20) { | |||||
| print(["Time's up! In you go."]); | |||||
| goToRoom("maw", state); | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| }, | |||||
| delay: 1000, | |||||
| loop: true, | |||||
| classes: [ | |||||
| "free" | |||||
| ] | |||||
| }, state); | |||||
| }, | }, | ||||
| "intro": state => { | "intro": state => { | ||||
| print(["Game started"]); | print(["Game started"]); | ||||
| } | } | ||||
| }, | }, | ||||
| "sounds": [ | "sounds": [ | ||||
| ], | ], | ||||
| "preload": [ | "preload": [ | ||||
| ], | ], | ||||
| "world": { | "world": { | ||||
| "pepper-grinder": { | "pepper-grinder": { | ||||
| @@ -41,25 +81,38 @@ | |||||
| print(["You dart over to the pepper grinder, which looms over you like a greatwood."]); | print(["You dart over to the pepper grinder, which looms over you like a greatwood."]); | ||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| { | { | ||||
| name: "Tap", | |||||
| desc: "Bang on the pepper shaker", | |||||
| execute: (room, state) => { | |||||
| print(["You thump the pepper shaker, making a dull thud."]); | |||||
| checkSuspicion(state, 25); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| name: "Tap", | |||||
| desc: "Bang on the pepper shaker", | |||||
| execute: (room, state) => { | |||||
| print(["You thump the pepper shaker, making a dull thud."]); | |||||
| checkSuspicion(state, 25); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| }, | |||||
| { | |||||
| name: "Wait", | |||||
| desc: "Wait for the fox to finish his breakfast. Surely you'll be able to escape after that...right?", | |||||
| execute: (room, state) => { | |||||
| state.info.time.value = 60 * 60 * 7 + 60 * 20; | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| }, | }, | ||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| @@ -67,80 +120,80 @@ | |||||
| "target": "bowl", | "target": "bowl", | ||||
| "desc": "Walk up to the cereal bowl", | "desc": "Walk up to the cereal bowl", | ||||
| "show": [ | "show": [ | ||||
| ], | ], | ||||
| "conditions": [ | "conditions": [ | ||||
| ], | ], | ||||
| "hooks": [ | "hooks": [ | ||||
| (room, exit, state) => { | (room, exit, state) => { | ||||
| return checkSuspicion(state, 10); | |||||
| return checkSuspicion(state, 10); | |||||
| } | } | ||||
| ] | ] | ||||
| }, | }, | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| "bowl": { | "bowl": { | ||||
| "id": "bowl", | |||||
| "name": "Behind the Bowl", | |||||
| "desc": "You're crouched behind Geta's bowl of cereal", | |||||
| "move": (room, state) => { | |||||
| print(["You scurry up to the looming bowl, staying low and out of Geta's sight."]); | |||||
| }, | |||||
| "enter": (room, state) => { | |||||
| }, | |||||
| "exit": (room, state) => { | |||||
| }, | |||||
| "actions": [ | |||||
| ], | |||||
| "exits": { | |||||
| "ascend": { | |||||
| "target": "in-bowl", | |||||
| "desc": "Climb into Geta's cereal", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | |||||
| "down": { | |||||
| "target": "pepper-grinder", | |||||
| "desc": "Run back behind the pepper grinder", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | |||||
| }, | |||||
| "hooks": [ | |||||
| ], | |||||
| "data": { | |||||
| "stats": { | |||||
| "id": "bowl", | |||||
| "name": "Behind the Bowl", | |||||
| "desc": "You're crouched behind Geta's bowl of cereal", | |||||
| "move": (room, state) => { | |||||
| print(["You scurry up to the looming bowl, staying low and out of Geta's sight."]); | |||||
| }, | |||||
| "enter": (room, state) => { | |||||
| }, | |||||
| "exit": (room, state) => { | |||||
| }, | |||||
| "actions": [ | |||||
| ], | |||||
| "exits": { | |||||
| "ascend": { | |||||
| "target": "in-bowl", | |||||
| "desc": "Climb into Geta's cereal", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | |||||
| "down": { | |||||
| "target": "pepper-grinder", | |||||
| "desc": "Run back behind the pepper grinder", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | |||||
| }, | |||||
| "hooks": [ | |||||
| ], | |||||
| "data": { | |||||
| "stats": { | |||||
| } | |||||
| } | } | ||||
| } | |||||
| }, | }, | ||||
| "in-bowl": { | "in-bowl": { | ||||
| "id": "in-bowl", | "id": "in-bowl", | ||||
| @@ -148,6 +201,7 @@ | |||||
| "desc": "You're in the cereal bowl...", | "desc": "You're in the cereal bowl...", | ||||
| "move": (room, state) => { | "move": (room, state) => { | ||||
| print(["Why did you do that?"]); | print(["Why did you do that?"]); | ||||
| stopClassTimers("free", state); | |||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| startTimer({ | startTimer({ | ||||
| @@ -161,31 +215,31 @@ | |||||
| goToRoom("maw", state); | goToRoom("maw", state); | ||||
| return false; | return false; | ||||
| } | } | ||||
| }, | }, | ||||
| delay: 3000, | delay: 3000, | ||||
| loop: true, | loop: true, | ||||
| classes: [ | classes: [ | ||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -194,7 +248,7 @@ | |||||
| "name": "Geta's Maw", | "name": "Geta's Maw", | ||||
| "desc": "You've been slurped up into the fox's jaws", | "desc": "You've been slurped up into the fox's jaws", | ||||
| "move": (room, state) => { | "move": (room, state) => { | ||||
| stopClassTimers("free", state); | |||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| startTimer({ | startTimer({ | ||||
| @@ -207,26 +261,26 @@ | |||||
| delay: 5000, | delay: 5000, | ||||
| loop: false, | loop: false, | ||||
| classes: [ | classes: [ | ||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -235,7 +289,7 @@ | |||||
| "name": "Geta's Gullet", | "name": "Geta's Gullet", | ||||
| "desc": "GULP!", | "desc": "GULP!", | ||||
| "move": (room, state) => { | "move": (room, state) => { | ||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| startTimer({ | startTimer({ | ||||
| @@ -248,26 +302,38 @@ | |||||
| delay: 7000, | delay: 7000, | ||||
| loop: false, | loop: false, | ||||
| classes: [ | classes: [ | ||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| { | |||||
| name: "Struggle", | |||||
| desc: "Try to climb back out!", | |||||
| execute: (room, state) => { | |||||
| print(["Nope"]); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| }, | |||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -276,7 +342,7 @@ | |||||
| "name": "Geta's Stomach", | "name": "Geta's Stomach", | ||||
| "desc": "Glorp", | "desc": "Glorp", | ||||
| "move": (room, state) => { | "move": (room, state) => { | ||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| startTimer({ | startTimer({ | ||||
| @@ -289,42 +355,42 @@ | |||||
| delay: 10000, | delay: 10000, | ||||
| loop: false, | loop: false, | ||||
| classes: [ | classes: [ | ||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| { | { | ||||
| name: "Squirm", | |||||
| desc: "Rub at the walls of the fox's churning stomach", | |||||
| execute: (room, state) => { | |||||
| printRandom([ | |||||
| ["You punch and kick at the walls"], | |||||
| ["A powerful churn grabs hold of you, stifling any attempts at struggling"], | |||||
| ["Your little thumps and kicks do little to faze your captor"] | |||||
| ]); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| name: "Squirm", | |||||
| desc: "Rub at the walls of the fox's churning stomach", | |||||
| execute: (room, state) => { | |||||
| printRandom([ | |||||
| ["You punch and kick at the walls"], | |||||
| ["A powerful churn grabs hold of you, stifling any attempts at struggling"], | |||||
| ["Your little thumps and kicks do little to faze your captor"] | |||||
| ]); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| }, | }, | ||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -333,47 +399,47 @@ | |||||
| "name": "Fat", | "name": "Fat", | ||||
| "desc": "You're just fat now", | "desc": "You're just fat now", | ||||
| "move": (room, state) => { | "move": (room, state) => { | ||||
| }, | }, | ||||
| "enter": (room, state) => { | "enter": (room, state) => { | ||||
| }, | }, | ||||
| "exit": (room, state) => { | "exit": (room, state) => { | ||||
| }, | }, | ||||
| "actions": [ | "actions": [ | ||||
| { | { | ||||
| name: "Gurgle", | |||||
| desc: "Glorp", | |||||
| execute: (room, state) => { | |||||
| printRandom([ | |||||
| ["Grrrrgle"], | |||||
| ["Glorp"], | |||||
| ["Glrrrrrrnnnnnn..."], | |||||
| ["Gwoooooorgle"] | |||||
| ]); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| name: "Gurgle", | |||||
| desc: "Glorp", | |||||
| execute: (room, state) => { | |||||
| printRandom([ | |||||
| ["Grrrrgle"], | |||||
| ["Glorp"], | |||||
| ["Glrrrrrrnnnnnn..."], | |||||
| ["Gwoooooorgle"] | |||||
| ]); | |||||
| }, | |||||
| show: [ | |||||
| ], | |||||
| conditions: [ | |||||
| ] | |||||
| }, | }, | ||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| ], | ], | ||||
| "data": { | "data": { | ||||
| "stats": { | "stats": { | ||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| } | } | ||||
| }); | }); | ||||
| })(); | })(); | ||||