浏览代码

Organ Streching

*added ability for organs to strech based on capacity
*added comments explaining rates/times in human terms
*adjusted digestion to take size of organ into account
*adjusted how organ size displays to take changing sizes into account
master
jsb5468 5 年前
父节点
当前提交
3a897ac2cb
共有 2 个文件被更改,包括 55 次插入9 次删除
  1. +53
    -7
      feast.js
  2. +2
    -2
      vore.js

+ 53
- 7
feast.js 查看文件

@@ -8,7 +8,7 @@ let currentFoe = null;
let dirButtons = []; let dirButtons = [];
let mode = "explore"; let mode = "explore";
let actions = []; let actions = [];
let time = 9*60*60;
let time = 9*60*60; //time is calculated in seconds
let date = 1; let date = 1;
let newline = " "; let newline = " ";


@@ -255,26 +255,27 @@ function updateDisplay() {
document.getElementById("stat-dex").innerHTML = "Dex: " + player.dex; document.getElementById("stat-dex").innerHTML = "Dex: " + player.dex;
document.getElementById("stat-con").innerHTML = "Con: " + player.con; document.getElementById("stat-con").innerHTML = "Con: " + player.con;
document.getElementById("stat-arousal").innerHTML = "Arousal: " + round(player.arousal,0) + "/" + round(player.arousalLimit(),0); document.getElementById("stat-arousal").innerHTML = "Arousal: " + round(player.arousal,0) + "/" + round(player.arousalLimit(),0);
document.getElementById("stat-stomach").innerHTML = "Stomach: " + round(player.stomach.fullness(),0) + "/" + player.stomach.capacity;
document.getElementById("stat-stomach").innerHTML = "Stomach: " + round(player.stomach.fullness(),0) + "/" + round(player.stomach.capacity, 0);
if (player.prefs.pred.anal || player.prefs.scat) if (player.prefs.pred.anal || player.prefs.scat)
document.getElementById("stat-bowels").innerHTML = "Bowels: " + round(player.bowels.fullness(),0) + "/" + player.bowels.capacity;
document.getElementById("stat-bowels").innerHTML = "Bowels: " + round(player.bowels.fullness(),0) + "/" + round(player.bowels.capacity, 0);
else else
document.getElementById("stat-bowels").innerHTML = ""; document.getElementById("stat-bowels").innerHTML = "";
if (player.prefs.pred.cock) if (player.prefs.pred.cock)
document.getElementById("stat-balls").innerHTML = "Balls: " + round(player.balls.fullness(),0) + "/" + player.balls.capacity;
document.getElementById("stat-balls").innerHTML = "Balls: " + round(player.balls.fullness(),0) + "/" + round(player.balls.capacity, 0);
else else
document.getElementById("stat-balls").innerHTML = ""; document.getElementById("stat-balls").innerHTML = "";
if (player.prefs.pred.unbirth) if (player.prefs.pred.unbirth)
document.getElementById("stat-womb").innerHTML = "Womb: " + round(player.womb.fullness(),0) + "/" + player.womb.capacity;
document.getElementById("stat-womb").innerHTML = "Womb: " + round(player.womb.fullness(),0) + "/" + round(player.womb.capacity, 0);
else else
document.getElementById("stat-womb").innerHTML = ""; document.getElementById("stat-womb").innerHTML = "";
if (player.prefs.pred.breast) if (player.prefs.pred.breast)
document.getElementById("stat-breasts").innerHTML = "Breasts: " + round(player.breasts.fullness(),0) + "/" + player.breasts.capacity;
document.getElementById("stat-breasts").innerHTML = "Breasts: " + round(player.breasts.fullness(),0) + "/" + round(player.breasts.capacity, 0);
else else
document.getElementById("stat-breasts").innerHTML = ""; document.getElementById("stat-breasts").innerHTML = "";


} }



function advanceTimeTo(newTime, conscious=true) { function advanceTimeTo(newTime, conscious=true) {
advanceTime((86400 + newTime - time) % 86400, conscious); advanceTime((86400 + newTime - time) % 86400, conscious);
} }
@@ -294,6 +295,7 @@ function advanceTime(amount, conscious=true) {
update(player.balls.digest(amount)); update(player.balls.digest(amount));
update(player.womb.digest(amount)); update(player.womb.digest(amount));
update(player.breasts.digest(amount)); update(player.breasts.digest(amount));
stretchOrgans(amount);


if (conscious) { if (conscious) {
update(player.buildArousal(amount)); update(player.buildArousal(amount));
@@ -380,6 +382,7 @@ function start() {
document.getElementById("save-button").addEventListener("click", saveGameButton, false); document.getElementById("save-button").addEventListener("click", saveGameButton, false);
loadCompass(); loadCompass();
loadDialog(); loadDialog();
setupStrechableOrgans();
world = createWorld(); world = createWorld();
currentRoom = world["Bedroom"]; currentRoom = world["Bedroom"];
respawnRoom = currentRoom; respawnRoom = currentRoom;
@@ -904,10 +907,53 @@ function status() {
} }
} }


update(lines);
}


function checkOverfill(organ,returnValue=false, returnPercent=false){
let percentFilled = (round(player[organ].fullness(),0) / player[organ].capacity);
if (returnValue == false){
if (percentFilled > 1){
return (true);
}else{
return (false);
}
}else{
if (returnPercent == true){
return (round(player[organ].fullness(),0));
}else{
return (round(player[organ].fullness(),0) - player[organ].capacity);
}
}
}


var strechableOrgans = ["stomach","bowels","balls","womb","breasts"];


update(lines);
function setupStrechableOrgans(){
strechableOrgans = ["stomach"];

if (player.prefs.pred.anal || player.prefs.scat){ //these if conditions are copied from the if statements above that define if the stat menu shows stats for a set organ
strechableOrgans.push("bowels");
}if (player.prefs.pred.cock){
strechableOrgans.push("balls");
}if (player.prefs.pred.unbirth){
strechableOrgans.push("womb");
}if (player.prefs.pred.breast){
strechableOrgans.push("breasts");
}
}

function stretchOrgans(time){
for (i=0; i<strechableOrgans.length; i++){
let organ = strechableOrgans[i];
let overfillState = checkOverfill(organ, false, false);
if (overfillState == true){
excessMass = checkOverfill(organ,true, false);
massDigested = time*player[organ].digestRate;
massDigested = Math.min(excessMass, massDigested);
player[organ].capacity += massDigested;
}
}
} }


let toSave = ["str","dex","con","name","species","health","stamina"]; let toSave = ["str","dex","con","name","species","health","stamina"];


+ 2
- 2
vore.js 查看文件

@@ -360,7 +360,7 @@ function Container(owner) {
this.capacity = 100; this.capacity = 100;


// kg/sec // kg/sec
this.digestRate = 80 / 8640;
this.digestRate = 80 / 8640; //100kg/3hr equivalent


this.digest = function(time) { this.digest = function(time) {
let lines = []; let lines = [];
@@ -380,7 +380,7 @@ function Container(owner) {
} }


if (prey.health <= 0) { if (prey.health <= 0) {
let digested = Math.min(prey.mass, this.digestRate * time);
let digested = Math.min(prey.mass, this.digestRate * time * (this.capacity/100));


prey.mass -= digested; prey.mass -= digested;




正在加载...
取消
保存