浏览代码

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 strolling = false;


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


victims = {}; victims = {};


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


stomach.push(prey); stomach.push(prey);


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


++stomachDigesting;

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


bowels.push(prey); bowels.push(prey);


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


++bowelsDigesting;

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


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


var container = new Container(); var container = new Container();
@@ -246,6 +242,11 @@ function doDigest(containerName)
else if (containerName == "bowels") else if (containerName == "bowels")
update(["Your bowels churn as they absorb " + container.describe() + " " + summarize(container.sum())]); 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) { window.addEventListener('load', function(event) {


正在加载...
取消
保存