diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js index ad1c54f0f63d5e5437efeb7c2cc63440a87d4aa0..a739c0e6192ea9c13dc460d49ffec937b713aa23 100644 --- a/src/Mods/SecExp/js/secExp.js +++ b/src/Mods/SecExp/js/secExp.js @@ -370,246 +370,7 @@ App.SecExp.Check = (function() { }; function general() { - if (jsDef(V.secExp)) { - if (V.secExpEnabled !== 1) { - V.secExpEnabled = V.secExp; - } - delete V.secExp; - } - if (typeof V.secExpEnabled !== "number") { - V.secExpEnabled = 0; - } - V.SecExp = V.SecExp || SecExpBase(); - V.SecExp.settings = V.SecExp.settings || {}; - delete V.SecExp.settings.show; - - delete V.SecExp.army; - - if (V.secExpEnabled > 0) { - Object.assign(V.secBots, { - active: V.secBots.active || V.arcologyUpgrade.drones > 0 ? 1 : 0, - ID: -1, - isDeployed: V.secBots.isDeployed || 0, - troops: Math.max(V.secBots.troops, V.arcologyUpgrade.drones > 0 ? 30 : 0), - maxTroops: Math.max(V.secBots.maxTroops, V.arcologyUpgrade.drones > 0 ? 30 : 0) - }); - - V.SecExp.core = V.SecExp.core || {}; - - V.SecExp.core.trade = V.SecExp.core.trade || 0; - if (passage() === "Acquisition" || V.SecExp.core.trade === 0) { - let init = jsRandom(20, 30); - if (V.terrain === "urban") { - init += jsRandom(10, 10); - } else if (V.terrain === "ravine") { - init -= jsRandom(5, 5); - } - if (["BlackHat", "capitalist", "celebrity", "wealth"].includes(V.PC.career)) { - init += jsRandom(5, 5); - } else if (["escort", "gang", "servant"].includes(V.PC.career)) { - init -= jsRandom(5, 5); - } - V.SecExp.core.trade = init; - } - if (jsDef(V.trade)) { - V.SecExp.core.trade = V.trade; - } - - V.SecExp.core.authority = V.SecExp.core.authority || 0; - if (jsDef(V.authority)) { - V.SecExp.core.authority = V.authority; - } - - V.SecExp.security = V.SecExp.security || {}; - V.SecExp.security.cap = V.SecExp.security.cap || 100; - if (jsDef(V.security)) { - V.SecExp.security.cap = V.security; - } - V.SecExp.core.crimeLow = V.SecExp.core.crimeLow || 30; - if (jsDef(V.crime)) { - V.SecExp.core.crimeLow = V.crime; - } - - V.SecExp.settings.difficulty = V.SecExp.settings.difficulty || 1; - if (jsDef(V.difficulty)) { - V.SecExp.settings.difficulty = V.difficulty; - } - - V.SecExp.settings.battle = V.SecExp.settings.battle || {}; - if (!jsDef(V.SecExp.settings.battle.enabled)) { - V.SecExp.settings.battle.enabled = 1; - } - if (jsDef(V.battlesEnabled)) { - V.SecExp.settings.battle.enabled = V.battlesEnabled; - } - delete V.SecExp.battle; - - V.SecExp.settings.battle.major = V.SecExp.settings.battle.major || {}; - V.SecExp.settings.battle.frequency = V.SecExp.settings.battle.frequency || 1; - if (jsDef(V.battleFrequency)) { - V.SecExp.settings.battle.frequency = V.battleFrequency; - } - V.SecExp.settings.battle.force = V.SecExp.settings.battle.force || 0; - if (jsDef(V.forceBattle)) { - V.SecExp.settings.battle.force = V.forceBattle; - } - - if (jsDef(V.readiness)) { - if(V.readiness === 10) { - V.sectionInFirebase = 1; - } - } - - V.SecExp.settings.unitDescriptions = V.SecExp.settings.unitDescriptions || 0; - - if (!jsDef(V.SecExp.settings.battle.allowSlavePrestige)) { - V.SecExp.settings.battle.allowSlavePrestige = 1; - } - if (jsDef(V.allowPrestigeFromBattles)) { - V.SecExp.settings.battle.allowSlavePrestige = V.allowPrestigeFromBattles; - } - - V.SecExp.settings.battle.major.enabled = V.SecExp.settings.battle.major.enabled || 0; - if (jsDef(V.majorBattlesEnabled)) { - V.SecExp.settings.battle.major.enabled = V.majorBattlesEnabled; - } - - if (!jsDef(V.SecExp.settings.battle.major.gameOver)) { - V.SecExp.settings.battle.major.gameOver = 1; - } - if (jsDef(V.majorBattleGameOver)) { - V.SecExp.settings.battle.major.gameOver = V.majorBattleGameOver; - } - V.SecExp.settings.battle.major.force = V.SecExp.settings.battle.major.force || 0; - if (jsDef(V.forceMajorBattle)) { - V.SecExp.settings.battle.major.force = V.forceMajorBattle; - } - V.SecExp.settings.battle.major.mult = V.SecExp.settings.battle.major.mult || 1; - - V.SecExp.settings.rebellion = V.SecExp.settings.rebellion || {}; - if (!jsDef(V.SecExp.settings.rebellion.enabled)) { - V.SecExp.settings.rebellion.enabled = 1; - } - if (jsDef(V.rebellionsEnabled)) { - V.SecExp.settings.rebellion.enabled = V.rebellionsEnabled; - } - - V.SecExp.settings.rebellion.force = V.SecExp.settings.rebellion.force || 0; - if (jsDef(V.forceRebellion)) { - V.SecExp.settings.rebellion.force = V.forceRebellion; - } - if (!jsDef(V.SecExp.settings.rebellion.gameOver)) { - V.SecExp.settings.rebellion.gameOver = 1; - } - if (jsDef(V.rebellionGameOver)) { - V.SecExp.settings.rebellion.gameOver = V.rebellionGameOver; - } - - V.SecExp.settings.rebellion.speed = V.SecExp.settings.rebellion.speed || 1; - if (jsDef(V.rebellionSpeed)) { - V.SecExp.settings.rebellion.speed = V.rebellionSpeed; - } - - if (V.SecExp.settings.battle.enabled + V.SecExp.settings.rebellion.enabled > 0) { - V.SecExp.settings.showStats = V.SecExp.settings.showStats || 0; - if (jsDef(V.showBattleStatistics)) { - V.SecExp.settings.showStats = V.showBattleStatistics; - } - } - - V.SecExp.buildings = V.SecExp.buildings || {}; - V.SecExp.buildings.propHub = V.SecExp.buildings.propHub || {}; - V.SecExp.buildings.propHub.active = V.SecExp.buildings.propHub.active || 0; - if (V.SecExp.buildings.pr === null) { - delete V.SecExp.buildings.pr; - } - if (jsDef(V.SecExp.buildings.pr)) { - V.SecExp.buildings.propHub = V.SecExp.buildings.pr; - delete V.SecExp.buildings.pr; - } - if (jsDef(V.propHub)) { - V.SecExp.buildings.propHub.active = V.propHub; - } - - if (V.SecExp.buildings.propHub.active > 0) { - V.SecExp.buildings.propHub.recuriterOffice = V.SecExp.buildings.propHub.recuriterOffice || 0; - V.SecExp.buildings.propHub.campaign = V.SecExp.buildings.propHub.campaign || 0; - if (jsDef(V.propCampaign)) { - V.SecExp.buildings.propHub.campaign = V.propCampaign; - } - - V.SecExp.buildings.propHub.miniTruth = V.SecExp.buildings.propHub.miniTruth || 0; - if (jsDef(V.miniTruth)) { - V.SecExp.buildings.propHub.miniTruth = V.miniTruth; - } - - V.SecExp.buildings.propHub.secretService = V.SecExp.buildings.propHub.secretService || 0; - if (jsDef(V.secretService)) { - V.SecExp.buildings.propHub.secretService = V.secretService; - } - if (jsDef(V.SecExp.buildings.propHub.SS)) { - V.SecExp.buildings.propHub.secretService = V.SecExp.buildings.propHub.SS; - delete V.SecExp.buildings.propHub.SS; - } - - if (V.SecExp.buildings.propHub.campaign >= 1) { - V.SecExp.buildings.propHub.focus = V.SecExp.buildings.propHub.focus || "social engineering"; - if (jsDef(V.propFocus) && V.propFocus !== "none") { - V.SecExp.buildings.propHub.focus = V.propFocus; - } - } - - if (jsDef(V.RecuriterOffice)) { - V.recuriterOffice = V.RecuriterOffice; - } - const vars = ['recuriterOffice', 'fakeNews', 'controlLeaks', 'marketInfiltration', 'blackOps']; - for(let i = 0; i < vars.length; i++) { - if (jsDef(V[vars[i]]) && V[vars[i]] > 0) { - V.SecExp.buildings.propHub[vars[i]] = V[vars[i]]; - delete V[vars[i]]; - } else { - V.SecExp.buildings.propHub[vars[i]] = V.SecExp.buildings.propHub[vars[i]] || 0; - } - } - } - - V.SecExp.buildings.barracks = V.SecExp.buildings.barracks || {}; - V.SecExp.buildings.barracks.active = V.SecExp.buildings.barracks.active || 0; - if (jsDef(V.secBarracks)) { - V.SecExp.buildings.barracks.active = V.secBarracks; - } - - if (V.SecExp.buildings.barracks.active > 0) { - V.SecExp.buildings.barracks.upgrades = V.SecExp.buildings.barracks.upgrades || {}; - V.SecExp.buildings.barracks.upgrades.size = V.SecExp.buildings.barracks.upgrades.size || 0; - V.SecExp.buildings.barracks.upgrades.luxury = V.SecExp.buildings.barracks.upgrades.luxury || 0; - V.SecExp.buildings.barracks.upgrades.training = V.SecExp.buildings.barracks.upgrades.training || 0; - V.SecExp.buildings.barracks.upgrades.loyaltyMod = V.SecExp.buildings.barracks.upgrades.loyaltyMod || 0; - if (jsDef(V.secBarracksUpgrades)) { - V.SecExp.buildings.barracks.upgrades = V.secBarracksUpgrades; - } - } - - V.SecExp.proclamation = V.SecExp.proclamation || {}; - V.SecExp.proclamation.cooldown = V.SecExp.proclamation.cooldown || 0; - if (jsDef(V.proclamationsCooldown)) { - V.SecExp.proclamation.cooldown = V.proclamationsCooldown; - } - V.SecExp.proclamation.currency = V.SecExp.proclamation.currency || ""; - if (jsDef(V.proclamationCurrency)) { - V.SecExp.proclamation.currency = V.proclamationCurrency; - } - V.SecExp.proclamation.type = V.SecExp.proclamation.type || "crime"; - if (jsDef(V.proclamationType)) { - if (V.proclamationType !== "none") { - V.SecExp.proclamation.type = V.proclamationType; - } - } - } - - if (jsDef(V.SecExp.core)) { - delete V.SecExp.core.crimeCap; - } + App.SecExp.generalBC(); } // Closes general check function. function secRestPoint() { diff --git a/src/Mods/SecExp/js/secExpBC.js b/src/Mods/SecExp/js/secExpBC.js new file mode 100644 index 0000000000000000000000000000000000000000..efbc3f89b41104e62e9f9cb74b4c3a268f8dcdf7 --- /dev/null +++ b/src/Mods/SecExp/js/secExpBC.js @@ -0,0 +1,243 @@ +// @ts-nocheck +App.SecExp.generalBC = function (){ + if (jsDef(V.secExp)) { + if (V.secExpEnabled !== 1) { + V.secExpEnabled = V.secExp; + } + delete V.secExp; + } + if (typeof V.secExpEnabled !== "number") { + V.secExpEnabled = 0; + } + V.SecExp = V.SecExp || SecExpBase(); + V.SecExp.settings = V.SecExp.settings || {}; + delete V.SecExp.settings.show; + + delete V.SecExp.army; + + if (V.secExpEnabled > 0) { + Object.assign(V.secBots, { + active: V.secBots.active || V.arcologyUpgrade.drones > 0 ? 1 : 0, + ID: -1, + isDeployed: V.secBots.isDeployed || 0, + troops: Math.max(V.secBots.troops, V.arcologyUpgrade.drones > 0 ? 30 : 0), + maxTroops: Math.max(V.secBots.maxTroops, V.arcologyUpgrade.drones > 0 ? 30 : 0) + }); + + V.SecExp.core = V.SecExp.core || {}; + + V.SecExp.core.trade = V.SecExp.core.trade || 0; + if (passage() === "Acquisition" || V.SecExp.core.trade === 0) { + let init = jsRandom(20, 30); + if (V.terrain === "urban") { + init += jsRandom(10, 10); + } else if (V.terrain === "ravine") { + init -= jsRandom(5, 5); + } + if (["BlackHat", "capitalist", "celebrity", "wealth"].includes(V.PC.career)) { + init += jsRandom(5, 5); + } else if (["escort", "gang", "servant"].includes(V.PC.career)) { + init -= jsRandom(5, 5); + } + V.SecExp.core.trade = init; + } + if (jsDef(V.trade)) { + V.SecExp.core.trade = V.trade; + } + + V.SecExp.core.authority = V.SecExp.core.authority || 0; + if (jsDef(V.authority)) { + V.SecExp.core.authority = V.authority; + } + + V.SecExp.security = V.SecExp.security || {}; + V.SecExp.security.cap = V.SecExp.security.cap || 100; + if (jsDef(V.security)) { + V.SecExp.security.cap = V.security; + } + V.SecExp.core.crimeLow = V.SecExp.core.crimeLow || 30; + if (jsDef(V.crime)) { + V.SecExp.core.crimeLow = V.crime; + } + + V.SecExp.settings.difficulty = V.SecExp.settings.difficulty || 1; + if (jsDef(V.difficulty)) { + V.SecExp.settings.difficulty = V.difficulty; + } + + V.SecExp.settings.battle = V.SecExp.settings.battle || {}; + if (!jsDef(V.SecExp.settings.battle.enabled)) { + V.SecExp.settings.battle.enabled = 1; + } + if (jsDef(V.battlesEnabled)) { + V.SecExp.settings.battle.enabled = V.battlesEnabled; + } + delete V.SecExp.battle; + + V.SecExp.settings.battle.major = V.SecExp.settings.battle.major || {}; + V.SecExp.settings.battle.frequency = V.SecExp.settings.battle.frequency || 1; + if (jsDef(V.battleFrequency)) { + V.SecExp.settings.battle.frequency = V.battleFrequency; + } + V.SecExp.settings.battle.force = V.SecExp.settings.battle.force || 0; + if (jsDef(V.forceBattle)) { + V.SecExp.settings.battle.force = V.forceBattle; + } + + if (jsDef(V.readiness)) { + if(V.readiness === 10) { + V.sectionInFirebase = 1; + } + } + + V.SecExp.settings.unitDescriptions = V.SecExp.settings.unitDescriptions || 0; + + if (!jsDef(V.SecExp.settings.battle.allowSlavePrestige)) { + V.SecExp.settings.battle.allowSlavePrestige = 1; + } + if (jsDef(V.allowPrestigeFromBattles)) { + V.SecExp.settings.battle.allowSlavePrestige = V.allowPrestigeFromBattles; + } + + V.SecExp.settings.battle.major.enabled = V.SecExp.settings.battle.major.enabled || 0; + if (jsDef(V.majorBattlesEnabled)) { + V.SecExp.settings.battle.major.enabled = V.majorBattlesEnabled; + } + + if (!jsDef(V.SecExp.settings.battle.major.gameOver)) { + V.SecExp.settings.battle.major.gameOver = 1; + } + if (jsDef(V.majorBattleGameOver)) { + V.SecExp.settings.battle.major.gameOver = V.majorBattleGameOver; + } + V.SecExp.settings.battle.major.force = V.SecExp.settings.battle.major.force || 0; + if (jsDef(V.forceMajorBattle)) { + V.SecExp.settings.battle.major.force = V.forceMajorBattle; + } + V.SecExp.settings.battle.major.mult = V.SecExp.settings.battle.major.mult || 1; + + V.SecExp.settings.rebellion = V.SecExp.settings.rebellion || {}; + if (!jsDef(V.SecExp.settings.rebellion.enabled)) { + V.SecExp.settings.rebellion.enabled = 1; + } + if (jsDef(V.rebellionsEnabled)) { + V.SecExp.settings.rebellion.enabled = V.rebellionsEnabled; + } + + V.SecExp.settings.rebellion.force = V.SecExp.settings.rebellion.force || 0; + if (jsDef(V.forceRebellion)) { + V.SecExp.settings.rebellion.force = V.forceRebellion; + } + if (!jsDef(V.SecExp.settings.rebellion.gameOver)) { + V.SecExp.settings.rebellion.gameOver = 1; + } + if (jsDef(V.rebellionGameOver)) { + V.SecExp.settings.rebellion.gameOver = V.rebellionGameOver; + } + + V.SecExp.settings.rebellion.speed = V.SecExp.settings.rebellion.speed || 1; + if (jsDef(V.rebellionSpeed)) { + V.SecExp.settings.rebellion.speed = V.rebellionSpeed; + } + + if (V.SecExp.settings.battle.enabled + V.SecExp.settings.rebellion.enabled > 0) { + V.SecExp.settings.showStats = V.SecExp.settings.showStats || 0; + if (jsDef(V.showBattleStatistics)) { + V.SecExp.settings.showStats = V.showBattleStatistics; + } + } + + V.SecExp.buildings = V.SecExp.buildings || {}; + V.SecExp.buildings.propHub = V.SecExp.buildings.propHub || {}; + V.SecExp.buildings.propHub.active = V.SecExp.buildings.propHub.active || 0; + if (V.SecExp.buildings.pr === null) { + delete V.SecExp.buildings.pr; + } + if (jsDef(V.SecExp.buildings.pr)) { + V.SecExp.buildings.propHub = V.SecExp.buildings.pr; + delete V.SecExp.buildings.pr; + } + if (jsDef(V.propHub)) { + V.SecExp.buildings.propHub.active = V.propHub; + } + + if (V.SecExp.buildings.propHub.active > 0) { + V.SecExp.buildings.propHub.recuriterOffice = V.SecExp.buildings.propHub.recuriterOffice || 0; + V.SecExp.buildings.propHub.campaign = V.SecExp.buildings.propHub.campaign || 0; + if (jsDef(V.propCampaign)) { + V.SecExp.buildings.propHub.campaign = V.propCampaign; + } + + V.SecExp.buildings.propHub.miniTruth = V.SecExp.buildings.propHub.miniTruth || 0; + if (jsDef(V.miniTruth)) { + V.SecExp.buildings.propHub.miniTruth = V.miniTruth; + } + + V.SecExp.buildings.propHub.secretService = V.SecExp.buildings.propHub.secretService || 0; + if (jsDef(V.secretService)) { + V.SecExp.buildings.propHub.secretService = V.secretService; + } + if (jsDef(V.SecExp.buildings.propHub.SS)) { + V.SecExp.buildings.propHub.secretService = V.SecExp.buildings.propHub.SS; + delete V.SecExp.buildings.propHub.SS; + } + + if (V.SecExp.buildings.propHub.campaign >= 1) { + V.SecExp.buildings.propHub.focus = V.SecExp.buildings.propHub.focus || "social engineering"; + if (jsDef(V.propFocus) && V.propFocus !== "none") { + V.SecExp.buildings.propHub.focus = V.propFocus; + } + } + + if (jsDef(V.RecuriterOffice)) { + V.recuriterOffice = V.RecuriterOffice; + } + const vars = ['recuriterOffice', 'fakeNews', 'controlLeaks', 'marketInfiltration', 'blackOps']; + for(let i = 0; i < vars.length; i++) { + if (jsDef(V[vars[i]]) && V[vars[i]] > 0) { + V.SecExp.buildings.propHub[vars[i]] = V[vars[i]]; + delete V[vars[i]]; + } else { + V.SecExp.buildings.propHub[vars[i]] = V.SecExp.buildings.propHub[vars[i]] || 0; + } + } + } + + V.SecExp.buildings.barracks = V.SecExp.buildings.barracks || {}; + V.SecExp.buildings.barracks.active = V.SecExp.buildings.barracks.active || 0; + if (jsDef(V.secBarracks)) { + V.SecExp.buildings.barracks.active = V.secBarracks; + } + + if (V.SecExp.buildings.barracks.active > 0) { + V.SecExp.buildings.barracks.upgrades = V.SecExp.buildings.barracks.upgrades || {}; + V.SecExp.buildings.barracks.upgrades.size = V.SecExp.buildings.barracks.upgrades.size || 0; + V.SecExp.buildings.barracks.upgrades.luxury = V.SecExp.buildings.barracks.upgrades.luxury || 0; + V.SecExp.buildings.barracks.upgrades.training = V.SecExp.buildings.barracks.upgrades.training || 0; + V.SecExp.buildings.barracks.upgrades.loyaltyMod = V.SecExp.buildings.barracks.upgrades.loyaltyMod || 0; + if (jsDef(V.secBarracksUpgrades)) { + V.SecExp.buildings.barracks.upgrades = V.secBarracksUpgrades; + } + } + + V.SecExp.proclamation = V.SecExp.proclamation || {}; + V.SecExp.proclamation.cooldown = V.SecExp.proclamation.cooldown || 0; + if (jsDef(V.proclamationsCooldown)) { + V.SecExp.proclamation.cooldown = V.proclamationsCooldown; + } + V.SecExp.proclamation.currency = V.SecExp.proclamation.currency || ""; + if (jsDef(V.proclamationCurrency)) { + V.SecExp.proclamation.currency = V.proclamationCurrency; + } + V.SecExp.proclamation.type = V.SecExp.proclamation.type || "crime"; + if (jsDef(V.proclamationType)) { + if (V.proclamationType !== "none") { + V.SecExp.proclamation.type = V.proclamationType; + } + } + } + + if (jsDef(V.SecExp.core)) { + delete V.SecExp.core.crimeCap; + } +}; diff --git a/src/Mods/SpecialForce/SpecialForce.js b/src/Mods/SpecialForce/SpecialForce.js index dc53b2c38a1a24b3924d8d15b79f41dc01696d13..88ca2598303e22be61244f454caadede97a07118 100644 --- a/src/Mods/SpecialForce/SpecialForce.js +++ b/src/Mods/SpecialForce/SpecialForce.js @@ -215,359 +215,6 @@ App.SF.Init = function() { // V.arcologies[0].SFRaid = 1; V.arcologies[0].SFRaidTarget = -1; }; -/* no-usedOnce */ -App.SF.BC = function() { - function InitClean() { - delete V.SFMODToggle; - delete V.securityForceActive; - delete V.securityForceCreate; - delete V.securityForceEventSeen; - } - - function MainClean() { - delete V.securityForceActive; - delete V.securityForceRecruit; - delete V.securityForceTrade; - delete V.securityForceBooty; - delete V.securityForceIncome; - delete V.securityForceMissionEfficiency; - delete V.securityForceProfitable; - delete V.TierTwoUnlock; - delete V.securityForceDepravity; - delete V.SFAO; - delete V.securityForceUpgradeTokenReset; - delete V.securityForceUpgradeToken; - delete V.securityForceGiftToken; - delete V.securityForceRulesOfEngagement; - delete V.securityForceFocus; - delete V.securityForceAccountability; - delete V.securityForceName; - delete V.SubsidyActive; - delete V.securityForceSubsidyActive; - } - - function ColonelClean() { - delete V.ColonelCore; - delete V.securityForceColonelToken; - delete V.securityForceColonelSexed; - delete V.ColonelRelationship; - delete V.securityForceSexedColonelToken; - } - - function TradeShowClean() { - delete V.OverallTradeShowAttendance; - delete V.CurrentTradeShowAttendance; - delete V.TradeShowIncome; - delete V.TotalTradeShowIncome; - delete V.TradeShowHelots; - delete V.TotalTradeShowHelots; - } - - function UnitsClean() { - delete V.securityForceInfantryPower; - delete V.securityForceArcologyUpgrades; - delete V.securityForceVehiclePower; - delete V.securityForceDronePower; - delete V.securityForceStimulantPower; - delete V.securityForceHeavyBattleTank; - delete V.securityForceAircraftPower; - delete V.securityForceSpacePlanePower; - delete V.securityForceAC130; - delete V.securityForceSatellitePower; - delete V.securityForceGiantRobot; - delete V.securityForceMissileSilo; - delete V.securityForceAircraftCarrier; - delete V.securityForceSubmarine; - delete V.securityForceHeavyAmphibiousTransport; - delete V.securityForcePersonnel; - delete V.securityForceFortressZeppelin; - delete V.securityForceHeavyTransport; - } - - if (typeof V.SF !== "object") { - if (V.securityForceEventSeen < 1) { - V.securityForceActive = -1; - } else { - V.securityForceActive = 2; - } - V.SF = {Toggle: V.SFMODToggle, Active: V.securityForceActive}; - InitClean(); - if (V.securityForceName === undefined) { - V.securityForceName = "the special force"; - } - if (V.SF.Active >= 1) { - Object.assign(V.SF, { - Depravity: V.securityForceDepravity, - Upgrade: V.securityForceUpgradeToken, - Gift: V.securityForceGiftToken, - UC: {Assign: V.SF.SpecOps, Lock: V.SF.SpecOpsLock}, - ROE: V.securityForceRulesOfEngagement, - Target: V.securityForceFocus, - Regs: V.securityForceAccountability, - Lower: V.securityForceName, - }); - MainClean(); - - if (V.ColonelCore === undefined) { - V.ColonelCore = ""; - } - if (V.ColonelDiscussion === undefined) { - V.ColonelDiscussion = 0; - } - if (V.ColonelSexed === undefined) { - V.ColonelSexed = 0; - } - V.SF.Colonel = { - Core: V.ColonelCore, - Talk: V.securityForceColonelToken, - Fun: V.securityForceColonelSexed, - Status: V.ColonelRelationship - }; - ColonelClean(); - - if (V.TradeShowIncome === undefined) { - V.TradeShowIncome = 0; - } - if (V.TotalTradeShowIncome === undefined) { - V.TotalTradeShowIncome = 0; - } - if (V.TradeShowHelots === undefined) { - V.TradeShowHelots = 0; - } - if (V.TotalTradeShowHelots === undefined) { - V.TotalTradeShowHelots = 0; - } - V.SF.MercCon = { - History: V.OverallTradeShowAttendance, - CanAttend: V.CurrentTradeShowAttendance, - Income: V.TradeShowIncome, - Revenue: V.TotalTradeShowIncome, - Menials: V.TradeShowHelots, - TotalMenials: V.TotalTradeShowHelots, - Mercs: 0, - TotalMercs: 0 - }; - TradeShowClean(); - if (V.SF.MercCon.History > 0) { - V.SF.MercCon.CanAttend = 1; - } - - if (V.securityForceHeavyBattleTank === undefined) { - V.securityForceHeavyBattleTank = 0; - } - if (V.securityForceSpacePlanePower === undefined) { - V.securityForceSpacePlanePower = 0; - } - if (V.securityForceAC130 === undefined) { - V.securityForceAC130 = 0; - } - if (V.securityForceSatellitePower === undefined) { - V.securityForceSatellitePower = 0; - } - if (V.securityForceGiantRobot === undefined) { - V.securityForceGiantRobot = 0; - } - if (V.securityForceMissileSilo === undefined) { - V.securityForceMissileSilo = 0; - } - if (V.securityForceAircraftCarrier === undefined) { - V.securityForceAircraftCarrier = 0; - } - if (V.securityForceSubmarine === undefined) { - V.securityForceSubmarine = 0; - } - if (V.securityForceHeavyAmphibiousTransport === undefined) { - V.securityForceHeavyAmphibiousTransport = 0; - } - - V.SF.ArmySize = V.securityForcePersonnel; - - V.SF.SatLaunched = 0; - - V.SF.Squad = { - Armoury: V.securityForceInfantryPower, - Firebase: V.securityForceArcologyUpgrades, - AV: V.securityForceVehiclePower, - TV: V.securityForceVehiclePower, - Drones: V.securityForceDronePower, - Drugs: V.securityForceStimulantPower, - PGT: V.securityForceHeavyBattleTank, - AA: V.securityForceAircraftPower, - TA: V.securityForceAircraftPower, - SpacePlane: V.securityForceSpacePlanePower, - GunS: V.securityForceAC130, - Satellite: V.securityForceSatellitePower, - GiantRobot: V.securityForceGiantRobot, - MissileSilo: V.securityForceMissileSilo, - AircraftCarrier: V.securityForceAircraftCarrier, - Sub: V.securityForceSubmarine, - HAT: V.securityForceHeavyAmphibiousTransport - }; - UnitsClean(); - } else { - App.SF.Init(); - } - } else if (typeof V.SF === "object") { - V.SF.FS = V.SF.FS || {}; - V.SF.FS.Tension = V.SF.FS.Tension || -1; - - if (V.SF.Toggle && V.SF.Active >= 1) { - V.SF.UC = V.SF.UC || {}; - V.SF.Depravity = V.SF.Depravity || 0; - V.SF.Upgrade = V.SF.Upgrade || 0; - V.SF.Gift = V.SF.Gift || 0; - V.SF.UC.Assign = V.SF.UC.Assign || 0; - V.SF.UC.Lock = V.SF.UC.Lock || 0; - V.SF.ROE = V.SF.ROE || "hold"; - V.SF.Target = V.SF.Target || "recruit"; - V.SF.Regs = V.SF.Regs || "strict"; - V.SF.Lower = V.SF.Lower || "the special force"; - - V.SF.ArmySize = V.SF.ArmySize || 40; - - V.SF.Squad = V.SF.Squad || {}; - for (let i = 0; i < App.SF.upgrades.list('all').length; i++) { - V.SF.Squad[App.SF.upgrades.list('all')[i]] = V.SF.Squad[App.SF.upgrades.list('all')[i]] || 0; - } - - V.SF.SatLaunched = V.SF.SatLaunched || 0; - - V.SF.Colonel = V.SF.Colonel || {}; - V.SF.Colonel.Core = V.SF.Colonel.Core || ""; - V.SF.Colonel.Talk = V.SF.Colonel.Talk || 0; - V.SF.Colonel.Fun = V.SF.Colonel.Fun || 0; - V.SF.Colonel.Status = V.SF.Colonel.Status || 0; - - V.SF.MercCon = V.SF.MercCon || {}; - V.SF.MercCon.History = V.SF.MercCon.History || 0; - V.SF.MercCon.CanAttend = V.SF.MercCon.CanAttend || 0; - if (V.SF.MercCon.History >= 1) { - V.SF.MercCon.CanAttend = -1; - } - V.SF.MercCon.Income = V.SF.MercCon.Income || 0; - V.SF.MercCon.Revenue = V.SF.MercCon.Revenue || 0; - V.SF.MercCon.Mercs = V.SF.MercCon.Mercs || 0; - V.SF.MercCon.Menials = V.SF.MercCon.Menials || 0; - V.SF.MercCon.TotalMenials = V.SF.MercCon.TotalMenials || 0; - V.SF.MercCon.TotalMercs = V.SF.MercCon.TotalMercs || 0; - - if (typeof V.SF.Squad.Satellite === "object") { - if (V.SF.Squad.Satellite.InOrbit > 0) { - V.SF.SatLaunched = V.SF.Squad.Satellite.InOrbit; delete V.SF.Squad.Satellite.InOrbit; - } - V.SF.Squad.Satellite = V.SF.Squad.Satellite.lv; - } - - delete V.SF.FS.upgrade; delete V.SF.UC.num; - - if (jsDef(V.choice)) { - V.SF.Gift = V.choice; - } - - if (V.Tour !== undefined) { - V.SF.tour = V.Tour || 0; - } - - if (V.SF.Squad.Troops) { - V.SF.ArmySize = V.SF.Squad.Troops; - delete V.SF.Squad.Troops; - } - - if (V.SF.MercCon !== undefined) { - if( V.SF.MercCon.View !== undefined) { - delete V.SF.MercCon.View; - } - if (V.SF.MercCon.Helots !== undefined) { - V.SF.MercCon.Menials = V.SF.MercCon.Helots; - delete V.SF.MercCon.Helots; - } - if (V.SF.MercCon.TotalHelots !== undefined) { - V.SF.MercCon.TotalMenials = V.SF.MercCon.TotalHelots; - delete V.SF.MercCon.TotalHelots; - } - } - - if (V.SF.SpecOps !== undefined && V.SF.SpecOpsLock !== undefined) { - V.SF.UC = {Assign: V.SF.SpecOps, Lock: V.SF.SpecOpsLock}; - } - - if (V.SFUC !== undefined) { - V.SF.UC.num = V.SFUC || 0; - } - - if (V.SpecOpsLock !== undefined) { - V.SF.SpecOpsLock = V.SpecOpsLock; - } - - if (V.SF.U !== undefined) { - V.SF.Upgrade = V.SF.U || 0; - } - - if (V.SF.WG !== undefined) { - V.SF.Gift = V.SF.WG || 0; - } - - if (V.SF.Depravity < 0) { - V.SF.Depravity = 0; - } - - if (V.SFUnit !== undefined) { - if (V.SFUnit.AT !== undefined) { - V.SFUnitTA = 0; - } - if (V.SFTradeShow !== undefined) { - V.SF.MercCon = V.SFTradeShow; - } - delete V.SFTradeShow; - if (V.SFColonel !== undefined) { - V.SF.Colonel = V.SFColonel; - } - - if (V.SF.Squad !== undefined && V.SF.Squad.Satellite !== undefined && V.SatLaunched !== undefined) { - V.SF.Squad.Sat = {lv: V.SF.Squad.Satellite, InOrbit: V.SatLaunched}; - V.SF.Squad.Satellite = V.SF.Squad.Sat; - delete V.SF.Squad.Sat; - delete V.SatLaunched; - } - } - } // closes: V.SF.Toggle && V.SF.Active >= 1 - } - - delete V.Tour; delete V.SFColonel; delete V.SFUnit; - delete V.SF.tour; delete V.SF.Caps; delete V.SF.Size; delete V.choice; - delete V.SF.Units; delete V.SpecOpsLock; delete V.SF.U; delete V.SF.WG; - delete V.SF.Subsidy; delete V.SF.SpecOps; delete V.SF.SpecOpsLock; delete V.SFUC; - - if (V.SF.BadOutcome !== undefined) { - delete V.SF.BadOutcome; - } - if (V.arcologies[0].SFRaid !== undefined) { - delete V.arcologies[0].SFRaid; - } - if (V.arcologies[0].SFRaidTarget !== undefined) { - delete V.arcologies[0].SFRaidTarget; - } - if (V.SF.Facility !== undefined) { - delete V.SF.Facility; - } - - if (V.SF.MWU !== undefined) { - delete V.SF.MWU; - } - if (V.SF.Bonus !== undefined) { - delete V.SF.Bonus; - } - - InitClean(); - MainClean(); - ColonelClean(); - TradeShowClean(); - UnitsClean(); - - if (V.week < 72 && V.SF.Active !== -1) { V.SF.Active = -1; } -}; -/* usedOnce */ - App.SF.fsIntegration = function(input = 'Menu', textDisplay = 100) { const Revivalisms = ['Arabian_Revivalism', 'Aztec_Revivalism', 'Chinese_Revivalism', 'Edo_Revivalism', 'Egyptian_Revivalism', 'Multiculturalism', 'Roman_Revivalism']; let FS_OPTIONS = ['Asset_Expansionism', 'Body_Purism', 'Chattel_Religionism', 'Degradationism', 'Eugenics', 'Gender_radicalism', 'Gender_traditionalism', 'Hedonistic_Decadence', 'Maturity_Preferentialism', 'Paternalism', 'Physical_Idealism', 'Repopulation', 'Slave_Pastoralism', 'Slimness_Enthusiasm', 'Transformation_Fetishism', 'Youth_Preferentialism']; diff --git a/src/Mods/SpecialForce/SpecialForceBC.js b/src/Mods/SpecialForce/SpecialForceBC.js new file mode 100644 index 0000000000000000000000000000000000000000..7b848c1b539e874ff337b2cf52eee7749d799c8d --- /dev/null +++ b/src/Mods/SpecialForce/SpecialForceBC.js @@ -0,0 +1,353 @@ +// @ts-nocheck +/* no-usedOnce */ +App.SF.BC = function() { + function InitClean() { + delete V.SFMODToggle; + delete V.securityForceActive; + delete V.securityForceCreate; + delete V.securityForceEventSeen; + } + + function MainClean() { + delete V.securityForceActive; + delete V.securityForceRecruit; + delete V.securityForceTrade; + delete V.securityForceBooty; + delete V.securityForceIncome; + delete V.securityForceMissionEfficiency; + delete V.securityForceProfitable; + delete V.TierTwoUnlock; + delete V.securityForceDepravity; + delete V.SFAO; + delete V.securityForceUpgradeTokenReset; + delete V.securityForceUpgradeToken; + delete V.securityForceGiftToken; + delete V.securityForceRulesOfEngagement; + delete V.securityForceFocus; + delete V.securityForceAccountability; + delete V.securityForceName; + delete V.SubsidyActive; + delete V.securityForceSubsidyActive; + } + + function ColonelClean() { + delete V.ColonelCore; + delete V.securityForceColonelToken; + delete V.securityForceColonelSexed; + delete V.ColonelRelationship; + delete V.securityForceSexedColonelToken; + } + + function TradeShowClean() { + delete V.OverallTradeShowAttendance; + delete V.CurrentTradeShowAttendance; + delete V.TradeShowIncome; + delete V.TotalTradeShowIncome; + delete V.TradeShowHelots; + delete V.TotalTradeShowHelots; + } + + function UnitsClean() { + delete V.securityForceInfantryPower; + delete V.securityForceArcologyUpgrades; + delete V.securityForceVehiclePower; + delete V.securityForceDronePower; + delete V.securityForceStimulantPower; + delete V.securityForceHeavyBattleTank; + delete V.securityForceAircraftPower; + delete V.securityForceSpacePlanePower; + delete V.securityForceAC130; + delete V.securityForceSatellitePower; + delete V.securityForceGiantRobot; + delete V.securityForceMissileSilo; + delete V.securityForceAircraftCarrier; + delete V.securityForceSubmarine; + delete V.securityForceHeavyAmphibiousTransport; + delete V.securityForcePersonnel; + delete V.securityForceFortressZeppelin; + delete V.securityForceHeavyTransport; + } + + if (typeof V.SF !== "object") { + if (V.securityForceEventSeen < 1) { + V.securityForceActive = -1; + } else { + V.securityForceActive = 2; + } + V.SF = {Toggle: V.SFMODToggle, Active: V.securityForceActive}; + InitClean(); + if (V.securityForceName === undefined) { + V.securityForceName = "the special force"; + } + if (V.SF.Active >= 1) { + Object.assign(V.SF, { + Depravity: V.securityForceDepravity, + Upgrade: V.securityForceUpgradeToken, + Gift: V.securityForceGiftToken, + UC: {Assign: V.SF.SpecOps, Lock: V.SF.SpecOpsLock}, + ROE: V.securityForceRulesOfEngagement, + Target: V.securityForceFocus, + Regs: V.securityForceAccountability, + Lower: V.securityForceName, + }); + MainClean(); + + if (V.ColonelCore === undefined) { + V.ColonelCore = ""; + } + if (V.ColonelDiscussion === undefined) { + V.ColonelDiscussion = 0; + } + if (V.ColonelSexed === undefined) { + V.ColonelSexed = 0; + } + V.SF.Colonel = { + Core: V.ColonelCore, + Talk: V.securityForceColonelToken, + Fun: V.securityForceColonelSexed, + Status: V.ColonelRelationship + }; + ColonelClean(); + + if (V.TradeShowIncome === undefined) { + V.TradeShowIncome = 0; + } + if (V.TotalTradeShowIncome === undefined) { + V.TotalTradeShowIncome = 0; + } + if (V.TradeShowHelots === undefined) { + V.TradeShowHelots = 0; + } + if (V.TotalTradeShowHelots === undefined) { + V.TotalTradeShowHelots = 0; + } + V.SF.MercCon = { + History: V.OverallTradeShowAttendance, + CanAttend: V.CurrentTradeShowAttendance, + Income: V.TradeShowIncome, + Revenue: V.TotalTradeShowIncome, + Menials: V.TradeShowHelots, + TotalMenials: V.TotalTradeShowHelots, + Mercs: 0, + TotalMercs: 0 + }; + TradeShowClean(); + if (V.SF.MercCon.History > 0) { + V.SF.MercCon.CanAttend = 1; + } + + if (V.securityForceHeavyBattleTank === undefined) { + V.securityForceHeavyBattleTank = 0; + } + if (V.securityForceSpacePlanePower === undefined) { + V.securityForceSpacePlanePower = 0; + } + if (V.securityForceAC130 === undefined) { + V.securityForceAC130 = 0; + } + if (V.securityForceSatellitePower === undefined) { + V.securityForceSatellitePower = 0; + } + if (V.securityForceGiantRobot === undefined) { + V.securityForceGiantRobot = 0; + } + if (V.securityForceMissileSilo === undefined) { + V.securityForceMissileSilo = 0; + } + if (V.securityForceAircraftCarrier === undefined) { + V.securityForceAircraftCarrier = 0; + } + if (V.securityForceSubmarine === undefined) { + V.securityForceSubmarine = 0; + } + if (V.securityForceHeavyAmphibiousTransport === undefined) { + V.securityForceHeavyAmphibiousTransport = 0; + } + + V.SF.ArmySize = V.securityForcePersonnel; + + V.SF.SatLaunched = 0; + + V.SF.Squad = { + Armoury: V.securityForceInfantryPower, + Firebase: V.securityForceArcologyUpgrades, + AV: V.securityForceVehiclePower, + TV: V.securityForceVehiclePower, + Drones: V.securityForceDronePower, + Drugs: V.securityForceStimulantPower, + PGT: V.securityForceHeavyBattleTank, + AA: V.securityForceAircraftPower, + TA: V.securityForceAircraftPower, + SpacePlane: V.securityForceSpacePlanePower, + GunS: V.securityForceAC130, + Satellite: V.securityForceSatellitePower, + GiantRobot: V.securityForceGiantRobot, + MissileSilo: V.securityForceMissileSilo, + AircraftCarrier: V.securityForceAircraftCarrier, + Sub: V.securityForceSubmarine, + HAT: V.securityForceHeavyAmphibiousTransport + }; + UnitsClean(); + } else { + App.SF.Init(); + } + } else if (typeof V.SF === "object") { + V.SF.FS = V.SF.FS || {}; + V.SF.FS.Tension = V.SF.FS.Tension || -1; + + if (V.SF.Toggle && V.SF.Active >= 1) { + V.SF.UC = V.SF.UC || {}; + V.SF.Depravity = V.SF.Depravity || 0; + V.SF.Upgrade = V.SF.Upgrade || 0; + V.SF.Gift = V.SF.Gift || 0; + V.SF.UC.Assign = V.SF.UC.Assign || 0; + V.SF.UC.Lock = V.SF.UC.Lock || 0; + V.SF.ROE = V.SF.ROE || "hold"; + V.SF.Target = V.SF.Target || "recruit"; + V.SF.Regs = V.SF.Regs || "strict"; + V.SF.Lower = V.SF.Lower || "the special force"; + + V.SF.ArmySize = V.SF.ArmySize || 40; + + V.SF.Squad = V.SF.Squad || {}; + for (let i = 0; i < App.SF.upgrades.list('all').length; i++) { + V.SF.Squad[App.SF.upgrades.list('all')[i]] = V.SF.Squad[App.SF.upgrades.list('all')[i]] || 0; + } + + V.SF.SatLaunched = V.SF.SatLaunched || 0; + + V.SF.Colonel = V.SF.Colonel || {}; + V.SF.Colonel.Core = V.SF.Colonel.Core || ""; + V.SF.Colonel.Talk = V.SF.Colonel.Talk || 0; + V.SF.Colonel.Fun = V.SF.Colonel.Fun || 0; + V.SF.Colonel.Status = V.SF.Colonel.Status || 0; + + V.SF.MercCon = V.SF.MercCon || {}; + V.SF.MercCon.History = V.SF.MercCon.History || 0; + V.SF.MercCon.CanAttend = V.SF.MercCon.CanAttend || 0; + if (V.SF.MercCon.History >= 1) { + V.SF.MercCon.CanAttend = -1; + } + V.SF.MercCon.Income = V.SF.MercCon.Income || 0; + V.SF.MercCon.Revenue = V.SF.MercCon.Revenue || 0; + V.SF.MercCon.Mercs = V.SF.MercCon.Mercs || 0; + V.SF.MercCon.Menials = V.SF.MercCon.Menials || 0; + V.SF.MercCon.TotalMenials = V.SF.MercCon.TotalMenials || 0; + V.SF.MercCon.TotalMercs = V.SF.MercCon.TotalMercs || 0; + + if (typeof V.SF.Squad.Satellite === "object") { + if (V.SF.Squad.Satellite.InOrbit > 0) { + V.SF.SatLaunched = V.SF.Squad.Satellite.InOrbit; delete V.SF.Squad.Satellite.InOrbit; + } + V.SF.Squad.Satellite = V.SF.Squad.Satellite.lv; + } + + delete V.SF.FS.upgrade; delete V.SF.UC.num; + + if (jsDef(V.choice)) { + V.SF.Gift = V.choice; + } + + if (V.Tour !== undefined) { + V.SF.tour = V.Tour || 0; + } + + if (V.SF.Squad.Troops) { + V.SF.ArmySize = V.SF.Squad.Troops; + delete V.SF.Squad.Troops; + } + + if (V.SF.MercCon !== undefined) { + if( V.SF.MercCon.View !== undefined) { + delete V.SF.MercCon.View; + } + if (V.SF.MercCon.Helots !== undefined) { + V.SF.MercCon.Menials = V.SF.MercCon.Helots; + delete V.SF.MercCon.Helots; + } + if (V.SF.MercCon.TotalHelots !== undefined) { + V.SF.MercCon.TotalMenials = V.SF.MercCon.TotalHelots; + delete V.SF.MercCon.TotalHelots; + } + } + + if (V.SF.SpecOps !== undefined && V.SF.SpecOpsLock !== undefined) { + V.SF.UC = {Assign: V.SF.SpecOps, Lock: V.SF.SpecOpsLock}; + } + + if (V.SFUC !== undefined) { + V.SF.UC.num = V.SFUC || 0; + } + + if (V.SpecOpsLock !== undefined) { + V.SF.SpecOpsLock = V.SpecOpsLock; + } + + if (V.SF.U !== undefined) { + V.SF.Upgrade = V.SF.U || 0; + } + + if (V.SF.WG !== undefined) { + V.SF.Gift = V.SF.WG || 0; + } + + if (V.SF.Depravity < 0) { + V.SF.Depravity = 0; + } + + if (V.SFUnit !== undefined) { + if (V.SFUnit.AT !== undefined) { + V.SFUnitTA = 0; + } + if (V.SFTradeShow !== undefined) { + V.SF.MercCon = V.SFTradeShow; + } + delete V.SFTradeShow; + if (V.SFColonel !== undefined) { + V.SF.Colonel = V.SFColonel; + } + + if (V.SF.Squad !== undefined && V.SF.Squad.Satellite !== undefined && V.SatLaunched !== undefined) { + V.SF.Squad.Sat = {lv: V.SF.Squad.Satellite, InOrbit: V.SatLaunched}; + V.SF.Squad.Satellite = V.SF.Squad.Sat; + delete V.SF.Squad.Sat; + delete V.SatLaunched; + } + } + } // closes: V.SF.Toggle && V.SF.Active >= 1 + } + + delete V.Tour; delete V.SFColonel; delete V.SFUnit; + delete V.SF.tour; delete V.SF.Caps; delete V.SF.Size; delete V.choice; + delete V.SF.Units; delete V.SpecOpsLock; delete V.SF.U; delete V.SF.WG; + delete V.SF.Subsidy; delete V.SF.SpecOps; delete V.SF.SpecOpsLock; delete V.SFUC; + + if (V.SF.BadOutcome !== undefined) { + delete V.SF.BadOutcome; + } + if (V.arcologies[0].SFRaid !== undefined) { + delete V.arcologies[0].SFRaid; + } + if (V.arcologies[0].SFRaidTarget !== undefined) { + delete V.arcologies[0].SFRaidTarget; + } + if (V.SF.Facility !== undefined) { + delete V.SF.Facility; + } + + if (V.SF.MWU !== undefined) { + delete V.SF.MWU; + } + if (V.SF.Bonus !== undefined) { + delete V.SF.Bonus; + } + + InitClean(); + MainClean(); + ColonelClean(); + TradeShowClean(); + UnitsClean(); + + if (V.week < 72 && V.SF.Active !== -1) { V.SF.Active = -1; } +}; +/* usedOnce */ diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index 64ed155782408677cfc8c1b7f75ffe62b9be8d78..a7d01cebf0829551b4155a9cac50a67977923fd1 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -914,7 +914,7 @@ App.Update.globalVariables = function(node) { } } - policies.BC(); + App.Update.policies(); // Player Arcology { diff --git a/src/data/backwardsCompatibility/policiesBC.js b/src/data/backwardsCompatibility/policiesBC.js new file mode 100644 index 0000000000000000000000000000000000000000..861bd621fd7562681ca91ba7aedaac0713191f97 --- /dev/null +++ b/src/data/backwardsCompatibility/policiesBC.js @@ -0,0 +1,85 @@ +// @ts-nocheck +App.Update.policies = function() { + function convertMain(variable, pro, anti) { + if (V[pro]) { + V.policies[variable] = 1; + } else if (V[anti]) { + V.policies[variable] = -1; + } + } + + function convertRetirement(variable, retireType, amountRequired) { + if (V[retireType] && V[amountRequired]) { + V.policies.retirement[variable] = V[amountRequired]; + } + } + + if (V.releaseID < 1069) { + V.policies.childProtectionAct = V.childProtectionAct; + V.policies.culturalOpenness = V.CulturalOpenness; + V.policies.sexualOpeness = V.sexualOpeness; + V.policies.proRefugees = V.ProRefugees; + V.policies.publicFuckdolls = V.publicFuckdolls; + + V.policies.proRecruitment = V.ProRecruitment; + V.policies.cash4Babies = V.Cash4Babies; + V.policies.regularParties = V.RegularParties; + V.policies.publicPA = V.PAPublic; + V.policies.coursingAssociation = V.CoursingAssociation; + + V.policies.raidingMercenaries = V.RaidingMercenaries; + V.policies.mixedMarriage = V.MixedMarriage; + V.policies.goodImageCampaign = V.goodImageCampaign; + V.policies.alwaysSubsidizeRep = V.alwaysSubsidizeRep; + V.policies.alwaysSubsidizeGrowth = V.alwaysSubsidizeGrowth; + + convertMain('immmigrationCash', 'ProImmigrationCash', 'AntiImmigrationCash'); + convertMain('immmigrationRep', 'ProImmigrationRep', 'AntiImmigrationRep'); + convertMain('enslavementCash', 'ProEnslavementCash', 'AntiEnslavementCash'); + convertMain('enslavementRep', 'ProEnslavementRep', 'AntiEnslavementRep'); + convertMain('cashForRep', 'CashForRep', 'RepForCash'); + + convertMain('oralAppeal', 'OralEncouragement', 'OralDiscouragement'); + convertMain('vaginalAppeal', 'VaginalEncouragement', 'VaginalDiscouragement'); + convertMain('analAppeal', 'AnalEncouragement', 'AnalDiscouragement'); + + convertRetirement('sex', 'SexMilestoneRetirement', 'retirementSex'); + convertRetirement('milk', 'MilkMilestoneRetirement', 'retirementMilk'); + convertRetirement('cum', 'CumMilestoneRetirement', 'retirementCum'); + convertRetirement('births', 'BirthsMilestoneRetirement', 'retirementBirths'); + convertRetirement('kills', 'KillsMilestoneRetirement', 'retirementKills'); + + if (V.BioreactorRetirement) { + V.policies.retirement.fate = "bioreactor"; + } else if (V.ArcadeRetirement) { + V.policies.retirement.fate = "arcade"; + } else if (V.CitizenRetirement) { + V.policies.retirement.fate = "citizen"; + } + + V.policies.retirement.menial2Citizen = V.citizenRetirementMenials; + V.policies.retirement.customAgePolicy = V.policies.retirement.customAgePolicySet || V.CustomRetirementAgePolicy; + V.policies.retirement.physicalAgePolicy = V.PhysicalRetirementAgePolicy; + + V.policies.SMR.basicSMR = V.BasicSMR; + V.policies.SMR.healthInspectionSMR = V.HealthInspectionSMR; + V.policies.SMR.educationSMR = V.EducationSMR; + V.policies.SMR.frigiditySMR = V.FrigiditySMR; + + V.policies.SMR.weightSMR = V.BasicWeightSMR; + V.policies.SMR.honestySMR = V.HonestySMR; + + V.policies.SMR.beauty.basicSMR = V.BasicBeautySMR; + V.policies.SMR.beauty.qualitySMR = V.QualityBeautySMR; + + V.policies.SMR.height.basicSMR = V.BasicHeightSMR; + V.policies.SMR.height.advancedSMR = V.AdvancedHeightSMR; + + V.policies.SMR.intelligence.basicSMR = V.BasicIntelligenceSMR; + V.policies.SMR.intelligence.qualitySMR = V.QualityIntelligenceSMR; + + V.policies.SMR.eugenics.faceSMR = V.FaceEugenicsSMR; + V.policies.SMR.eugenics.heightSMR = V.HeightEugenicsSMR; + V.policies.SMR.eugenics.intelligenceSMR = V.IntelligenceEugenicsSMR; + } +}; diff --git a/src/interaction/policies/policies.js b/src/interaction/policies/policies.js index a266ae3e29fca26bd3ea82b645142664a8aba8d5..b2e5ee597a90982a3ddcee19cb83096e3d8a470d 100644 --- a/src/interaction/policies/policies.js +++ b/src/interaction/policies/policies.js @@ -1,7 +1,6 @@ globalThis.policies = (function() { return { countEugenicsSMRs: countEugenicsSMRs, - BC: BC, cost: cost, }; @@ -19,91 +18,6 @@ globalThis.policies = (function() { return value; } - function BC() { - function convertMain(variable, pro, anti) { - if (V[pro]) { - V.policies[variable] = 1; - } else if (V[anti]) { - V.policies[variable] = -1; - } - } - - function convertRetirement(variable, retireType, amountRequired) { - if (V[retireType] && V[amountRequired]) { - V.policies.retirement[variable] = V[amountRequired]; - } - } - - if (V.releaseID < 1069) { - V.policies.childProtectionAct = V.childProtectionAct; - V.policies.culturalOpenness = V.CulturalOpenness; - V.policies.sexualOpeness = V.sexualOpeness; - V.policies.proRefugees = V.ProRefugees; - V.policies.publicFuckdolls = V.publicFuckdolls; - - V.policies.proRecruitment = V.ProRecruitment; - V.policies.cash4Babies = V.Cash4Babies; - V.policies.regularParties = V.RegularParties; - V.policies.publicPA = V.PAPublic; - V.policies.coursingAssociation = V.CoursingAssociation; - - V.policies.raidingMercenaries = V.RaidingMercenaries; - V.policies.mixedMarriage = V.MixedMarriage; - V.policies.goodImageCampaign = V.goodImageCampaign; - V.policies.alwaysSubsidizeRep = V.alwaysSubsidizeRep; - V.policies.alwaysSubsidizeGrowth = V.alwaysSubsidizeGrowth; - - convertMain('immmigrationCash', 'ProImmigrationCash', 'AntiImmigrationCash'); - convertMain('immmigrationRep', 'ProImmigrationRep', 'AntiImmigrationRep'); - convertMain('enslavementCash', 'ProEnslavementCash', 'AntiEnslavementCash'); - convertMain('enslavementRep', 'ProEnslavementRep', 'AntiEnslavementRep'); - convertMain('cashForRep', 'CashForRep', 'RepForCash'); - - convertMain('oralAppeal', 'OralEncouragement', 'OralDiscouragement'); - convertMain('vaginalAppeal', 'VaginalEncouragement', 'VaginalDiscouragement'); - convertMain('analAppeal', 'AnalEncouragement', 'AnalDiscouragement'); - - convertRetirement('sex', 'SexMilestoneRetirement', 'retirementSex'); - convertRetirement('milk', 'MilkMilestoneRetirement', 'retirementMilk'); - convertRetirement('cum', 'CumMilestoneRetirement', 'retirementCum'); - convertRetirement('births', 'BirthsMilestoneRetirement', 'retirementBirths'); - convertRetirement('kills', 'KillsMilestoneRetirement', 'retirementKills'); - - if (V.BioreactorRetirement) { - V.policies.retirement.fate = "bioreactor"; - } else if (V.ArcadeRetirement) { - V.policies.retirement.fate = "arcade"; - } else if (V.CitizenRetirement) { - V.policies.retirement.fate = "citizen"; - } - - V.policies.retirement.menial2Citizen = V.citizenRetirementMenials; - V.policies.retirement.customAgePolicy = V.policies.retirement.customAgePolicySet || V.CustomRetirementAgePolicy; - V.policies.retirement.physicalAgePolicy = V.PhysicalRetirementAgePolicy; - - V.policies.SMR.basicSMR = V.BasicSMR; - V.policies.SMR.healthInspectionSMR = V.HealthInspectionSMR; - V.policies.SMR.educationSMR = V.EducationSMR; - V.policies.SMR.frigiditySMR = V.FrigiditySMR; - - V.policies.SMR.weightSMR = V.BasicWeightSMR; - V.policies.SMR.honestySMR = V.HonestySMR; - - V.policies.SMR.beauty.basicSMR = V.BasicBeautySMR; - V.policies.SMR.beauty.qualitySMR = V.QualityBeautySMR; - - V.policies.SMR.height.basicSMR = V.BasicHeightSMR; - V.policies.SMR.height.advancedSMR = V.AdvancedHeightSMR; - - V.policies.SMR.intelligence.basicSMR = V.BasicIntelligenceSMR; - V.policies.SMR.intelligence.qualitySMR = V.QualityIntelligenceSMR; - - V.policies.SMR.eugenics.faceSMR = V.FaceEugenicsSMR; - V.policies.SMR.eugenics.heightSMR = V.HeightEugenicsSMR; - V.policies.SMR.eugenics.intelligenceSMR = V.IntelligenceEugenicsSMR; - } - } - function cost() { return 5000; } })(); /** diff --git a/src/personalAssistant/assistant.js b/src/personalAssistant/assistant.js index 19712cbac6e288288d68d496f898fbbc34304187..848c946ec417d7bf96e5e383c36b1b1dbc983d9c 100644 --- a/src/personalAssistant/assistant.js +++ b/src/personalAssistant/assistant.js @@ -6,45 +6,7 @@ globalThis.assistant = (function() { }; function BC() { - function convert(oldVar, variable, value = null) { - if (jsDef(V[oldVar])) { - if (typeof V[oldVar] !== "number" || (typeof V[oldVar] === "number" && V[oldVar] > 0)) { - V.assistant[variable] = value === null ? V[oldVar] : value; - } - } - delete V[oldVar]; - } - - const object = Object.assign({}, - { - personality: V.assistant, - name: V.assistantName, - power: V.assistantPower, - appearance: V.assistantAppearance, - }); - V.assistant = object; - delete V.assistantName; delete V.assistantPower; - delete V.assistantAppearance; delete V.assistantPronouns; - - convert('marketAssistantAnnounced', 'market', {}); - convert('assistantExtra1', 'Extra1'); - convert('assistantExtra2', 'Extra2'); - convert('assistantNameAnnounced', 'announcedName'); - convert('assistantBodyDesire', 'bodyDesire'); - convert('assistantOptions', 'options'); - convert('assistantFSOptions', 'fsOptions'); - convert('assistantFSAppearance', 'fsAppearance'); - - if (V.assistant.market) { - Object.assign(V.assistant.market, - { - relationship: V.marketAssistantRelationship, - limit: V.marketAssistantLimit, - aggressiveness: V.marketAssistantAggressiveness, - }); - } - delete V.marketAssistantRelationship; delete V.marketAssistantLimit; - delete V.marketAssistantAggressiveness; delete V.marketAssistantPronouns; + App.Update.assistantBC(); } function pronouns() { @@ -67,20 +29,18 @@ globalThis.assistant = (function() { function manage() { V.assistant = V.assistant || {}; - Object.assign(V.assistant, - { - personality: V.assistant.personality || 0, - name: V.assistant.name || "your personal assistant", - power: V.assistant.power || 0, - appearance: V.assistant.appearance || "normal", + Object.assign(V.assistant, { + personality: V.assistant.personality || 0, + name: V.assistant.name || "your personal assistant", + power: V.assistant.power || 0, + appearance: V.assistant.appearance || "normal", }); if (V.assistant.market) { - Object.assign(V.assistant.market, - { - relationship: V.assistant.market.relationship || "cute", - limit: V.assistant.market.limit || 0, - aggressiveness: V.assistant.market.aggressiveness || 0, + Object.assign(V.assistant.market, { + relationship: V.assistant.market.relationship || "cute", + limit: V.assistant.market.limit || 0, + aggressiveness: V.assistant.market.aggressiveness || 0, }); } if (V.week < 18) { diff --git a/src/personalAssistant/assistantBC.js b/src/personalAssistant/assistantBC.js new file mode 100644 index 0000000000000000000000000000000000000000..c7ef8a4f3d827f4f7e055f08f43f047ee0f126f1 --- /dev/null +++ b/src/personalAssistant/assistantBC.js @@ -0,0 +1,39 @@ +// @ts-nocheck +App.Update.assistantBC = function() { + function convert(oldVar, variable, value = null) { + if (jsDef(V[oldVar])) { + if (typeof V[oldVar] !== "number" || (typeof V[oldVar] === "number" && V[oldVar] > 0)) { + V.assistant[variable] = value === null ? V[oldVar] : value; + } + } + delete V[oldVar]; + } + + V.assistant = Object.assign({}, { + personality: V.assistant, + name: V.assistantName, + power: V.assistantPower, + appearance: V.assistantAppearance, + }); + delete V.assistantName; delete V.assistantPower; + delete V.assistantAppearance; delete V.assistantPronouns; + + convert('marketAssistantAnnounced', 'market', {}); + convert('assistantExtra1', 'Extra1'); + convert('assistantExtra2', 'Extra2'); + convert('assistantNameAnnounced', 'announcedName'); + convert('assistantBodyDesire', 'bodyDesire'); + convert('assistantOptions', 'options'); + convert('assistantFSOptions', 'fsOptions'); + convert('assistantFSAppearance', 'fsAppearance'); + + if (V.assistant.market) { + Object.assign(V.assistant.market, { + relationship: V.marketAssistantRelationship, + limit: V.marketAssistantLimit, + aggressiveness: V.marketAssistantAggressiveness, + }); + } + delete V.marketAssistantRelationship; delete V.marketAssistantLimit; + delete V.marketAssistantAggressiveness; delete V.marketAssistantPronouns; +};