From a2f0876668107ac149222b037e918c6b6f77b863 Mon Sep 17 00:00:00 2001 From: BuildTools <unconfigured@null.spigotmc.org> Date: Mon, 15 Oct 2018 12:19:49 +0200 Subject: [PATCH] Economic Difficulty Additions Added some difficulty options and an economy that can fluctuate but generally moves downward, making things more expensive. Should be functional... --- src/SpecialForce/JS.js | 4 +- src/events/intro/economyIntro.tw | 51 +++++++++++++++++++-- src/events/intro/introSummary.tw | 73 +++++++++++++++++++++++++----- src/js/economyJS.tw | 2 +- src/uncategorized/arcmgmt.tw | 13 +++--- src/uncategorized/costsReport.tw | 2 +- src/uncategorized/manageEconomy.tw | 34 ++++++++++++++ src/uncategorized/nextWeek.tw | 56 +++++++++++++++++++++++ src/uncategorized/storyCaption.tw | 1 + 9 files changed, 211 insertions(+), 25 deletions(-) create mode 100644 src/uncategorized/manageEconomy.tw diff --git a/src/SpecialForce/JS.js b/src/SpecialForce/JS.js index 9f7dbe701d4..3bbb4f9d309 100644 --- a/src/SpecialForce/JS.js +++ b/src/SpecialForce/JS.js @@ -73,8 +73,8 @@ window.Count = function() { T.NY = S.AircraftCarrier + S.Sub + S.HAT, T.Base += T.NY; T.NYU = T.ACU + T.SubU + T.HATU, T.max += T.NYU;} V.SF.Units = T.Base, V.SF.Units = C(V.SF.Units, 0, T.max); - if (E < 1) {T.Env = 4;} - else if (E < 1.5) {T.Env = 3;} + if (E > 100) {T.Env = 4;} + else if (E > 200/3) {T.Env = 3;} else {T.Env = 2;} }; diff --git a/src/events/intro/economyIntro.tw b/src/events/intro/economyIntro.tw index 66fdff34554..7a030946faa 100644 --- a/src/events/intro/economyIntro.tw +++ b/src/events/intro/economyIntro.tw @@ -5,9 +5,54 @@ <<else>> It is the year 2037, and the past 21 years have not been kind. The world is starting to fall apart. The climate is deteriorating, resources are being exhausted, and there are more people to feed every year. Technology is advancing, but not fast enough to save everyone. @@.orange;Exactly how bad is the situation?@@ <br> - <br>[[Very serious.|Trade Intro][$economy = 1]] //Default difficulty.// - <br>[[Not truly dire. Not yet.|Trade Intro][$economy = 0.5]] //Easy economics.// - <br>[[This is the last dance.|Trade Intro][$economy = 1.5]] //Crushing challenge.// + <<if $economy == 1>> + <<set $economy = 100>> + <<set $difficultySwitch = 0>> + <br>[[Very serious.|Trade Intro][$economy = 100]] //Default difficulty.// + <br>[[Not truly dire. Not yet.|Trade Intro][$economy = 150]] //Easy economics.// + <br>[[This is the last dance.|Trade Intro][$economy = 200/3]] //Crushing challenge.// + <br> + <br>[[Switch Economic Difficulty|Economy Intro][$difficultySwitch = 1,$econRate = 2,$incomeMod = 1]] + <<else>> + /*New economic difficulty settings*/ + <br><<if $economy == 100>> + The world economy is in ''doubtful'' shape + [[Easier|Economy Intro][$economy = 120]] | [[Harder|Economy Intro][$economy = 80]] + <<elseif $economy > 100>> + The world economy is still in ''good'' shape + [[Harder|Economy Intro][$economy = 100]] + <<else>> + The world economy is in ''terrible'' shape + [[Easier|Economy Intro][$economy = 100]] + <</if>> + <br> and is + <<if $econRate == 1>> + ''slowly declining''. + [[Harder|Economy Intro][$econRate = 2]] + <<elseif $econRate == 2>> + ''visibly deteriorating'' around you. + [[Easier|Economy Intro][$econRate = 1]] | [[Harder|Economy Intro][$econRate = 4]] + <<else>> + ''going to hell in a handbasket''. + [[Easier|Economy Intro][$econRate = 2]] + <</if>> + /* Not functional yet + <br> All the things you need to run your arcology are getting more expensive + <<if $incomeMod == 0>> + while all forms of income ''remain static''. + [[Easier|Economy Intro][$incomeMod = 1]] + <<elseif $incomeMod == 1>> + while all forms of income ''rise but can not keep pace''. + [[Easier|Economy Intro][$incomeMod = 2]] | [[Harder|Economy Intro][$incomeMod = 0]] + <<else>> + but luckily all forms of income ''rise in lockstep''. + [[Harder|Economy Intro][$incomeMod = 1]] + <</if>> */ + <br> + <br>[[Switch Economic DIfficulty Back|Economy Intro][$difficultySwitch = 0,$economy = 1]] + <</if>> + <br> + <br>[[Next|Trade Intro]] <br> <br>[[Skip Intro|Intro Summary]] //This will preclude you from taking over an established arcology.// <</if>> diff --git a/src/events/intro/introSummary.tw b/src/events/intro/introSummary.tw index b3d91545122..050f78d0cf8 100644 --- a/src/events/intro/introSummary.tw +++ b/src/events/intro/introSummary.tw @@ -28,20 +28,69 @@ You may review your settings before clicking "Continue" to begin. __''World Settings''__ <br> <<if $economy == 1>> + <<set $economy = 100>> The world economy is in ''doubtful'' shape. - [[Easier|Intro Summary][$economy = 0.5]] | [[Harder|Intro Summary][$economy = 1.5]] -<<elseif $economy < 1>> - The world economy is still in ''good'' shape. - [[Harder|Intro Summary][$economy = 1]] + [[Easier|Intro Summary][$economy = 150]] | [[Harder|Intro Summary][$economy = 200/3]] +<<elseif $difficultySwitch == 0>> + <<if $economy == 100>> + The world economy is in ''doubtful'' shape. + [[Easier|Intro Summary][$economy = 150]] | [[Harder|Intro Summary][$economy = 200/3]] + <<elseif $economy > 100>> + The world economy is still in ''good'' shape. + [[Harder|Intro Summary][$economy = 100]] + <<else>> + The world economy is in ''terrible'' shape. + [[Easier|Intro Summary][$economy = 100]] + <</if>> <<else>> - The world economy is in ''terrible'' shape. - [[Easier|Intro Summary][$economy = 1]] + <<if $globalEcon == 100>> + The world economy is in ''doubtful'' shape + [[Easier|Economy Intro][$globalEcon = 120]] | [[Harder|Economy Intro][$globalEcon = 80]] + <<elseif $globalEcon > 100>> + The world economy is still in ''good'' shape + [[Harder|Economy Intro][$globalEcon = 100]] + <<else>> + The world economy is in ''terrible'' shape + [[Easier|Economy Intro][$globalEcon = 100]] + <</if>> + <br> and is + <<if $econRate == 1>> + ''slowly declining''. + [[Harder|Economy Intro][$econRate = 2]] + <<elseif $econRate == 2>> + ''visibly deteriorating'' around you. + [[Easier|Economy Intro][$econRate = 1]] | [[Harder|Economy Intro][$econRate = 4]] + <<else>> + ''going to hell in a handbasket''. + [[Easier|Economy Intro][$econRate = 2]] + <</if>> + /* Not functional yet + <br> All the things you need to run your arcology are getting more expensive + <<if $incomeMod == 0>> + while all forms of income ''remain static''. + [[Easier|Economy Intro][$incomeMod = 1]] + <<elseif $incomeMod == 1>> + while all forms of income ''rise but can not keep pace''. + [[Harder|Economy Intro][$incomeMod = 0]] | [[Easier|Economy Intro][$incomeMod = 2]] + <<else>> + but luckily all forms of income ''rise in lockstep''. + [[Harder|Economy Intro][$incomeMod = 1]] + <</if>> */ <</if>> -<<set $drugsCost = Math.trunc(100*$economy)>> -<<set $rulesCost = Math.trunc(100*$economy)>> -<<set $modCost = Math.trunc(50*$economy)>> -<<set $surgeryCost = Math.trunc(300*$economy)>> + <<set $foodCost = Math.trunc(2500/$economy)>> + <<set $drugsCost = Math.trunc(10000/$economy)>> + <<set $rulesCost = Math.trunc(10000/$economy)>> + <<set $modCost = Math.trunc(5000/$economy)>> + <<set $surgeryCost = Math.trunc(30000/$economy)>> + +<<if $difficultySwitch == 1>> + <<set $econAdvantage = -2>> + <<set $localEcon = $economy>> + /* Not functional yet + <<set $baseCost = Math.trunc(100000/$localEcon)>> + <<set $baseIncome = ... */ +<</if>> <br> @@ -1089,8 +1138,8 @@ __''Mods''__ <<goto "init Nationalities">> <</link>> -<<if ($economy != 1) || ($seeDicks != 50) || ($continent != "North America") || ($internationalTrade != 1) || ($internationalVariety != 1) || ($seeRace != 1) || ($seeNationality != 1) || ($seeExtreme != 0) || ($seeCircumcision != 1) || ($seeAge != 1) || ($plot != 1)>> - | [[restore defaults|Intro Summary][$seeDicks = 50,$economy = 1,$continent = "North America",$internationalTrade = 1,$internationalVariety = 1,$seeRace = 1,$seeNationality = 1,$seeExtreme = 0,$seeCircumcision = 1,$seeAge = 1,$plot = 1]] +<<if ($economy != 100) || ($seeDicks != 50) || ($continent != "North America") || ($internationalTrade != 1) || ($internationalVariety != 1) || ($seeRace != 1) || ($seeNationality != 1) || ($seeExtreme != 0) || ($seeCircumcision != 1) || ($seeAge != 1) || ($plot != 1)>> + | [[restore defaults|Intro Summary][$seeDicks = 50,$economy = 100,$continent = "North America",$internationalTrade = 1,$internationalVariety = 1,$seeRace = 1,$seeNationality = 1,$seeExtreme = 0,$seeCircumcision = 1,$seeAge = 1,$plot = 1]] <</if>> <br><br> diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index c5db2859d0f..5cc333eb745 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -124,7 +124,7 @@ window.getCost = function(array) { } //general arcology costs - costs += (State.variables.girls * (250 + (economy * 500))); + costs += (State.variables.girls * (250 + (500000 / economy))); if(State.variables.arcologies[0].FSRepopulationFocusLaw === 1 && State.variables.PC.pregKnown == 1) { costs -= 500; diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index a1fa76c5cf6..b3df7f157cc 100644 --- a/src/uncategorized/arcmgmt.tw +++ b/src/uncategorized/arcmgmt.tw @@ -303,14 +303,15 @@ This week, rents from $arcologies[0].name came to <<else>> @@.red;<<print cashFormat(_rents)>>.@@ <</if>> - -<<if $economy > 1>> - <<set _bribes = ($week*100)+random(-100,100)>> - <<if $cash > 1000>> +<<if $difficultySwitch == 0>> + <<if $economy < 100>> + <<set _bribes = ($week*100)+random(-100,100)>> + <<if $cash > 1000>> <<set _bribes += Math.trunc($cash*0.02)>> + <</if>> + The @@.red;degenerating world economy@@ makes supplying and maintaining $arcologies[0].name extremely difficult. This week, bribes and other costs to keep it running came to @@.yellowgreen;<<print cashFormat(_bribes)>>.@@ + <<set $cash -= _bribes>> <</if>> - The @@.red;degenerating world economy@@ makes supplying and maintaining $arcologies[0].name extremely difficult. This week, bribes and other costs to keep it running came to @@.yellowgreen;<<print cashFormat(_bribes)>>.@@ - <<set $cash -= _bribes>> <</if>> <<if $helots+$menialBioreactors+$fuckdolls > 0>> diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw index c3ace6928c1..d39ca876b72 100644 --- a/src/uncategorized/costsReport.tw +++ b/src/uncategorized/costsReport.tw @@ -13,7 +13,7 @@ Since you are <<else>> used to a fairly normal life, <</if>> -your __personal living expenses__ are <<print cashFormat(($girls*(250+($economy*500))))>>. +your __personal living expenses__ are <<print cashFormat(($girls*(250+(50000/$economy))))>>. <<if $arcologies[0].FSRepopulationFocusLaw == 1 && $PC.pregKnown == 1>> <br>Rent promotion for being a pregnant citizen under ''Universal Pregnancy Subsidy:'' <<print cashFormat(500)>> diff --git a/src/uncategorized/manageEconomy.tw b/src/uncategorized/manageEconomy.tw new file mode 100644 index 00000000000..c830e475c5a --- /dev/null +++ b/src/uncategorized/manageEconomy.tw @@ -0,0 +1,34 @@ +:: Manage Economy [nobr] + +<span id="globalEcon"> + @@.yellowgreen;Global Economy@@ +| <<print $economy>> +</span> +<<if ($cheatMode) && ($cheatModeM)>> + <<set _Teconomy = $economy>> + <<textbox "$economy" $economy>> + <<link "Apply">> + <<set $globalEcon = Math.trunc(Number($economy)) || _Teconomy, $cheater = 1>> + <<replace "#economy">> + @@.yellowgreen;Global Economy@@ + | <<print $economy>> + <</replace>> + <</link>> +<</if>> +<br> + +<span id="localEcon"> + @@.yellowgreen;Local Economy@@ +| <<print $localEcon>> +</span> +<<if ($cheatMode) && ($cheatModeM)>> + <<set _TlocalEcon = $localEcon>> + <<textbox "$localEcon" $localEcon>> + <<link "Apply">> + <<set $localEcon = Math.trunc(Number($localEcon)) || _TlocalEcon, $cheater = 1>> + <<replace "#localEcon">> + @@.yellowgreen;Local Economy@@ + | <<print $localEcon>> + <</replace>> + <</link>> +<</if>> diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index 249d530cc45..04916719aa2 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -21,6 +21,62 @@ <</if>> <</if>> +/*Adding random changes to the economy*/ +<<if $difficultySwitch == 1>> + <<set _globalEconSeed = random(1,100)>> + <<if _globalEconSeed > 98>> + <<set $economy += 2>> + <<elseif _globalEconSeed > 85>> + <<set $economy += 1>> + <<elseif _globalEconSeed <= 2>> + <<set $economy -= 2>> + <<elseif _globalEconSeed <= 25 + $econRate * 10>> + <<set $economy -= 1>> + <</if>> + <<if $economy < 20>> + <<set $economy = 20>> + <</if>> + <<set _localEconSeed = random(1,100)>> + <<if $localEcon <= ($globalEcon + $econAdvantage)>> + <<if _localEconSeed > 95>> + <<set $localEcon += 2>> + <<elseif _localEconSeed > 50>> + <<set $localEcon += 1>> + <<elseif _localEconSeed <= 1>> + <<set $localEcon -= 2>> + <<elseif _localEconSeed <= 10>> + <<set $localEcon -= 1>> + <</if>> + <<elseif $localEcon <= ($globalEcon + $econAdvantage + 5)>> + <<if _localEconSeed > 98>> + <<set $localEcon += 2>> + <<elseif _localEconSeed > 66>> + <<set $localEcon += 1>> + <<elseif _localEconSeed <= 2>> + <<set $localEcon -= 2>> + <<elseif _localEconSeed <= 33>> + <<set $localEcon -= 1>> + <</if>> + <<elseif _localEconSeed > 99>> + <<set $localEcon += 2>> + <<elseif _localEconSeed > 90>> + <<set $localEcon += 1>> + <<elseif _localEconSeed <= 5>> + <<set $localEcon -= 2>> + <<elseif _localEconSeed <= 50>> + <<set $localEcon -= 1>> + <</if>> + <<if $localEcon < 20>> + <<set $localEcon = 20>> + <</if>> + + <<set $foodCost = Math.trunc(2500/$localEcon)>> + <<set $drugsCost = Math.trunc(10000/$localEcon)>> + <<set $rulesCost = Math.trunc(10000/$localEcon)>> + <<set $modCost = Math.trunc(5000/$localEcon)>> + <<set $surgeryCost = Math.trunc(30000/$localEcon)>> +<</if>> + <<set $averageTrust = 0, $averageDevotion = 0, _slavesContributing = 0, _OldHG = -1, _NewHG = -1, _SL = $slaves.length>> <<if $studio == 1>> <<set $pornStars = 0, $pornStarFuckdolls = 0, $pornStarRapees = 0, $pornStarPreggos = 0, diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw index 229d621da53..7b799e07291 100644 --- a/src/uncategorized/storyCaption.tw +++ b/src/uncategorized/storyCaption.tw @@ -523,6 +523,7 @@ <</if>> <br><span id="optionsButton"><<link "Game Options">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Options">><</link>></span> @@.cyan;[O]@@ <<else>> + <br><span id="manageEconomy"><<link "Manage Economy">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Economy">><</link>></span> <br><span id="manageArcology"><<link "Manage Arcology">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Arcology">><</link>></span> @@.cyan;[C]@@ <br><span id="managePenthouse"><<link "Manage Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>></span> @@.cyan;[P]@@ <br><span id="managePerson"><<link "Manage Personal Affairs">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Personal Affairs">><</link>></span> @@.cyan;[X]@@ -- GitLab