diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 8345f314899cd5ff53543a1d8e0fb7e2c4231498..de8ec63a98775103924d5c6af53bb6d93728ef18 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -41,34 +41,68 @@ window.SFInit = function() { }; window.SFBC = function() { - function jsDel(input) { - while (input.length > 0) { - delete input[0]; input.splice(input[0], 1); - } - } - const V = State.variables; function InitClean() { - jsDel([V.SFMODToggle, V.securityForceActive, V.securityForceCreate, V.securityForceEventSeen]); + delete V.SFMODToggle; + delete V.securityForceActive; + delete V.securityForceCreate; + delete V.securityForceEventSeen; } function MainClean() { - jsDel([V.securityForceActive, V.securityForceRecruit, V.securityForceTrade, V.securityForceBooty, V.securityForceIncome]); - jsDel([V.securityForceMissionEfficiency, V.securityForceProfitable, V.TierTwoUnlock, V.securityForceDepravity, V.SFAO]); - jsDel([V.securityForceUpgradeTokenReset, V.securityForceUpgradeToken, V.securityForceGiftToken, V.securityForceRulesOfEngagement]); - jsDel([V.securityForceFocus, V.securityForceAccountability, V.securityForceName, V.SubsidyActive]); + 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() { - jsDel([V.SubsidyActive, V.ColonelCore, V.securityForceColonelToken, V.securityForceColonelSexed, V.ColonelRelationship]); + delete V.ColonelCore; + delete V.securityForceColonelToken; + delete V.securityForceColonelSexed; + delete V.ColonelRelationship; + delete V.securityForceSexedColonelToken; } function TradeShowClean() { - jsDel([V.OverallTradeShowAttendance, V.CurrentTradeShowAttendance, V.TradeShowIncome, V.TotalTradeShowIncome]); - jsDel([V.TradeShowHelots, V.TotalTradeShowHelots]); + delete V.OverallTradeShowAttendance; + delete V.CurrentTradeShowAttendance; + delete V.TradeShowIncome; + delete V.TotalTradeShowIncome; + delete V.TradeShowHelots; + delete V.TotalTradeShowHelots; } function UnitsClean() { - jsDel([V.securityForceInfantryPower, V.securityForceArcologyUpgrades, V.securityForceVehiclePower, V.securityForceDronePower]); - jsDel([V.securityForceStimulantPower, V.securityForceHeavyBattleTank, V.securityForceAircraftPower, V.securityForceSpacePlanePower]); - jsDel([V.securityForceAC130, V.securityForceSatellitePower, V.securityForceGiantRobot, V.securityForceMissileSilo, V.securityForceAircraftCarrier]); - jsDel([V.securityForceSubmarine, V.securityForceHeavyAmphibiousTransport, V.securityForcePersonnel]); + 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 (V.SF === undefined) { @@ -163,7 +197,7 @@ window.SFBC = function() { if (V.SF.UC === 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]); + delete V.SF.SpecOps; delete V.SF.SpecOpsLock; } else if (V.SF.UC === {}) { V.SF.UC = {Assign:0, Lock:0}; } @@ -188,16 +222,13 @@ window.SFBC = function() { if (V.SF.Size === undefined) V.SF.Size = V.SF.Units; delete V.SF.Units; if (V.SFUnit !== undefined) { if (V.SFUnit.AT !== undefined) V.SFUnitTA = 0; - V.SF.Squad.Satellite = V.SF.Squad.Sat; - jsDel([V.SF.Squad.Sat, V.SatLaunched, V.SFUnit.AT]); - V.SF.Squad.Satellite = V.SF.Squad.Sat; delete V.SF.Squad.Sat; if (V.SFTradeShow !== undefined) V.SF.MercCon = V.SFTradeShow; delete V.SFTradeShow; if (V.SFColonel !== undefined) V.SF.Colonel = V.SFColonel; delete V.SFColonel; if (V.SF.BadOutcome === undefined) V.SF.BadOutcome = ""; if (V.SF.Squad.Satellite !== undefined && V.SatLaunched === undefined) { V.SF.Squad.Sat = {lv:0, InOrbit:0}; V.SF.Squad.Satellite = V.SF.Squad.Sat; - jsDel([V.SF.Squad.Sat, V.SatLaunched, V.SFUnit]); + delete V.SF.Squad.Sat; delete V.SatLaunched; delete V.SFUnit; } } if (V.SF.Squad !== undefined && V.SF.Squad.Satellite.lv === undefined) { @@ -205,8 +236,9 @@ window.SFBC = function() { V.SF.Squad.Satellite = V.SF.Squad.Sat; delete V.SF.Squad.Sat; } } - if (V.securityForceName !== undefined) InitClean(); MainClean(); ColonelClean(); TradeShowClean(); UnitsClean(); + InitClean(); MainClean(); ColonelClean(); TradeShowClean(); UnitsClean(); if (V.SF.Facility === undefined) Facility(); + if (V.SF.Squad.Satellite === undefined) V.SF.Squad.Satellite = {lv:0, InOrbit:0}; }; window.SFReport = function() {