diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 1fd0c022fe6d3a362ee58d9ea2b1f8714a8bf174..e344a3621459f37bd3d7b9c79ddca00a4a4c425c 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -7420,23 +7420,21 @@ window.TatScore = function(slave) { }; window.slimPass = function(slave) { - var slimPass = 0; - var ArcologyZero = State.variables.arcologies[0]; + let slimPass = 0; + let ArcologyZero = State.variables.arcologies[0]; if (ArcologyZero.FSSlimnessEnthusiastLaw === 1) { if ((slave.boobs < 300) && (slave.butt <= 1) && (slave.waist <= 10)) { - State.variables.slimPass = 1; if ((ArcologyZero.FSPhysicalIdealist === "unset") && (ArcologyZero.FSHedonisticDecadenceStrongFat === 0) && (slave.muscles > 30)) { /*muscle check*/ slimPass = 0; - } - if (State.variables.slimPass === 1) { - if ((ArcologyZero.FSHedonisticDecadence !== "unset") || (ArcologyZero.FSPhysicalIdealistStrongFat === 1)) { /*weight check*/ - if (slave.weight > 30) { - slimPass = 0; - } - } else if (slave.weight > 10) { + } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") || (ArcologyZero.FSPhysicalIdealistStrongFat === 1)) { /*weight check*/ + if (slave.weight > 30) { slimPass = 0; } + } else if (slave.weight > 10) { + slimPass = 0; + } else { + slimPass = 1; } } } @@ -9370,8 +9368,7 @@ window.Deadliness = function Deadliness(slave) { deadliness -= 1; } - deadlines = Math.max(deadliness, 1); - V.deadliness = deadliness; + return Math.max(deadliness, 1); }; /*:: relationshipChecks [script]*/ @@ -11352,7 +11349,7 @@ window.FResult = (function() { "use strict"; // we can't initialise our global variables on load, because SugarCube.State isn't initialised // instead, declare them and initialise on run time - let V, incest_bonus; + let V, result, incest_bonus; function FResult(slave) { V = State.variables; incest_bonus = V.arcologies[0].FSEgyptianRevivalist > 20 || V.arcologies[0].FSEgyptianRevivalistIncestPolicy === 1; @@ -11361,15 +11358,15 @@ window.FResult = (function() { if (!slave.fuckdoll) calcNotFuckdoll(slave); else - V.FResult += slave.fuckdoll/10; + result += slave.fuckdoll/10; - V.FResult += Math.max(0, slave.aphrodisiacs) * 2; + result += Math.max(0, slave.aphrodisiacs) * 2; if (slave.inflationType === "aphrodisiac") - V.FResult += slave.inflation*4; + result += slave.inflation*4; if (slave.lactation > 0) - V.FResult += 1; + result += 1; if (slave.nipples === "fuckable") calcFuckableTits(slave); @@ -11377,67 +11374,68 @@ window.FResult = (function() { if (V.seeAge === 1) calcAge(slave); if (slave.fetish === "mindbroken") - V.FResult = Math.trunc(V.FResult*0.4); + result = Math.trunc(result*0.4); else - V.FResult = Math.trunc(V.FResult*0.7); + result = Math.trunc(result*0.7); if (slave.pregWeek < 0) - V.FResult -= Math.trunc(V.FResult*slave.pregWeek/10); // reduced the most just after birth + result -= Math.trunc(result*slave.pregWeek/10); // reduced the most just after birth calcAmputation(slave); if (V.arcologies[0].FSHedonisticDecadence > 20) calcHedonismWeight(slave); - if (V.FResult < 2) { + if (result < 2) { if (supremeRaceP(slave) && V.arcologies[0].FSSupremacist > 20) - V.FResult = 0; + result = 0; else - V.FResult = 2; + result = 2; } + return result; } function calcUseWeights(slave) { - V.FResult = (3 - slave.anus)+(slave.muscles/30); + result = (3 - slave.anus)+(slave.muscles/30); if (slave.muscles < -95) - V.FResult -= 5; + result -= 5; else if (slave.muscles < -30) - V.FResult -= 2; + result -= 2; const uses = V.oralUseWeight + V.vaginalUseWeight + V.analUseWeight; if (uses <= 0) return; - V.FResult += (6+slave.tonguePiercing) * (V.oralUseWeight/uses) * (slave.oralSkill/30); + result += (6+slave.tonguePiercing) * (V.oralUseWeight/uses) * (slave.oralSkill/30); if (slave.sexualFlaw === "cum addict") - V.FResult += (V.oralUseWeight/uses) * (slave.oralSkill/30); + result += (V.oralUseWeight/uses) * (slave.oralSkill/30); if (canDoVaginal(slave)) { - V.FResult += 6 * (V.vaginalUseWeight/uses) * (slave.vaginalSkill/30); - V.FResult += (3 - slave.vagina); - V.FResult += slave.vaginaLube; + result += 6 * (V.vaginalUseWeight/uses) * (slave.vaginalSkill/30); + result += (3 - slave.vagina); + result += slave.vaginaLube; } if (canDoAnal(slave)) { - V.FResult += 6 * (V.analUseWeight/uses) * (slave.analSkill/30); + result += 6 * (V.analUseWeight/uses) * (slave.analSkill/30); if (slave.sexualFlaw === "anal addict") - V.FResult += (V.analUseWeight/uses) * (slave.analSkill/30); + result += (V.analUseWeight/uses) * (slave.analSkill/30); if (slave.inflationType === "aphrodisiac") - V.FResult += (V.analUseWeight/uses) * (slave.inflation * 3); + result += (V.analUseWeight/uses) * (slave.inflation * 3); } } function calcFuckableTits(slave) { - V.FResult += 2; + result += 2; if (slave.fetish === "boobs") - V.FResult += Math.trunc(slave.fetishStrength/20); + result += Math.trunc(slave.fetishStrength/20); } function calcWorksWithRelatives(slave) { V.slaves.forEach(islave => { if (isParentP(slave, islave) && sameAssignmentP(slave, islave)) { - V.FResult += 1; - if (incest_bonus) V.FResult += 1; + result += 1; + if (incest_bonus) result += 1; } if (areSisters(slave, islave) > 0 && sameAssignmentP(slave, islave)) { - V.FResult += 1; - if (incest_bonus) V.FResult += 1; + result += 1; + if (incest_bonus) result += 1; } }); } @@ -11445,8 +11443,8 @@ window.FResult = (function() { function calcWorksWithRelativesVanilla(slave) { const fre = getSlave(slave.relationTarget) if (fre !== undefined && sameAssignmentP(slave, fre)) { - V.FResult += 2; - if (incest_bonus) V.FResult += 2; + result += 2; + if (incest_bonus) result += 2; } } @@ -11454,94 +11452,92 @@ window.FResult = (function() { const fre = V.slaves.findIndex(s => { return haveRelationshipP(slave, s) && sameAssignmentP(slave, s); }); - if (fre !== -1) V.FResult += 1; + if (fre !== -1) result += 1; } function calcWorksWithRival(slave) { - const en = V.slaves.findIndex(s => { - return isRivalP(slave, s) && sameAssignmentP(slave, s); - }); - if (en !== -1) V.FResult -= 1; + const en = getSlave(slave.rivalryTarget); + if (en !== undefined && sameAssignmentP(slave, en)) result -= 1; } function calcHInjectionsDiet(slave) { if (slave.drugs === "male hormone injections" || slave.drugs === "female hormone injections") - V.FResult -= 10; + result -= 10; if (slave.diet === "XXY") - V.FResult += 2; + result += 2; else if (slave.diet === "XY" || slave.diet === "XX") - V.FResult += 1; + result += 1; else if (slave.diet === "cum production") - V.FResult += 1; + result += 1; else if (slave.diet === "fertility") - V.FResult += 1; + result += 1; } function calcPreg(slave) { if (V.arcologies[0].FSRepopulationFocus > 20) { - if (slave.preg > 10) V.FResult += 2; - else V.FResult -= 2; + if (slave.preg > 10) result += 2; + else result -= 2; } else if (V.arcologies[0].FSRestart > 20) { if (slave.bellyPreg >= 500 && slave.breedingMark === 1 && V.propOutcome === 1) - V.FResult += 1; + result += 1; else if (slave.preg > 10) - V.FResult -= 10; + result -= 10; else - V.FResult += 0; + result += 0; } } function calcRace(slave) { if (V.arcologies[0].FSSupremacist !== "unset" && supremeRaceP(slave)) - V.FResult -= (V.arcologies[0].FSSupremacist/5) + (V.arcologies[0].FSSupremacistLawME*10); + result -= (V.arcologies[0].FSSupremacist/5) + (V.arcologies[0].FSSupremacistLawME*10); if (V.arcologies[0].FSSubjugationist !== "unset" && inferiorRaceP(slave)) - V.FResult += (V.arcologies[0].FSSubjugationist/10) + (V.arcologies[0].FSSubjugationistLawME); + result += (V.arcologies[0].FSSubjugationist/10) + (V.arcologies[0].FSSubjugationistLawME); } function calcSexAttributes(slave) { - if (slave.clitPiercing > 2) V.FResult += 1; + if (slave.clitPiercing > 2) result += 1; if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish != "none") - V.FResult += slave.fetishStrength/5; + result += slave.fetishStrength/5; if (slave.attrKnown === 1) { - V.FResult += Math.trunc(slave.attrXX/20); - V.FResult += Math.trunc(slave.attrXY/20); - if (slave.energy > 95) V.FResult += 3; - else if (slave.energy > 80) V.FResult += 2; - else if (slave.energy > 60) V.FResult += 1; - else if (slave.energy <= 20) V.FResult -= 2; - else if (slave.energy <= 40) V.FResult -= 1; + result += Math.trunc(slave.attrXX/20); + result += Math.trunc(slave.attrXY/20); + if (slave.energy > 95) result += 3; + else if (slave.energy > 80) result += 2; + else if (slave.energy > 60) result += 1; + else if (slave.energy <= 20) result -= 2; + else if (slave.energy <= 40) result -= 1; } - if (slave.sexualFlaw !== "none") V.FResult -= 2; - if (slave.sexualQuirk !== "none") V.FResult += 2; - if (slave.behavioralFlaw !== "none") V.FResult -= 2; - if (slave.behavioralQuirk !== "none") V.FResult += 2; + if (slave.sexualFlaw !== "none") result -= 2; + if (slave.sexualQuirk !== "none") result += 2; + if (slave.behavioralFlaw !== "none") result -= 2; + if (slave.behavioralQuirk !== "none") result += 2; } function calcCareer(slave) { if (setup.whoreCareers.includes(slave.career)) - V.FResult += 1; + result += 1; else if (slave.oralCount + slave.analCount + slave.vaginalCount + slave.mammaryCount + slave.penetrativeCount > 1000) - V.FResult += 1; + result += 1; } function calcSight(slave) { - if (!canSee(slave)) V.FResult -= 3; + if (!canSee(slave)) result -= 3; else if (slave.eyes <= -1) { if (slave.eyewear !== "corrective glasses" && slave.eyewear !== "corrective contacts") - V.FResult -= 1; + result -= 1; } else if (slave.eyewear === "blurring glasses") - V.FResult -= 1; + result -= 1; else if (slave.eyewear === "blurring contacts") - V.FResult -= 1; + result -= 1; } function calcHearing(slave) { - if (!canHear(slave)) V.FResult -= 2; + if (!canHear(slave)) result -= 2; else if (slave.hears <= -1) { if (slave.earwear !== "hearing aids") - V.FResult -= 1; + result -= 1; } else if (slave.earwear === "muffling ear plugs") - V.FResult -= 1; + result -= 1; } function calcEgyptianBonus(slave) { @@ -11553,15 +11549,15 @@ window.FResult = (function() { function calcYouthBonus(slave) { if (slave.visualAge < 30) { if (slave.actualAge > 30) - V.FResult += 5; // experienced for her apparent age + result += 5; // experienced for her apparent age if (slave.physicalAge > 30) - V.FResult -= slave.physicalAge/2; // too old :( + result -= slave.physicalAge/2; // too old :( } } function calcMatureBonus(slave) { if (slave.visualAge >= 30 && slave.actualAge >= 30 && slave.physicalAge < slave.visualAge) - V.FResult += Math.min((slave.physicalAge - slave.visualAge) * 2, 20); // looks and acts mature, but has a body that just won't quit + result += Math.min((slave.physicalAge - slave.visualAge) * 2, 20); // looks and acts mature, but has a body that just won't quit } function calcNotFuckdoll(slave) { @@ -11588,43 +11584,41 @@ window.FResult = (function() { function calcAge(slave) { if ((V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset") && slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave)) { - V.FResult += 1; - if (slave.birthWeek === 0) V.FResult += V.FResult; - else if (slave.birthWeek < 4) V.FResult += 0.2*V.FResult; + result += 1; + if (slave.birthWeek === 0) result += result; + else if (slave.birthWeek < 4) result += 0.2*result; } else if (slave.physicalAge === V.minimumSlaveAge) { - V.FResult += 1; - if (slave.birthWeek === 0 ) V.FResult += 0.5*V.FResult; - else if (slave.birthWeek < 4) V.FResult += 0.1*V.FResult; + result += 1; + if (slave.birthWeek === 0 ) result += 0.5*result; + else if (slave.birthWeek < 4) result += 0.1*result; } else if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset")) { - V.FResult += 1; + result += 1; if (slave.birthWeek === 0) - V.FResult += 0.5*V.FResult; + result += 0.5*result; else if (slave.birthWeek < 4) - V.FResult += 0.1*V.FResult; + result += 0.1*result; } } function calcAmputation(slave) { switch(slave.amp) { case 0: - break; - case 1: - V.FResult -= 2; - break; case -2: - break; case -5: break; + case 1: + result -= 2; + break; default: - V.FResult -= 1; + result -= 1; } } function calcHedonismWeight(slave) { if (slave.weight < 10) - V.FResult -= 2; + result -= 2; else if (slave.weight > 190) - V.FResult -= 5; // too fat + result -= 5; // too fat } return FResult; })(); @@ -36450,22 +36444,7 @@ window.Beauty = (function() { }; function calcSlimBeauty(slave) { - let slimPass; - - if (slave.boobs < 300 && slave.butt <= 1 && slave.waist <= 10) { - if (arcology.FSPhysicalIdealist === "unset" && arcology.FSHedonisticDecadenceStrongFat === 0 && slave.muscles > 30) { /*muscle check*/ - slimPass = 0; - } else if (arcology.FSHedonisticDecadence !== "unset" || arcology.FSPhysicalIdealistStrongFat === 1) { /*weight check*/ - if (slave.weight > 30) { - slimPass = 0; - } - } else if (slave.weight > 10) { - slimPass = 0; - } else { - slimPass = 1; - } - } - if (slimPass === 1) { + if (slimPass(slave) === 1) { beauty += 40 + (arcology.FSSlimnessEnthusiast/20); /*45*/ } else { beauty -= arcology.FSSlimnessEnthusiast/20; diff --git a/src/js/assayJS.tw b/src/js/assayJS.tw index 177703e647257d8e0f67256964e90ad0047e65f6..fe12b6fd496bfe59bb87dcdb09e621a4c9913277 100644 --- a/src/js/assayJS.tw +++ b/src/js/assayJS.tw @@ -174,23 +174,21 @@ window.TatScore = function(slave) { }; window.slimPass = function(slave) { - var slimPass = 0; - var ArcologyZero = State.variables.arcologies[0]; + let slimPass = 0; + let ArcologyZero = State.variables.arcologies[0]; if (ArcologyZero.FSSlimnessEnthusiastLaw === 1) { if ((slave.boobs < 300) && (slave.butt <= 1) && (slave.waist <= 10)) { - slimPass = 1; if ((ArcologyZero.FSPhysicalIdealist === "unset") && (ArcologyZero.FSHedonisticDecadenceStrongFat === 0) && (slave.muscles > 30)) { /*muscle check*/ slimPass = 0; - } - if (slimPass === 1) { - if ((ArcologyZero.FSHedonisticDecadence !== "unset") || (ArcologyZero.FSPhysicalIdealistStrongFat === 1)) { /*weight check*/ - if (slave.weight > 30) { - slimPass = 0; - } - } else if (slave.weight > 10) { + } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") || (ArcologyZero.FSPhysicalIdealistStrongFat === 1)) { /*weight check*/ + if (slave.weight > 30) { slimPass = 0; } + } else if (slave.weight > 10) { + slimPass = 0; + } else { + slimPass = 1; } } } @@ -2124,6 +2122,5 @@ window.Deadliness = function Deadliness(slave) { deadliness -= 1; } - deadlines = Math.max(deadliness, 1); - V.deadliness = deadliness; + return Math.max(deadliness, 1); }; diff --git a/src/js/beautyJS.tw b/src/js/beautyJS.tw index 73aee348cf8004bbf5bad8406048183c8bf5dae2..a08e7e1515e74d2839f612060aea1666f4c158a1 100644 --- a/src/js/beautyJS.tw +++ b/src/js/beautyJS.tw @@ -61,7 +61,7 @@ window.Beauty = (function() { calcMultipliersBeauty(slave); beauty = Math.max(1, Math.trunc(0.5*beauty)); - V.beauty = beauty; + return beauty; }; function calcInitBeauty(slave) { @@ -1079,22 +1079,7 @@ window.Beauty = (function() { }; function calcSlimBeauty(slave) { - let slimPass; - - if (slave.boobs < 300 && slave.butt <= 1 && slave.waist <= 10) { - if (arcology.FSPhysicalIdealist === "unset" && arcology.FSHedonisticDecadenceStrongFat === 0 && slave.muscles > 30) { /*muscle check*/ - slimPass = 0; - } else if (arcology.FSHedonisticDecadence !== "unset" || arcology.FSPhysicalIdealistStrongFat === 1) { /*weight check*/ - if (slave.weight > 30) { - slimPass = 0; - } - } else if (slave.weight > 10) { - slimPass = 0; - } else { - slimPass = 1; - } - } - if (slimPass === 1) { + if (slimPass(slave) === 1) { beauty += 40 + (arcology.FSSlimnessEnthusiast/20); /*45*/ } else { beauty -= arcology.FSSlimnessEnthusiast/20; diff --git a/src/js/fresult.tw b/src/js/fresult.tw index 2721c0956a05a85a71bcf0b6c690b780ab488aaf..bcb29ff23f0c8c506bc79f99369fdf79f38db719 100644 --- a/src/js/fresult.tw +++ b/src/js/fresult.tw @@ -9,7 +9,7 @@ window.FResult = (function() { "use strict"; // we can't initialise our global variables on load, because SugarCube.State isn't initialised // instead, declare them and initialise on run time - let V, incest_bonus; + let V, result, incest_bonus; function FResult(slave) { V = State.variables; incest_bonus = V.arcologies[0].FSEgyptianRevivalist > 20 || V.arcologies[0].FSEgyptianRevivalistIncestPolicy === 1; @@ -18,15 +18,15 @@ window.FResult = (function() { if (!slave.fuckdoll) calcNotFuckdoll(slave); else - V.FResult += slave.fuckdoll/10; + result += slave.fuckdoll/10; - V.FResult += Math.max(0, slave.aphrodisiacs) * 2; + result += Math.max(0, slave.aphrodisiacs) * 2; if (slave.inflationType === "aphrodisiac") - V.FResult += slave.inflation*4; + result += slave.inflation*4; if (slave.lactation > 0) - V.FResult += 1; + result += 1; if (slave.nipples === "fuckable") calcFuckableTits(slave); @@ -34,67 +34,68 @@ window.FResult = (function() { if (V.seeAge === 1) calcAge(slave); if (slave.fetish === "mindbroken") - V.FResult = Math.trunc(V.FResult*0.4); + result = Math.trunc(result*0.4); else - V.FResult = Math.trunc(V.FResult*0.7); + result = Math.trunc(result*0.7); if (slave.pregWeek < 0) - V.FResult -= Math.trunc(V.FResult*slave.pregWeek/10); // reduced the most just after birth + result -= Math.trunc(result*slave.pregWeek/10); // reduced the most just after birth calcAmputation(slave); if (V.arcologies[0].FSHedonisticDecadence > 20) calcHedonismWeight(slave); - if (V.FResult < 2) { + if (result < 2) { if (supremeRaceP(slave) && V.arcologies[0].FSSupremacist > 20) - V.FResult = 0; + result = 0; else - V.FResult = 2; + result = 2; } + return result; } function calcUseWeights(slave) { - V.FResult = (3 - slave.anus)+(slave.muscles/30); + result = (3 - slave.anus)+(slave.muscles/30); if (slave.muscles < -95) - V.FResult -= 5; + result -= 5; else if (slave.muscles < -30) - V.FResult -= 2; + result -= 2; const uses = V.oralUseWeight + V.vaginalUseWeight + V.analUseWeight; if (uses <= 0) return; - V.FResult += (6+slave.tonguePiercing) * (V.oralUseWeight/uses) * (slave.oralSkill/30); + result += (6+slave.tonguePiercing) * (V.oralUseWeight/uses) * (slave.oralSkill/30); if (slave.sexualFlaw === "cum addict") - V.FResult += (V.oralUseWeight/uses) * (slave.oralSkill/30); + result += (V.oralUseWeight/uses) * (slave.oralSkill/30); if (canDoVaginal(slave)) { - V.FResult += 6 * (V.vaginalUseWeight/uses) * (slave.vaginalSkill/30); - V.FResult += (3 - slave.vagina); - V.FResult += slave.vaginaLube; + result += 6 * (V.vaginalUseWeight/uses) * (slave.vaginalSkill/30); + result += (3 - slave.vagina); + result += slave.vaginaLube; } if (canDoAnal(slave)) { - V.FResult += 6 * (V.analUseWeight/uses) * (slave.analSkill/30); + result += 6 * (V.analUseWeight/uses) * (slave.analSkill/30); if (slave.sexualFlaw === "anal addict") - V.FResult += (V.analUseWeight/uses) * (slave.analSkill/30); + result += (V.analUseWeight/uses) * (slave.analSkill/30); if (slave.inflationType === "aphrodisiac") - V.FResult += (V.analUseWeight/uses) * (slave.inflation * 3); + result += (V.analUseWeight/uses) * (slave.inflation * 3); } } function calcFuckableTits(slave) { - V.FResult += 2; + result += 2; if (slave.fetish === "boobs") - V.FResult += Math.trunc(slave.fetishStrength/20); + result += Math.trunc(slave.fetishStrength/20); } function calcWorksWithRelatives(slave) { V.slaves.forEach(islave => { if (isParentP(slave, islave) && sameAssignmentP(slave, islave)) { - V.FResult += 1; - if (incest_bonus) V.FResult += 1; + result += 1; + if (incest_bonus) result += 1; } if (areSisters(slave, islave) > 0 && sameAssignmentP(slave, islave)) { - V.FResult += 1; - if (incest_bonus) V.FResult += 1; + result += 1; + if (incest_bonus) result += 1; } }); } @@ -102,8 +103,8 @@ window.FResult = (function() { function calcWorksWithRelativesVanilla(slave) { const fre = getSlave(slave.relationTarget) if (fre !== undefined && sameAssignmentP(slave, fre)) { - V.FResult += 2; - if (incest_bonus) V.FResult += 2; + result += 2; + if (incest_bonus) result += 2; } } @@ -111,94 +112,92 @@ window.FResult = (function() { const fre = V.slaves.findIndex(s => { return haveRelationshipP(slave, s) && sameAssignmentP(slave, s); }); - if (fre !== -1) V.FResult += 1; + if (fre !== -1) result += 1; } function calcWorksWithRival(slave) { - const en = V.slaves.findIndex(s => { - return isRivalP(slave, s) && sameAssignmentP(slave, s); - }); - if (en !== -1) V.FResult -= 1; + const en = getSlave(slave.rivalryTarget); + if (en !== undefined && sameAssignmentP(slave, en)) result -= 1; } function calcHInjectionsDiet(slave) { if (slave.drugs === "male hormone injections" || slave.drugs === "female hormone injections") - V.FResult -= 10; + result -= 10; if (slave.diet === "XXY") - V.FResult += 2; + result += 2; else if (slave.diet === "XY" || slave.diet === "XX") - V.FResult += 1; + result += 1; else if (slave.diet === "cum production") - V.FResult += 1; + result += 1; else if (slave.diet === "fertility") - V.FResult += 1; + result += 1; } function calcPreg(slave) { if (V.arcologies[0].FSRepopulationFocus > 20) { - if (slave.preg > 10) V.FResult += 2; - else V.FResult -= 2; + if (slave.preg > 10) result += 2; + else result -= 2; } else if (V.arcologies[0].FSRestart > 20) { if (slave.bellyPreg >= 500 && slave.breedingMark === 1 && V.propOutcome === 1) - V.FResult += 1; + result += 1; else if (slave.preg > 10) - V.FResult -= 10; + result -= 10; else - V.FResult += 0; + result += 0; } } function calcRace(slave) { if (V.arcologies[0].FSSupremacist !== "unset" && supremeRaceP(slave)) - V.FResult -= (V.arcologies[0].FSSupremacist/5) + (V.arcologies[0].FSSupremacistLawME*10); + result -= (V.arcologies[0].FSSupremacist/5) + (V.arcologies[0].FSSupremacistLawME*10); if (V.arcologies[0].FSSubjugationist !== "unset" && inferiorRaceP(slave)) - V.FResult += (V.arcologies[0].FSSubjugationist/10) + (V.arcologies[0].FSSubjugationistLawME); + result += (V.arcologies[0].FSSubjugationist/10) + (V.arcologies[0].FSSubjugationistLawME); } function calcSexAttributes(slave) { - if (slave.clitPiercing > 2) V.FResult += 1; + if (slave.clitPiercing > 2) result += 1; if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish != "none") - V.FResult += slave.fetishStrength/5; + result += slave.fetishStrength/5; if (slave.attrKnown === 1) { - V.FResult += Math.trunc(slave.attrXX/20); - V.FResult += Math.trunc(slave.attrXY/20); - if (slave.energy > 95) V.FResult += 3; - else if (slave.energy > 80) V.FResult += 2; - else if (slave.energy > 60) V.FResult += 1; - else if (slave.energy <= 20) V.FResult -= 2; - else if (slave.energy <= 40) V.FResult -= 1; + result += Math.trunc(slave.attrXX/20); + result += Math.trunc(slave.attrXY/20); + if (slave.energy > 95) result += 3; + else if (slave.energy > 80) result += 2; + else if (slave.energy > 60) result += 1; + else if (slave.energy <= 20) result -= 2; + else if (slave.energy <= 40) result -= 1; } - if (slave.sexualFlaw !== "none") V.FResult -= 2; - if (slave.sexualQuirk !== "none") V.FResult += 2; - if (slave.behavioralFlaw !== "none") V.FResult -= 2; - if (slave.behavioralQuirk !== "none") V.FResult += 2; + if (slave.sexualFlaw !== "none") result -= 2; + if (slave.sexualQuirk !== "none") result += 2; + if (slave.behavioralFlaw !== "none") result -= 2; + if (slave.behavioralQuirk !== "none") result += 2; } function calcCareer(slave) { if (setup.whoreCareers.includes(slave.career)) - V.FResult += 1; + result += 1; else if (slave.oralCount + slave.analCount + slave.vaginalCount + slave.mammaryCount + slave.penetrativeCount > 1000) - V.FResult += 1; + result += 1; } function calcSight(slave) { - if (!canSee(slave)) V.FResult -= 3; + if (!canSee(slave)) result -= 3; else if (slave.eyes <= -1) { if (slave.eyewear !== "corrective glasses" && slave.eyewear !== "corrective contacts") - V.FResult -= 1; + result -= 1; } else if (slave.eyewear === "blurring glasses") - V.FResult -= 1; + result -= 1; else if (slave.eyewear === "blurring contacts") - V.FResult -= 1; + result -= 1; } function calcHearing(slave) { - if (!canHear(slave)) V.FResult -= 2; + if (!canHear(slave)) result -= 2; else if (slave.hears <= -1) { if (slave.earwear !== "hearing aids") - V.FResult -= 1; + result -= 1; } else if (slave.earwear === "muffling ear plugs") - V.FResult -= 1; + result -= 1; } function calcEgyptianBonus(slave) { @@ -210,15 +209,15 @@ window.FResult = (function() { function calcYouthBonus(slave) { if (slave.visualAge < 30) { if (slave.actualAge > 30) - V.FResult += 5; // experienced for her apparent age + result += 5; // experienced for her apparent age if (slave.physicalAge > 30) - V.FResult -= slave.physicalAge/2; // too old :( + result -= slave.physicalAge/2; // too old :( } } function calcMatureBonus(slave) { if (slave.visualAge >= 30 && slave.actualAge >= 30 && slave.physicalAge < slave.visualAge) - V.FResult += Math.min((slave.physicalAge - slave.visualAge) * 2, 20); // looks and acts mature, but has a body that just won't quit + result += Math.min((slave.physicalAge - slave.visualAge) * 2, 20); // looks and acts mature, but has a body that just won't quit } function calcNotFuckdoll(slave) { @@ -245,43 +244,41 @@ window.FResult = (function() { function calcAge(slave) { if ((V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset") && slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave)) { - V.FResult += 1; - if (slave.birthWeek === 0) V.FResult += V.FResult; - else if (slave.birthWeek < 4) V.FResult += 0.2*V.FResult; + result += 1; + if (slave.birthWeek === 0) result += result; + else if (slave.birthWeek < 4) result += 0.2*result; } else if (slave.physicalAge === V.minimumSlaveAge) { - V.FResult += 1; - if (slave.birthWeek === 0 ) V.FResult += 0.5*V.FResult; - else if (slave.birthWeek < 4) V.FResult += 0.1*V.FResult; + result += 1; + if (slave.birthWeek === 0 ) result += 0.5*result; + else if (slave.birthWeek < 4) result += 0.1*result; } else if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset")) { - V.FResult += 1; + result += 1; if (slave.birthWeek === 0) - V.FResult += 0.5*V.FResult; + result += 0.5*result; else if (slave.birthWeek < 4) - V.FResult += 0.1*V.FResult; + result += 0.1*result; } } function calcAmputation(slave) { switch(slave.amp) { case 0: - break; - case 1: - V.FResult -= 2; - break; case -2: - break; case -5: break; + case 1: + result -= 2; + break; default: - V.FResult -= 1; + result -= 1; } } function calcHedonismWeight(slave) { if (slave.weight < 10) - V.FResult -= 2; + result -= 2; else if (slave.weight > 190) - V.FResult -= 5; // too fat + result -= 5; // too fat } return FResult; })(); diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 28858597e229cb9c264e027d05adfac385fe47d9..e160e07e65ed96b42118628011a7b76dba461858 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -2,7 +2,7 @@ <<run SlavePronouns($activeSlave)>> <<run SlaveStatClamp($activeSlave)>> -<<run Beauty($activeSlave)>> +<<set $beauty = Beauty($activeSlave)>> <<setLocalPronouns $activeSlave>> /* 000-250-006 */ @@ -1642,7 +1642,7 @@ is <</if>> <<if ($showScores != 0)>> - <<set FResult($activeSlave)>> + <<set $FResult = FResult($activeSlave)>> Currently, $he has an @@.pink;''attractiveness score'' of __''$beauty''__@@ and a @@.lightcoral;''sexual score'' of __''$FResult''__.@@ <</if>> diff --git a/src/uncategorized/pePitFight.tw b/src/uncategorized/pePitFight.tw index 4bab85562f7e5b19d22ba0c12bc5e4b37086d2a7..8c385563c976436707c3f6bd4888b69d76d85d7d 100644 --- a/src/uncategorized/pePitFight.tw +++ b/src/uncategorized/pePitFight.tw @@ -5,7 +5,7 @@ <<set $activeSlave = $Bodyguard>> <<setLocalPronouns $activeSlave>> -<<run Deadliness($activeSlave)>> +<<set $deadliness = Deadliness($activeSlave)>> <<set $PPit = 0>> diff --git a/src/uncategorized/saGetMilked.tw b/src/uncategorized/saGetMilked.tw index 4ce6a160e00839fc4db5f758a9a586d392a0a09e..de004e58b98435a7e3d7a6887734967bcd83a280 100644 --- a/src/uncategorized/saGetMilked.tw +++ b/src/uncategorized/saGetMilked.tw @@ -471,7 +471,7 @@ gets milked this week. <<set _vignette = GetVignette($slaves[$i])>> __This week__ _vignette.text <<if (_vignette.type == "cash")>> - <<set FResult($slaves[$i])>> + <<set $FResult = FResult($slaves[$i])>> <<if (_vignette.effect > 0)>> @@.yellowgreen;making you an extra <<print cashFormat(Math.trunc($FResult*_vignette.effect))>>.@@ <<elseif (_vignette.effect < 0)>> @@ -537,7 +537,7 @@ gets milked this week. <</if>> <<set $slaves[$i].health += 2*_vignette.effect>> <<else>> - <<set FResult($slaves[$i])>> + <<set $FResult = FResult($slaves[$i])>> <<if (_vignette.effect > 0)>> @@.green;gaining you a bit of reputation.@@ <<elseif (_vignette.effect < 0)>> diff --git a/src/uncategorized/saGuardsYou.tw b/src/uncategorized/saGuardsYou.tw index 7f5ffe142c79ecad73b99d016dcff88b29e83178..e5058e703c2f96dfb9b5974b1ccfdec545f5cdcd 100644 --- a/src/uncategorized/saGuardsYou.tw +++ b/src/uncategorized/saGuardsYou.tw @@ -6,7 +6,7 @@ carries arms in your defense. <<set $slaves[$i].livingRules = "luxurious">> <</if>> -<<run Deadliness($slaves[$i])>> +<<set $deadliness = Deadliness($slaves[$i])>> <<if $slaves[$i].combatSkill > 0>> $His combat skills greatly increase $his deadliness. diff --git a/src/uncategorized/saPleaseYou.tw b/src/uncategorized/saPleaseYou.tw index 83050ae4ab0bcf40e3418a37f930b40836382edd..945ac15bb623888951c568e30d973ddd84f557b8 100644 --- a/src/uncategorized/saPleaseYou.tw +++ b/src/uncategorized/saPleaseYou.tw @@ -1179,8 +1179,8 @@ serves you this week. <</if>> <</if>> -<<run FResult($slaves[$i])>> -<<run Beauty($slaves[$i])>> +<<set $FResult = FResult($slaves[$i])>> +<<set $beauty = Beauty($slaves[$i])>> <<set _multiplier = 0.1>> <<if $slaves[$i].relationship == -2>> diff --git a/src/uncategorized/saServeThePublic.tw b/src/uncategorized/saServeThePublic.tw index 372a2e4fe3f36eb28fb1555d745d39e527d078cc..bdf3b8fd8a298a670582ed9720ba7628c2495790 100644 --- a/src/uncategorized/saServeThePublic.tw +++ b/src/uncategorized/saServeThePublic.tw @@ -8,7 +8,7 @@ <<set $publicServants += 1>> <</if>> -<<set FResult($slaves[$i])>> +<<set $FResult = FResult($slaves[$i])>> <<if ($slaves[$i].releaseRules == "restrictive") && ($slaves[$i].standardReward !== "orgasm")>> <<set $FResult += 2>> <</if>> @@ -23,7 +23,7 @@ <<else>> <<set $FResult = Math.trunc($FResult*0.85)>> <</if>> -<<run Beauty($slaves[$i])>> +<<set $beauty = Beauty($slaves[$i])>> <<if $ACitizens > $ASlaves*2>> <<set $beauty = Math.trunc($beauty*1.1)>> <<elseif $ACitizens > $ASlaves>> diff --git a/src/uncategorized/saWhore.tw b/src/uncategorized/saWhore.tw index 718c1abbc19786fa615ce5055b74f52e65bd2623..c82e30a182d22e7cf729c206273a9b90458c872d 100644 --- a/src/uncategorized/saWhore.tw +++ b/src/uncategorized/saWhore.tw @@ -3,7 +3,7 @@ <!-- Statistics gathering --> <<set _incomeStats = getSlaveStatisticData($slaves[$i], $slaves[$i].assignment === Job.BROTHEL ? $facility.brothel : undefined)>> -<<set FResult($slaves[$i])>> +<<set $FResult = FResult($slaves[$i])>> <<if ($slaves[$i].releaseRules == "restrictive") && ($slaves[$i].standardReward !== "orgasm")>> <<set $FResult += 2>> <</if>> @@ -18,7 +18,7 @@ <<else>> <<set $FResult = Math.trunc($FResult*0.85)>> <</if>> -<<run Beauty($slaves[$i])>> +<<set $beauty = Beauty($slaves[$i])>> <<if $ACitizens > $ASlaves*2>> <<set $beauty = Math.trunc($beauty*1.1)>> <<elseif $ACitizens > $ASlaves>> diff --git a/src/uncategorized/seLethalPit.tw b/src/uncategorized/seLethalPit.tw index 5760f6d8fbe2237c152bc8db50f6c9dd0a20a93c..b97509045a02a8142dda6901642e186f3de91bc8 100644 --- a/src/uncategorized/seLethalPit.tw +++ b/src/uncategorized/seLethalPit.tw @@ -47,8 +47,7 @@ You review the rules - the <<if $pitAnimal == 0>>combatants<<else>>slave<</if>> <br><br> -<<run Deadliness(_fighterOne)>> -<<set _fighterOneDeadliness = $deadliness>> +<<set _fighterOneDeadliness = Deadliness(_fighterOne)>> <<if _fighterOne.fetish == "mindbroken">> _fighterOne.slaveName is too broken to care about whether she lives or dies; @@ -200,8 +199,7 @@ You review the rules - the <<if $pitAnimal == 0>>combatants<<else>>slave<</if>> <br><br> <<if $pitAnimal == 0>> - <<run Deadliness(_fighterTwo)>> - <<set _fighterTwoDeadliness = $deadliness>> + <<set _fighterTwoDeadliness = Deadliness(_fighterTwo)>> <<if _fighterTwo.fetish == "mindbroken">> _fighterTwo.slaveName is too broken to care about whether she lives or dies; diff --git a/src/uncategorized/seNonlethalPit.tw b/src/uncategorized/seNonlethalPit.tw index 350541bfc2c237671658d6444095125dcdfa17d8..a1f26a53a651c424c8eace67661f06726e979d8d 100644 --- a/src/uncategorized/seNonlethalPit.tw +++ b/src/uncategorized/seNonlethalPit.tw @@ -60,8 +60,7 @@ <br><br> - <<run Deadliness(_fighterOne)>> - <<set _fighterOneDeadliness = $deadliness>> + <<set _fighterOneDeadliness = Deadliness(_fighterOne)>> <<if _fighterOneDeadliness > 5>> _fighterOne.slaveName seems very confident, even eager to win a break. @@ -197,8 +196,7 @@ <br><br> - <<run Deadliness(_fighterTwo)>> - <<set _fighterTwoDeadliness = $deadliness>> + <<set _fighterTwoDeadliness = Deadliness(_fighterTwo)>> <<if _fighterTwoDeadliness > 5>> _fighterTwo.slaveName seems very confident, even eager to win a break. diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 314f2e1bf97f9f6d3a19f983dab5ae052bfadbff..d33668e5c11162097c2f7c3f4797dccf5ff57c93 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -223,7 +223,7 @@ <</if>> <</if>> <<if $cheatMode == 1>> - | <<link "Check $his deadliness @@.red;FOR TESTING@@">><<replace "#miniscene">><<run Deadliness($activeSlave)>>$deadliness<br> <</replace>><</link>> + | <<link "Check $his deadliness @@.red;FOR TESTING@@">><<replace "#miniscene">><<set $deadliness = Deadliness($activeSlave)>>$deadliness<br> <</replace>><</link>> <</if>> | <<link "Abuse $him">><<replace "#miniscene">><<include "FAbuse">><</replace>><</link>> <<if $familyTesting == 1>> diff --git a/src/utility/assayWidgets.tw b/src/utility/assayWidgets.tw index da82c24ebda69511d7b1b8c36c548cf14d3c5cb8..2834071bb18bd69ce48176af000a2b7c2654d20c 100644 --- a/src/utility/assayWidgets.tw +++ b/src/utility/assayWidgets.tw @@ -2,8 +2,8 @@ <<widget "slaveCost">> -<<run Beauty($args[0])>> -<<set FResult($args[0])>> +<<set $beauty = Beauty($args[0])>> +<<set $FResult = FResult($args[0])>> <<set $slaveCost = ($beauty*$FResult)>>