Просмотр исходного кода

Improve population tracking

mass-vore
Fen Dweller 6 лет назад
Родитель
Сommit
45e499e6d0
1 измененных файлов: 8 добавлений и 4 удалений
  1. +8
    -4
      stories/mass-vore.js

+ 8
- 4
stories/mass-vore.js Просмотреть файл

@@ -4,7 +4,9 @@
function devour(state, count) { function devour(state, count) {
state.player.stats.stomach.value += count; state.player.stats.stomach.value += count;
state.player.stats.eaten.value += count; state.player.stats.eaten.value += count;
state.info.population.value -= count;

state.world[state.player.location].data.stats.population.value -= count;
playRandomSfx("swallow"); playRandomSfx("swallow");
} }


@@ -137,7 +139,9 @@
type: "counter", type: "counter",
min: 0, min: 0,
max: 5000000, max: 5000000,
value: 5000000,
get value() {
return state.world.city.data.stats.population.value;
},
get render() {return this.value}, get render() {return this.value},
color: "rgb(255,255,255)" color: "rgb(255,255,255)"
}; };
@@ -149,7 +153,7 @@
world: { world: {
"city": { "city": {
id: "city", id: "city",
name: "City",
name: "Downtown",
desc: "A city, full of tasty prey", desc: "A city, full of tasty prey",
move: (room, state) => { move: (room, state) => {
@@ -187,7 +191,7 @@
}, },
data: { data: {
stats: { stats: {
population: {name: "Population", min: 0, max: 1000000, value: 1000000, type: "meter", color: "rgb(255,255,255)"}
} }
} }
} }


Загрузка…
Отмена
Сохранить