diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 0bb95adce6a724182f6bd2c4f7f41f145c2afa36..11678ef3958764f35db83720784e6993e04ef04d 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -876,6 +876,7 @@ globalThis.calculateCosts = (function() { costs += foodCost * V.PC.pregType; } } + costs = Math.trunc(costs); if (V.PC.diet === 'XX' || V.PC.diet === 'XY') { costs += 25; } else if (V.PC.diet === 'fertility') { @@ -1217,24 +1218,42 @@ globalThis.getSlaveCostArray = function(s) { retval.push({text: "Living Expenses", value: cost}); // Food - retval.push({text: "Basic slave food cost", value: foodCost * 4}); + retval.push({ + text: "Basic slave food cost", + value: Math.trunc(foodCost * 4) + }); switch (s.diet) { case 'fattening': case 'muscle building': - retval.push({text: "Heavy diet", value: foodCost}); + retval.push({ + text: "Heavy diet", + value: Math.trunc(foodCost) + }); break; case 'restricted': case 'slimming': - retval.push({text: "Light diet, reduced by", value: -Math.abs(foodCost)}); + retval.push({ + text: "Light diet, reduced by", + value: -Math.abs(Math.trunc(foodCost)) + }); break; } if (s.weight > 130) { - retval.push({text: "Heavy weight", value: foodCost * 2}); + retval.push({ + text: "Heavy weight", + value: Math.trunc(foodCost * 2) + }); } else if (s.weight > 50) { - retval.push({text: "High weight", value: foodCost}); + retval.push({ + text: "High weight", + value: Math.trunc(foodCost) + }); } else if (s.weight < -50) { - retval.push({text: "Light weight, reduced by", value: -Math.abs(foodCost)}); + retval.push({ + text: "Light weight, reduced by", + value: -Math.abs(Math.trunc(foodCost)) + }); } if (s.geneticQuirks.fertility === 2 && s.geneticQuirks.hyperFertility === 2 && s.preg === 0 && (s.ovaries === 1 || s.mpreg === 1)) { if (V.geneticMappingUpgrade >= 1) { @@ -1256,7 +1275,10 @@ globalThis.getSlaveCostArray = function(s) { value: Math.trunc(foodCost * 0.2) }); } else { - retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)}); + retval.push({ + text: "Adjustment for unusual dietary deficiencies", + value: Math.trunc(foodCost * 0.2) + }); } } if (s.geneticQuirks.macromastia === 2) { @@ -1266,7 +1288,10 @@ globalThis.getSlaveCostArray = function(s) { value: Math.trunc(foodCost * 0.2) }); } else { - retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)}); + retval.push({ + text: "Adjustment for unusual dietary deficiencies", + value: Math.trunc(foodCost * 0.2) + }); } } if (s.geneticQuirks.gigantomastia === 2) { @@ -1276,7 +1301,10 @@ globalThis.getSlaveCostArray = function(s) { value: Math.trunc(foodCost * 0.2) }); } else { - retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)}); + retval.push({ + text: "Adjustment for unusual dietary deficiencies", + value: Math.trunc(foodCost * 0.2) + }); } } if (s.geneticQuirks.mGain === 2 && s.geneticQuirks.mLoss !== 2) { @@ -1286,7 +1314,10 @@ globalThis.getSlaveCostArray = function(s) { value: Math.trunc(foodCost * 0.2) }); } else { - retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)}); + retval.push({ + text: "Adjustment for unusual dietary deficiencies", + value: Math.trunc(foodCost * 0.2) + }); } } if (s.geneticQuirks.wGain === 2 && s.geneticQuirks.wLoss !== 2) { @@ -1296,11 +1327,17 @@ globalThis.getSlaveCostArray = function(s) { value: Math.trunc(foodCost * 0.2) }); } else { - retval.push({text: "Adjustment for unusual dietary deficiencies", value: Math.trunc(foodCost * 0.2)}); + retval.push({ + text: "Adjustment for unusual dietary deficiencies", + value: Math.trunc(foodCost * 0.2) + }); } } if (s.drugs === 'appetite suppressors') { - retval.push({text: "Food saved via suppressed appetite", value: -Math.abs(foodCost)}); + retval.push({ + text: "Food saved via suppressed appetite", + value: -Math.abs(Math.trunc(foodCost)) + }); } if (s.lactation > 0) { t = "Food to support "; @@ -1317,13 +1354,19 @@ globalThis.getSlaveCostArray = function(s) { } else { t += "reasonable breasts"; } - retval.push({text: t, value: foodCost * s.lactation * (1 + Math.trunc(s.boobs / 10000))}); + retval.push({ + text: t, + value: Math.trunc(foodCost * s.lactation * (1 + (s.boobs / 10000))) + }); } if (s.preg > s.pregData.normalBirth / 8) { if (s.assignment === Job.DAIRY && V.dairyFeedersSetting > 0) { // Extra feeding costs to support pregnancy are covered by dairy feeders. // TODO: Include them here anyway? - retval.push({text: "Extra feeding costs to support pregnancy are covered by dairy feeders", value: 0}); + retval.push({ + text: "Extra feeding costs to support pregnancy are covered by dairy feeders", + value: 0 + }); } else if ((s.assignment === Job.MASTERSUITE || s.assignment === Job.CONCUBINE) && V.masterSuiteUpgradePregnancy === 1) { // Extra feeding costs to support pregnancy are covered by master suite luxuries. @@ -1340,28 +1383,28 @@ globalThis.getSlaveCostArray = function(s) { t += "pregnancy"; retval.push({ text: t, - value: foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1) + value: Math.trunc(foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1)) }); if (s.pregType >= 100) { retval.push({ text: "Specialized dietary requirements and feeding methods to support absurd multiples", - value: foodCost * 5 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1) + value: Math.trunc(foodCost * 5 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1)) }); } else if (s.pregType >= 50) { retval.push({ text: "Specialized dietary adjustments and concentrated, quick to digest food required to support absurd multiples", - value: foodCost * 3 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1) + value: Math.trunc(foodCost * 3 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1)) }); } else if (s.pregType >= 30) { retval.push({ text: "Concentrated, quick to digest food blend to support extreme multiples", - value: foodCost * 2 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1) + value: Math.trunc(foodCost * 2 * s.pregType * (s.pregControl === 'speed up' ? 3 : 1)) }); } else if (s.pregType >= 10) { retval.push({ text: "Specialized food blend to support multiples", - value: foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1) + value: Math.trunc(foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1)) }); } }