瀏覽代碼

Limited digestion to 10 things at a time

tags/v0.7.0
Fen Dweller 7 年之前
父節點
當前提交
89ea7aa3f7
共有 1 個文件被更改,包括 14 次插入13 次删除
  1. +14
    -13
      game.js

+ 14
- 13
game.js 查看文件

@@ -4,8 +4,8 @@ var scale = 1;

var strolling = false;

var stomachDigesting = 0;
var bowelsDigesting = 0;
var maxStomachDigest = 10;
var maxBowelsDigest = 10;

victims = {};

@@ -102,11 +102,9 @@ function feed()

stomach.push(prey);

if (stomachDigesting == 0)
if (stomach.length == 1)
setTimeout(function() { doDigest("stomach"); }, 15000);

++stomachDigesting;

updateVictims("stomach",prey);
update([line]);
}
@@ -135,11 +133,9 @@ function anal_vore()

bowels.push(prey);

if (bowelsDigesting == 0)
if (bowels.length == 1)
setTimeout(function() { doDigest("bowels"); }, 15000);

++bowelsDigesting;

updateVictims("bowels",prey);
update([line]);
}
@@ -212,14 +208,14 @@ function grow()
function doDigest(containerName)
{
var digestType = containerName == "stomach" ? stomach : bowels;
var count = 0;
var count = 0

if (containerName == "stomach") {
count = stomachDigesting;
stomachDigesting = 0;
count = stomach.length;
count = Math.min(count,maxStomachDigest);
} else if (containerName == "bowels") {
count = bowelsDigesting;
bowelsDigesting = 0;
count = bowels.length;
count = Math.min(count,maxBowelsDigest);
}

var container = new Container();
@@ -246,6 +242,11 @@ function doDigest(containerName)
else if (containerName == "bowels")
update(["Your bowels churn as they absorb " + container.describe() + " " + summarize(container.sum())]);

if (digestType.length > 0) {
setTimeout(function() {
doDigest(containerName);
}, 15000);
}
}

window.addEventListener('load', function(event) {


Loading…
取消
儲存