Kaynağa Gözat

Add stats for total food and for food from clicks

tags/v0.1.0
Fen Dweller 6 yıl önce
ebeveyn
işleme
fca19703fa
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: E80B35A6F11C3656
2 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. +6
    -0
      constants.js
  2. +5
    -1
      gorge.js

+ 6
- 0
constants.js Dosyayı Görüntüle

@@ -1462,6 +1462,12 @@ const statTypes = {
}, },
clicks: { clicks: {
name: "Clicks" name: "Clicks"
},
foodClicked: {
name: "Food from clicks"
},
food: {
name: "Total food"
} }
} }




+ 5
- 1
gorge.js Dosyayı Görüntüle

@@ -291,7 +291,10 @@ function updateProductivity() {


function addResources(delta) { function addResources(delta) {
for (const [resource, amount] of Object.entries(currentProductivity)) { for (const [resource, amount] of Object.entries(currentProductivity)) {
resources[resource] += amount * delta / 1000;
const gained = amount * delta / 1000;
resources[resource] += gained;
if (resource == "food")
stats.food += gained;
} }
} }


@@ -496,6 +499,7 @@ function buyUpgrade(id, e) {
function eatPrey() { function eatPrey() {
const add = clickPowers.clickMultiplier * (buildings[clickPowers.clickVictim]["prod"].food * 10 + clickPowers.clickBonus); const add = clickPowers.clickMultiplier * (buildings[clickPowers.clickVictim]["prod"].food * 10 + clickPowers.clickBonus);
resources.food += add; resources.food += add;
stats.foodClicked += add;
return add; return add;
} }




Yükleniyor…
İptal
Kaydet