diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index f16808347daed9fbd54e8e2fce797194c941ec07..ea974b0dbf8ebe94a21d33eb9a9fbd9174a10d35 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -389,6 +389,8 @@ You should have received a copy of the GNU General Public License along with thi <<set $economy = 100>> <<set $econRate = 2>> <<set $difficultySwitch = 0>> + <<set $econWeatherDamage = 0>> + <<set $disasterResponse = 0>> <<set $neighboringArcologies = 3>> <<set $newDescriptions = 0>> <<set $familyTesting = 0>> diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 42629b15dd99e68082736416ff610658bda2a24f..99cc80c6fcc8b844f06f86258d2e84a6b7d139b9 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -335,6 +335,9 @@ window.getCost = function(array) { costs += Math.ceil(T.SFCashBonus); } } + if(State.variables.econWeatherDamage && State.variables.disasterResponse > 0) { + costs += Math.trunc(State.variables.disasterResponse * 200000 / State.variables.localEcon); + } // clean up if(costs < 0) { costs = 0; diff --git a/src/pregmod/manageEconomy.tw b/src/pregmod/manageEconomy.tw index d66c6ff712636aa4d33c6bf6ab550229c599c26f..bb05654a2803365049580cb4e5ac9366f41f2906 100644 --- a/src/pregmod/manageEconomy.tw +++ b/src/pregmod/manageEconomy.tw @@ -45,6 +45,20 @@ <<set _econPercent = Math.trunc(100000/$localEcon-1000)/10>> increasing prices by @@.red;''<<print _econPercent>> %.''@@ <</if>> + <<if $econWeatherDamage > 0>> + <br><br>The recent terrible weather has damaged the local infrastructure. It is @@.red;reducing the local economy score by <<print $econWeatherDamage>>.@@ + <<if $disasterResponse == 0>> + <br>Locals will do their best to repair the damage on their own, but setting up a disaster response unit <br>will improve the recovery of infrastructure critical for keeping goods, people and information flowing smoothly in and out of your arcology. + <br>Creating the unit will cost <<print cashFormat(50000)>> and incur upkeep. [[Create Disaster Response Unit|Manage Economy][$cash -= 50000, $disasterResponse = 1]] + <<elseif $disasterResponse == 1>> + <br>You are sending your disaster response unit to repair critical infrastructure. They are doing what they can. + <br>The unit can be made more effective with an additional investment of <<print cashFormat(100000)>>. This will also increase upkeep. [[Improve Disaster Response Unit|Manage Economy][$cash -= 100000, $disasterResponse = 2]] + <<else>> + <br>Your highly capable disaster response unit is rapidly repairing the weather damage. + <</if>> + <<elseif $disasterResponse > 0>> + <br><br>Your disaster response unit is idle. It won't cost you any upkeep this week. + <</if>> <br><br> <</if>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index ad3fa0f716081e29dfd8836c7df5cc8e63b0534b..d09af19cea8922c78f62738a4557aefb843ef361 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3495,3 +3495,12 @@ Done! <<if $releaseID < 1031>> <<set $releaseID = 1031>> <</if>> + +<<if $difficultySwitch == 1>> + <<if ndef $econWeatherDamage>> + <<set $econWeatherDamage = 0>> + <</if>> + <<if ndef $disasterResponse>> + <<set $disasterResponse = 0>> + <</if>> +<</if>> diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw index 6d2c9df6844084c1ef3175008ceafa871d2ed63d..9b3f39662ae8ee4b5b16c01d51f9a2d39f0c3658 100644 --- a/src/uncategorized/costsReport.tw +++ b/src/uncategorized/costsReport.tw @@ -156,6 +156,10 @@ your __personal living expenses__ are <<print cashFormat(Math.trunc($girls*(250+ <</for>> <</if>> +<<if $econWeatherDamage && $disasterResponse > 0>> + <<set _DRUUpkeep = Math.trunc($disasterResponse * 200000 / $localEcon)>> + <br>__Disaster Response Unit__ expenses: <<print cashFormat(_DRUUpkeep)>> +<</if>> <<if $FSSpending != 0>> <br>__Society Shaping__ expenses: <<print cashFormat($FSSpending)>> <</if>> diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index e9a301d8ad15dac163324c951e40d22c967db59e..c8a9e955591c2a6bd7ef6bdbfa8692737766e674 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -37,7 +37,7 @@ <<set $economy = 20>> <</if>> <<set _localEconSeed = random(1,100)>> - <<if $localEcon <= ($globalEcon + $econAdvantage)>> + <<if $localEcon <= ($economy + $econAdvantage)>> <<if _localEconSeed > 95>> <<set $localEcon += 2>> <<elseif _localEconSeed > 50>> @@ -47,7 +47,7 @@ <<elseif _localEconSeed <= 10>> <<set $localEcon -= 1>> <</if>> - <<elseif $localEcon <= ($globalEcon + $econAdvantage + 5)>> + <<elseif $localEcon <= ($economy + $econAdvantage + 5)>> <<if _localEconSeed > 98>> <<set $localEcon += 2>> <<elseif _localEconSeed > 66>> diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw index 111294fe8f9917893847bcd94d25cfe6267703ca..83e582bcec2035ef332dcb0e2339db2304ae8d0b 100644 --- a/src/uncategorized/persBusiness.tw +++ b/src/uncategorized/persBusiness.tw @@ -1033,14 +1033,45 @@ The RomanFS may need further tweaking (it probably got weaker). Could increase t <</if>> <<if $difficultySwitch == 1>> +<<if $econWeatherDamage > 0>> + <<set _repairSeed = random(1,3)>> + <<if $disasterResponse == 0>> + <<if _repairSeed == 3>> + <<set $econWeatherDamage -= 1>> + <<set $localEcon += 1>> + <</if>> + <<elseif $disasterResponse == 1>> + <<if _repairSeed > 1>> + <<set $econWeatherDamage -= 1>> + <<set $localEcon += 1>> + <</if>> + <<else>> + <<if _repairSeed == 3>> + <<if $econWeatherDamage > 1>> + <<set $econWeatherDamage -= 2>> + <<set $localEcon += 2>> + <<else>> + <<set $econWeatherDamage -= 1>> + <<set $localEcon += 1>> + <</if>> + <<else>> + <<set $econWeatherDamage -= 1>> + <<set $localEcon += 1>> + <</if>> + <</if>> +<</if>> +<<if $terrain != "oceanic">> <<if $weatherToday.severity == 3>> <<set $localEcon -= 1>> + <<set $econWeatherDamage += 1>> <br><br>This week's terrible weather did a number on the region, @@.red;hurting the local economy.@@ <<elseif $weatherToday.severity > 3>> <<set $localEcon -= 3>> + <<set $econWeatherDamage += 3>> <br><br>This week's extreme weather ravaged the region, @@.red;the local economy is seriously disrupted.@@ <</if>> <</if>> +<</if>>