| @@ -1,6 +1,11 @@ | |||||
| (() => { | (() => { | ||||
| function checkSuspicion(state, add = 0) { | function checkSuspicion(state, add = 0) { | ||||
| const old = getStat("suspicion", state); | const old = getStat("suspicion", state); | ||||
| if (add >= 0) { | |||||
| add *= state.geta.awareness; | |||||
| } | |||||
| changeStat("suspicion", add, state); | changeStat("suspicion", add, state); | ||||
| if (getStat("suspicion", state) >= 100) { | if (getStat("suspicion", state) >= 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."]); | ||||
| @@ -23,6 +28,9 @@ | |||||
| "intro": { | "intro": { | ||||
| "start": "pepper-grinder", | "start": "pepper-grinder", | ||||
| "setup": state => { | "setup": state => { | ||||
| state.geta = {}; | |||||
| state.geta.awareness = 1; | |||||
| state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,55,55)" }; | state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,55,55)" }; | ||||
| 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.info.time.value = 60 * 60 * 7 + 60 * 17; | ||||
| @@ -56,7 +64,6 @@ | |||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| startTimer({ | startTimer({ | ||||
| id: "timeout", | id: "timeout", | ||||
| func: state => { | func: state => { | ||||
| @@ -78,6 +85,60 @@ | |||||
| ] | ] | ||||
| }, state); | }, state); | ||||
| startTimer({ | |||||
| id: "geta-action", | |||||
| func: state => { | |||||
| const random = Math.random(); | |||||
| if (random < 0.7) { | |||||
| print(["Geta slurps up a spoonful of cereal."]); | |||||
| } else if (random < 0.9) { | |||||
| state.geta.awareness = 0.1; | |||||
| print(["The fox yawns and stretches."]); | |||||
| startTimer({ | |||||
| id: "yawn-end", | |||||
| func: state => { | |||||
| print(["Geta finishes his stretch"]); | |||||
| state.geta.awareness = 1; | |||||
| return true; | |||||
| }, | |||||
| delay: 2000, | |||||
| loop: false, | |||||
| classes: [ | |||||
| "free" | |||||
| ] | |||||
| }, state); | |||||
| } else { | |||||
| state.geta.awareness = 2; | |||||
| print(["Geta narrows his eyes and looks around the table. Something seems off to him..."]); | |||||
| startTimer({ | |||||
| id: "squint-end", | |||||
| func: state => { | |||||
| print(["He goes back to his breakfast."]); | |||||
| state.geta.awareness = 1; | |||||
| return true; | |||||
| }, | |||||
| delay: 4000, | |||||
| loop: false, | |||||
| classes: [ | |||||
| "free" | |||||
| ] | |||||
| }, state); | |||||
| } | |||||
| return 5000 | |||||
| }, | |||||
| delay: 5000, | |||||
| loop: true, | |||||
| classes: [ | |||||
| "free" | |||||
| ] | |||||
| }, state); | |||||
| }, | }, | ||||
| "intro": state => { | "intro": state => { | ||||
| @@ -151,17 +212,17 @@ | |||||
| ] | ] | ||||
| }, | }, | ||||
| "left": { | "left": { | ||||
| "target": "table", | |||||
| "desc": "Run out into the open", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| "target": "table", | |||||
| "desc": "Run out into the open", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | }, | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||
| @@ -256,17 +317,17 @@ | |||||
| ], | ], | ||||
| "exits": { | "exits": { | ||||
| "right": { | "right": { | ||||
| "target": "pepper-grinder", | |||||
| "desc": "Run back to cover", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| "target": "pepper-grinder", | |||||
| "desc": "Run back to cover", | |||||
| "show": [ | |||||
| ], | |||||
| "conditions": [ | |||||
| ], | |||||
| "hooks": [ | |||||
| ] | |||||
| }, | }, | ||||
| }, | }, | ||||
| "hooks": [ | "hooks": [ | ||||