diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 766f197eb780d3049eb83746747ebe7b132b42da..2029edfaff07e91525ee414a1a1fa8a1aa515128 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ -/* eslint-disable no-undef */ /* config.history.tracking = false;*/ // State.expired.disable; @@ -16,16 +14,14 @@ window.variableAsNumber = function(x, defaultValue, minValue, maxValue) { } return x; }; + window.isSexuallyPure = /** @param {App.Entity.SlaveState} slave */ function (slave) { if (!slave) { return null; } - if (slave.vagina < 1 && slave.anus < 1 && !slave.analCount && !slave.vaginalCount && !slave.oralCount && !slave.mammaryCount && !slave.penetrativeCount) { - return true; - } else { - return false; - } + return (slave.vagina < 1 && slave.anus < 1 && !slave.analCount && !slave.vaginalCount && !slave.oralCount && !slave.mammaryCount && !slave.penetrativeCount); }; + if (typeof interpolate === "undefined") { const interpolate = function(x0, y0, x1, y1, x) { if (x <= x0) { @@ -68,11 +64,8 @@ window.filterInPlace = function(arr, callback, thisArg) { window.canBreed = function(slave1, slave2) { if (!slave1 || !slave2) { return null; - } else if (slave1.eggType === slave2.ballType) { - return true; - } else { - return false; } + return (slave1.eggType === slave2.ballType); }; /** assuming slave1 is fertile, could slave2 impregnate slave1? @@ -149,46 +142,45 @@ window.milkAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) let calcs; if (!slave) { return null; + } + calcs = slave.boobs - slave.boobsImplant - slave.boobsMilk; + if (calcs > 40000) { + milk = (158 + ((calcs - 10000) / 600)); + } else if (calcs > 25000) { + milk = (128 + ((calcs - 10000) / 500)); + } else if (calcs > 10000) { + milk = (78 + ((calcs - 10000) / 300)); + } else if (calcs > 5000) { + milk = (53 + ((calcs - 5000) / 200)); + } else if (calcs > 2000) { + milk = (29 + ((calcs - 2000) / 125)); + } else if (calcs > 800) { + milk = (16 + ((calcs - 800) / 80)); } else { - calcs = slave.boobs - slave.boobsImplant - slave.boobsMilk; - if (calcs > 40000) { - milk = (158 + ((calcs - 10000) / 600)); - } else if (calcs > 25000) { - milk = (128 + ((calcs - 10000) / 500)); - } else if (calcs > 10000) { - milk = (78 + ((calcs - 10000) / 300)); - } else if (calcs > 5000) { - milk = (53 + ((calcs - 5000) / 200)); - } else if (calcs > 2000) { - milk = (29 + ((calcs - 2000) / 125)); - } else if (calcs > 800) { - milk = (16 + ((calcs - 800) / 80)); - } else { - milk = (8 + ((calcs - 400) / 50)); - } - if (slave.lactation === 2) { - milk *= 1.2; - } - milk += (milk * ((slave.devotion - 50) / 200)); - if (slave.boobsImplant > 200) { - milk *= 0.9; - } - calcs = (slave.hormoneBalance / 50); - if (slave.balls !== 0 && calcs > -2) { - calcs -= 1; - } else if (slave.ovaries !== 1 && calcs < 2) { - calcs += 1; - } - milk *= (1 + (calcs * 0.1)); - milk *= (1 + (slave.preg / 100)); - milk *= (1 + (slave.health / 50)); - milk *= (1 + (slave.weight / 500)); - milk *= (1 + (slave.lactationAdaptation / 500)); - milk += (slave.boobsMilk / 100); - milk = Math.trunc(milk); - milk = Math.clamp(milk, 1, 1000000000000000000); - return milk; + milk = (8 + ((calcs - 400) / 50)); + } + if (slave.lactation === 2) { + milk *= 1.2; + } + milk += (milk * ((slave.devotion - 50) / 200)); + if (slave.boobsImplant > 200) { + milk *= 0.9; } + calcs = (slave.hormoneBalance / 50); + if (slave.balls !== 0 && calcs > -2) { + calcs -= 1; + } else if (slave.ovaries !== 1 && calcs < 2) { + calcs += 1; + } + milk *= (1 + (calcs * 0.1)); + milk *= (1 + (slave.preg / 100)); + milk *= (1 + (slave.health / 50)); + milk *= (1 + (slave.weight / 500)); + milk *= (1 + (slave.lactationAdaptation / 500)); + milk += (slave.boobsMilk / 100); + milk = Math.trunc(milk); + milk = Math.clamp(milk, 1, 1000000000000000000); + return milk; }; window.cumAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) { @@ -196,46 +188,45 @@ window.cumAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) let calcs = 0; if (!slave) { return null; + } + if (slave.drugs === "testicle enhancement") { + cum = ((slave.balls * 3.5) + 1); + } else if (slave.drugs === "hyper testicle enhancement") { + cum = ((slave.balls * 5) + 1); } else { - if (slave.drugs === "testicle enhancement") { - cum = ((slave.balls * 3.5) + 1); - } else if (slave.drugs === "hyper testicle enhancement") { - cum = ((slave.balls * 5) + 1); - } else { - cum = ((slave.balls * 2.5) + 1); - } - if (slave.ballType === "sterile") { - cum *= 0.8; - } - if (slave.diet === "cum production") { - cum *= 1.2; - } - calcs = (slave.hormoneBalance / 50); - cum *= (1 - (calcs * 0.1)); - if (slave.scrotum === 0) { - cum *= 0.8; - } - if (slave.prostate === 0) { - cum *= 0.2; // being generous here - } else if (slave.prostate === 2) { - cum *= 1.2; - } else if (slave.prostate === 3) { - cum *= 1.5; - } - if (slave.devotion > 50) { - cum += (cum * (slave.devotion / 100)); - } else if (slave.devotion < -50) { - cum += (cum * (slave.devotion / 100)); - } - if (slave.health > 50) { - cum += (cum * (slave.health / 50)); - } else if (slave.health < -50) { - cum += (cum * (slave.health / 50)); - } - cum = Math.trunc(cum); - cum = Math.clamp(cum, 1, 1000000000000000000); - return cum; + cum = ((slave.balls * 2.5) + 1); + } + if (slave.ballType === "sterile") { + cum *= 0.8; + } + if (slave.diet === "cum production") { + cum *= 1.2; + } + calcs = (slave.hormoneBalance / 50); + cum *= (1 - (calcs * 0.1)); + if (slave.scrotum === 0) { + cum *= 0.8; + } + if (slave.prostate === 0) { + cum *= 0.2; // being generous here + } else if (slave.prostate === 2) { + cum *= 1.2; + } else if (slave.prostate === 3) { + cum *= 1.5; + } + if (slave.devotion > 50) { + cum += (cum * (slave.devotion / 100)); + } else if (slave.devotion < -50) { + cum += (cum * (slave.devotion / 100)); + } + if (slave.health > 50) { + cum += (cum * (slave.health / 50)); + } else if (slave.health < -50) { + cum += (cum * (slave.health / 50)); } + cum = Math.trunc(cum); + cum = Math.clamp(cum, 1, 1000000000000000000); + return cum; }; window.lispReplace = function (text) {