diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 95dfd1adb78289dfd297acaf7398518e02306e99..ee2442fe46341781b06632591d84ddb9297f02e2 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ //V=SugarCube.State.variables, T=SugarCube.State.temporary; window.Main = function() { const V=State.variables; @@ -73,7 +74,7 @@ window.SFBC = function() { Caps:"The Special Force", Lower:V.securityForceName, Subsidy:V.SubsidyActive}); MainClean(); - SFNameCapsCheck(); + SFNameCapsCheck(); if (V.ColonelCore === undefined) V.ColonelCore=""; if (V.ColonelDiscussion === undefined) V.ColonelDiscussion=0; @@ -135,9 +136,9 @@ window.SFBC = function() { if (V.SFUC > 0) V.SF.UC.num=V.SFUC; delete V.SFUC; if (V.SF.Active === -1) SFInit(); if (V.SF.MWU) delete V.SF.MWU; - if (V.SpecOpsLock != undefined) V.SF.SpecOpsLock=V.SpecOpsLock; delete V.SpecOpsLock; + if (V.SpecOpsLock !== undefined) V.SF.SpecOpsLock=V.SpecOpsLock; delete V.SpecOpsLock; if (V.SF.UC === undefined) { - if (V.SF.SpecOps != undefined && V.SF.SpecOpsLock != undefined) { + if (V.SF.SpecOps !== undefined && V.SF.SpecOpsLock !== undefined) { V.SF.UC={Assign:V.SF.SpecOps, Lock:V.SF.SpecOpsLock}; jsDel([V.SF.SpecOps,V.SF.SpecOpsLock]); } else if (V.SF.UC === {}) { @@ -148,11 +149,11 @@ window.SFBC = function() { if (V.SF.WG !== undefined) V.SF.Gift=V.SF.WG; delete V.SF.WG; if (V.SF.MercCon === undefined) MercCon(); - if (V.SF.MercCon.Helots != undefined) { + if (V.SF.MercCon.Helots !== undefined) { V.SF.MercCon.Menials=V.SF.MercCon.Helots; delete V.SF.MercCon.Helots; } else { V.SF.MercCon.Menials=0; } - if (V.SF.MercCon.TotalHelots != undefined) { + if (V.SF.MercCon.TotalHelots !== undefined) { V.SF.MercCon.TotalMenials=V.SF.MercCon.TotalHelots; delete V.SF.MercCon.TotalHelots; } else { V.SF.MercCon.TotalMenials=0; } @@ -281,7 +282,7 @@ window.SFReport = function() { } else if (V.SF.Target === "secure") { SFD -= 0.05; Multiplier.action += 0.2; } else { SFD -= 0.1; Multiplier.action -= 0.5; } if (V.SF.ROE === "free") { Multiplier.action *= 0.8; SFD += 0.05; Trade += Trade*0.95; - } else if (V.SF.ROE == "hold") { Multiplier.action *= 1.1; SFD -= 0.05; Trade += Trade*1.05; } + } else if (V.SF.ROE === "hold") { Multiplier.action *= 1.1; SFD -= 0.05; Trade += Trade*1.05; } if (V.SF.Regs === "none") { Multiplier.action *= 0.8; SFD += 0.05; Trade += Trade*0.95; } else if (V.SF.Regs === "strict") { Multiplier.action *= 1.1; SFD -= 0.05; Trade += Trade*1.05; Multiplier.depravity=1+SFD; } @@ -324,7 +325,7 @@ window.SFReport = function() { r += `<br>A ${V.SF.UC.Assign < 2 ? 'small':'large'} portion of the force was assigned as ${V.SF.UC.Assign < 2 ? 'part':'full'} time undercover officers.`; } if (deaths > 0) { - r += ` <span class='red'>${deaths} soldiers fatally overdosed on the drug cocktail</span>`; + r += ` <span class='red'>${deaths} soldiers fatally overdosed on the drug cocktail</span>`; if (V.SF.MercCon.CanAttend === -1) r += `, The Colonel's much heavier than average drug use saves her from this side effect.`; } r += `<br>These activities have, overall, <span class='green'>improved your arcology's prosperity</span>.`; @@ -339,7 +340,7 @@ window.SFReport = function() { r += ` ${V.SF.Caps} managed to recruit ${Math.round(FNG/2)} new soldiers this week, and your reputation has <span class='green'>increased through the improvement of trade security</span>.`; r += `<br>//Your instructions to ${SFC()}://`; r += `<br> Deployment focus: `; - r += `<span id="focus"> <<if $SF.Target == "recruit">>''Recruiting and Training''<<elseif $SF.Target == "secure">>''Securing Trade Routes''<<else>>''Raiding and Slaving''<</if>></span>. `; + r += `<span id="focus"> <<if $SF.Target === "recruit">>''Recruiting and Training''<<elseif $SF.Target === "secure">>''Securing Trade Routes''<<else>>''Raiding and Slaving''<</if>></span>. `; r += `<<link "Recruit and Train">> <<set $SF.Target="recruit">> <<replace "#focus">>''Recruiting and Training''<</replace>> <</link>> | <<link "Secure Trade Routes">> <<set $SF.Target="secure">> <<replace "#focus">>''Securing Trade Routes''<</replace>> <</link>> | <<link "Raiding and Slaving">> <<set $SF.Target="raiding">> <<replace "#focus">>''Raiding and Slaving''<</replace>> <</link>>`; r += `<br> Rules of Engagement: `; r += `<span id="roe"> <<if $SF.ROE === "hold">>''Hold Fire''<<elseif $SF.ROE === "limited">>''Limited Fire''<<else>>''Free Fire''<</if>></span>. `; @@ -407,7 +408,7 @@ window.Count = function() { window.SFNameCapsCheck = function() { const V=State.variables; - if (V.SF.Lower != "the special force") V.SF.Caps=V.SF.Lower.replace("the ", "The "); + if (V.SF.Lower !== "the special force") V.SF.Caps=V.SF.Lower.replace("the ", "The "); }; window.SFUpgradeCost = function(cost,unit) { @@ -424,18 +425,18 @@ window.progress = function(x,max) { if (State.variables.SF.Size < 30) { z = 5 - x; for (i=0;i<x;i++) out += `â–ˆâ`; - for (i=0;i<z;i++) out += `<span style=\"opacity: 0;\">â–ˆ</span>â`; + for (i=0;i<z;i++) out += `<span style="opacity: 0;">â–ˆ</span>â`; for (i=0;i<5;i++) out += `â–‘â`;} else { z = 10 - x; for (i=0;i<x;i++) out += `â–ˆâ`; - for (i=0;i<z;i++) out += `<span style=\"opacity: 0;\">â–ˆ</span>â`;}} + for (i=0;i<z;i++) out += `<span style="opacity: 0;">â–ˆ</span>â`;}} else { Math.clamp(x,0,max); x=Math.floor(10*x/max); z=10 - x; for (i=0;i<x;i++) out += `â–ˆâ`; - for (i=0;i<z;i++) out += `<span style=\"opacity: 0;\">â–ˆ</span>â`;} + for (i=0;i<z;i++) out += `<span style="opacity: 0;">â–ˆ</span>â`;} return `${out}`; }; @@ -458,19 +459,19 @@ window.Interactions = function() { "use strict"; let choice=``, time=``; const V=State.variables, C=V.SF.Colonel; if (V.SF.Gift > 0) { - if (V.choice == 1) { + if (V.choice === 1) { choice +=`${V.SF.Caps} is turning over spare capital in tribute this week. `; if (V.SF.MercCon.CanAttend === -1 && (C.Talk + C.Fun !== 1)) { - choice += `"I think I can find <span class='yellowgreen'>${cashFormat(Math.ceil(V.CashGift))}</span> for you, boss."`; + choice += `"I think I can find <span class='yellowgreen'>${cashFormat(Math.ceil(V.CashGift))}</span> for you, boss."`; } else { - choice += `"We can spare <span class='yellowgreen'>${cashFormat(Math.ceil(V.CashGift))}</span> in tribute this week, boss".`; } - } else if (V.choice == 2) { + choice += `"We can spare <span class='yellowgreen'>${cashFormat(Math.ceil(V.CashGift))}</span> in tribute this week, boss".`; } + } else if (V.choice === 2) { choice += `${V.SF.Caps} will be throwing a military parade this week. `; if (V.SF.MercCon.CanAttend === -1 && (C.Talk + C.Fun !== 1)) { choice += `"I expect the <span class='green'>public to enjoy</span> the parade, boss."`; } else { choice += `"I'll have plans for an <span class='green'>popular parade</span> on your desk, boss".`; } - } else if (V.choice == 3) { + } else if (V.choice === 3) { choice += `${V.SF.Caps} will be conducting corporate sabotage on rival arcologies' businesses. `; if (V.SF.MercCon.CanAttend === -1 && (C.Talk + C.Fun !== 1)) { choice += `"Our interests should see a <span class='yellowgreen'>big boost,</span> boss."`; @@ -545,7 +546,8 @@ window.UnitText = function(input) { if (S.Firebase >= 9) training=`A high-tech killhouse has been constructed to aid in soldier training.`; if (S.Firebase >= 10) artillery=`Railgun artillery batteries are set around the base of the arcology, capable of accurately destroying enemies an absurd distance away.`; return `${r} The firebase ${appear} ${barracks} ${comms} ${training} ${slave} ${common} ${garage}${drone} ${hangar} ${launch} ${artillery}`; - } break; + } + break; case 'troop': r += `<br> The large dormitories are`; const Quantity=`the ${num(S.Troops)} members of ${V.SF.Lower}`; if (S.Troops < 100) {return `${r} sparsely occupied, ${Quantity} residing within them concentrating together in a corner. The hundreds of empty beds and lockers visibly herald the future`;} @@ -706,7 +708,7 @@ window.UnitText = function(input) { if (S.Satellite.lv >= 8) reactor=`A small, efficient nuclear reactor has been installed to continue generating energy while in the Earth's shadow.`; if (S.Satellite.lv >= 9) lens=`A higher quality and adjustable lens has been installed on the laser, allowing scalpel precision on armor or wide-area blasts on unarmored targets.`; if (S.Satellite.lv >= 10) kin=`A magazine of directable tungsten rods have been mounted to the exterior of the satellite, allowing for kinetic bombardment roughly equal to a series of nuclear blasts.`; - return `${r} ${loc1} ${gyro} ${thrusters} ${telemetry} ${solar} ${reactor} ${surviv} ${laser1}${heat} ${lens} ${kin}`; + return `${r} ${loc1} ${gyro} ${thrusters} ${telemetry} ${solar} ${reactor} ${surviv} ${laser1}${heat} ${lens} ${kin}`; } break; case 'GR': let loc=`has been purchased from a crumbling Old World nation. It`, power=`Large batteries mounted in oversized shoulders power the robot for up to ten minutes of use, though they make for large targets.`, knife=`simply a 8.5 meter long knife, though additional weapons are under development.`, armor8=``, actuator=``, cannon1=``, heatsink=``, ammo2=``, missile=``; diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index 03911b649521559b5cd602a1044d9ba4e8acbc36..985b0f45d0f972ae9a93a380da5cd92ec2d5957f 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** * Encapsulates the full description of a slave state. Serializable by the SugarCube state * management. diff --git a/src/js/economyJS.js b/src/js/economyJS.js index a47284eae8bbc56515fa04793471cca855b700f5..c27a61ba4571ea105bb19e69a68bc5d9f9aa94c1 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.LivingRule = Object.freeze({LUXURIOUS: 'luxurious', NORMAL: 'normal', SPARE: 'spare'}); window.Job = Object.freeze({ DAIRY: 'work in the dairy', MILKMAID: 'be the Milkmaid', MASTER_SUITE: 'serve in the master suite', CONCUBINE: 'be your Concubine', @@ -12,7 +13,7 @@ window.PersonalAttention = Object.freeze({TRADE: 'trading', WAR: 'warfare', SLAV window.predictCost = function(array) { var array2 = array; var totalCosts = ( - getBrothelCosts() + + getBrothelCosts() + getBrothelAdsCosts() + getArcadeCosts() + getClubCosts() + @@ -51,7 +52,7 @@ window.predictCost = function(array) { ); /* // clean up - if(totalCosts > 0) { + if (totalCosts > 0) { totalCosts = 0; } else { totalCosts = Math.ceil(totalCosts); @@ -141,7 +142,7 @@ window.getBrothelCosts = function() { window.getBrothelAdsCosts = function() { var brothel = State.variables.brothel; var costs = 0; - if(brothel > 0) { + if (brothel > 0) { costs += State.variables.brothelAdsSpending; } return costs; @@ -161,7 +162,7 @@ window.getClubCosts = function() { var club = State.variables.club; var costs = (club * facilityCost); costs += (0.2 * State.variables.clubUpgradePDAs * club * facilityCost); - if(club > 0) { + if (club > 0) { costs += State.variables.clubAdsSpending; } return costs; @@ -170,7 +171,7 @@ window.getClubCosts = function() { window.getClubAdsCosts = function() { var club = State.variables.club; var costs = 0; - if(club > 0) { + if (club > 0) { costs += State.variables.clubAdsSpending; } return costs; @@ -182,7 +183,7 @@ window.getDairyCosts = function() { var costs = (dairy * facilityCost) + (0.2 * State.variables.dairyFeedersUpgrade * dairy * facilityCost) + (0.1 * State.variables.dairyPregUpgrade * dairy * facilityCost) + (0.2 * State.variables.dairyStimulatorsUpgrade * facilityCost); - if(dairy > 0) { + if (dairy > 0) { costs += ((State.variables.bioreactorsXY + State.variables.bioreactorsXX + State.variables.bioreactorsHerm + State.variables.bioreactorsBarren) * 100); } return costs; @@ -197,7 +198,7 @@ window.getIncubatorCosts = function() { + (0.2 * State.variables.incubatorUpgradeReproduction * incubator * facilityCost) + (0.2 * State.variables.incubatorUpgradeGrowthStims * incubator * facilityCost) + (0.5 * State.variables.incubatorUpgradeSpeed * incubator * facilityCost); - if(incubator > 0) { + if (incubator > 0) { costs += ((State.variables.incubatorWeightSetting + State.variables.incubatorMusclesSetting + State.variables.incubatorReproductionSetting + State.variables.incubatorGrowthStimsSetting) * 500); } return costs; @@ -212,10 +213,10 @@ window.getServantsQuartersCosts = function() { window.getMasterSuiteCosts = function() { var costs = 0; - if(State.variables.masterSuitePregnancySlaveLuxuries === 1) { + if (State.variables.masterSuitePregnancySlaveLuxuries === 1) { costs += 500; } - if(State.variables.masterSuitePregnancyFertilitySupplements === 1) { + if (State.variables.masterSuitePregnancyFertilitySupplements === 1) { costs += 1000; } return costs; @@ -239,51 +240,51 @@ window.getSecurityExpansionCost = function() { //security expansion var secExpCost = 0; var soldierMod = 0; - if(State.variables.secExp === 1) { - if(State.variables.edictsUpkeep > 0) { + if (State.variables.secExp === 1) { + if (State.variables.edictsUpkeep > 0) { secExpCost += State.variables.edictsUpkeep; } - if(State.variables.SFSupportUpkeep > 0) { + if (State.variables.SFSupportUpkeep > 0) { secExpCost += State.variables.SFSupportUpkeep; } - if(State.variables.propHub > 0) { + if (State.variables.propHub > 0) { secExpCost += State.variables.propHubUpkeep; } - if(State.variables.secHQ > 0) { + if (State.variables.secHQ > 0) { secExpCost += State.variables.secHQUpkeep + 20 * State.variables.secMenials; } - if(State.variables.secBarracks > 0) { + if (State.variables.secBarracks > 0) { secExpCost += State.variables.secBarracksUpkeep; } - if(State.variables.riotCenter > 0) { + if (State.variables.riotCenter > 0) { secExpCost += State.variables.riotUpkeep; } - if(State.variables.soldierWages === 0) { + if (State.variables.soldierWages === 0) { soldierMod = 1; } - else if(State.variables.soldierWages === 1) { + else if (State.variables.soldierWages === 1) { soldierMod = 1.5; } else { soldierMod = 2; } - if (State.variables.militiaUnits != null) { + if (State.variables.militiaUnits !== null) { for (var i = 0; i < State.variables.militiaUnits.length; i++) { - if( !(State.variables.militiaUnits[i] === null) ) { + if (State.variables.militiaUnits[i] !== null) { secExpCost += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep * soldierMod; } } } - if (State.variables.slaveUnits != null) { + if (State.variables.slaveUnits !== null) { for (var i = 0; i < State.variables.slaveUnits.length; i++) { - if( !( State.variables.slaveUnits[i] === null) ) { + if (State.variables.slaveUnits[i] !== null) { secExpCost += State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5 * soldierMod; } } } - if (State.variables.mercUnits != null) { + if (State.variables.mercUnits !== null) { for (var i = 0; i < State.variables.mercUnits.length; i++) { - if( !(State.variables.mercUnits[i] === null) ) { + if (State.variables.mercUnits[i] !== null) { secExpCost += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5 * soldierMod; } } @@ -304,7 +305,7 @@ window.getLifestyleCosts = function() { window.getFSCosts = function() { var costs = 0; costs += State.variables.FSSpending; - if(State.variables.arcologies[0].FSRepopulationFocusLaw === 1 && State.variables.PC.pregKnown === 1) { + if (State.variables.arcologies[0].FSRepopulationFocusLaw === 1 && State.variables.PC.pregKnown === 1) { costs -= 500; } return costs; @@ -319,7 +320,7 @@ window.getCitizenOrphanageCosts = function() { window.getPrivateOrphanageCosts = function() { var costs = 0; costs += State.variables.privateOrphanageTotal * 500; - if(State.variables.breederOrphanageTotal > 0) { + if (State.variables.breederOrphanageTotal > 0) { costs += 50; } return costs; @@ -327,7 +328,7 @@ window.getPrivateOrphanageCosts = function() { window.getPeacekeeperCosts = function() { var costs = 0; - if(State.variables.peacekeepers !== 0 && State.variables.peacekeepers.undermining !== 0) { + if (State.variables.peacekeepers !== 0 && State.variables.peacekeepers.undermining !== 0) { costs += State.variables.peacekeepers.undermining; } return costs; @@ -336,11 +337,11 @@ window.getPeacekeeperCosts = function() { window.getMercenariesCosts = function() { var costs = 0; var mercCosts = State.variables.mercenaries * 2000; - if(State.variables.mercenaries > 0) { - if(State.variables.barracks) { + if (State.variables.mercenaries > 0) { + if (State.variables.barracks) { mercCosts *= 0.5; } - if((State.variables.PC.warfare >= 100) || (State.variables.PC.career === 'arcology owner')) { + if ((State.variables.PC.warfare >= 100) || (State.variables.PC.career === 'arcology owner')) { mercCosts *= 0.5; } costs += mercCosts; @@ -350,7 +351,7 @@ window.getMercenariesCosts = function() { window.getMenialRetirementCosts = function() { var costs = 0; - if(State.variables.citizenRetirementMenials === 1) { + if (State.variables.citizenRetirementMenials === 1) { costs += State.variables.menials * 2; } return costs; @@ -359,7 +360,7 @@ window.getMenialRetirementCosts = function() { // policy and other expenses window.getRecruiterCosts = function() { var costs = 0; - if(State.variables.Recruiter !== 0) { + if (State.variables.Recruiter !== 0) { costs += 250; } return costs; @@ -367,52 +368,52 @@ window.getRecruiterCosts = function() { window.getSchoolCosts = function() { var costs = 0; - if(State.variables.TSS.schoolPresent === 1) { + if (State.variables.TSS.schoolPresent === 1) { costs += 1000; } - if(State.variables.GRI.schoolPresent === 1) { + if (State.variables.GRI.schoolPresent === 1) { costs += 1000; } - if(State.variables.SCP.schoolPresent === 1) { + if (State.variables.SCP.schoolPresent === 1) { costs += 1000; } - if(State.variables.LDE.schoolPresent === 1) { + if (State.variables.LDE.schoolPresent === 1) { costs += 1000; } - if(State.variables.TGA.schoolPresent === 1) { + if (State.variables.TGA.schoolPresent === 1) { costs += 1000; } - if(State.variables.HA.schoolPresent === 1) { + if (State.variables.HA.schoolPresent === 1) { costs += 1000; } - if(State.variables.TCR.schoolPresent === 1) { + if (State.variables.TCR.schoolPresent === 1) { costs += 1000; } - if((State.variables.TFS.schoolPresent === 1) && ((State.variables.PC.dick === 0) || (State.variables.PC.vagina === 0) || (State.variables.PC.boobs === 0))) { + if ((State.variables.TFS.schoolPresent === 1) && ((State.variables.PC.dick === 0) || (State.variables.PC.vagina === 0) || (State.variables.PC.boobs === 0))) { costs += 1000; } - if(State.variables.TSS.subsidize !== 0) { + if (State.variables.TSS.subsidize !== 0) { costs += 1000; } - if(State.variables.GRI.subsidize !== 0) { + if (State.variables.GRI.subsidize !== 0) { costs += 1000; } - if(State.variables.SCP.subsidize !== 0) { + if (State.variables.SCP.subsidize !== 0) { costs += 1000; } - if(State.variables.LDE.subsidize !== 0) { + if (State.variables.LDE.subsidize !== 0) { costs += 1000; } - if(State.variables.TGA.subsidize !== 0) { + if (State.variables.TGA.subsidize !== 0) { costs += 1000; } - if(State.variables.HA.subsidize !== 0) { + if (State.variables.HA.subsidize !== 0) { costs += 1000; } - if(State.variables.TCR.subsidize !== 0) { + if (State.variables.TCR.subsidize !== 0) { costs += 1000; } - if(State.variables.TFS.subsidize !== 0) { + if (State.variables.TFS.subsidize !== 0) { costs += 1000; } return costs; @@ -421,24 +422,24 @@ window.getSchoolCosts = function() { window.getPolicyCosts = function() { var costs = 0; var policyCost = State.variables.policyCost; - if(State.variables.alwaysSubsidizeGrowth === 1) { + if (State.variables.alwaysSubsidizeGrowth === 1) { costs += policyCost; } - if(State.variables.alwaysSubsidizeRep === 1) { + if (State.variables.alwaysSubsidizeRep === 1) { costs += policyCost; } - if(State.variables.RegularParties === 1) { + if (State.variables.RegularParties === 1) { costs += policyCost; } - if(State.variables.ProImmigrationCash === 1) { + if (State.variables.ProImmigrationCash === 1) { costs += policyCost; } - if(State.variables.AntiEnslavementCash === 1) { + if (State.variables.AntiEnslavementCash === 1) { costs += policyCost; } - if(State.variables.CoursingAssociation === 1) { + if (State.variables.CoursingAssociation === 1) { costs += 1000; } return costs; @@ -446,7 +447,7 @@ window.getPolicyCosts = function() { window.getCyberModCosts = function() { var costs = 0; - if(State.variables.cyberMod !== 0 && State.variables.researchLab.built === 'true') { + if (State.variables.cyberMod !== 0 && State.variables.researchLab.built === 'true') { costs += ((100 * State.variables.researchLab.maxSpace) + (300 * State.variables.researchLab.hired) + (100 * State.variables.researchLab.hired)); } return costs; @@ -456,18 +457,18 @@ window.getCyberModCosts = function() { //player expenses window.getPCTrainingCosts = function() { var costs = 0; - if(State.variables.PC.actualAge >= State.variables.IsInPrimePC && State.variables.PC.actualAge < State.variables.IsPastPrimePC) { - if(State.variables.personalAttention === PersonalAttention.TRADE) { + if (State.variables.PC.actualAge >= State.variables.IsInPrimePC && State.variables.PC.actualAge < State.variables.IsPastPrimePC) { + if (State.variables.personalAttention === PersonalAttention.TRADE) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; - } else if(State.variables.personalAttention === PersonalAttention.WAR) { + } else if (State.variables.personalAttention === PersonalAttention.WAR) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; - } else if(State.variables.personalAttention === PersonalAttention.SLAVING) { + } else if (State.variables.personalAttention === PersonalAttention.SLAVING) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; - } else if(State.variables.personalAttention === PersonalAttention.ENGINEERING) { + } else if (State.variables.personalAttention === PersonalAttention.ENGINEERING) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; - } else if(State.variables.personalAttention === PersonalAttention.MEDICINE) { + } else if (State.variables.personalAttention === PersonalAttention.MEDICINE) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; - } else if(State.variables.personalAttention === PersonalAttention.HACKING) { + } else if (State.variables.personalAttention === PersonalAttention.HACKING) { costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; } } @@ -475,14 +476,14 @@ window.getPCTrainingCosts = function() { }; window.getPCCosts = function() { var costs = 0; - if(State.variables.PC.preg === -1) { + if (State.variables.PC.preg === -1) { costs += 25; - } else if(State.variables.PC.fertDrugs === 1) { + } else if (State.variables.PC.fertDrugs === 1) { costs += 50; - } else if(State.variables.PC.preg >= 16) { + } else if (State.variables.PC.preg >= 16) { costs += 100; } - if(State.variables.PC.staminaPills === 1) { + if (State.variables.PC.staminaPills === 1) { costs += 50; } return costs; @@ -490,9 +491,9 @@ window.getPCCosts = function() { window.getPCMultiplierCosts = function(cost) { - if(State.variables.PC.career === 'servant') { - if(State.variables.personalAttention === PersonalAttention.MAID) { - if(State.variables.PC.belly >= 5000) { + if (State.variables.PC.career === 'servant') { + if (State.variables.personalAttention === PersonalAttention.MAID) { + if (State.variables.PC.belly >= 5000) { cost *= 0.80; } else { cost *= 0.75; @@ -506,12 +507,12 @@ window.getPCMultiplierCosts = function(cost) { }; window.getEnvironmentCosts = function(cost) { - if(State.variables.secExp === 1) { - if(State.variables.terrain === 'oceanic' || State.variables.terrain === 'marine') { - if(State.variables.docks > 0) { + if (State.variables.secExp === 1) { + if (State.variables.terrain === 'oceanic' || State.variables.terrain === 'marine') { + if (State.variables.docks > 0) { cost *= (1 - State.variables.docks * 0.05); } - } else if(State.variables.railway > 0) { + } else if (State.variables.railway > 0) { cost *= (1 - State.variables.railway * 0.05); } } @@ -520,7 +521,7 @@ window.getEnvironmentCosts = function(cost) { window.getSFCosts = function() { var costs = 0; - if(State.variables.SF.Toggle && State.variables.SF.Active >= 1 && State.variables.SF.Subsidy !== undefined) { + if (State.variables.SF.Toggle && State.variables.SF.Active >= 1 && State.variables.SF.Subsidy !== undefined) { Count(); costs += Math.ceil(State.temporary.SFSubsidy); } return costs; @@ -528,10 +529,10 @@ window.getSFCosts = function() { window.getWeatherCosts = function() { var costs = 0; - if(State.variables.econWeatherDamage && State.variables.disasterResponse > 0) { + if (State.variables.econWeatherDamage && State.variables.disasterResponse > 0) { costs += Math.trunc(State.variables.disasterResponse * 200000 / State.variables.localEcon); } - if(State.variables.antiWeatherFreeze > 0) { + if (State.variables.antiWeatherFreeze > 0) { costs += Math.trunc(State.variables.antiWeatherFreeze * 200000 / State.variables.localEcon); } return costs; @@ -540,42 +541,42 @@ window.getWeatherCosts = function() { window.getSlaveMinorCosts = function(slave) { var costs = 0; var rulesCost = State.variables.rulesCost; - if(slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER) { - if(slave.trust < -20) { + if (slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER) { + if (slave.trust < -20) { costs -= rulesCost * 4; - } else if(slave.devotion < -20) { + } else if (slave.devotion < -20) { if (slave.trust >= 20) { costs -= rulesCost / 2; } else { costs -= rulesCost * 2; } - } else if(slave.devotion <= 20) { + } else if (slave.devotion <= 20) { costs -= rulesCost * 3; - } else if(slave.devotion <= 50) { + } else if (slave.devotion <= 50) { costs -= rulesCost * 4; } else { costs -= rulesCost * 5; } - if(slave.fetish === 'submissive') { + if (slave.fetish === 'submissive') { costs -= rulesCost; - } else if(slave.fetish === 'dom') { + } else if (slave.fetish === 'dom') { costs += rulesCost; } - if(slave.relationship < -1) { + if (slave.relationship < -1) { costs -= rulesCost; } - if(slave.energy < 20) { + if (slave.energy < 20) { costs -= rulesCost; - } else if(slave.energy < 40) { + } else if (slave.energy < 40) { costs -= rulesCost / 2; } - if(slave.lactation > 0) { + if (slave.lactation > 0) { costs -= 25; } - if(slave.assignment === Job.SERVANT) { + if (slave.assignment === Job.SERVANT) { costs -= rulesCost; } - if(setup.servantCareers.includes(slave.career) || slave.skillS >= State.variables.masteredXP) { + if (setup.servantCareers.includes(slave.career) || slave.skillS >= State.variables.masteredXP) { costs -= rulesCost; } } @@ -583,7 +584,7 @@ window.getSlaveMinorCosts = function(slave) { }; window.getSlaveCost = function(s) { - if(!s) { return 0; } + if (!s) { return 0; } // Data duplicated from Cost Report var cost = 0; var rulesCost = State.variables.rulesCost; @@ -596,18 +597,18 @@ window.getSlaveCost = function(s) { cost += rulesCost * 0.75; break; case Job.DAIRY: - if(State.variables.dairyRestraintsSetting >= 2) { + if (State.variables.dairyRestraintsSetting >= 2) { cost += rulesCost * 0.75; - } else if(s.livingRules === LivingRule.NORMAL) { + } else if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.5; - } else if(State.variables.dairyDecoration === 'Degradationist') { + } else if (State.variables.dairyDecoration === 'Degradationist') { cost += rulesCost * 0.90; } else { cost += rulesCost; } break; case Job.BROTHEL: - if(s.livingRules === LivingRule.NORMAL) { + if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { cost += rulesCost; @@ -617,28 +618,28 @@ window.getSlaveCost = function(s) { cost += rulesCost * 1.5; break; case Job.CLINIC: - if(s.livingRules === LivingRule.LUXURIOUS) { + if (s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 2; - } else if(s.livingRules === LivingRule.NORMAL) { + } else if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { cost += rulesCost; } break; case Job.SPA: case Job.NANNY: - if(s.livingRules === LivingRule.LUXURIOUS) { + if (s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 1.75; - } else if(s.livingRules === LivingRule.NORMAL) { + } else if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { cost += rulesCost; } break; case Job.SERVANT: - if(s.livingRules === LivingRule.NORMAL) { + if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { - if(State.variables.servantsQuartersDecoration === 'Degradationist') { + if (State.variables.servantsQuartersDecoration === 'Degradationist') { cost += rulesCost * 0.90; } else { cost += rulesCost; @@ -646,7 +647,7 @@ window.getSlaveCost = function(s) { } break; case Job.JAIL: - if(s.livingRules === LivingRule.NORMAL) { + if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 1.25; } else { cost += rulesCost * 0.90; @@ -658,9 +659,9 @@ window.getSlaveCost = function(s) { cost += rulesCost * 2; break; default: - if(s.livingRules === LivingRule.LUXURIOUS) { + if (s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * (s.relationship >= 4 ? 3 : 4); - } else if(s.livingRules === LivingRule.NORMAL) { + } else if (s.livingRules === LivingRule.NORMAL) { cost += rulesCost * 2; } else { cost += rulesCost; @@ -678,27 +679,27 @@ window.getSlaveCost = function(s) { cost -= foodCost; break; } - if(s.geneticQuirks.fertility === 2 && s.geneticQuirks.hyperFertility === 2 && s.preg === 0 && (s.ovaries === 1 || s.mpreg === 1)) { + if (s.geneticQuirks.fertility === 2 && s.geneticQuirks.hyperFertility === 2 && s.preg === 0 && (s.ovaries === 1 || s.mpreg === 1)) { cost += foodCost * 0.5; } - if(s.weight > 130) { + if (s.weight > 130) { cost += foodCost * 2; - } else if(s.weight > 50) { + } else if (s.weight > 50) { cost += foodCost; - } else if(s.weight < -50) { + } else if (s.weight < -50) { cost -= foodCost; } - if(s.drugs === 'appetite suppressors') { + if (s.drugs === 'appetite suppressors') { cost -= foodCost; } - if(s.lactation > 0) { + if (s.lactation > 0) { cost += foodCost * s.lactation * (1 + Math.trunc(s.boobs/10000)); } - if(s.preg > s.pregData.normalBirth/8) { - if(s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) { + if (s.preg > s.pregData.normalBirth/8) { + if (s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) { // Extra feeding costs to support pregnancy are covered by dairy feeders. // TODO: Include them here anyway? - } else if((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE) + } else if ((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE) && State.variables.masterSuiteUpgradePregnancy === 1) { // Extra feeding costs to support pregnancy are covered by master suite luxuries. // TODO: Include them here anyway? @@ -715,82 +716,82 @@ window.getSlaveCost = function(s) { } } } - if(s.diet === 'XX' || s.diet === 'XY' || s.diet === 'fertility') { + if (s.diet === 'XX' || s.diet === 'XY' || s.diet === 'fertility') { cost += 25; - } else if(s.diet === 'cleansing') { + } else if (s.diet === 'cleansing') { cost += 50; - } else if(s.diet === 'XXY') { + } else if (s.diet === 'XXY') { cost += 75; } // Accessibility costs - if(State.variables.boobAccessibility !== 1 && s.boobs > 20000 + if (State.variables.boobAccessibility !== 1 && s.boobs > 20000 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; } - if(State.variables.pregAccessibility !== 1 + if (State.variables.pregAccessibility !== 1 && (s.belly >= 60000) && s.assignment !== Job.BABY_FACTORY && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 100; } - if(State.variables.dickAccessibility !== 1 && s.dick > 45 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (State.variables.dickAccessibility !== 1 && s.dick > 45 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; } - if(State.variables.ballsAccessibility !== 1 && s.balls > 90 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (State.variables.ballsAccessibility !== 1 && s.balls > 90 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; } - if(State.variables.buttAccessibility !== 1 && s.butt > 15 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (State.variables.buttAccessibility !== 1 && s.butt > 15 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; } - if(!canSee(s) && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (!canSee(s) && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; - } else if(s.eyes <= -1 && s.eyewear !== 'corrective glasses' && s.eyewear !== 'corrective contacts') { + } else if (s.eyes <= -1 && s.eyewear !== 'corrective glasses' && s.eyewear !== 'corrective contacts') { cost += 25; - } else if(s.eyewear === 'blurring glasses' || s.eyewear === 'blurring contacts') { + } else if (s.eyewear === 'blurring glasses' || s.eyewear === 'blurring contacts') { cost += 25; } - if(!canHear(s) && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (!canHear(s) && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 40; - } else if(s.hears <= -1 && s.earwear !== 'hearing aids') { + } else if (s.hears <= -1 && s.earwear !== 'hearing aids') { cost += 15; - } else if(s.earwear === 'muffling ear plugs') { + } else if (s.earwear === 'muffling ear plugs') { cost += 15; } - if((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { - if(s.amp !== 0) { - if(s.amp === 1) { + if ((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (s.amp !== 0) { + if (s.amp === 1) { cost += rulesCost; } else { cost += rulesCost / 2; } - } else if(!canWalk(s)) { + } else if (!canWalk(s)) { cost += rulesCost; } } // Maintenance - if(s.boobs > 10000 && s.boobsImplantType === 1) { + if (s.boobs > 10000 && s.boobsImplantType === 1) { cost += 50; } - if(s.butt > 10 && s.buttImplantType === 1) { + if (s.butt > 10 && s.buttImplantType === 1) { cost += 50; } - if((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { - if(s.preg > s.pregData.minLiveBirth && State.variables.universalRulesBirthing === 1) { + if ((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (s.preg > s.pregData.minLiveBirth && State.variables.universalRulesBirthing === 1) { cost += 50; } } // Retirement account - if(State.variables.citizenRetirementMenials === 1 && State.variables.CitizenRetirement === 0) { + if (State.variables.citizenRetirementMenials === 1 && State.variables.CitizenRetirement === 0) { cost += 2; } - if(State.variables.CitizenRetirement === 1) { + if (State.variables.CitizenRetirement === 1) { cost += 250; } // Enemas - if(s.inflation === 3) { + if (s.inflation === 3) { switch(s.inflationType) { case 'water': cost += 100; @@ -802,7 +803,7 @@ window.getSlaveCost = function(s) { cost += (100 + (drugsCost * 2)); break; } - } else if(s.inflation === 2) { + } else if (s.inflation === 2) { switch(s.inflationType) { case 'water': cost += 50; @@ -814,7 +815,7 @@ window.getSlaveCost = function(s) { cost += (50 + (drugsCost * 2)); break; } - } else if(s.inflation === 1) { + } else if (s.inflation === 1) { switch(s.inflationType) { case 'water': cost += 25; @@ -849,30 +850,30 @@ window.getSlaveCost = function(s) { cost += drugsCost * 2; break; } - if(s.curatives > 0 && s.assignmentVisible === 1) { + if (s.curatives > 0 && s.assignmentVisible === 1) { cost += drugsCost * s.curatives; } - if(s.aphrodisiacs !== 0) { + if (s.aphrodisiacs !== 0) { cost += Math.trunc(drugsCost * Math.abs(s.aphrodisiacs)); } - if(s.hormones !== 0) { + if (s.hormones !== 0) { cost += Math.trunc((drugsCost * Math.abs(s.hormones) * 0.5)); } - if(s.bodySwap > 0) { + if (s.bodySwap > 0) { cost += Math.trunc((drugsCost * s.bodySwap * 10)); } - if(s.preg === -1 && isFertile(s)) { + if (s.preg === -1 && isFertile(s)) { cost += Math.trunc((drugsCost * 0.5)); } // Promotion costs - if(State.variables.studio === 1) { - if(s.pornFameSpending > 0) { + if (State.variables.studio === 1) { + if (s.pornFameSpending > 0) { cost += (s.pornFameSpending/State.variables.PCSlutContacts); } } - if(isNaN(cost)) { + if (isNaN(cost)) { throw new Error('Cost calculation for slave ' + s.slaveName + ' (' + s.ID + ') failed.'); } return cost; @@ -882,7 +883,7 @@ window.getSlaveCost = function(s) { // PC buying slaves reduces supply, selling slaves reduces demand. window.menialSlaveCost = function(q) { - if(!q) { + if (!q) { q = 0; } var demand = State.variables.menialDemandFactor; @@ -896,44 +897,44 @@ window.menialSlaveCost = function(q) { window.corpValue = function() { const V = State.variables; - if(V.corpIncorporated === 0) { + if (V.corpIncorporated === 0) { return 0; } else { var corpAssets = 0; - if(V.corpDivExtra > 0) { + if (V.corpDivExtra > 0) { corpAssets += V.corpDivExtraDev * 16000 + V.corpDivExtraSlaves * 10000; } - if(V.corpDivLegal > 0) { + if (V.corpDivLegal > 0) { corpAssets += V.corpDivLegalDev * 20000 + V.corpDivLegalSlaves * 15000; } - if(V.corpDivBreak > 0) { + if (V.corpDivBreak > 0) { corpAssets += V.corpDivBreakDev * 7200 + V.corpDivBreakSlaves * 10000 + V.corpDivBreakSlaves2 * 15000; } - if(V.corpDivSurgery > 0) { + if (V.corpDivSurgery > 0) { corpAssets += V.corpDivSurgeryDev * 16000 + V.corpDivSurgerySlaves * 15000 + V.corpDivSurgerySlaves2 * 23000; } - if(V.corpDivTrain > 0) { - if(V.corpDivSurgery + V.corpDivTrain < 2 && V.corpDivTrainSurgerySwitch === 0) { + if (V.corpDivTrain > 0) { + if (V.corpDivSurgery + V.corpDivTrain < 2 && V.corpDivTrainSurgerySwitch === 0) { corpAssets += V.corpDivTrainDev * 20000 + V.corpDivTrainSlaves * 15000 + V.corpDivTrainSlaves2 * 26000; - } else if(V.corpDivTrainSurgerySwitch === 1 && V.corpDivTrainSurgeryTimer < 5) { + } else if (V.corpDivTrainSurgerySwitch === 1 && V.corpDivTrainSurgeryTimer < 5) { corpAssets += V.corpDivTrainDev * 20000 + V.corpDivTrainSlaves * (15000 + 1600 * V.corpDivTrainSurgeryTimer) + V.corpDivTrainSlaves2 * (26000 + 1600 * V.corpDivTrainSurgeryTimer); } else { corpAssets += V.corpDivTrainDev * 20000 + V.corpDivTrainSlaves * 23000 + V.corpDivTrainSlaves2 * 34000; } } - if(V.corpDivArcade > 0) { + if (V.corpDivArcade > 0) { corpAssets += V.corpDivArcadeDev * 4000 + V.corpDivArcadeSlaves * 10000; } - if(V.corpDivMenial > 0) { + if (V.corpDivMenial > 0) { corpAssets += V.corpDivMenialDev * 5200 + V.corpDivMenialSlaves * 15000; } - if(V.corpDivDairy > 0) { + if (V.corpDivDairy > 0) { corpAssets += V.corpDivDairyDev * 12000 + V.corpDivDairySlaves * 23000; } - if(V.corpDivWhore > 0) { - if(V.corpDivSurgery + V.corpDivTrain < 2 && V.corpDivTrainSurgerySwitch === 0) { + if (V.corpDivWhore > 0) { + if (V.corpDivSurgery + V.corpDivTrain < 2 && V.corpDivTrainSurgerySwitch === 0) { corpAssets += V.corpDivWhoreDev * 16000 + V.corpDivWhoreSlaves * 26000; - } else if(V.corpDivTrainSurgerySwitch === 1 && V.corpDivTrainSurgeryTimer < 20) { + } else if (V.corpDivTrainSurgerySwitch === 1 && V.corpDivTrainSurgeryTimer < 20) { corpAssets += V.corpDivWhoreDev * 16000 + V.corpDivWhoreSlaves * (26000 + 400 * V.corpDivTrainSurgeryTimer); } else { corpAssets += V.corpDivWhoreDev * 16000 + V.corpDivWhoreSlaves * 34000; @@ -948,7 +949,7 @@ window.corpValue = function() { window.corpSharePrice = function(q) { const V = State.variables; - if(V.corpIncorporated === 0) { + if (V.corpIncorporated === 0) { return 0; } else { return Math.trunc(1000 * (corpValue() / (V.personalShares + V.publicShares + (q || 0)))); @@ -961,7 +962,7 @@ window.corpSharePrice = function(q) { window.corpDivBreakSlavesRoom = function() { const V = State.variables; - if(V.corpDivBreak === 1 && V.corpDivBreakDev > V.corpDivBreakSlaves) { + if (V.corpDivBreak === 1 && V.corpDivBreakDev > V.corpDivBreakSlaves) { return V.corpDivBreakDev - V.corpDivBreakSlaves; } else { return 0; @@ -970,7 +971,7 @@ window.corpDivBreakSlavesRoom = function() { window.corpDivSurgerySlavesRoom = function() { const V = State.variables; - if(V.corpDivSurgery === 1 && V.corpDivSurgeryDev > V.corpDivSurgerySlaves) { + if (V.corpDivSurgery === 1 && V.corpDivSurgeryDev > V.corpDivSurgerySlaves) { return V.corpDivSurgeryDev - V.corpDivSurgerySlaves; } else { return 0; @@ -979,7 +980,7 @@ window.corpDivSurgerySlavesRoom = function() { window.corpDivTrainSlavesRoom = function() { const V = State.variables; - if(V.corpDivTrain === 1 && V.corpDivTrainDev > V.corpDivTrainSlaves) { + if (V.corpDivTrain === 1 && V.corpDivTrainDev > V.corpDivTrainSlaves) { return V.corpDivTrainDev - V.corpDivTrainSlaves; } else { return 0; @@ -988,7 +989,7 @@ window.corpDivTrainSlavesRoom = function() { window.corpDivArcadeSlavesRoom = function() { const V = State.variables; - if(V.corpDivArcade === 1 && V.corpDivArcadeDev > V.corpDivArcadeSlaves) { + if (V.corpDivArcade === 1 && V.corpDivArcadeDev > V.corpDivArcadeSlaves) { return V.corpDivArcadeDev - V.corpDivArcadeSlaves; } else { return 0; @@ -997,7 +998,7 @@ window.corpDivArcadeSlavesRoom = function() { window.corpDivMenialSlavesRoom = function() { const V = State.variables; - if(V.corpDivMenial === 1 && V.corpDivMenialDev > V.corpDivMenialSlaves) { + if (V.corpDivMenial === 1 && V.corpDivMenialDev > V.corpDivMenialSlaves) { return V.corpDivMenialDev - V.corpDivMenialSlaves; } else { return 0; @@ -1006,7 +1007,7 @@ window.corpDivMenialSlavesRoom = function() { window.corpDivDairySlavesRoom = function() { const V = State.variables; - if(V.corpDivDairy === 1 && V.corpDivDairyDev > V.corpDivDairySlaves) { + if (V.corpDivDairy === 1 && V.corpDivDairyDev > V.corpDivDairySlaves) { return V.corpDivDairyDev - V.corpDivDairySlaves; } else { return 0; @@ -1015,7 +1016,7 @@ window.corpDivDairySlavesRoom = function() { window.corpDivWhoreSlavesRoom = function() { const V = State.variables; - if(V.corpDivWhore === 1 && V.corpDivWhoreDev > V.corpDivWhoreSlaves) { + if (V.corpDivWhore === 1 && V.corpDivWhoreDev > V.corpDivWhoreSlaves) { return V.corpDivWhoreDev - V.corpDivWhoreSlaves; } else { return 0; @@ -1026,9 +1027,9 @@ window.corpDivWhoreSlavesRoom = function() { //race is the lowercase string representing the race, 'blacklist' is either 1 or 0. 1 means we are blacklisting and 0 means we are whitelisting said race window.corpBlacklistRace = function(race, blacklist) { var raceArray = State.variables.corpSpecRaces; - if(raceArray.length > 0 && blacklist === 1) { + if (raceArray.length > 0 && blacklist === 1) { raceArray.delete(race); - } else if(blacklist === 1) { + } else if (blacklist === 1) { raceArray = setup.filterRacesLowercase.filter(x => x !== race); } else { raceArray.push(race); @@ -1037,7 +1038,7 @@ window.corpBlacklistRace = function(race, blacklist) { }; window.getSlaveStatisticData = function(s, facility) { - if(!s || !facility) { + if (!s || !facility) { // Base data, even without facility return { ID: s.ID, slaveName: s.slaveName, customLabel: s.customLabel, @@ -1046,11 +1047,11 @@ window.getSlaveStatisticData = function(s, facility) { }; } - if(!facility.income) { + if (!facility.income) { facility.income = new Map(); } - if(facility.income.has(s.ID)) { + if (facility.income.has(s.ID)) { return facility.income.get(s.ID); } else { var data = { @@ -1115,7 +1116,7 @@ window.cashX = function(cost, what, who) { V.cash += cost; //INCOME - if(cost > 0) { + if (cost > 0) { //record the action if (typeof V.lastWeeksCashIncome[what] !== 'undefined') { @@ -1132,7 +1133,7 @@ window.cashX = function(cost, what, who) { } //EXPENSES - else if(cost < 0) { + else if (cost < 0) { //record the action if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') { @@ -1166,7 +1167,7 @@ window.repX = function(rep, what, who) { //INCOME //These are all scaled relative to current rep except when recording the who, to keep comparisons between slaves possible across times. This quite drastically reduces rep income at high levels of rep and only slightly at low levels. - if(rep > 0) { + if (rep > 0) { //record the slave, if available if (typeof who !== 'undefined') { @@ -1175,7 +1176,7 @@ window.repX = function(rep, what, who) { } //record the action - if (what === "cheating" || passage() == "init" || passage() == "init Nationalities") { + if (what === "cheating" || passage() === "init" || passage() === "init Nationalities") { /*we don't want to curve startup or cheating.*/ V.lastWeeksRepIncome[what] += rep; } else if (typeof V.lastWeeksRepIncome[what] !== 'undefined') { @@ -1187,7 +1188,7 @@ window.repX = function(rep, what, who) { } //EXPENSES - else if(rep < 0) { + else if (rep < 0) { //record the action if (typeof V.lastWeeksRepExpenses[what] !== 'undefined') { diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index c217f3b9021ed242a4ddbbfe4a68a1a65755cf74..329776772f1d76e9355b906442e329fe0f98fcd9 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* intended to condense the clothing/toy/etc availability checks into something less asinine */ window.isItemAccessible = function(string) { const V = State.variables; diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 3ecd4fba67e6c3382a18efe8ece7c4799b7cf182..4e084ac766c33ee9abbf2c1ea13ce72c20179d38 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ // rewrite of the rules assistant options page in javascript // uses an object-oriented widget pattern // wrapped in a closure so as not to pollute the global namespace diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index b0ea5dadd13e8195977ce207ccac0b2e7808ac93..f5729d019cb007562013de157319a3d71e326222 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ function clearSummaryCache(slave) { if (!slave) setup.summaryCache = {}; @@ -3786,7 +3787,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3812,7 +3813,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID && handled !== 1) { - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3838,7 +3839,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s mother`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3850,7 +3851,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s father`; if (slave.relationshipTarget === V.slaves[_ssj].ID && handled !== 1) { - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3866,7 +3867,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s sister`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += `& ${friendShipShort}`; handled = 1; } @@ -3881,7 +3882,7 @@ window.SlaveSummaryUncached = (function(){ }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s`; - var friendShipShort = relationshipTermShort(slave); + let friendShipShort = relationshipTermShort(slave); r += ` ${friendShipShort}`; } } else if (slave.relationship === -3 && slave.mother !== -1 && slave.father !== -1) { @@ -3964,7 +3965,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTerm(slave); + let friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -3991,7 +3992,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTerm(slave); + let friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4018,7 +4019,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">mother`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTerm(slave); + let friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4030,7 +4031,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">father`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTerm(slave); + let friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4052,7 +4053,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">sister`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - var friendShipShort = relationshipTerm(slave); + let friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4732,82 +4733,82 @@ App.UI.PassageSlaveFilers = { "Main": s => (s.assignmentVisible === 1), "Personal Attention Select": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0), "Agent Select": s => (s.fuckdoll === 0 && s.devotion > 20 && s.intelligence + s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark !== 1 || State.variables.propOutcome === 0)), - "BG Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.assignment != "guard you" && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), - "Recruiter Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)), - "HG Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "be your Head Girl" && canWalk(s) && canHear(s) && canSee(s) && canTalk(s)), - "Head Girl Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "be your Head Girl" && s.indentureRestrictions <= 0 && (s.breedingMark != 1 || State.variables.propOutcome == 0)) || - (State.variables.Flag != 0 && s.assignment == "live with your Head Girl"))), - "Subordinate Targeting": s => (s.devotion >= -20 && s.fuckdoll == 0 && State.variables.activeSlave.ID != s.ID && (State.variables.activeSlave.amp != 1 || s.amp != 1)), - "Spa": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "rest in the spa") || - (State.variables.Flag == 1 && s.assignment == "rest in the spa") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Attendant.ID))), - "Attendant Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), - "Nursery": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (s.devotion > 20 || s.trust > 20) && ( - (State.variables.Flag == 0 && s.assignment != "work as a nanny") || - (State.variables.Flag == 1 && s.assignment == "work as a nanny") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Matron.ID))), - "Matron Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), - "Brothel": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "work in the brothel") || - (State.variables.Flag == 1 && s.assignment == "work in the brothel") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Madam.ID))), - "Madam Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), - "Club": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "serve in the club") || - (State.variables.Flag == 1 && s.assignment == "serve in the club") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.DJ.ID))), - "DJ Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canTalk(s) && canHear(s) && canWalk(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), - "Clinic": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "get treatment in the clinic") || - (State.variables.Flag == 1 && s.assignment == "get treatment in the clinic") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Nurse.ID))), - "Nurse Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s)), - "Schoolroom": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.fetish != "mindbroken" && s.assignment != "learn in the schoolroom") || - (State.variables.Flag == 1 && s.assignment == "learn in the schoolroom") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Schoolteacher.ID))), - "Schoolteacher Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canTalk(s) && canHear(s) && canSee(s)), - "Dairy": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "work in the dairy") || - (State.variables.Flag == 1 && s.assignment == "work in the dairy") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Milkmaid.ID))), - "Milkmaid Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 20 && canWalk(s) && canSee(s) && canHear(s)), - "Farmyard": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && canWalk(s) && ( - (State.variables.Flag == 0 && s.assignment != "work as a farmhand") || - (State.variables.Flag == 1 && s.assignment == "work as a farmhand") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Farmer.ID))), - "Farmer Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), - "Servants' Quarters": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "work as a servant") || - (State.variables.Flag == 1 && s.assignment == "work as a servant") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Stewardess.ID))), - "Stewardess Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s)), - "Master Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - (State.variables.Flag == 0 && s.assignment != "serve in the master suite") || - (State.variables.Flag == 1 && s.assignment == "serve in the master suite") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Concubine.ID))), - "Concubine Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.amp != 1), - "Cellblock": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && ( - (State.variables.Flag == 0 && s.assignment != "be confined in the cellblock") || - (State.variables.Flag == 1 && s.assignment == "be confined in the cellblock") || - (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Wardeness.ID))), - "Wardeness Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), - "Arcade": s => (s.assignmentVisible == 1 && (State.variables.arcade >= State.variables.arcadeSlaves || State.variables.arcadeUpgradeFuckdolls == 1) && ( - (State.variables.Flag == 0 && s.assignment != "be confined in the arcade") || - (State.variables.Flag != 0 && s.assignment == "be confined in the arcade"))), - "Pit": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( - (State.variables.Flag == 0 && !State.variables.fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment != "guard you") && (s.assignment != "work in the dairy" || State.variables.dairyRestraintsSetting < 2)) || - (State.variables.Flag != 0 && State.variables.fighterIDs.includes(s.ID)))), - "Coursing Association": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( - (State.variables.Flag == 0 && canWalk(s) && State.variables.Lurcher.ID != s.ID) || - (State.variables.Flag != 0 && State.variables.Lurcher.ID == s.ID))), - "New Game Plus": s => ((State.variables.Flag == 0 && s.assignment != "be imported") || (State.variables.Flag != 0 && s.assignment == "be imported")), - "Rules Slave Select": s => ((State.variables.Flag == 0 && !ruleSlaveSelected(s, State.variables.currentRule)) || (State.variables.Flag != 0 && ruleSlaveSelected(s, State.variables.currentRule))), - "Rules Slave Exclude": s => ((State.variables.Flag == 0 && !ruleSlaveExcluded(s, State.variables.currentRule)) || (State.variables.Flag != 0 && ruleSlaveExcluded(s, State.variables.currentRule))), - "Matchmaking": s => (s.devotion >= 100 && s.relationship == State.variables.activeSlave.relationship && s.ID != State.variables.activeSlave.ID), - "Dinner Party Preparations": s => (s.assignmentVisible == 1 && s.fuckdoll == 0), + "BG Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.assignment !== "guard you" && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark !== 1 || State.variables.propOutcome === 0)), + "Recruiter Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.assignment !== "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)), + "HG Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.assignment !== "be your Head Girl" && canWalk(s) && canHear(s) && canSee(s) && canTalk(s)), + "Head Girl Suite": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "be your Head Girl" && s.indentureRestrictions <= 0 && (s.breedingMark !== 1 || State.variables.propOutcome === 0)) || + (State.variables.Flag !== 0 && s.assignment === "live with your Head Girl"))), + "Subordinate Targeting": s => (s.devotion >= -20 && s.fuckdoll === 0 && State.variables.activeSlave.ID !== s.ID && (State.variables.activeSlave.amp !== 1 || s.amp !== 1)), + "Spa": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "rest in the spa") || + (State.variables.Flag === 1 && s.assignment === "rest in the spa") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Attendant.ID))), + "Attendant Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canWalk(s) && canHear(s)), + "Nursery": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && (s.devotion > 20 || s.trust > 20) && ( + (State.variables.Flag === 0 && s.assignment !== "work as a nanny") || + (State.variables.Flag === 1 && s.assignment === "work as a nanny") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Matron.ID))), + "Matron Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canWalk(s) && canHear(s)), + "Brothel": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "work in the brothel") || + (State.variables.Flag === 1 && s.assignment === "work in the brothel") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Madam.ID))), + "Madam Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark !== 1 || State.variables.propOutcome === 0)), + "Club": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "serve in the club") || + (State.variables.Flag === 1 && s.assignment === "serve in the club") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.DJ.ID))), + "DJ Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canTalk(s) && canHear(s) && canWalk(s) && (s.breedingMark !== 1 || State.variables.propOutcome === 0)), + "Clinic": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "get treatment in the clinic") || + (State.variables.Flag === 1 && s.assignment === "get treatment in the clinic") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Nurse.ID))), + "Nurse Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canWalk(s) && canSee(s)), + "Schoolroom": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.fetish !== "mindbroken" && s.assignment !== "learn in the schoolroom") || + (State.variables.Flag === 1 && s.assignment === "learn in the schoolroom") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Schoolteacher.ID))), + "Schoolteacher Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canTalk(s) && canHear(s) && canSee(s)), + "Dairy": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "work in the dairy") || + (State.variables.Flag === 1 && s.assignment === "work in the dairy") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Milkmaid.ID))), + "Milkmaid Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 20 && canWalk(s) && canSee(s) && canHear(s)), + "Farmyard": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && canWalk(s) && ( + (State.variables.Flag === 0 && s.assignment !== "work as a farmhand") || + (State.variables.Flag === 1 && s.assignment === "work as a farmhand") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Farmer.ID))), + "Farmer Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), + "Servants' Quarters": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "work as a servant") || + (State.variables.Flag === 1 && s.assignment === "work as a servant") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Stewardess.ID))), + "Stewardess Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s)), + "Master Suite": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag === 0 && s.assignment !== "serve in the master suite") || + (State.variables.Flag === 1 && s.assignment === "serve in the master suite") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Concubine.ID))), + "Concubine Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.amp !== 1), + "Cellblock": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0 && s.fetish !== "mindbroken" && ( + (State.variables.Flag === 0 && s.assignment !== "be confined in the cellblock") || + (State.variables.Flag === 1 && s.assignment === "be confined in the cellblock") || + (State.variables.Flag !== 0 && State.variables.Flag !== 1 && s.ID === State.variables.Wardeness.ID))), + "Wardeness Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), + "Arcade": s => (s.assignmentVisible === 1 && (State.variables.arcade >= State.variables.arcadeSlaves || State.variables.arcadeUpgradeFuckdolls === 1) && ( + (State.variables.Flag === 0 && s.assignment !== "be confined in the arcade") || + (State.variables.Flag !== 0 && s.assignment === "be confined in the arcade"))), + "Pit": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && ( + (State.variables.Flag === 0 && !State.variables.fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment !== "guard you") && (s.assignment !== "work in the dairy" || State.variables.dairyRestraintsSetting < 2)) || + (State.variables.Flag !== 0 && State.variables.fighterIDs.includes(s.ID)))), + "Coursing Association": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && ( + (State.variables.Flag === 0 && canWalk(s) && State.variables.Lurcher.ID !== s.ID) || + (State.variables.Flag !== 0 && State.variables.Lurcher.ID === s.ID))), + "New Game Plus": s => ((State.variables.Flag === 0 && s.assignment !== "be imported") || (State.variables.Flag !== 0 && s.assignment === "be imported")), + "Rules Slave Select": s => ((State.variables.Flag === 0 && !ruleSlaveSelected(s, State.variables.currentRule)) || (State.variables.Flag !== 0 && ruleSlaveSelected(s, State.variables.currentRule))), + "Rules Slave Exclude": s => ((State.variables.Flag === 0 && !ruleSlaveExcluded(s, State.variables.currentRule)) || (State.variables.Flag !== 0 && ruleSlaveExcluded(s, State.variables.currentRule))), + "Matchmaking": s => (s.devotion >= 100 && s.relationship === State.variables.activeSlave.relationship && s.ID !== State.variables.activeSlave.ID), + "Dinner Party Preparations": s => (s.assignmentVisible === 1 && s.fuckdoll === 0), }; /** @@ -4860,7 +4861,7 @@ App.UI.slaveSummaryList = function (passageName) { if ("object" === typeof attributes) attributes = $.map(attributes, (val, key) => key + '="' + val + '"').join(" "); else - attributes = 'id="' + String(this.args[0]).trim() + '"'; + attributes = 'id="' + String(this.args[0]).trim() + '"'; /** TODO: If a strict mode function is executed using function invocation, its 'this' value will be undefined. jshint(W040) */ return '<' + htag + ' ' + attributes + '>' + payload + '</' + htag + '>'; } @@ -4875,8 +4876,8 @@ App.UI.slaveSummaryList = function (passageName) { function dividerAndImage(s, showImage) { showImage = showImage || true; - let r = [V.lineSeparations == 0 ? '<br>' : '<hr style="margin:0">']; - if (showImage && (V.seeImages == 1) && (V.seeSummaryImages == 1)) { + let r = [V.lineSeparations === 0 ? '<br>' : '<hr style="margin:0">']; + if (showImage && (V.seeImages === 1) && (V.seeSummaryImages === 1)) { r.push(slaveImage(s)); } return r.join(""); @@ -4898,21 +4899,21 @@ App.UI.slaveSummaryList = function (passageName) { const tabName = V.slaveAssignmentTab; let _tableCount = 0; - if (V.useSlaveListInPageJSNavigation == 1) { + if (V.useSlaveListInPageJSNavigation === 1) { const _Count = _indexSlavesIdxs.length; /* Useful for finding weird combinations — usages of this passage that don't yet generate the quick index. * <<print 'pass/count/indexed/flag::[' + passageName + '/' + _Count + '/' + _indexed + '/' + $Flag + ']'>> */ - if (((_Count > 1) && (_indexed == 0) && (((passageName == 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs == 0) || (V.slaveAssignmentTab == "all"))) || (V.Flag == 1)))) { + if (((_Count > 1) && (_indexed === 0) && (((passageName === 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs === 0) || (V.slaveAssignmentTab === "all"))) || (V.Flag === 1)))) { let _indexed = 1, _counter = 0, _buttons = [], _offset = -50; if (/Select/i.test(passageName)) { - _offset = -25 + _offset = -25; } - res.push("<br />") + res.push("<br />"); _tableCount++; /* * we want <button data-quick-index="<<= _tableCount>>">... @@ -4988,7 +4989,7 @@ App.UI.slaveSummaryList = function (passageName) { const _slaveName = SlaveFullName(_Slave); let _tableCount = 0; - let slaveImagePrinted = (V.seeImages == 1) && (V.seeSummaryImages == 1); + let slaveImagePrinted = (V.seeImages === 1) && (V.seeSummaryImages === 1); res.push('<div id="slave_' + _Slave.ID + '" style="clear:both">'); @@ -5005,7 +5006,7 @@ App.UI.slaveSummaryList = function (passageName) { else if ("recruit girls" === _Slave.assignment) res.push('<strong>@@.lightcoral;RC@@</strong> '); else if ("guard you" === _Slave.assignment) res.push('<strong>@@.lightcoral;BG@@</strong> '); - if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID == _Slave.ID) != -1) { + if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1) { res.push('<strong>@@.lightcoral; PA@@</strong> '); } res.push(this.passageLink(_slaveName, 'Slave Interact', `$activeSlave = $slaves[${_ssi}]`)); /* lists their names */ @@ -5032,7 +5033,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|HG Workaround][$i = ${_ssi}]]`); break; case "Head Girl Suite": - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5045,10 +5046,10 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Subordinate Targeting][$activeSlave.subTarget = $slaves[${_ssi}].ID]]`); break; case "Spa": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.spa <= V.spaSlaves) { res.pop(); continue; } - if ((_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish == "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none") { - if (_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") { + if ((_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish === "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none") { + if (_Slave.devotion >= -20 || _Slave.fetish === "mindbroken") { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5059,11 +5060,11 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`<i>${_Slave.slaveName} cannot benefit from the spa</i></div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { - if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) res.push(slaveImage(_Slave)); + if ((V.seeImages === 1) && (V.seeSummaryImages === 1)) res.push(slaveImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } break; @@ -5072,7 +5073,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Attendant Workaround][$i = ${_ssi}]]`); break; case "Nursery": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.nurseryNannies <= V.nurserySlaves) { res.pop(); continue; } if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)) { res.push(dividerAndImage(_Slave)); @@ -5081,11 +5082,11 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`<i>${_Slave.slaveName} must be either more fearful of you or devoted to you</i></div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { - if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) { + if ((V.seeImages === 1) && (V.seeSummaryImages === 1)) { res.push(slaveImage(_Slave)); } res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); @@ -5096,9 +5097,9 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Matron Workaround][$i = ${_ssi}]]`); break; case "Brothel": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.brothel <= V.brothelSlaves) { res.pop(); continue; } - if (_Slave.breedingMark != 1 || V.propOutcome == 0) { + if (_Slave.breedingMark !== 1 || V.propOutcome === 0) { if ((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); @@ -5110,11 +5111,11 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`<i>${_Slave.slaveName} is for private use only</i></div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { - if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) { + if ((V.seeImages === 1) && (V.seeSummaryImages === 1)) { res.push(slaveImage(_Slave)); } res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); @@ -5125,9 +5126,9 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Madam Workaround][$i = ${_ssi}]]`); break; case "Club": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.club <= V.clubSlaves) { res.pop(); continue; } - if (_Slave.breedingMark != 1 || V.propOutcome == 0) { + if (_Slave.breedingMark !== 1 || V.propOutcome === 0) { if ((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); @@ -5139,7 +5140,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} is for private use only//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5152,16 +5153,16 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|DJ Workaround][$i = ${_ssi}]]`); break; case "Clinic": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.clinic <= V.clinicSlaves) { res.pop(); continue; } - if ((_Slave.health < 20) || (V.Nurse != 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters == 1) || (V.bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33)))) { + if ((_Slave.health < 20) || (V.Nurse !== 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters === 1) || (V.bellyImplants === 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown === 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl === "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33)))) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { res.push(`//${_Slave.slaveName} cannot benefit from the clinic//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5174,10 +5175,10 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Nurse Workaround][$i = ${_ssi}]]`); break; case "Schoolroom": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.schoolroom <= V.schoolroomSlaves) { res.pop(); continue; } if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)) { - if ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20))) { + if ((_Slave.intelligenceImplant < 30) || (_Slave.voice !== 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20))) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5188,7 +5189,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} is too resistant to learn//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5201,9 +5202,9 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Schoolteacher Workaround][$i = ${_ssi}]]`); break; case "Dairy": - if (V.Flag == 0) { + if (V.Flag === 0) { const _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; - if (_Slave.assignment == "work in the dairy") { res.pop(); continue; } + if (_Slave.assignment === "work in the dairy") { res.pop(); continue; } if (V.dairy <= V.dairySlaves + _dairySeed) { res.pop(); continue; } if ((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) { res.push(`//${_Slave.slaveName}'s indenture forbids extractive Dairy service.//</div>`); @@ -5211,17 +5212,17 @@ App.UI.slaveSummaryList = function (passageName) { } else if ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) { res.push(`//${_Slave.slaveName}'s indenture allows only free range milking.//</div>`); continue; - } else if (_Slave.breedingMark == 1 && V.propOutcome == 1 && V.dairyRestraintsSetting > 0) { + } else if (_Slave.breedingMark === 1 && V.propOutcome === 1 && V.dairyRestraintsSetting > 0) { res.push(`//${_Slave.slaveName} may only be a free range cow//</div>`); continue; - } else if ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother != 0))) { + } else if ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant !== -1) || (_Slave.broodmother !== 0))) { res.push(`//${_Slave.slaveName}'s womb cannot accommodate current machine settings//</div>`); continue; } else { - if ((_Slave.lactation > 0) || (_Slave.balls > 0) || ((V.dairySlimMaintainUpgrade == 0 || V.dairySlimMaintain == 0) && (_Slave.boobs > 300 || _Slave.balls == 0 || V.dairyImplantsSetting == 1) && V.dairyImplantsSetting != 2)) { - if ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.amp == 1) || (V.dairyRestraintsUpgrade == 1)) { - if ((V.dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || (V.dairyPrepUpgrade == 1)) { - if ((V.dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries == 0) || (V.dairyPrepUpgrade == 1)) { + if ((_Slave.lactation > 0) || (_Slave.balls > 0) || ((V.dairySlimMaintainUpgrade === 0 || V.dairySlimMaintain === 0) && (_Slave.boobs > 300 || _Slave.balls === 0 || V.dairyImplantsSetting === 1) && V.dairyImplantsSetting !== 2)) { + if ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.amp === 1) || (V.dairyRestraintsUpgrade === 1)) { + if ((V.dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || (V.dairyPrepUpgrade === 1)) { + if ((V.dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries === 0) || (V.dairyPrepUpgrade === 1)) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5236,7 +5237,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} must be obedient in order to be milked here//</div>`); continue; } - } else if ((V.dairySlimMaintainUpgrade == 1 && V.dairySlimMaintain == 1) || (V.dairyImplantsSetting == 2) || (_Slave.boobs <= 300 && _Slave.balls > 0 && (V.dairyImplantsSetting == 0 || V.dairyImplantsSetting == 3))) { + } else if ((V.dairySlimMaintainUpgrade === 1 && V.dairySlimMaintain === 1) || (V.dairyImplantsSetting === 2) || (_Slave.boobs <= 300 && _Slave.balls > 0 && (V.dairyImplantsSetting === 0 || V.dairyImplantsSetting === 3))) { res.push(`//${_Slave.slaveName} is not lactating ${(V.seeDicks > 0) ? 'or producing semen' : ''} and ${V.dairyName}'s current settings forbid the automatic implantation of lactation inducing drugs or manual stimulation to induce it, so she cannot be a cow//</div>`); continue; } else { @@ -5244,7 +5245,7 @@ App.UI.slaveSummaryList = function (passageName) { continue; } } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5257,12 +5258,12 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Milkmaid Workaround][$i = ${_ssi}]]`); break; case "Farmyard": - if (V.Flag == 0) { - if (_Slave.assignment == "work as a farmhand") { res.pop(); continue; } + if (V.Flag === 0) { + if (_Slave.assignment === "work as a farmhand") { res.pop(); continue; } if (V.farmyard <= V.farmyardSlaves){ res.pop(); continue; } res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5275,7 +5276,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Farmer Workaround][$i = ${_ssi}]]`); break; case "Servants' Quarters": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.servantsQuarters <= V.servantsQuartersSlaves) { res.pop(); continue; } if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)) { res.push(dividerAndImage(_Slave)); @@ -5284,7 +5285,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} must be either more fearful of you or devoted to you//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5297,7 +5298,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Stewardess Workaround][$i = ${_ssi}]]`); break; case "Master Suite": - if (V.Flag == 0) { + if (V.Flag === 0) { if (V.masterSuite <= V.masterSuiteSlaves) { res.pop(); continue; } if ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)) { res.push(dividerAndImage(_Slave)); @@ -5306,7 +5307,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} is not sufficiently broken for the master suite//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5319,8 +5320,8 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Concubine Workaround][$i = ${_ssi}]]`); break; case "Cellblock": - if (_Slave.assignmentVisible != 1) { res.pop(); continue; } - if (V.Flag == 0) { + if (_Slave.assignmentVisible !== 1) { res.pop(); continue; } + if (V.Flag === 0) { if (V.cellblock <= V.cellblockSlaves) { res.pop(); continue; } if ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50)) { res.push(dividerAndImage(_Slave)); @@ -5329,7 +5330,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`//${_Slave.slaveName} is sufficiently broken in so that the cellblock would have no effect//</div>`); continue; } - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else { @@ -5342,10 +5343,10 @@ App.UI.slaveSummaryList = function (passageName) { res.push(`[[${_slaveName}|Wardeness Workaround][$i = ${_ssi}]]`); break; case "Arcade": - if (V.Flag == 0) { - if (_Slave.assignment == "be confined in the arcade") { res.pop(); continue; } - if (V.arcade <= V.arcadeSlaves && V.arcadeUpgradeFuckdolls != 1) { res.pop(); continue; } - if ((_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if (V.Flag === 0) { + if (_Slave.assignment === "be confined in the arcade") { res.pop(); continue; } + if (V.arcade <= V.arcadeSlaves && V.arcadeUpgradeFuckdolls !== 1) { res.pop(); continue; } + if ((_Slave.breedingMark !== 1 || V.propOutcome === 0)) { if (_Slave.indentureRestrictions <= 0) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); @@ -5363,14 +5364,14 @@ App.UI.slaveSummaryList = function (passageName) { } break; case "Pit": - if (V.Flag == 0) { - if ((_Slave.indentureRestrictions > 0) && (V.pitLethal == 1)) { + if (V.Flag === 0) { + if ((_Slave.indentureRestrictions > 0) && (V.pitLethal === 1)) { res.push(`//${_Slave.slaveName}'s indenture forbids lethal fights.//</div>`); continue; } else if (_Slave.indentureRestrictions > 1) { res.push(`//${_Slave.slaveName}'s indenture forbids fighting.//</div>`); continue; - } else if (_Slave.breedingMark == 1 && V.propOutcome == 1) { + } else if (_Slave.breedingMark === 1 && V.propOutcome === 1) { res.push(`//${_Slave.slaveName} may not participate in combat//</div>`); continue; } else { @@ -5383,7 +5384,7 @@ App.UI.slaveSummaryList = function (passageName) { } break; case "Coursing Association": - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Assign][$i = ${_ssi}]]`); } else { @@ -5393,7 +5394,7 @@ App.UI.slaveSummaryList = function (passageName) { break; case "New Game Plus": res.push(dividerAndImage(_Slave)); - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(`__''@@.pink;${_Slave.slaveName}@@''__`); } else { res.push(`__''@@.pink;${_Slave.slaveName}@@''__`); @@ -5401,7 +5402,7 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Rules Slave Select": slaveImagePrinted = false; - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(`__''[[${_slaveName}|Rules Slave Select Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); } else { res.push(`__''[[${_slaveName}|Rules Slave Deselect Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); @@ -5409,7 +5410,7 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Rules Slave Exclude": slaveImagePrinted = false; - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(`__''[[${_slaveName}|Rules Slave Exclude Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); } else { res.push(`__''[[${_slaveName}|Rules Slave NoExclude Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); @@ -5426,18 +5427,20 @@ App.UI.slaveSummaryList = function (passageName) { } SlaveStatClamp(_Slave); - _Slave.trust = Math.trunc(_Slave.trust), _Slave.devotion = Math.trunc(_Slave.devotion), _Slave.health = Math.trunc(_Slave.health); + _Slave.trust = Math.trunc(_Slave.trust); + _Slave.devotion = Math.trunc(_Slave.devotion); + _Slave.health = Math.trunc(_Slave.health); V.slaves[_ssi] = _Slave; res.push(' will '); - if ((_Slave.assignment == "rest") && (_Slave.health >= -20)) { + if ((_Slave.assignment === "rest") && (_Slave.health >= -20)) { res.push("''__@@.lawngreen;rest@@__''"); - } else if ((_Slave.assignment == "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))) { + } else if ((_Slave.assignment === "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))) { res.push("''__@@.lawngreen;stay confined.@@__''"); if (_Slave.sentence > 0) { res.push(`(${_Slave.sentence} weeks)`); } - } else if (_Slave.choosesOwnAssignment == 1) { + } else if (_Slave.choosesOwnAssignment === 1) { res.push('choose her own job'); } else { res.push(_Slave.assignment); @@ -5447,62 +5450,62 @@ App.UI.slaveSummaryList = function (passageName) { /** @type {string[]} */ let assignments = []; - if ((V.displayAssignments == 1) && (passageName == "Main") && (_Slave.ID != V.HeadGirl.ID) && (_Slave.ID != V.Recruiter.ID) && (_Slave.ID != V.Bodyguard.ID)) { - if (_Slave.assignment != "rest") { + if ((V.displayAssignments === 1) && (passageName === "Main") && (_Slave.ID !== V.HeadGirl.ID) && (_Slave.ID !== V.Recruiter.ID) && (_Slave.ID !== V.Bodyguard.ID)) { + if (_Slave.assignment !== "rest") { assignments.push(`<<link "Rest" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); } else { assignments.push('Rest'); } - if (_Slave.assignment != "please you") { + if (_Slave.assignment !== "please you") { assignments.push(`<<link "Fucktoy" "Main">><<= assignJob($slaves[${_ssi}], "please you")>><</link>>`); } else { assignments.push('Fucktoy'); } - if (_Slave.indentureRestrictions <= 0 && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { - if (_Slave.assignment != "work a glory hole") { + if (_Slave.indentureRestrictions <= 0 && (_Slave.breedingMark !== 1 || V.propOutcome === 0)) { + if (_Slave.assignment !== "work a glory hole") { assignments.push(`<<link "Gloryhole" "Main">><<= assignJob($slaves[${_ssi}], "work a glory hole")>><</link>>`); } else { assignments.push('Hole'); } } - if (_Slave.fuckdoll == 0) { /* NON-FUCKDOLL ASSIGNMENTS */ - if (_Slave.assignment != "take classes") { - if ((_Slave.intelligenceImplant < 15) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish != "mindbroken")) { + if (_Slave.fuckdoll === 0) { /* NON-FUCKDOLL ASSIGNMENTS */ + if (_Slave.assignment !== "take classes") { + if ((_Slave.intelligenceImplant < 15) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish !== "mindbroken")) { assignments.push(`<<link "Classes" "Main">><<= assignJob($slaves[${_ssi}], "take classes")>><</link>>`); } } else { assignments.push(`Classes`); } - if (_Slave.assignment != "be a servant") { + if (_Slave.assignment !== "be a servant") { if (((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && canWalk(_Slave) && canSee(_Slave)) { assignments.push(`<<link "House Servant" "Main">><<= assignJob($slaves[${_ssi}], "be a servant")>><</link>>`); } } else { assignments.push('House Servant'); } - if ((_Slave.assignment != "whore") && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if ((_Slave.assignment !== "whore") && (_Slave.breedingMark !== 1 || V.propOutcome === 0)) { assignments.push(`<<link "Whore" "Main">><<= assignJob($slaves[${_ssi}], "whore")>><</link>>`); } else { assignments.push('Whore'); } - if ((_Slave.assignment != "serve the public") && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if ((_Slave.assignment !== "serve the public") && (_Slave.breedingMark !== 1 || V.propOutcome === 0)) { assignments.push(`<<link "Public Servant" "Main">><<= assignJob($slaves[${_ssi}], "serve the public")>><</link>>`); } else { assignments.push('Public Servant'); } if ((_Slave.lactation > 0) || (_Slave.balls > 0)) { - if (_Slave.assignment != "get milked") { + if (_Slave.assignment !== "get milked") { assignments.push(`<<link "Milked" "Main">><<= assignJob($slaves[${_ssi}], "get milked")>><</link>>`); } else { assignments.push('Milked'); } } - if (_Slave.assignment != "stay confined") { + if (_Slave.assignment !== "stay confined") { assignments.push(`<<link "Confinement" "Main">><<= assignJob($slaves[${_ssi}], "stay confined")>><</link>>`); } else { assignments.push('Confinement'); } - if (_Slave.assignment != "choose her own job") { + if (_Slave.assignment !== "choose her own job") { assignments.push(`<<link "Let ${_Slave.object} choose" "Main">><<= assignJob($slaves[${_ssi}], "choose her own job")>><</link>>`); } else { assignments.push(`Let ${_Slave.object} choose`); @@ -5515,44 +5518,44 @@ App.UI.slaveSummaryList = function (passageName) { let _numFacilities = V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite; if (_numFacilities > 0) { - if (passageName == "Main" || passageName == "Head Girl Suite" || passageName == "Spa" || passageName == "Brothel" || passageName == "Club" || passageName == "Arcade" || passageName == "Clinic" || passageName == "Schoolroom" || passageName == "Dairy" || passageName == "Farmyard" || passageName == "Servants' Quarters" || passageName == "Master Suite" || passageName == "Cellblock") { + if (passageName === "Main" || passageName === "Head Girl Suite" || passageName === "Spa" || passageName === "Brothel" || passageName === "Club" || passageName === "Arcade" || passageName === "Clinic" || passageName === "Schoolroom" || passageName === "Dairy" || passageName === "Farmyard" || passageName === "Servants' Quarters" || passageName === "Master Suite" || passageName === "Cellblock") { V.returnTo = passageName; res.push('<br>Transfer to: '); /** @type {string[]} */ - let transfers = [] - if (_Slave.assignment != "rest" && _Slave.assignment != "please you" && _Slave.assignment != "take classes" && _Slave.assignment != "be a servant" && _Slave.assignment != "whore" && _Slave.assignment != "serve the public" && _Slave.assignment != "get milked" && _Slave.assignment != "stay confined") { + let transfers = []; + if (_Slave.assignment !== "rest" && _Slave.assignment !== "please you" && _Slave.assignment !== "take classes" && _Slave.assignment !== "be a servant" && _Slave.assignment !== "whore" && _Slave.assignment !== "serve the public" && _Slave.assignment !== "get milked" && _Slave.assignment !== "stay confined") { transfers.push(`<<link "Penthouse" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); } else { transfers.push('Penthouse'); } - if (V.arcade != 0) { - if (V.arcade > V.arcadeSlaves && (_Slave.indentureRestrictions <= 0) && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if (V.arcade !== 0) { + if (V.arcade > V.arcadeSlaves && (_Slave.indentureRestrictions <= 0) && (_Slave.breedingMark !== 1 || V.propOutcome === 0)) { transfers.push(`[[Arcade|Assign][$assignTo = "Arcade", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { transfers.push('Arcade'); } } - if (_Slave.fuckdoll == 0) { /* NON-FUCKDOLL FACILITIES */ - if (V.clinic != 0) { - if (V.clinic > V.clinicSlaves && (_Slave.health < 20 || (V.Nurse != 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters == 1) || (V.bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33))))) { + if (_Slave.fuckdoll === 0) { /* NON-FUCKDOLL FACILITIES */ + if (V.clinic !== 0) { + if (V.clinic > V.clinicSlaves && (_Slave.health < 20 || (V.Nurse !== 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters === 1) || (V.bellyImplants === 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown === 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl === "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33))))) { transfers.push(`[[Clinic|Assign][$assignTo = "Clinic", $i =${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { transfers.push('Clinic'); } } - if (V.masterSuite != 0) { + if (V.masterSuite !== 0) { if (V.masterSuite > V.masterSuiteSlaves && ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50))) { transfers.push(`[[Master Suite|Assign][$assignTo = "Master Suite", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { - transfers.push('Master Suite') + transfers.push('Master Suite'); } } - if (V.cellblock != 0) { + if (V.cellblock !== 0) { if (V.cellblock > V.cellblockSlaves && ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50))) { transfers.push(`[[Cellblock|Assign][$assignTo = "Cellblock", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { @@ -5560,15 +5563,15 @@ App.UI.slaveSummaryList = function (passageName) { } } - if (V.schoolroom != 0) { - if (V.schoolroom > V.schoolroomSlaves && (_Slave.fetish != "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20)))) { + if (V.schoolroom !== 0) { + if (V.schoolroom > V.schoolroomSlaves && (_Slave.fetish !== "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 30) || (_Slave.voice !== 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20)))) { transfers.push(`[[Schoolroom|Assign][$assignTo = "Schoolroom", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { - transfers.push('Schoolroom') + transfers.push('Schoolroom'); } } - if (V.servantsQuarters != 0) { + if (V.servantsQuarters !== 0) { if (V.servantsQuarters > V.servantsQuartersSlaves && (canWalk(_Slave) && canSee(_Slave) && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust <= 20) || _Slave.trust < -20))) { transfers.push(`[[Servants' Quarters|Assign][$assignTo = "Servants' Quarters", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { @@ -5576,36 +5579,36 @@ App.UI.slaveSummaryList = function (passageName) { } } - if (V.brothel != 0) { - if (V.brothel > V.brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || V.propOutcome == 0))) { + if (V.brothel !== 0) { + if (V.brothel > V.brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark !== 1 || V.propOutcome === 0))) { transfers.push(`[[Brothel|Assign][$assignTo = "Brothel", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { - transfers.push('Brothel') + transfers.push('Brothel'); } } - if (V.club != 0) { - if (V.club > V.clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || V.propOutcome == 0))) { + if (V.club !== 0) { + if (V.club > V.clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark !== 1 || V.propOutcome === 0))) { transfers.push(`[[Club|Assign][$assignTo = "Club", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { - transfers.push('Club') + transfers.push('Club'); } } - if (V.dairy != 0) { + if (V.dairy !== 0) { let _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; if (V.dairy <= V.dairySlaves + _dairySeed) { transfers.push('Dairy'); - } else if (((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) || (_Slave.breedingMark == 1 && V.propOutcome == 1 && V.dairyRestraintsSetting > 0) || ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother > 0)))) { + } else if (((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) || (_Slave.breedingMark === 1 && V.propOutcome === 1 && V.dairyRestraintsSetting > 0) || ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant !== -1) || (_Slave.broodmother > 0)))) { transfers.push('Dairy'); - } else if (((_Slave.lactation > 0) || (_Slave.balls > 0)) || ((V.dairyFeedersUpgrade == 1) && (V.dairyFeedersSetting > 0) && (V.dairySlimMaintainUpgrade == 0))) { + } else if (((_Slave.lactation > 0) || (_Slave.balls > 0)) || ((V.dairyFeedersUpgrade === 1) && (V.dairyFeedersSetting > 0) && (V.dairySlimMaintainUpgrade === 0))) { transfers.push(`[[Dairy|Assign][$assignTo = "Dairy", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { - transfers.push('Dairy') + transfers.push('Dairy'); } } - if (V.farmyard != 0) { + if (V.farmyard !== 0) { if (V.farmyard > V.farmyardSlaves) { transfers.push(`[[Farmyard|Assign][$assignTo = "Farmyard", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { @@ -5613,16 +5616,16 @@ App.UI.slaveSummaryList = function (passageName) { } } - if (V.spa != 0) { - if (V.spa > V.spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") && (_Slave.health < 20 || _Slave.trust <= 60 || _Slave.devotion <= 60 || _Slave.fetish == "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))) { + if (V.spa !== 0) { + if (V.spa > V.spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish === "mindbroken") && (_Slave.health < 20 || _Slave.trust <= 60 || _Slave.devotion <= 60 || _Slave.fetish === "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))) { transfers.push(`[[Spa|Assign][$assignTo = "Spa", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { transfers.push('Spa'); } } - if (V.nursery != 0) { - if (V.nurseryNannies > V.nurserySlaves && (_Slave.devotion > 20 || _Slave.trust > 20 || _Slave.fetish == "mindbroken")) { + if (V.nursery !== 0) { + if (V.nurseryNannies > V.nurserySlaves && (_Slave.devotion > 20 || _Slave.trust > 20 || _Slave.fetish === "mindbroken")) { transfers.push(`[[Nursery|Assign][$assignTo = "Nursery", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ } else { transfers.push('Nursery'); @@ -5634,7 +5637,7 @@ App.UI.slaveSummaryList = function (passageName) { } }/* closes _numFacilities */ - if ((passageName != 'Main') || (V.Flag !== undefined) || (V.useSlaveSummaryTabs == 0) || (tabName == "all")) { + if ((passageName !== 'Main') || (V.Flag !== undefined) || (V.useSlaveSummaryTabs === 0) || (tabName === "all")) { res.push(`<span id="slave-${slaves[_ssi].ID}"> </span>`); } res.push('<br/>'); @@ -5654,13 +5657,13 @@ App.UI.slaveSummaryList = function (passageName) { continue; case "HG Select": if (setup.HGCareers.includes(_Slave.career) || (_Slave.skillHG >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Head Girl Suite": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`[[Send her to live with your Head Girl|Assign][$i = ${_ssi}]]`); } else { res.push(`[[Bring her out of the Head Girl's suite|Retrieve][$i = ${_ssi}]]`); @@ -5668,21 +5671,21 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Recruiter Select": if (setup.recruiterCareers.includes(_Slave.career) || (_Slave.skillRC >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "BG Select": if (setup.bodyguardCareers.includes(_Slave.career) || (_Slave.skillBG >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Spa": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $spaName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Remove ${_Slave.object} from ${V.spaName}" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Attendant|Attendant Select]]'); @@ -5690,15 +5693,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Attendant Select": if (setup.attendantCareers.includes(_Slave.career) || (_Slave.skillAT >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Nursery": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $nurseryName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Remove ${_Slave.object} from $nurseryName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Matron|Matron Select]]'); @@ -5706,15 +5709,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Matron Select": if (setup.matronCareers.includes(_Slave.career) || (_Slave.skillMT >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Brothel": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $brothelName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $brothelName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Madam|Madam Select]]'); @@ -5722,23 +5725,23 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Madam Select": if (setup.madamCareers.includes(_Slave.career) || (_Slave.skillMD >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Club": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $clubName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Remove ${_Slave.object} from $clubName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove DJ|DJ Select]]'); } break; case "Arcade": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Confine ${_Slave.object} in $arcadeName" "Assign">><<set $i = ${_ssi}>><</link>>`); } else { res.push(`<<link "Release ${_Slave.object} from $arcadeName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); @@ -5746,18 +5749,18 @@ App.UI.slaveSummaryList = function (passageName) { break; case "DJ Select": if (setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Clinic": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.clinicUpgradeScanner == 1) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.clinicUpgradeScanner === 1) { res.push(`@@.cyan;Estimated DNA error value: ${Math.ceil(_Slave.chem / 10)}@@`); } - if (V.Flag == 0) { + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $clinicName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Take ${_Slave.object} out of $clinicName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Nurse|Nurse Select]]'); @@ -5765,15 +5768,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Nurse Select": if (setup.nurseCareers.includes(_Slave.career) || (_Slave.skillNU >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Schoolroom": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Assign ${_Slave.object} to $schoolroomName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $schoolroomName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Schoolteacher|Schoolteacher Select]]'); @@ -5781,15 +5784,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Schoolteacher Select": if (setup.schoolteacherCareers.includes(_Slave.career) || (_Slave.skillTE >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Dairy": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $dairyName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $dairyName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Milkmaid|Milkmaid Select]]'); @@ -5797,15 +5800,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Milkmaid Select": if (setup.milkmaidCareers.includes(_Slave.career) || (_Slave.skillMM >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Farmyard": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Send ${_Slave.object} to $farmyardName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $farmyardName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Farmer|Farmer Select]]'); @@ -5813,15 +5816,15 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Farmer Select": if (setup.farmerCareers.includes(_Slave.career) || (_Slave.skillFA >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Servants' Quarters": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Assign ${_Slave.object} to $servantsQuartersName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $servantsQuartersName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Stewardess|Stewardess Select]]'); @@ -5829,25 +5832,25 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Stewardess Select": if (setup.stewardessCareers.includes(_Slave.career) || (_Slave.skillST >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "Master Suite": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Add ${_Slave.object} to $masterSuiteName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Send ${_Slave.object} out of $masterSuiteName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Concubine|Concubine Select]]'); } break; case "Cellblock": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); - if (V.Flag == 0) { + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); + if (V.Flag === 0) { res.push(`<<link "Confine ${_Slave.object} in $cellblockName" "Assign">><<set $i = ${_ssi}>><</link>>`); - } else if (V.Flag == 1) { + } else if (V.Flag === 1) { res.push(`<<link "Release ${_Slave.object} from $cellblockName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); } else { res.push('[[Change or remove Wardeness|Wardeness Select]]'); @@ -5855,12 +5858,12 @@ App.UI.slaveSummaryList = function (passageName) { break; case "Wardeness Select": if (setup.wardenessCareers.includes(_Slave.career) || (_Slave.skillWA >= V.masteredXP)) { - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push('@@.lime;Has applicable career experience.@@'); } break; case "New Game Plus": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); if (V.Flag === 0) { res.push(`<<link "Add to import list" "New Game Plus">> <<set $slavesToImport += 1,$Flag = 1>> @@ -5874,17 +5877,17 @@ App.UI.slaveSummaryList = function (passageName) { } break; case "Matchmaking": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push(`[[Match them|Matchmaking][$subSlave = $slaves[${_ssi}]]]`); break; case "Dinner Party Preparations": - res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('<br>' + (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) ? ' ' : ''); res.push(`[[Make her the main course|Dinner Party Execution][$activeSlave = $slaves[${_ssi}]]]`); break; } } return res.join(""); -} +}; /** * Adds/removes a slave with the given id to/from the personal attention array