Browse Source

Add color changes to the stat bars

geta
Fen Dweller 5 years ago
parent
commit
9a21a02eef
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      stories/geta-unaware.js

+ 8
- 7
stories/geta-unaware.js View File

@@ -121,11 +121,12 @@

state.geta = {};

state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,55,55)" };
state.player.stats.stamina = { name: "Stamina", type: "meter", value: 100, min: 0, max: 100, color: "rgb(55,255,55)", hidden: true };
state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)" };
state.player.stats.mawPos = { "name": "Struggle", "type": "meter", "value": 0.5, "min": 0, "max": 1, "color": "rgb(0,255,0)", hidden: true }
state.player.stats.throatPos = { "name": "Descent", "type": "meter", "value": 0.25, "min": 0, "max": 1, "color": "rgb(155,0,0)", hidden: true }
state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: (self) => "rgb(" + (155+self.value) + "," + (self.value/2) + "," + (self.value/2) + ")" };
state.player.stats.stamina = { name: "Stamina", type: "meter", value: 100, min: 0, max: 100, color: (self) => "rgb(55," + (155+self.value) + ",55)", hidden: true };
state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: (self) => "rgb(" + (100+self.value) + ",100,100)" };
state.player.stats.mawPos = { "name": "Struggle", "type": "meter", "value": 0.5, "min": 0, "max": 1, "color": (self) =>
(self.value <= 0.15 || self.value >= 0.85) ? "rgb(255,100,0)" : "rgb(0,255,0)", hidden: true }
state.player.stats.throatPos = { "name": "Descent", "type": "meter", "value": 0.25, "min": 0, "max": 1, "color": (self) => "rgb(" + (100+155*self.value) + ",0,0)", hidden: true }

state.info.time.value = 60 * 60 * 7 + 60 * 17;

@@ -640,7 +641,7 @@
}

if (choice == "swallow") {
if (getStat("mawPos") < 0.15) {
if (getStat("mawPos") <= 0.15) {
print(["You're too far back. The fox swallows a mouthful of cereal, taking you with it."]);
goToRoom("throat");
return false;
@@ -667,7 +668,7 @@
state.geta.slurps += 1;
return Math.random() * 1000 + 2500;
} else if (choice == "chew") {
if (getStat("mawPos") > 0.85) {
if (getStat("mawPos") >= 0.85) {
const limb = randomBodyPart();
state.player.limbs[limb] = false;
const limbName = limbs[limb];


Loading…
Cancel
Save