From cce01a9daa5acb83c1699cb8904767ce0a432e57 Mon Sep 17 00:00:00 2001 From: Jones <Jones> Date: Wed, 31 Oct 2018 21:48:31 +0100 Subject: [PATCH] Visitor and minor tweaks Crime and terrain now matter to visitors. A honeymoon visitor phase added for newly constructed arcologies. Made sure $ACitizens remains the total number of citizens instead of turning into the number for the lower class, which now has its own variable. Tweaks to the FS effect (verified that it does cap at 100 naturally). --- src/init/storyInit.tw | 3 +- src/uncategorized/BackwardsCompatibility.tw | 3 + src/uncategorized/arcmgmt.tw | 92 +++++++++++++++++---- 3 files changed, 79 insertions(+), 19 deletions(-) diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 9d761c53477..79e71cb3b3a 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -1114,7 +1114,8 @@ DairyRestraintsSetting($dairyRestraintsSetting) <<set $arcologyUpgrade = {drones: 0, hydro: 0, apron: 0, grid: 0, spire: 0}>> <<set $AGrowth = 2>> -<<set $ACitizens = 2850>> +<<set $ACitizens = 4000>> +<<set $lowerClass = 2850>> <<set $visitors = 0>> <<set $welfare = 0.004>> <<set $LCDemand = 1840>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index d737b1fbc09..bf4cacd26e1 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3505,6 +3505,9 @@ Done! <</if>> <</if>> +<<if ndef $lowerClass>> + <<set $lowerCLass = 2850>> +<</if>> <<if ndef $welfare>> <<set $welfare = 0.004>> <</if>> diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index 050b0694f5a..8601f63853f 100644 --- a/src/uncategorized/arcmgmt.tw +++ b/src/uncategorized/arcmgmt.tw @@ -228,7 +228,6 @@ This week, <<if _flux >= 20>>many<<elseif _flux >= 5>>some<<else>>few to none<</ Populations depend on the 'demand' for them. People flock to the Free City when there are jobs. Jobs for lower class people depend on prosperity and the need for labor from other classes. They compete with slaves for work. More elite citizens require their own slaves and will cause the population of slaves to increase as they move in. FS and policies will impact how many slaves they desire and how productive they are. The PC's menials also compete for labor within the arcology. Slaves can now 'expire', speed depends on FS and policies. Default lifespan for menials is an average of ~4 years. -/*Slaves*/ /*Slave expiration*/ <<set _expirationPC = Math.trunc($helots * $slaveExpiration)>> <<set _expirationNPC = Math.trunc($ASlaves * $slaveExpiration)>> @@ -243,6 +242,42 @@ More elite citizens require their own slaves and will cause the population of sl @@.red;One of them was yours.@@ <</if>> <</if>> + +/*Citizens turning into slaves*/ +<<set _enslaved = Math.trunc($lowerClass * $welfare)>> +<<set $lowerClass -= _enslaved>> +<<set $ASlaves += _enslaved>> + +/*Bad weather switch*/ +<<if $weatherToday.severity > 3>> + <<if $secExp == 1>> + <<if $docks || $railway < 4>> + <<set _weatherFreeze = 1>> + <<else>> + <<set _weatherFreeze = 0>> + <</if>> + <<elseif $SOMEWEATHERUPGRADE < X>> + <<set _weatherFreeze = 1>> + <<else>> + <<set _weatherFreeze = 0>> + <</if>> +<<elseif $weatherToday.severity > 2>> + <<if $secExp == 1>> + <<if $docks || $railway < 3>> + <<set _weatherFreeze = 1>> + <<else>> + <<set _weatherFeeze = 0>> + <</if>> + <<elseif $SOMEWEATHERUPGRADE < X-1>> + <<set _weatherFreeze = 1>> + <<else>> + <<set _weatherFreeze = 0>> + <</if>> +<<else>> + <<set _weatherFreeze = 0>> +<</if>> + +<<if _weatherFreeze = 0>> /*Bunch of visitor stuff*/ <<set _FSScore = 0>> <<if $arcologies[0].FSSupremacist != "unset">> @@ -317,7 +352,7 @@ More elite citizens require their own slaves and will cause the population of sl <<if $arcologies[0].FSHedonisticDecadence != "unset">> <<set _FSScore += $arcologies[0].FSHedonisticDecadence>> <</if>> -<<set _FSScore = Math.clamp(_FSScore / $FSCreditCount, 0, 500)>> +<<set _FSScore = _FSScore / $FSCreditCount>> <<if $secExp == 1>> <<if $docks > 0>> <<set _transportHub = 0.7 + $docks / 10 + $airport / 10>> @@ -329,8 +364,31 @@ More elite citizens require their own slaves and will cause the population of sl <<else>> <<set _transportHub = 1>> <</if>> -<<set $visitors = Math.trunc((($arcologies[0].prosperity + _FSScore) * _transportHub) / (100 / $localEcon))>> +<<if $secExp == 1>> + <<set _crime = (100 - $crime) / 100 + 0.2>> +<<else>> + <<set _crime = 0.8>> +<</if>> +<<if $terrain == "urban">> + <<set _terrain = 1.1>> +<<elseif $terrain == "rural">> + <<set _terrain = 1>> +<<elseif $terrain == "marine">> + <<set _terrain = 0.9>> +<<elseif $terrain == "oceanic" || "ravine">> + <<set _terrain = 0.8>> +<</if>> +<<if $targetArcology.type == "New">> + <<if $week < 21>> + <<set _honeymoon = 210 - 10 * $week>> + <<else>> + <<set _honeymoon = 0>> + <</if>> +<</if>> +<<set $visitors = Math.trunc((($arcologies[0].prosperity + _FSScore * 5 + _honeymoon) * _transportHub * _terrain * _crime) / (100 / $localEcon))>> <br>@@.green;<<print $visitors>> Traders and tourists@@ visited your arcology this week. + +/*slaves*/ /*Demand for simple labor*/ <<set _LSCD = ($LCDemand + ($arcologies[0].prosperity * 5) + (($middleClass + $visitors * 0.75) * 2) + (($upperClass + $visitors * 0.25) * 4.5) + ($topClass * 20)>> /*Demand for owning slaves*/ @@ -365,25 +423,21 @@ More elite citizens require their own slaves and will cause the population of sl <</if>> /*Lower Class Citizens*/ -/*Citizens turning into slaves*/ -<<set _enslaved = Math.trunc($ACitizens * $welfare)>> -<<set $ACitizens -= _enslaved>> -<<set $ASlaves += _enslaved>> /*Work left for lower class citizens*/ -<<set _LCD = ($LCDemand + ($arcologies[0].prosperity * 5) + ($middleClass * 2) + ($upperClass * 4.5) + ($topClass * 20) - Math.trunc(($ASlaves + $helots) * $slaveProductivity)) * $rentEffectL>> +<<set _LCD = ($LCDemand + ($arcologies[0].prosperity * 5) + (($middleClass + $visitors * 0.75) * 2) + (($upperClass + $visitors * 0.25) * 4.5) + ($topClass * 20) - Math.trunc(($ASlaves + $helots) * $slaveProductivity)) * $rentEffectL>> /*Changing population depending on work available*/ -<<if $ACitizens < _LCD>> - <<set _ACImmigration = Math.trunc((_LCD - $ACitizens) * 0.3) + 1>> - <<set $ACitizens += _ACImmigration>> +<<if $lowerClass < _LCD>> + <<set _ACImmigration = Math.trunc((_LCD - $lowerClass) * 0.3) + 1>> + <<set $lowerClass += _ACImmigration>> <<if _ACImmigration > 1>> <br>@@.green;<<print _ACImmigration>> Lower class citizens@@ moved to your arcology. <<elseif _ACImmigration > 0>> <br>@@.green;One lower class citizen@@ moved to your arcology. <</if>> -<<elseif $ACitizens > _LCD>> - <<set _ACEmigration = Math.trunc(($ACitizens - _LCD) * 0.6) + 1>> - <<set $ACitizens -= _ACEmigration>> - <<set _enslavedEmigrants = Math.trunc(($ACitizens - _LCD) * 0.6) * $enslaveChance)>> +<<elseif $lowerClass > _LCD>> + <<set _ACEmigration = Math.trunc(($lowerClass - _LCD) * 0.6) + 1>> + <<set $lowerClass -= _ACEmigration>> + <<set _enslavedEmigrants = Math.trunc(($lowerClass - _LCD) * 0.6) * $enslaveChance)>> <<set _enslaved += _enslavedEmigrants>> <<if _ACEmigration > 1>> <br>@@.red;<<print _ACEmigration>> Lower class citizens@@ had no work and tried to leave your arcology. @@ -418,7 +472,7 @@ More elite citizens require their own slaves and will cause the population of sl /*Middle Class Citizens*/ /*Demand for Middle Class*/ -<<set _MCD = (($ASlaves * 0.16) + ($ACitizens * 0.15) + ($upperClass) + ($topClass * 3)) * $rentEffectM>> +<<set _MCD = (($ASlaves * 0.16) + ($lowerClass * 0.15) + ($upperClass + $visitors * 0.25) + ($topClass * 3)) * $rentEffectM>> /*Middle Class Citizens immigrating*/ <<if $middleClass < _MCD>> <<set _MCImmigration = Math.trunc((_MCD - $middleClass) * 0.3) + 1>> @@ -441,7 +495,7 @@ More elite citizens require their own slaves and will cause the population of sl /*Upper Class Citizens*/ /*Demand for Upper Class*/ -<<set _UCD = (($ASlaves * 0.015) + ($ACizitens * 0.025) + ($middleClass * 0.1) + ($topClass * 0.5)) * $rentEffectU>> +<<set _UCD = (($ASlaves * 0.015) + ($ACizitens * 0.025) + (($middleClass + $visitors * 0.75) * 0.1) + ($topClass * 0.5)) * $rentEffectU>> /*Upper Class Citizens immigrating*/ <<if $upperClass < _UCD>> <<set _UCImmigration = Math.trunc((_UCD - $upperClass) * 0.3) + 1>> @@ -464,7 +518,7 @@ More elite citizens require their own slaves and will cause the population of sl /*Top Class Citizens*/ /*Setting GDP depending on population*/ -<<set $GDP = Math.trunc((($ASlaves + $helots) * 0.35 * $slaveProductivity) + ($ACitizens * 0.35) + ($middleClass * 0.75) + ($upperClass * 2) + ($topClass * 10)) / 10>> +<<set $GDP = Math.trunc((($ASlaves + $helots) * 0.35 * $slaveProductivity) + ($lowerClass * 0.35) + ($middleClass * 0.75) + ($upperClass * 2) + ($topClass * 10)) / 10>> /*Top Class Interest in living in your arcology*/ <<set _TCD = (Math.trunc($GDP / 18)) * $rentEffectT + 30>> /*Top Class Citizens immigrating*/ @@ -486,6 +540,8 @@ More elite citizens require their own slaves and will cause the population of sl <br>@@.red;One millionaire@@ left your arcology. <</if>> <</if>> +<</if>> /*ends _weatherFreeze*/ +<<set $ACitizens = $lowerClass + $middleClass + $upperClass + $topClass>> */ -- GitLab