diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js index 3a1ae8920e35cb0b9163a1982b03f31c78eb4577..f9d117c916b3cdafe92ea0ab50a7ec52e06fad6e 100644 --- a/src/Mods/SecExp/js/secExp.js +++ b/src/Mods/SecExp/js/secExp.js @@ -1,38 +1,42 @@ /** * Returns the effect of a campaign launched from the PR hub. */ -App.SecExp.propagandaEffects = function(focus, targetVariable) { +App.SecExp.propagandaEffects = function(focus) { + let t = ``, increase = 0; if (V.SecExp.buildings.propHub && V.SecExp.buildings.propHub.upgrades.campaign >= 1 && V.SecExp.buildings.propHub.focus === focus) { let campaign, modifier, adjut; const forcedViewing = V.SecExp.edicts.propCampaignBoost === 1; const noRecuriter = V.SecExp.buildings.propHub.recruiterOffice === 0 || V.RecruiterID === 0; + const recuriterActive = V.SecExp.buildings.propHub.recruiterOffice && V.RecruiterID > 0; switch(focus) { case "social engineering": campaign = 'societal engineering'; modifier = forcedViewing ? V.SecExp.buildings.propHub.upgrades.campaign : 1; - adjut = 32; if (noRecuriter) { - targetVariable += (forcedViewing ? 2 : 1) * modifier; + increase += (forcedViewing ? 2 : 1) * modifier; + } else if (recuriterActive) { + increase += modifier + Math.floor((S.Recruiter.intelligence+S.Recruiter.intelligenceImplant)/32); } break; case "recruitment": campaign = 'militia recruitment'; modifier = forcedViewing ? 1.2 : 1.15; - adjut = 650; if (noRecuriter) { - targetVariable *= (forcedViewing ? 1.1 : 1.05) * modifier; + increase += (forcedViewing ? 1.1 : 1.05) * modifier; + } else if (recuriterActive) { + increase += modifier + Math.floor((S.Recruiter.intelligence+S.Recruiter.intelligenceImplant)/650); } break; } - let t = `<span class='green'>Your propaganda campaign helps further your ${campaign} efforts.`; + t += `<span class='green'>Your propaganda campaign helps further your ${campaign} efforts.`; if (V.SecExp.buildings.propHub.recruiterOffice && V.RecruiterID > 0) { const {his} = getPronouns(S.Recruiter); t += ` <span class='slave-name'>${SlaveFullName(S.Recruiter)}</span> is able to further boost your ${campaign} campaign from ${his} PR hub office.`; - targetVariable += modifier + Math.floor((S.Recruiter.intelligence+S.Recruiter.intelligenceImplant)/adjut); } - return t + `</span>`; + t += `</span>`; } + return {text: t, effect: Math.round(increase)}; } /** diff --git a/src/Mods/SecExp/securityReport.tw b/src/Mods/SecExp/securityReport.tw index 58d2d4fdb046916ff5124bedc2010c0eb8e1e748..b0d2b1bf76c510a261cd35b55888aaea2c492ad0 100644 --- a/src/Mods/SecExp/securityReport.tw +++ b/src/Mods/SecExp/securityReport.tw @@ -342,7 +342,9 @@ Due to the deterioration of the old world countries, organized crime focuses mor Having a powerful special force attracts a lot of citizens, hopeful that they may be able to fight along side it. <<set _recruitsMultiplier *= 1 + (random(1, (Math.round(_size / 10))) / 20)>> /* not sure how high _size goes, so I hope this makes sense */ <</if>> - <<= App.SecExp.propagandaEffects("recruitment", _recruitsMultiplier)>> + <<set _propagandaEffects = App.SecExp.propagandaEffects("recruitment")>> + _propagandaEffects.text + <<set _recruitsMultiplier *= _propagandaEffects.effect>> <<if $SecExp.edicts.defense.militia === 2>> Your militia accepts only volunteering citizens, ready to defend their arcology. <<set _recruitLimit = App.SecExp.militiaCap(), _adjst = 0.0025>> diff --git a/src/uncategorized/fsDevelopments.tw b/src/uncategorized/fsDevelopments.tw index 4fd710fec16e6948a3a2f813db8839570a5a05d9..5ad4adc2711d80853f8677c3c580c265df6bae75 100644 --- a/src/uncategorized/fsDevelopments.tw +++ b/src/uncategorized/fsDevelopments.tw @@ -74,7 +74,9 @@ <</if>> <<if $secExpEnabled > 0>> - <<= App.SecExp.propagandaEffects("social engineering", _broadProgress)>> + <<set _propagandaEffects = App.SecExp.propagandaEffects("social engineering")>> + _propagandaEffects.text + <<set _broadProgress += _propagandaEffects.effect>> <</if>> <<if $terrain == "urban">>