瀏覽代碼

Display Geta's current awareness

geta
Fen Dweller 6 年之前
父節點
當前提交
f962ba2c40
共有 1 個檔案被更改,包括 28 行新增11 行删除
  1. +28
    -11
      stories/geta-unaware.js

+ 28
- 11
stories/geta-unaware.js 查看文件

@@ -3,7 +3,7 @@
const old = getStat("suspicion", state);

if (add >= 0) {
add *= state.geta.awareness;
add *= state.info.awareness.value;
}

changeStat("suspicion", add, state);
@@ -28,8 +28,22 @@
"intro": {
"start": "pepper-grinder",
"setup": state => {
state.geta = {};
state.geta.awareness = 1;
state.info.awareness = {
id: "awareness",
name: "Geta's Awareness",
type: "counter",
value: 1,
get render() {
if (this.value < 1) {
return "Distracted";
} else if (this.value == 1) {
return "Normal"
} else {
return "Alert"
}
}
}

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)" };
@@ -92,44 +106,47 @@

if (random < 0.7) {
print(["Geta slurps up a spoonful of cereal."]);
return Math.random() * 3000 + 3000
} else if (random < 0.9) {
state.geta.awareness = 0.1;
state.info.awareness.value = 0.1;
print(["The fox yawns and stretches."]);

startTimer({
id: "yawn-end",
func: state => {
print(["Geta finishes his stretch"]);
state.geta.awareness = 1;
state.info.awareness.value = 1;
return true;
},
delay: 2000,
delay: 5000,
loop: false,
classes: [
"free"
]
}, state);
return Math.random() * 3000 + 5000

} else {
state.geta.awareness = 2;
state.info.awareness.value = 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;
state.info.awareness.value = 1;
return true;
},
delay: 4000,
delay: 5000,
loop: false,
classes: [
"free"
]
}, state);

return Math.random() * 1000 + 6000

}
return 5000
},
delay: 5000,
loop: true,
@@ -437,7 +454,7 @@
"name": "Geta's Maw",
"desc": "You've been slurped up into the fox's jaws",
"move": (room, state) => {
},
"enter": (room, state) => {
stopClassTimers("free", state);


Loading…
取消
儲存