From e05921f497d858455fc43190df590027f2c739a9 Mon Sep 17 00:00:00 2001 From: Blank <blank@national.shitposting.agency> Date: Sun, 18 Aug 2019 02:48:25 -0700 Subject: [PATCH] Sec exp fixes and tweaks --- devTools/DL-Loop.sh | 19 +++--- src/SecExp/attackReport.tw | 2 +- src/SecExp/js/secExp.js | 96 +++++++++++++++++++++--------- src/SecExp/propagandaHub.tw | 2 +- src/SecExp/securityHQ.tw | 2 +- src/SecExp/unitsRebellionReport.tw | 2 +- src/interaction/main/mainLinks.js | 4 +- src/js/storyJS.js | 4 +- src/uncategorized/persBusiness.tw | 5 +- 9 files changed, 88 insertions(+), 48 deletions(-) diff --git a/devTools/DL-Loop.sh b/devTools/DL-Loop.sh index 9f8e8e36eee..62de8ace871 100755 --- a/devTools/DL-Loop.sh +++ b/devTools/DL-Loop.sh @@ -1,7 +1,11 @@ #!/bin/bash -echo "Use temp?" && read varname1 -echo "Use upstream or origin? 1:0" && read varname2 -echo "Use master or current branch? 1:0" && read varname3 +echo "Use temp [0], dump file to current directory [1] or overwrite file in place [2]" && read varname1 +echo "Use upstream [1] or origin [0]" && read varname2 +if [[ $varname2 == 0 ]];then + echo "Use master [1] or current branch [0]." && read varname3 +else + varname3=1; +fi echo "Dry run? 1:0" && read varname4 if [[ $varname2 == 1 ]];then @@ -20,11 +24,12 @@ if [[ $varname4 == 1 ]];then else for ((i=0; i<=$#; i++)) do - if [[ $varname1 == y ]]; then + if [[ $varname1 == 0 ]]; then wget -q -P /tmp/ https://gitgud.io/$varname2/fc-pregmod/raw/$varname3/${!i} - else - #curl $varname3/raw/pregmod-master/${!i} + elif [[ $varname1 == 1 ]]; then wget -q https://gitgud.io/$varname2/fc-pregmod/raw/$varname3/${!i} + else + curl -s https://gitgud.io/$varname2/fc-pregmod/raw/$varname3/${!i} > ${!i} fi done -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw index 5b2bfa775ca..bf7ebae515d 100644 --- a/src/SecExp/attackReport.tw +++ b/src/SecExp/attackReport.tw @@ -907,7 +907,7 @@ <<if $gainedWarfare == 1>> Battlefield experience increased your understanding of warfare, making you a better commander. <</if>> - <<if def $SecExp.pcWounded>> + <<if $SecExp.pcWounded > 0>> During the fighting @@.red;you were wounded.@@ Your medics assure you it's nothing life threatening, but you'll be weakened for a few weeks. <</if>> <<elseif $leadingTroops == "assistant">> diff --git a/src/SecExp/js/secExp.js b/src/SecExp/js/secExp.js index b211b542ecc..093459e097c 100644 --- a/src/SecExp/js/secExp.js +++ b/src/SecExp/js/secExp.js @@ -135,41 +135,81 @@ App.SecExp.conflict = (function() { function deployedUnits(input = '') { const V = State.variables; let bots = 0, militiaC = 0, slavesC = 0, mercsC = 0, init = 0; - if(V.secBots.isDeployed > 0) { - bots++; - } - if(passage() !== "attackOptions") { - if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) { // battle - init++; + if(V.slaveRebellion !== 1 && V.citizenRebellion !== 1) { + if(V.secBots.isDeployed > 0) { + bots++; } - } - if(V.slaveRebellion+V.citizenRebellion > 0) { - if (V.SF.Toggle && V.SF.Active >= 1) { // rebellion - init++; + if(passage() !== "attackOptions") { + if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) { // battle + init++; + } } - if(V.irregulars > 0) { - militiaC++; + if(V.slaveRebellion+V.citizenRebellion > 0) { + if (V.SF.Toggle && V.SF.Active >= 1) { // rebellion + init++; + } + if(V.irregulars > 0) { + militiaC++; + } } - } - const Militia = V.militiaUnits.length; - for(let i = 0; i < Militia; i++) { - if(V.militiaUnits[i].isDeployed > 0) { - militiaC++; + const Militia = V.militiaUnits.length; + for(let i = 0; i < Militia; i++) { + if(V.militiaUnits[i].isDeployed > 0) { + militiaC++; + } } - } - const Slaves = V.slaveUnits.length; - for(let i = 0; i < Slaves; i++) { - if(V.slaveUnits[i].isDeployed > 0) { - slavesC++; + const Slaves = V.slaveUnits.length; + for(let i = 0; i < Slaves; i++) { + if(V.slaveUnits[i].isDeployed > 0) { + slavesC++; + } } - } - const Mercs = V.mercUnits.length; - for(let i = 0; i < Mercs; i++) { - if(V.mercUnits[i].isDeployed > 0) { - mercsC++; + const Mercs = V.mercUnits.length; + for(let i = 0; i < Mercs; i++) { + if(V.mercUnits[i].isDeployed > 0) { + mercsC++; + } + } + } else { + if(V.secBots.active > 0) { + bots++; + } + if(passage() !== "attackOptions") { + if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) { // battle + init++; + } + } + if(V.slaveRebellion+V.citizenRebellion > 0) { + if (V.SF.Toggle && V.SF.Active >= 1) { // rebellion + init++; + } + if(V.irregulars > 0) { + militiaC++; + } + } + + const Militia = V.militiaUnits.length; + for(let i = 0; i < Militia; i++) { + if(V.militiaUnits[i].active > 0) { + militiaC++; + } + } + + const Slaves = V.slaveUnits.length; + for(let i = 0; i < Slaves; i++) { + if(V.slaveUnits[i].active > 0) { + slavesC++; + } + } + + const Mercs = V.mercUnits.length; + for(let i = 0; i < Mercs; i++) { + if(V.mercUnits[i].active > 0) { + mercsC++; + } } } @@ -1348,8 +1388,6 @@ App.SecExp.Check = (function() { delete V.SFGear; delete V.SFSupportLevel; - delete V.PCWounded; - delete V.garrison; delete V.PCvictories; diff --git a/src/SecExp/propagandaHub.tw b/src/SecExp/propagandaHub.tw index fe7f6d791b4..3e01e5b8712 100644 --- a/src/SecExp/propagandaHub.tw +++ b/src/SecExp/propagandaHub.tw @@ -122,7 +122,7 @@ The propaganda hub is a surprisingly inconspicuous building, dimly lit from the You have upgraded the authenticity department to its maximum. <</if>> <br> - <<if $SecExp.buildings.propHub.fakeNews > 0>> + <<if $SecExp.buildings.propHub.fakeNews == 0>> <<link "Install a news generator" "propagandaHub">> <<set $SecExp.buildings.propHub.fakeNews = 1>> <<run cashX(forceNeg(10000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx")>> diff --git a/src/SecExp/securityHQ.tw b/src/SecExp/securityHQ.tw index 5707ba116e1..cc4333629eb 100644 --- a/src/SecExp/securityHQ.tw +++ b/src/SecExp/securityHQ.tw @@ -383,7 +383,7 @@ Considering the current upgrades the maximum level of crime is <<print App.SecEx <br> <<if $SecExp.core.authority > 10000>> <<if $readinessUpgrades.rapidPlatforms == 0>> - [[Build rapid deployment platforms|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.rapidPlatforms = 1] + [[Build rapid deployment platforms|securityHQ][cashX(-Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount), "capEx"), $readinessUpgrades.rapidPlatforms = 1]] <br>//Costs <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*_HistoryDiscount))>>. Will increase readiness by 2, but will require 5 extra slaves in the headquarters and increases upkeep. The remaining slaves will be more efficient in dealling with crime.// <<else>> You have built rapid deployment platforms able to equip and deploy units within very limited time windows. diff --git a/src/SecExp/unitsRebellionReport.tw b/src/SecExp/unitsRebellionReport.tw index 6c976429d91..f30e7e3f433 100644 --- a/src/SecExp/unitsRebellionReport.tw +++ b/src/SecExp/unitsRebellionReport.tw @@ -4,7 +4,7 @@ <<if $irregulars > 0>> The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology. No casualties suffered. <</if>> - <<if App.SecExp.conflict.deployedUnits('bots')>> + <<if App.SecExp.conflict.deployedUnits('bots') >= 1>> <br> Security drones: no casualties suffered. <</if>> diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js index edbfebc73cc..29a2f4951cc 100644 --- a/src/interaction/main/mainLinks.js +++ b/src/interaction/main/mainLinks.js @@ -5,7 +5,7 @@ App.UI.View.MainLinks = function() { const PA = Array.isArray(V.personalAttention) ? V.personalAttention.map(x => getSlave(x.ID)) : []; let r = ''; - if (V.PCWounded === 1) { + if (V.SecExp.pcWounded === 1) { r += `The injuries received in the recent battle prevent you from undertaking tiring efforts.`; } else { switch (V.personalAttention) { @@ -76,7 +76,7 @@ App.UI.View.MainLinks = function() { } } - if (V.PCWounded !== 1) { + if (V.SecExp.pcWounded !== 1) { r += ` <span id="managePA"><strong><<link "Change plans">><<goto "Personal Attention Select">><</link>></strong></span> <span class="cyan">[A]</span>`; } diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 6b302730807..d9baf702ba3 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -466,9 +466,7 @@ window.overpowerCheck = function(slave, PC) { strength += (185-slave.height); strength -= (PC.belly/1000); strength += (PC.warfare/3); - if(jsDef(State.variables.SecExp.pcWounded)) { - strength -= (State.variables.SecExp.pcWounded * 15); - } + strength -= (State.variables.SecExp.pcWounded * 15); return strength; }; diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw index f9d0bd491e4..3ca92a65b6b 100644 --- a/src/uncategorized/persBusiness.tw +++ b/src/uncategorized/persBusiness.tw @@ -3,7 +3,7 @@ <<if $useTabs == 0>>__Personal Business__<</if>> <br> <<if $secExpEnabled == 1>> - <<if def $SecExp.pcWounded>> + <<if $SecExp.pcWounded > 0>> <<set $SecExp.pcWounded-->> The injuries received in the recent battle prevents you from engaging in tiring endeavors. <<if $SecExp.pcWounded > 1>> @@ -11,7 +11,6 @@ <<elseif $SecExp.pcWounded == 1>> You are starting to feel better. It's very likely you will be back to full working order within the next week. <<else>> - <<run delete $SecExp.pcWounded>> You have finally recovered from your injuries. <</if>> <</if>> @@ -404,7 +403,7 @@ /* <<set _X = 0>> */ /* <</if>> */ -<<if ndef $SecExp.pcWounded>> +<<if $SecExp.pcWounded == 0>> <<switch $personalAttention>> <<case "trading">> <<set _oldSkill = $PC.trading>> -- GitLab