Преглед на файлове

Make Geta randomly eat cereal, yawn, and look closely for the player

geta
Fen Dweller преди 6 години
родител
ревизия
1258241a61
променени са 1 файла, в които са добавени 84 реда и са изтрити 23 реда
  1. +84
    -23
      stories/geta-unaware.js

+ 84
- 23
stories/geta-unaware.js Целия файл

@@ -1,6 +1,11 @@
(() => {
function checkSuspicion(state, add = 0) {
const old = getStat("suspicion", state);

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

changeStat("suspicion", add, state);
if (getStat("suspicion", state) >= 100) {
print(["Geta spots you!", "You're snatched up and tossed into the fox's bowl of cereal."]);
@@ -23,6 +28,9 @@
"intro": {
"start": "pepper-grinder",
"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.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;
@@ -56,7 +64,6 @@
]
}, state);


startTimer({
id: "timeout",
func: state => {
@@ -78,6 +85,60 @@
]
}, 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 => {
@@ -151,17 +212,17 @@
]
},
"left": {
"target": "table",
"desc": "Run out into the open",
"show": [
],
"conditions": [
],
"hooks": [
]
"target": "table",
"desc": "Run out into the open",
"show": [
],
"conditions": [
],
"hooks": [
]
},
},
"hooks": [
@@ -256,17 +317,17 @@
],
"exits": {
"right": {
"target": "pepper-grinder",
"desc": "Run back to cover",
"show": [
],
"conditions": [
],
"hooks": [
]
"target": "pepper-grinder",
"desc": "Run back to cover",
"show": [
],
"conditions": [
],
"hooks": [
]
},
},
"hooks": [


Loading…
Отказ
Запис