Переглянути джерело

Basic crop logic

tags/v0.7.1
Fen Dweller 7 роки тому
джерело
коміт
06f03d254b
3 змінених файлів з 78 додано та 3 видалено
  1. +52
    -2
      game.js
  2. +15
    -1
      recursive-desc.js
  3. +11
    -0
      stroll.html

+ 52
- 2
game.js Переглянути файл

@@ -910,6 +910,47 @@ let macro =
"stages": 3
},

"cropEnabled": false,

"crop": {
"name" : "crop",
"setup": function(owner) {
this.owner = owner;
for (let i = 0; i < this.stages; i++)
this.contents.push(new Container());
owner.digest(owner, this, owner.cropTransferTime);
},
"feed": function(prey) {
this.feedFunc(prey,this,this.owner);
},
"feedFunc": function(prey,self,owner) {
this.contents[0] = this.contents[0].merge(prey);
},
"describeDigestion" : function(container) {
return describe("crop-transfer",container,this.owner,verbose);
},
"describeMove" : function(container) {
return describe("crop-transfer",container,this.owner,verbose);
},
"fill": function(owner,container) {

},
get description() {
let prey = new Container();
this.contents.forEach(function(x) {
prey = prey.merge(x);
});

if (prey.count == 0) {
return "Your crop don't contain any prey.";
} else {
return "Your crop bulges with " + prey.describe(false) + ".";
}
},
"contents" : [],
"stages": 3
},

// holding spots

hasPouch: true,
@@ -1013,6 +1054,7 @@ let macro =
this.souls.setup(this);
this.goo.setup(this);
this.pawsVore.setup(this);
this.crop.setup(this);
this.cumStorage.owner = this;
this.femcumStorage.owner = this;
this.milkStorage.owner = this;
@@ -1030,6 +1072,8 @@ let macro =
this.tail.moves = this.stomach;
}

this.crop.moves = this.stomach;

if (this.maleParts)
this.fillCum(this);
if (this.femaleParts)
@@ -1849,7 +1893,6 @@ function feed()
let area = macro.handArea;
let prey = getPrey(biome, area, macro.sameSizeVore);

let line = describe("eat", prey, macro, verbose);
let linesummary = summarize(prey.sum(), false);

let people = get_living_prey(prey.sum());
@@ -1858,9 +1901,16 @@ function feed()

let sound = getSound("swallow",preyMass);

let line = "";

if (macro.cropEnabled) {
macro.crop.feed(prey);
line = describe("crop-swallow", prey, macro, verbose);
} else {
macro.stomach.feed(prey);
line = describe("eat", prey, macro, verbose);
}

macro.stomach.feed(prey);

add_victim_people("eaten",prey);



+ 15
- 1
recursive-desc.js Переглянути файл

@@ -30,7 +30,7 @@ var actions = ["eat","chew","vomit","stomp","stomp-wedge","flex-toes","kick","an
"soul-digest","wear-shoe","remove-shoe","wear-sock","remove-sock","stuff-shoe","dump-shoe","stuff-sock","dump-sock","piss","bladder-vore","scat",
"sheath-toy","slit-toy","breast-toy","melt","solidify","flood","stomp-goo","goo-digest","ass-goo","goo-stomach-pull","goo-stomach-push",
"goo-bowels-pull","goo-bowels-push","goo-womb-pull","goo-womb-push","goo-balls-pull","goo-balls-push","goo-breasts-pull","goo-breasts-push",
"goo-tail-pull","goo-tail-push","goo-paws-pull","goo-paws-push","paw-vore","paw-vore-toes","paws"];
"goo-tail-pull","goo-tail-push","goo-paws-pull","goo-paws-push","paw-vore","paw-vore-toes","paws","crop-swallow","crop-transfer"];

for (let i=0; i<actions.length; i++) {
rules[actions[i]] = [];
@@ -977,6 +977,20 @@ function defaultPaws(container, macro, verbose) {
return "Your " + macro.footOnlyDesc(true) + " fully absorb " + container.describe(false) + ".";
}

function defaultCropSwallow(container, macro, verbose) {
if (container.count == 0)
return "You reach down for a delicious treat and grab - oh, nothing.";
else
return "You scoop up " + container.describe(verbose) + " and swallow " + (container.count > 1 ? "them" : "it") + " whole, pulling your prey into your crop.";
}

function defaultCropTransfer(container, macro, verbose) {
if (container.count == 0)
return "You have nothing in your crop";
else
return "Your throat squeezes, forcing " + container.describe(verbose) + " out of your crop and in to your stomach.";
}

// EATING

rules["eat"].push({


+ 11
- 0
stroll.html Переглянути файл

@@ -1063,6 +1063,17 @@
</li>
</div>
</div>

<div class="custom-category">
<input autocomplete="off" class="custom-header-checkbox" type="checkbox" id="cropEnabled" name="cropEnabled" />
<label class="custom-header" for="cropEnabled">Crop</label>
<div class="reveal-if-active">
<li>
<label for="pawDigestTime">Transfer time (0 for manual)</label>
<input autocomplete="off" type="number" step="any" id="cropTransferTime" name="cropTransferTime" placeholder="15">
</li>
</div>
</div>
</ul>
</form>
</div>


Завантаження…
Відмінити
Зберегти