From d6cc2baafde8eef40a8b68c5939e3bf14a7e8f12 Mon Sep 17 00:00:00 2001 From: Blank_Alt <> Date: Sat, 14 Nov 2020 11:23:17 +1300 Subject: [PATCH] minor-corrections --- devTools/types/FC/SecExp.d.ts | 2 +- src/Mods/SecExp/js/Unit.js | 24 ++++++++++---------- src/Mods/SecExp/js/secExp.js | 2 +- src/Mods/SecExp/js/tradeReport.js | 2 +- src/endWeek/economics/arcmgmt.js | 25 +++++++++------------ src/endWeek/economics/persBusiness.js | 13 ++++------- src/endWeek/saLiveWithHG.js | 2 +- src/events/RETS/reFucktoyPrefersRelative.js | 4 ++-- src/events/intro/initNationalities.js | 7 ------ submodules/sugarcube-2 | 1 - 10 files changed, 32 insertions(+), 50 deletions(-) delete mode 160000 submodules/sugarcube-2 diff --git a/devTools/types/FC/SecExp.d.ts b/devTools/types/FC/SecExp.d.ts index 444ae2beefd..f49f3d62296 100644 --- a/devTools/types/FC/SecExp.d.ts +++ b/devTools/types/FC/SecExp.d.ts @@ -23,7 +23,7 @@ declare namespace FC { commissars: number } - type PlayerHumanUnitType = "bots" | "citizens" | "mercenary" | "slave"; + type PlayerHumanUnitType = "bots" | "citizens" | "mercenary" | "slave" | "SF"; type EnemyUnitType = "raiders" | "free city" | "old world" | "freedom fighters"; } } diff --git a/src/Mods/SecExp/js/Unit.js b/src/Mods/SecExp/js/Unit.js index 2c9b03766eb..65b528b2a12 100644 --- a/src/Mods/SecExp/js/Unit.js +++ b/src/Mods/SecExp/js/Unit.js @@ -324,7 +324,7 @@ App.SecExp.generateUnitID = function() { }; /** Player unit factory - get a unit based on its type and index - * @param {string} type - "Bots", "Militia", "Slaves", "Mercs", or "SF" + * @param {PlayerHumanUnitType} type - "Bots", "Militia", "Slaves", "Mercs", or "SF" * @param {number} [index] - must be supplied if type is not "Bots" * @returns {App.SecExp.Unit} */ @@ -456,7 +456,7 @@ App.SecExp.getAppliedUpgrades = function(type) { attack++; def++; hp++; morale += 10; } if (V.arcologies[0].FSNeoImperialistLaw1) { - attack++; + attack++; } } } @@ -596,11 +596,11 @@ App.SecExp.BaseDroneUnit = class BaseDroneUnit { /** @implements {BaseUnit} */ App.SecExp.BaseRaiderUnit = class BaseRaiderUnit { static get attack() { - return 7; + return 7 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.raiders : 0); } static get defense() { - return 2; + return 2 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.raiders : 0); } static get morale() { @@ -615,11 +615,11 @@ App.SecExp.BaseRaiderUnit = class BaseRaiderUnit { /** @implements {BaseUnit} */ App.SecExp.BaseFreeCityUnit = class BaseFreeCityUnit { static get attack() { - return 6; + return 6 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.FC : 0); } static get defense() { - return 4; + return 4 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.FC : 0); } static get morale() { @@ -634,11 +634,11 @@ App.SecExp.BaseFreeCityUnit = class BaseFreeCityUnit { /** @implements {BaseUnit} */ App.SecExp.BaseOldWorldUnit = class BaseOldWorldUnit { static get attack() { - return 8; + return 8 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0); } static get defense() { - return 4; + return 4 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0); } static get morale() { @@ -653,11 +653,11 @@ App.SecExp.BaseOldWorldUnit = class BaseOldWorldUnit { /** @implements {BaseUnit} */ App.SecExp.BaseFreedomFighterUnit = class BaseFreedomFighterUnit { static get attack() { - return 9; + return 9 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0); } static get defense() { - return 2; + return 2 + (V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0); } static get morale() { @@ -883,12 +883,12 @@ App.SecExp.EnemyUnit = class SecExpEnemyUnit extends App.SecExp.Unit { get attack() { const equipmentFactor = this._data.equip * App.SecExp.equipMod; - return this._baseUnit.attack * (1 + equipmentFactor) + V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0; + return this._baseUnit.attack * (1 + equipmentFactor); } get defense() { const equipmentFactor = this._data.equip * App.SecExp.equipMod; - return this._baseUnit.defense * (1 + equipmentFactor) + V.SecExp.buildings.weapManu ? V.SecExp.buildings.weapManu.sellTo.oldWorld : 0; + return this._baseUnit.defense * (1 + equipmentFactor); } get hp() { diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js index 8bd6a0d9ae6..6e1edc00fab 100644 --- a/src/Mods/SecExp/js/secExp.js +++ b/src/Mods/SecExp/js/secExp.js @@ -4,7 +4,7 @@ * @param {string} [section=''] which sub section (if any) is this function being called from. * @returns {{text:string, bonus:number}} */ -App.SecExp.SF_effect = function(report, section = '') { +App.SecExp.assistanceSF = function(report, section = '') { const size = V.SF.Toggle && V.SF.Active >= 1 ? App.SF.upgrades.total() : 0; let r = ``, bonus = 0; if (size > 10) { diff --git a/src/Mods/SecExp/js/tradeReport.js b/src/Mods/SecExp/js/tradeReport.js index 582c987ab68..eb8e0dc19a1 100644 --- a/src/Mods/SecExp/js/tradeReport.js +++ b/src/Mods/SecExp/js/tradeReport.js @@ -117,7 +117,7 @@ App.SecExp.tradeReport = function() { } } - const SF = App.SecExp.SF_effect('trade'); + const SF = App.SecExp.assistanceSF('trade'); r.push(SF.text); tradeChange += SF.bonus; if (tradeChange > 0) { diff --git a/src/endWeek/economics/arcmgmt.js b/src/endWeek/economics/arcmgmt.js index a9b96bbd2e8..5c87e250a6b 100644 --- a/src/endWeek/economics/arcmgmt.js +++ b/src/endWeek/economics/arcmgmt.js @@ -1,5 +1,6 @@ App.EndWeek.arcManagement = function() { const el = new DocumentFragment(); + const secExpImigrationBonus = App.SecExp.propagandaEffects("immigration"); let r; let _enslaved; let _crime; @@ -625,17 +626,11 @@ App.EndWeek.arcManagement = function() { delete V.SecExp.smilingMan.globalCrisisWeeks; } } - if (V.garrison.reactorTime > 0) { - r.push(`The damage to the reactor caused by the last rebellion is extensive. Businesses and private citizens struggle to operate with the unreliable and limited energy production offered by the auxiliary generators.`); - r.push(`It will still take`); - if (V.garrison.reactorTime > 1) { - r.push(`${V.garrison.reactorTime} weeks`); - } else { - r.push(`a week`); - } - r.push(`to finish repair works.`); + let reactorDamaged = V.garrison.reactorTime + if (reactorDamaged > 0) { + r.push(`The damage to the reactor caused by the last rebellion is extensive. Businesses and private citizens struggle to operate with the unreliable and limited energy production offered by the auxiliary generators. It will still take ${numberWithPluralOne(reactorDamaged, 'week')} to finish repair works.`); _AWeekGrowth -= random(1, 2); - V.garrison.reactorTime--; + reactorDamaged--; IncreasePCSkills('engineering', 0.1); } @@ -1640,7 +1635,7 @@ App.EndWeek.arcManagement = function() { } r = []; if (V.lowerClass < _LCD) { - let _LCImmigration = Math.trunc((_LCD - V.lowerClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; + let _LCImmigration = Math.trunc((_LCD - V.lowerClass) * (0.3 * _terrain)) + 1 + secExpImigrationBonus .effect; if (V.arcologies[0].FSIntellectualDependencyLaw === 1) { /* Enslaving the dumb lower class immigrants*/ const _intellectualDependencyEnslaved = Math.trunc(_LCImmigration * 0.25); _LCImmigration -= _intellectualDependencyEnslaved; @@ -1705,7 +1700,7 @@ App.EndWeek.arcManagement = function() { appendDiv(`Your middle class is <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.middleClass < _MCD) { - let _MCImmigration = Math.trunc((_MCD - V.middleClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; + let _MCImmigration = Math.trunc((_MCD - V.middleClass) * (0.3 * _terrain)) + 1 + secExpImigrationBonus .effect; V.middleClass += _MCImmigration; if (_MCImmigration > 1) { @@ -1744,7 +1739,7 @@ App.EndWeek.arcManagement = function() { appendDiv(`Your upper class is <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.upperClass < _UCD) { - let _UCImmigration = Math.trunc((_UCD - V.upperClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; + let _UCImmigration = Math.trunc((_UCD - V.upperClass) * (0.3 * _terrain)) + 1 + secExpImigrationBonus .effect; V.upperClass += _UCImmigration; if (_UCImmigration > 1) { @@ -1789,7 +1784,7 @@ App.EndWeek.arcManagement = function() { appendDiv(`Your millionaires are <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.topClass < _TCD) { - let _TCImmigration = Math.trunc((_TCD - V.topClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; + let _TCImmigration = Math.trunc((_TCD - V.topClass) * (0.3 * _terrain)) + 1 + secExpImigrationBonus .effect; V.topClass += _TCImmigration; if (_TCImmigration > 1) { @@ -1808,7 +1803,7 @@ App.EndWeek.arcManagement = function() { } } } - appendDiv(App.SecExp.propagandaEffects("immigration").text); + appendDiv(secExpImigrationBonus .text); } function slaveRetirement() { diff --git a/src/endWeek/economics/persBusiness.js b/src/endWeek/economics/persBusiness.js index e5c9d3876af..cd4ae3d5bcd 100644 --- a/src/endWeek/economics/persBusiness.js +++ b/src/endWeek/economics/persBusiness.js @@ -878,16 +878,11 @@ App.EndWeek.personalBusiness = function() { cashX(blackMarket, "personalBusiness"); } - if (V.arcRepairTime > 0) { - r.push(`The recent rebellion left the arcology wounded and it falls to its owner to fix it. It will still take`); - if (V.arcRepairTime > 1) { - r.push(`${V.arcRepairTime} weeks`); - } else { - r.push(`a week`); - } - r.push(`to finish repair works.`); + let arcDamaged = V.arcRepairTime; + if (arcDamaged > 0) { + r.push(`The recent rebellion left the arcology wounded and it falls to its owner to fix it. It will still take ${numberWithPluralOne(arcDamaged, 'week')} to finish repair works.`); cashX(-5000, "personalBusiness"); - V.arcRepairTime--; + arcDamaged--; IncreasePCSkills('engineering', 0.1); } App.Events.addParagraph(el, r); diff --git a/src/endWeek/saLiveWithHG.js b/src/endWeek/saLiveWithHG.js index 2e6b5d27777..ba1c8b01a2d 100644 --- a/src/endWeek/saLiveWithHG.js +++ b/src/endWeek/saLiveWithHG.js @@ -411,7 +411,7 @@ App.SlaveAssignment.liveWithHG = (function() { if (HG.fetishKnown === 1) { r.push(`Since their relationship is very abusive, only ${HG.slaveName} <span class="devotion inc">enjoys</span> living together with ${slave.slaveName}.`); } else { - r.push(`It turns out their relationship is <span class="fetish gain">rather abusive</span>, so only ${HG.slaveName} gets any <span class="devotion inc">enjoyment</span> out of living together with ${slave.slaveName}.`); + r.push(`It turns out their relationship is <span class="fetish gain">rather abusive,</span> so only ${HG.slaveName} gets any <span class="devotion inc">enjoyment</span> out of living together with ${slave.slaveName}.`); } HG.devotion += 3; slave.devotion -= 5; diff --git a/src/events/RETS/reFucktoyPrefersRelative.js b/src/events/RETS/reFucktoyPrefersRelative.js index b6eec0a389e..f88e8ac2f7d 100644 --- a/src/events/RETS/reFucktoyPrefersRelative.js +++ b/src/events/RETS/reFucktoyPrefersRelative.js @@ -267,7 +267,7 @@ App.Events.RETSFucktoyPrefersRelative = class RETSFucktoyPrefersRelative extends recipient.vagina++; } } - t.push(`It takes a few moments to find a rythm, but ${fucktoy.slaveName} is excited that ${he} gets to do this with ${his} ${getWrittenTitle(fucktoy)} and ${his} ${relativeTerm(fucktoy, relative)}. It's easy to enjoy the change of pace, especially with ${recipient.slaveName} writhing on your ${V.PC.dick > 0 ? `dick` : `strapon`}.`); + t.push(`It takes a few moments to find a rhythm, but ${fucktoy.slaveName} is excited that ${he} gets to do this with ${his} ${getWrittenTitle(fucktoy)} and ${his} ${relativeTerm(fucktoy, relative)}. It's easy to enjoy the change of pace, especially with ${recipient.slaveName} writhing on your ${V.PC.dick > 0 ? `dick` : `strapon`}.`); App.Events.addParagraph(frag, t); } else if (doubleCowgirl) { const onDick = canDoVaginal(fucktoy) ? fucktoy : canDoVaginal(relative) ? relative : canDoAnal(fucktoy) ? fucktoy : relative; // whee @@ -291,7 +291,7 @@ App.Events.RETSFucktoyPrefersRelative = class RETSFucktoyPrefersRelative extends } else { t.push(`give ${fucktoy.slaveName} a rimjob`); // I guess? } - t.push(`while you get a taste of ${him2}. It takes a few moments to find a rythm, but ${fucktoy.slaveName} is excited that ${he} gets to do this with ${his} ${getWrittenTitle(fucktoy)} and ${his} ${relativeTerm(fucktoy, relative)}, and it's not long before all of you have reached orgasm.`); + t.push(`while you get a taste of ${him2}. It takes a few moments to find a rhythm, but ${fucktoy.slaveName} is excited that ${he} gets to do this with ${his} ${getWrittenTitle(fucktoy)} and ${his} ${relativeTerm(fucktoy, relative)}, and it's not long before all of you have reached orgasm.`); seX(fucktoy, "oral", relative, "oral", 1); App.Events.addParagraph(frag, t); } diff --git a/src/events/intro/initNationalities.js b/src/events/intro/initNationalities.js index e870dbb31e6..e484c6a4aa1 100644 --- a/src/events/intro/initNationalities.js +++ b/src/events/intro/initNationalities.js @@ -16,13 +16,6 @@ App.Intro.initNationalities = function() { assistantTime: 0, waterwayTime: 0 }; - if (V.wasToggledBefore === 0) { - if (V.mercenaries === 1) { - V.mercFreeManpower = jsRandom(5, 20); - } else if (V.mercenaries > 1) { - V.mercFreeManpower = jsRandom(10, 30); - } - } } function applyPCQualities() { diff --git a/submodules/sugarcube-2 b/submodules/sugarcube-2 deleted file mode 160000 index c9351665e98..00000000000 --- a/submodules/sugarcube-2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9351665e98ed6f74c6afa0bb5e181f5bd58ef0f -- GitLab