JavaScript is required. Please enable it to continue.
Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
!!<<print $city.name>> City Council <<if !($monthlyTask === "none") && $taskCompleted is "not yet">><br><<display "giantTasks">><</if>> <table> <tr><td> [[ [1] Palace|palace]] [[ [2] Laws|laws]] [[ [3] Security|security]] [[ [4] City|city]] [[ [5] Food|farms]] [[ [6] Production|industry]] [[ [7] Research|tech]] [[ [8] Reports|reports]] [[ [9] Workers|workers]] </td> <td> Go to the [[palace]], the personal residence of the $gt.title. Open the [[lawbook|laws]], and consider making some changes. Visit the [[barracks|security]] to review your security situation. Work in the [[city hall|city]], to review finances and city services Inspect the [[farms]], to manage food production. Visit the [[workshops|industry]], the manufacturing heart of the city. Visit the [[labs|tech]], to review the technological progress of the city. Read the [[reports]] about the overall status of your city. Review the [[labor ledger|workers]], for an overview of the workforce. </td> </tr> </table> <<nobr>> <<areReqMatched>> <<if $workers.freePops > 0>> <br>//You have $workers.freePops unemployed workers// <</if>> <<if !($monthlyTask === "none") && $taskCompleted is "not yet">> <br>//Ending the turn will fail the request// <</if>> <<if !$areReqMatched>> <br>//You are employing too few workers in some areas to maintain current levels of development// <</if>> <</nobr>> [[ [Enter] End Turn|turnHandler]]
/* Base stats */ <<set $turn to 1, $year to 2347, $month to random(1,12) >> <<set $baseFarmProd to 2, $baseFoodDecayRate to 3, $baseScrapProd to 1, $basePopGrowth to 0.012, $basePopDeath to 0.008, $baseGrowthRate to 0.5, $baseLackOfFoodHappinessDrop to 15, $baseFavorDecayRate to 1, $baseWrathDecayRate to 1, $baseFreePopTax to 0.2, $baseFarmerTax to 0.4, $baseScavengerTax to 0.6, $baseServiceTax to 1, $baseEngineerTax to 0.2, $baseScientistTax to 0.2, $baseGuardTax to 0.2, $baseServantTax to 0.2, $baseFreePopUpkeep to -0.3, $baseFarmerUpkeep to -0.2, $baseScavengerUpkeep to -0.2, $baseServiceUpkeep to -0.2, $baseEngineerUpkeep to -0.2, $baseScientistUpkeep to -0.6, $baseGuardUpkeep to -0.4, $baseServantUpkeep to -0.4, $taxLaw to 1, $tariffsLaw to 1, $baseFoodPrice to 3, $baseScrapPrice to 5, $buyMarkup to 2, $sellMarkup to 0.5, $baseSafetyDecayRate to 5, $baseLandPerGuard to 20, $basePopPerGuard to 2000, $guardsSafetyCap to 50, $serviceApprovalCap to 50, $baseFeetPerServant to 10, $baseHappinessDecayRate to 5, $servantsSatisfactionCap to 50, $basePopPerService to 600, $baseApprovalDecayRate to 5, $upgradeCostMult to 1, $baseProgressPerEngineer to 1, $baseProgressPerScientist to 1 >> /* giant stats */ /* stats are on a 1-100 scale, with 50 being average */ /* size tracks the height in feet */ <<set $gt to { name: "Unknown", title: "Lady", customTitle: "none", sex: "female", genitals: "female", chronoAge: 21, bioAge: 21, hairColor: "black", eyeColor: "blue", skinColor: "fair", ethnicity: "caucasian", appearance: "feminine", size: 30, weight: 50, muscles: 50, boobs: 50, ass: 50, dick: 50, health: 50, energy: 50, hungerBase: 1, hungerAdjusted: 1/100, lustBase: 1, funBase: 1, socialBase: 1, mood: "indifferent", happiness: 50, humanity: 50, trust: 50, favor: 0, wrath: 0, fame: 0, dread: 0, armor: "none", weapon: "none", traits: [] } >> /* City stats */ <<set $city to { name: "Dustspring", pop: 4000 + random(0,500), land: 50, foodStored: 100, scrap: 100, money: 100, approval: 20, safety: 20, trade: 20, } >> /* worker stats */ <<set $workers to { freePops: Math.trunc($city.pop / 100), farmers: 0, scavengers: 0, service: 0, guards: 0, scientists: 0, engineers: 0, servants: 0 } >> /* Engineering */ <<set $constructionQueue to []>> /* Research */ <<set $researchQueue to []>> /* scheduled tasks */ <<set $clearFields to 0, $abandonFields to 0 >> /* gameovers */ <<set $gameover to { pop: 0, wrath: 0, coup: 0 } >> /* Upgrades */ <<display "upgradesInit">> /* tech */ <<display "researchInit">> /* Auxiliary variables */ <<set $physicalTrait to "none", $historyTrait to "none", $gtFoodConsumption to 0, $cityFoodConsumption to 0, $foodConsumed to 0, $foodProduced to 0, $foodTraded to 0, $notEnoughFoodProduced to false, $foodScarcity to false, $turnsOfFamine to 0, $foodDeficit to 0, $foodLost to 0, $lostToHunger to 0, $newborn to 0, $naturalDead to 0, $migrants to 0, $popDiff to 0, $growth to 0, $taxRevenue to 0, $farmTax to 0, $scavTax to 0, $servantsTax to 0, $serviceTax to 0, $guardTax to 0, $engineerTax to 0, $scientistTax to 0, $freePopTax to 0, $income to 0, $guardsRequired to 0, $serviceRequired to 0, $servantsRequired to 0, $farmersRequired to 0, $safetyChange to 0, $approvalChange to 0, $satisfactionChange to 0, $areReqMatched to false, $farmsLastVisited to "farmsFields", $workshopLastVisited to "workshopEngineering" $secLastVisited to "secGuards", $palaceLastVisited to "palaceServants", $cityLastVisited to "cityService", $repLastVisited to "repFinances", $scrapConsumed to 0, $currentProject to "none", $finishedProject to "none", $techLastVisited to "techScientists", $currentResearch to "none", $finishedResearch to "none", $availableTasks to 0, $monthlyTask to "none", $lastTask to "none", $taskCompleted to "no", $taskDebuff to "none", $currentWorkerNumber to 0, $scrapIncome to 0, $accidentalDeaths to 0, $taskRoll to 0, $taskWorkerMessage to "none", $tariffsRevenue to 0, $tradeDiff to 0, $upkeep to 0, $revenue to 0, $startingFoodMarketSupply to 500, $startingScrapMarketSupply to 100, $foodMarketSupply to 500, $scrapMarketSupply to 100, $foodMarketBuyPrice to 0, $foodMarketSellPrice to 0, $scrapMarketBuyPrice to 0, $scrapMarketSellPrice to 0, $foodMarketDiff to 0, $scrapMarketDiff to 0 >> /* Variables for statistics */ <<set $old to { pop: 0, land: 0, foodStored: 0, foodConsumed: 0, foodProduced: 0, safety: 0, happiness: 0, favor: 0, wrath: 0, approval: 0, trade: 0 } >>
!!End Of Month Report <<nobr>> <<button "General">><<replace "#report">><br><<display "generalReport">><</replace>><</button>> <<button "The Palace">><<replace "#report">>''The <<print $gt.title>>'': <br><<display "gtReport">><</replace>><</button>> <<button "Population">><<replace "#report">>''Population'': <br><<display "popReport">><</replace>><</button>> <<button "Security">><<replace "#report">>''Security'': <br><<display "securityReport">><</replace>><</button>> <<button "Finances">><<replace "#report">>''Finance'': <br><<display "financeReport">><</replace>><</button>> <<button "Food">><<replace "#report">>''Food'': <br><<display "foodReport">><</replace>><</button>> <<button "Engineering">><<replace "#report">>''Engineering'': <br><<display "engineeringReport">><</replace>><</button>> <<button "Research">><<replace "#report">>''Research'': <br><<display "researchReport">><</replace>><</button>> <</nobr>> <span id="report"> <<display "generalReport">> </span> [[ [C]ontinue|postTurn]] <<checkWorkerCount>>
!!The Labor Ledger Here you can see all workers in the city, and their assignments. For a more detailed explanation about each role and requirements, see their relative page. <<updateAllRequired>> <div class="workerGrid"> <div class="grid-item"> ''Free workers'': @@color:yellow;<<print $workers.freePops>>@@ <<display "general worker buttons">> </div> <div class="grid-item"> ''Farmers'': @@color:yellow;<<print $workers.farmers>>@@/@@color:yellow;<<print $farmersRequired>>@@. Max: @@color:yellow;<<print $city.land>>@@ <<display "farm buttons">> </div> <div class="grid-item"> ''Servants'': @@color:yellow;<<print $workers.servants>>@@/@@color:yellow;<<print $servantsRequired>>@@. <<display "servant buttons simple">> </div> <div class="grid-item"> ''Military'': @@color:yellow;<<print $workers.guards>>@@/@@color:yellow;<<print $guardsRequired>>@@ <<display "guards buttons simple">> </div> <div class="grid-item"> ''Service Workers'': @@color:yellow;<<print $workers.service>>@@/@@color:yellow;<<print $serviceRequired>>@@ <<display "service buttons simple">> </div> <div class="grid-item"> ''Scavengers'': @@color:yellow;<<print $workers.scavengers>>@@ <<display "scrap buttons">> </div> <div class="grid-item"> ''Engineers'': @@color:yellow;<<print $workers.engineers>>@@ <<display "engineer buttons simple">> </div> <div class="grid-item"> ''Scientists'': @@color:yellow;<<print $workers.scientists>>@@ <<display "scientist buttons simple">> </div> <div class="grid-item"> [Placeholder] </div> </div> [[ [B]ack|mainWindow]]
<<widget p>><<if $gt.sex is "female">>she<<else>>he<</if>><</widget>> <<widget pc>><<if $gt.sex is "female">>She<<else>>He<</if>><</widget>> <<widget pp>><<if $gt.sex is "female">>her<<else>>his<</if>><</widget>> <<widget ppc>><<if $gt.sex is "female">>Her<<else>>His<</if>><</widget>> <<widget po>><<if $gt.sex is "female">>her<<else>>him<</if>><</widget>> <<widget poc>><<if $gt.sex is "female">>Her<<else>>Him<</if>><</widget>> <<widget sex>><<if $gt.sex is "female">>female<<else>>male<</if>><</widget>> <<widget sexC>><<if $gt.sex is "female">>Female<<else>>Male<</if>><</widget>> <<widget gender>><<nobr>> <<set _gender to "none">> <<if $gt.sex is "female">> <<if $gt.genitals is "female" or $gt.genitals is "neither">> <<if $gt.appearance is "masculine">> <<set _gender to "butch">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "tomboy">> <<else>> <<set _gender to "female">> <</if>> <<elseif $gt.genitals is "male">> <<if $gt.appearance is "masculine">> <<set _gender to "trans-man">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "dickgirl">> <<else>> <<set _gender to "dickgirl">> <</if>> <<elseif $gt.genitals is "both">> <<if $gt.appearance is "masculine">> <<set _gender to "hermaphrodite">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "hermaphrodite">> <<else>> <<set _gender to "futanari">> <</if>> <</if>> <<elseif $gt.sex is "male">> <<if $gt.genitals is "female" or $gt.genitals is "neither">> <<if $gt.appearance is "masculine">> <<set _gender to "cuntboy">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "cuntboy">> <<else>> <<set _gender to "trans-woman">> <</if>> <<elseif $gt.genitals is "male">> <<if $gt.appearance is "masculine">> <<set _gender to "man">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "femboy">> <<else>> <<set _gender to "trap">> <</if>> <<elseif $gt.genitals is "both">> <<if $gt.appearance is "masculine">> <<set _gender to "hermaphrodite">> <<elseif $gt.appearance is "androgynous">> <<set _gender to "hermaphrodite">> <<else>> <<set _gender to "futanari">> <</if>> <</if>> <</if>> <<print _gender>> <</nobr>><</widget>>
<<nobr>> /* quick update to relevant variables */ <<updateFoodConsumption>> Add: /* buttons */ <<if $workers.freePops >= 1 && ($workers.farmers + 1) <= $city.land>> <<link "1">> <<set $workers.freePops-->> <<set $workers.farmers++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5 && ($workers.farmers + 5) <= $city.land>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.farmers to $workers.farmers + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10 && ($workers.farmers + 10) <= $city.land>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.farmers to $workers.farmers + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20 && ($workers.farmers + 20) <= $city.land>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.farmers to $workers.farmers + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50 && ($workers.farmers + 50) <= $city.land>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.farmers to $workers.farmers + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> Remove: <<if $workers.farmers >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.farmers-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.farmers >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.farmers to $workers.farmers - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.farmers >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.farmers to $workers.farmers - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.farmers >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.farmers to $workers.farmers - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.farmers >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.farmers to $workers.farmers - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $farmersRequired > $workers.farmers && $workers.freePops >= $farmersRequired && $workers.farmers < $city.land && $farmersRequired <= $city.land>> <<link "Auto">> <<if $workers.freePops > ($farmersRequired - $workers.farmers)>> <<set $workers.freePops to $workers.freePops - ($farmersRequired - $workers.farmers)>> <<set $workers.farmers to $farmersRequired>> <<goto "workers">> <<else>> <<set $workers.farmers to $workers.farmers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</link>> <<else>> Auto <</if>>| <<if $workers.freePops >= 1 && $workers.farmers < $city.land>> <<link "Add All">> <<if $workers.freePops > ($city.land - $workers.farmers)>> <<set $workers.freePops to $workers.freePops - ($city.land - $workers.farmers)>> <<set $workers.farmers to $city.land>> <<goto "workers">> <<else>> <<set $workers.farmers to $workers.farmers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</link>> <<else>> Add All <</if>>| <<if $workers.farmers > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.farmers>> <<set $workers.farmers to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<if $old.land < $city.land>>As planned, @@color:yellow;<<print $city.land - $old.land>>@@ fields were cleared and they are ready for use. <<elseif $old.land > $city.land>>As planned, @@color:yellow;<<print $old.land - $city.land>>@@ fields were abandoned. <</if>>This month, the city has produced $foodProduced units of food, while $foodConsumed were consumed.<<if $foodScarcity>> The city is short @@color:red;$foodDeficit@@ units and its granaries are @@color:red;empty@@, some of your citizens will have to go hungry.<<elseif $notEnoughFoodProduced>> The city is not producing enough food to support itself, you have lost @@color:red;<<print $old.foodStored - $city.foodStored>>@@ units of stored food. With $city.foodStored units left in storage, your reserves will be exhausted in <<print Math.trunc($city.foodStored / ($foodConsumed - $foodProduced))>> months.<<elseif ($foodProduced - $foodConsumed) > 0>> There is a surplus of @@color:lightGreen;<<print $foodProduced - $foodConsumed>>@@ units of food. <</if>> <<if $foodLost > 0>>Some of your stored food has spoiled, you lost @@color:red;$foodLost@@ units this month. <</if>>Your granaries contain $city.foodStored units.
<<nobr>> /* The food consumption fo the giant is equal to its relative scale factor (number of times they are larger than a 6 ft human) to the power of three, all mutiplied for his/her base hunger value */ /* For normal humans, one unit of food feeds 100 people */ /* Updating variables */ <<set $old.land to $city.land>> <<set $old.foodStored to $city.foodStored>> <<set $old.foodConsumed to $foodConsumed>> <<set $old.foodProduced to $foodProduced>> /* Managing fields */ <<if $clearFields > 0>> <<set $city.land to $city.land + $clearFields>> <<set $clearFields to 0>> <<elseif $abandonFields > 0>> <<set $city.land to $city.land - $abandonFields>> <<set $abandonFields to 0>> <<if $workers.farmers > $city.land>> <<set $workers.freePops to $workers.freePops + ($workers.farmers - $city.land)>> <<set $workers.farmers to $city.land>> <</if>> <</if>> <<updateFoodConsumption>> <<set $foodProduced to Math.trunc($workers.farmers * ($baseFarmProd + $farmerUpgradeBonus))>> /* Calculation */ <<if $city.foodStored + $foodProduced < $foodConsumed>> <<set $foodScarcity to true>> <<set $turnsOfFamine++>> <<set $foodDeficit to $foodConsumed - ($city.foodStored + $foodProduced)>> <<set $city.foodStored to 0>> <<elseif $foodProduced < $foodConsumed>> <<if $turnsOfFamine > 0>> <<set $turnsOfFamine to Math.clamp($turnsOfFamine - 1, 0, $turnsOfFamine)>> <</if>> <<set $notEnoughFoodProduced to true>> <<set $foodScarcity to false>> <<set $foodDeficit to 0>> <<set $city.foodStored to Math.trunc($city.foodStored + $foodProduced - $foodConsumed)>> <<else>> <<if $turnsOfFamine > 0>> <<set $turnsOfFamine to Math.clamp($turnsOfFamine - 2, 0, $turnsOfFamine)>> <</if>> <<set $foodScarcity to false>> <<set $notEnoughFoodProduced to false>> <<set $foodDeficit to 0>> <<set $city.foodStored to Math.trunc($city.foodStored + $foodProduced - $foodConsumed)>> <</if>> /* food decay */ <<set $foodLost to Math.trunc($city.foodStored * $baseFoodDecayRate / 100)>> <<if $foodLost >= 1>> <<set $city.foodStored to $city.foodStored - $foodLost>> <<else>> <<set $foodLost to 0>> <</if>> <</nobr>>
<<widget updateAllRequired>><<nobr>> <<updateFoodConsumption>> <<updateServantsRequired>> <<updateServiceRequired>> <<updateGuardsRequired>> <</nobr>><</widget>> <<widget updateFoodConsumption>><<nobr>> <<set $scaleFactor to $gt.size / 6>> <<set $gtFoodConsumption to Math.trunc($gt.hungerAdjusted * ($scaleFactor * $scaleFactor * $scaleFactor * 0.50))>> <<if $gtFoodConsumption < 1>> <<set $gtFoodConsumption to 1>> <</if>> <<set $cityFoodConsumption to Math.trunc($city.pop / 100)>> <<set $foodConsumed to $gtFoodConsumption + $cityFoodConsumption + $foodTraded>> <<set $farmersRequired to Math.trunc($foodConsumed / ($baseFarmProd + $farmerUpgradeBonus))>> <<if Math.trunc($farmersRequired * ($baseFarmProd + $farmerUpgradeBonus)) < $foodConsumed>> <<set $farmersRequired++>> <</if>> <</nobr>><</widget>> <<widget updateFoodProduction>><<nobr>> <<set $foodProduced to Math.trunc($workers.farmers * ($baseFarmProd + $farmerUpgradeBonus))>> <</nobr>><</widget>> <<widget updateGuardsRequired>><<nobr>> <<if $taskDebuff === "increased guards numbers">> <<set $guardsRequired to Math.trunc(1.5 * (($city.land / $baseLandPerGuard) + Math.trunc($city.pop / $basePopPerGuard)))>> <<else>> <<set $guardsRequired to (Math.trunc($city.land / $baseLandPerGuard) + Math.trunc($city.pop / $basePopPerGuard))>> <</if>> <</nobr>><</widget>> <<widget updateServantsRequired>><<nobr>> <<if $taskDebuff === "increased servants numbers">> <<set $servantsRequired to Math.trunc(1.5 * ($gt.size / $baseFeetPerServant))>> <<else>> <<set $servantsRequired to Math.trunc($gt.size / $baseFeetPerServant)>> <</if>> <</nobr>><</widget>> <<widget updateServiceRequired>><<nobr>> <<if $taskDebuff === "increased service numbers">> <<set $serviceRequired to Math.trunc(1.3 * (Math.trunc($city.pop / $basePopPerService)))>> <<else>> <<set $serviceRequired to Math.trunc($city.pop / $basePopPerService)>> <</if>> <</nobr>><</widget>> <<widget readjustWorkers>><<nobr>> <<set _actualWorkerCount to Math.trunc($city.pop / 100)>> <<set _oldFarm to $workers.farmers, $workers.farmers to 0>> <<set _oldScav to $workers.scavengers, $workers.scavengers to 0>> <<set _oldSol to $workers.guards, $workers.guards to 0>> <<set _oldServ to $workers.servants, $workers.servants to 0>> <<set _oldEngi to $workers.engineers, $workers.engineers to 0>> <<set _oldScie to $workers.scientists, $workers.scientists to 0>> <<set _oldService to $workers.service, $workers.service to 0>> <<set $workerDiff to 0>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldFarm && _oldFarm > 0>> <<set $workers.farmers to _oldFarm>> <<set _actualWorkerCount to (_actualWorkerCount - _oldFarm)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldFarm>> <<set $workers.farmers to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldServ && _oldServ > 0>> <<set $workers.servants to _oldServ>> <<set _actualWorkerCount to (_actualWorkerCount - _oldServ)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldServ>> <<set $workers.servants to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldService && _oldService > 0>> <<set $workers.service to _oldService>> <<set _actualWorkerCount to (_actualWorkerCount - _oldService)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldService>> <<set $workers.service to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldSol && _oldSol > 0>> <<set $workers.guards to _oldSol>> <<set _actualWorkerCount to (_actualWorkerCount - _oldSol)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldSol>> <<set $workers.guards to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldScav && _oldScav > 0>> <<set $workers.scavengers to _oldScav>> <<set _actualWorkerCount to (_actualWorkerCount - _oldScav)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldScav>> <<set $workers.scavengers to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldEngi && _oldEngi > 0>> <<set $workers.engineers to _oldEngi>> <<set _actualWorkerCount to (_actualWorkerCount - _oldEngi)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldEngi>> <<set $workers.engineers to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0 && _actualWorkerCount >= _oldScie && _oldScie > 0>> <<set $workers.scientists to _oldScie>> <<set _actualWorkerCount to (_actualWorkerCount - _oldScie)>> <<elseif _actualWorkerCount > 0 && _actualWorkerCount < _oldScie>> <<set $workers.scientists to _actualWorkerCount>> <<set _actualWorkerCount to 0>> <</if>> <<if _actualWorkerCount > 0>> <<set $workers.freePops to _actualWorkerCount>> <</if>> <<if Math.trunc($old.pop / 100) != Math.trunc($city.pop / 100)>> <<set $workerDiff to Math.trunc(($city.pop / 100) - ($old.pop / 100))>> <</if>> <</nobr>><</widget>> <<widget updateAvailableTasks>><<nobr>> /* In the future will update availableTasks to filter unapplicable tasks like voring humans for vegetarians giants */ <<set $availableTasks to 6>> <</nobr>><</widget>>
<<nobr>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.scavengers++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.scavengers to $workers.scavengers + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.scavengers to $workers.scavengers + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.scavengers to $workers.scavengers + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.scavengers to $workers.scavengers + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> Remove: <<if $workers.scavengers >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.scavengers-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.scavengers >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.scavengers to $workers.scavengers - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.scavengers >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.scavengers to $workers.scavengers - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.scavengers >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.scavengers to $workers.scavengers - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.scavengers >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.scavengers to $workers.scavengers - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.scavengers to $workers.scavengers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.scavengers > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.scavengers>> <<set $workers.scavengers to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<set $turn++>> <<set $month++>> <<if $month >= 13>> <<set $year++>> <<set $gt.chronoAge++>> <<set $month to 1>> <</if>> <<display "taskCalc">> <<display "foodCalc">> <<display "scrapCalc">> <<display "popCalc">> <<display "gtCalc">> <<display "financeCalc">> <<display "securityCalc">> <<display "constructionCalc">> <<display "researchCalc">> <<goto "turnReport">> /* [[continue|turnReport]] */
Our scavengers were able to collect <<print Math.trunc($workers.scavengers * $baseScrapProd)>> units of scrap this month. <<display "constructionReport">>
<<nobr>> /* updating variables */ <<set $scrapIncome to 0>> /* Calculation */ <<set $scrapIncome to Math.trunc($workers.scavengers * $baseScrapProd)>> <<set $city.scrap to $city.scrap + $scrapIncome>> /* Scrap consumption */ <</nobr>>
This month, $newborn children joined the workforce, while $naturalDead citizens left the workforce due to age or death by natural causes. <<if $foodScarcity>>@@color:red;<<print $lostToHunger>>@@ citizens were lost to hunger.<</if>> <<if $migrants != 0>><<if $migrants < 0>><<set $migrants to $migrants * -1>> <<print $migrants>> people left the city.<<else>> <<print $migrants>> people migrated to the city.<</if>><</if>> <<if $popDiff < 0>><<set $popDiff to $popDiff * -1>><<if $accidentalDeaths != 0>>@@color:red;<<print $accidentalDeaths>>@@ people were lost this month due to accidents.<</if>> Overall, the city lost @@color:red;<<print $popDiff>>@@ citizens this month.<<else>>Overall, the city gained @@color:lightGreen;<<print $popDiff>>@@ citizens.<</if>> <<if $workerDiff != 0>>This month we <<if $old.pop > $city.pop>>had to disband @@color:red;<<print $workerDiff>>@@ squads of workers due to population loss.<<else>>managed to assemble @@color:lightGreen;<<print $workerDiff>>@@ new worker units.<</if>><</if>>
<<nobr>> /* Updating variables */ <<set $old.pop to $city.pop>> <<set $lostToHunger to 0>> <<set $newborn to 0>> <<set $naturalDead to 0>> <<set $migrants to 0>> <<set $migrationPush to 0>> <<set $accidentalDeaths to 0>> <<set $workerDiff to 0>> /* Calculation */ /* famine */ <<if $foodScarcity>> <<set _percentDeficitAdjusted to Math.clamp($foodDeficit / $foodConsumed, 0, 0.15)>> <<set $lostToHunger to Math.trunc($city.pop * _percentDeficitAdjusted * ($turnsOfFamine / 2))>> <</if>> /* Births */ <<set $newborn to Math.trunc($city.pop * $basePopGrowth + random(-5,5))>> /* Natural deaths */ <<set $naturalDead to Math.trunc($city.pop * $basePopDeath + random(-5,5))>> /* Accidents */ <<if $taskDebuff is "war games">> <<set _roll to (random(1,10)* 0.1)>> <<set $accidentalDeaths to Math.trunc($workers.guards * 100 * _roll)>> <<elseif $taskDebuff is "servants exiled">> <<set _roll to (random(1,10) * 0.1)>> <<set $accidentalDeaths to Math.trunc($workers.servants * 100 * _roll)>> <</if>> /* Migration */ /* Negative migration will make people emigrate, positive will make people immigrate */ <<if $foodScarcity>> <<set $migrationPush to $migrationPush - Math.clamp($turnsOfFamine, 0, 20)>> <</if>> <<if $gt.fame > 0>> /* Every 20 points of giant's fame is an extra point of immigration */ <<set $migrationPush to $migrationPush + Math.trunc($gt.fame / 20)>> <</if>> <<if $gt.dread > 0>> /* Every 20 points of giant's dread is an extra point of emigration */ <<set $migrationPush to $migrationPush - Math.trunc($gt.dread / 20)>> <</if>> <<if $city.safety > 0>> /* Every 20 points of safety is an extra point of immigration */ <<set $migrationPush to $migrationPush + Math.trunc($city.safety / 20)>> <</if>> /* Migration push then becomes a percentage of the current population */ <<set $migrants to Math.trunc($city.pop * ($migrationPush / 500))>> /* Final calc */ <<set $popDiff to $newborn + $migrants - $naturalDead - $lostToHunger - $accidentalDeaths>> <<set $city.pop to $city.pop + $popDiff>> /* updating worker count */ <<if Math.trunc($old.pop / 100) != Math.trunc($city.pop / 100)>> <<readjustWorkers>> <</if>> <</nobr>>
<<if $growth > 0>>The <<print $gt.title>> has grown $growth feet this last month.<<else>>The <<print $gt.title>> has not grown this month.<</if>><<if $satisfactionChange > 0>> The <<print $gt.title>>'s happiness @@color:lightGreen;improved@@ in these last few weeks.<<elseif $satisfactionChange < 0>> The <<print $gt.title>>'s happiness @@color:red;worsened@@ in these last few weeks.<</if>><<if $favorChange > 0>> Your favor with the $gt.title has @@color:lightGreen;increased@@ recently.<<elseif $favorChange < 0>> Your favor with the $gt.title has @@color:red;decreased@@ recently.<</if>><<if $wrathChange < 0>> The $gt.title's wrath towards you has @@color:lightGreen;softened@@.<<elseif $wrathChange > 0>> The $gt.title's wrath towards you @@color:red;intensified@@.<</if>> <<nobr>> <<display "taskReport">> <</nobr>>
<<nobr>> /* Updating variables */ <<updateServantsRequired>> <<set $growth to 0>> <<set $satisfactionChange to 0>> <<set $old.happiness to $gt.happiness>> <<if $monthlyTask is "none">> <<set $favorChange to 0>> <<set $wrathChange to 0>> <</if>> /* Growth */ <<if !$foodScarcity>> <<set $growth to $baseGrowthRate + 0.2 * random(-1,1)>> <<set $gt.size to $gt.size + $growth>> <</if>> /* happiness */ /* food */ <<if $foodScarcity>> <<set $satisfactionChange to $satisfactionChange - Math.clamp(($baseLackOfFoodHappinessDrop * $turnsOfFamine),-30, 0)>> <</if>> /* Servants */ <<set _satisfactionRating to Math.clamp($workers.servants / $servantsRequired, 0, 2)>> /* if satisfaction is under the servants cap moderated by the actual servant count, then it grows by 0% to 10%, depending on the amount of servants */ /* otherwise it goes down by the default rate */ <<if $gt.happiness < _satisfactionRating * $servantsSatisfactionCap>> <<set $satisfactionChange to _satisfactionRating * 5>> <<elseif $gt.happiness != _satisfactionRating * $servantsSatisfactionCap && $gt.happiness > 0>> <<set $satisfactionChange to -1 * $baseHappinessDecayRate>> <</if>> /* Final calculation */ <<set $gt.happiness to Math.trunc(Math.clamp($gt.happiness + $satisfactionChange, 0, $servantsSatisfactionCap))>> /* Favor */ <<if $gt.happiness >= 60>> <<set $favorChange to $favorChange + Math.trunc(Math.clamp((100 - $gt.happiness) / 5 + 1, 1, 5))>> <</if>> <<set $gt.favor to Math.clamp($gt.favor + $favorChange - $baseFavorDecayRate, 0, 100)>> /* Wrath */ <<if $gt.happiness <= 40>> <<set $wrathChange to $wrathChange + Math.trunc(Math.clamp($gt.happiness / 5 + 1, 1, 5))>> <</if>> <<if $turnsOfFamine >= 3>> <<set $wrathChange to $wrathChange + $turnsOfFamine>> <</if>> <<set $gt.wrath to Math.clamp($gt.wrath + $wrathChange - $baseWrathDecayRate, 0, 100)>> <</nobr>>
!!The Palace <<set _title to "The " + $gt.title>> <<nobr>> <<button "Servants">><<set $palaceLastVisited to "palaceServants">><<replace "#screen">><<display "palaceServants">><</replace>><</button>> <<button _title>><<set $palaceLastVisited to "palaceGiant">><<replace "#screen">><<display "palaceGiant">><</replace>><</button>> <<button "Upgrades">><<set $palaceLastVisited to "palaceUpgrades">><<replace "#screen">><<display "palaceUpgrades">><</replace>><</button>> <</nobr>> <span id="screen"><<display $palaceLastVisited>></span> [[ [B]ack|mainWindow]]
!!The Farms <<nobr>> <<button "Fields">><<set $farmsLastVisited to "farmsFields">><<replace "#screen">><<display "farmsFields">><</replace>><</button>> <<button "Workers">><<set $farmsLastVisited to "farmsWorkers">><<replace "#screen">><<display "farmsWorkers">><</replace>><</button>> <<button "Upgrades">><<set $farmsLastVisited to "farmsUpgrades">><<replace "#screen">><<display "farmsUpgrades">><</replace>><</button>> <</nobr>> <span id="screen"><<display $farmsLastVisited>></span> [[ [B]ack|mainWindow]]
!!The City <<nobr>><<button "Service">><<set $cityLastVisited to "cityService">><<replace "#screen">><<display "cityService">><</replace>><</button>> <<button Finances>><<set $cityLastVisited to "cityFinances">><<replace "#screen">><<display "cityFinances">><</replace>><</button>> <<button "Trade">><<set $cityLastVisited to "cityTrade">><<replace "#screen">><<display "cityTrade">><</replace>><</button>> <<button "Buildings">><<set $cityLastVisited to "cityBuildings">><<replace "#screen">><<display "cityBuildings">><</replace>><</button>> <<button "Demographics">><<set $cityLastVisited to "cityDemo">><<replace "#screen">><<display "cityDemo">><</replace>><</button>> <</nobr>> <span id="screen"><<display $cityLastVisited>></span> [[ [B]ack|mainWindow]]
!!The Labs <<nobr>> <<button "Scientists">><<set $techLastVisited to "techScientists">><<replace "#screen">><<display "techScientists">><</replace>><</button>> <<button "Research">><<set $techLastVisited to "techResearch">><<replace "#screen">><<display "techResearch">><</replace>><</button>> <<button "Upgrades">><<set $techLastVisited to "techUpgrades">><<replace "#screen">><<display "techUpgrades">><</replace>><</button>> <</nobr>> <span id="screen"><<display $techLastVisited>></span> [[ [B]ack|mainWindow]]
It is the year 2347. Three centuries ago, the old world was devastated, its population shattered, its monuments to technology and culture broken and buried. Humanity is a shadow of its former self: Where billions stood, now a sickly few remain. The end of the old world coincided with the emergence of the giants, humans with size to rival the Gods of the ancients. Their origin is unknown, as is their involvement in the fall of the old world. But what happened in the far past has little importance, the planet has a new apex species, and humanity finds itself forced to live in dark holes, or bend the knee and serve their titanic masters, trading freedom for protection from their peers. The world is a fragmented constellation of small kingdoms, controlled by a single giant who rules supreme, and the rare free enclave forever skulking away in the shadows, hoping for another day without giants. You lived in one of these, a free, if spartan existence. That is, until a young giant came, saw, and conquered your little slice of Earth. Seemingly uninterested in the day to day management of their newly aquired domain, the new ruler has tasked you with managing it in their name. You will have to keep the small town you call home from collapsing, and cater to the ever growing needs and desires of your new overlord. The penalty for failure, of course, is a painful death. [[Continue|customization]] [[Skip|mainWindow]]
The $gt.title never revealed to you <<pp>> true name. You never really needed to know, <<p>> prohibited anyone from using anything else than <<pp>> chosen title. <div class="marketGrid"> <div class="market-item"> ''Gender'': <<nobr>> <<sexC>> | <<link "Switch">> <<if $gt.sex == "female">> <<set $gt.sex to "male">> <<set $gt.appearance to "masculine">> <<set $gt.genitals to "male">> <<set $gt.title to "Lord">> <<goto "customization">> <<else>> <<set $gt.sex to "female">> <<set $gt.appearance to "female">> <<set $gt.genitals to "female">> <<set $gt.title to "Lady">> <<goto "customization">> <</if>> <</link>> <</nobr>> </div> <div class="market-item"> ''Name'': <<textbox "$gt.name" "Unknown">> </div> <div class="market-item"> ''Title'': <<nobr>><<if $gt.sex == "female">> <<listbox "$gt.title" autoselect>> <<option "Lady">> <<option "Empress">> <<option "Queen">> <<option "Princess">> <<option "Duchess">> <<option "Giantess">> <<option "Governess">> <<option "Mistress">> <<option "Ruler">> <<option "Overlord">> <<option "Guardian">> <</listbox>> <<else>> <<listbox "$gt.title" autoselect>> <<option "Lord">> <<option "Emperor">> <<option "King">> <<option "Prince">> <<option "Giant">> <<option "Duke">> <<option "Governor">> <<option "Master">> <<option "Ruler">> <<option "Overlord">> <<option "Guardian">> <</listbox>> <</if>><</nobr>> </div> <div class="market-item"> ''Age'': <<listbox "$gt.bioAge" autoselect>> <<option "18" 18>> <<option "21" 21>> <<option "25" 25>> <<option "28" 28>> <</listbox>> </div> <div class="market-item"> ''Ethnicity'': <<listbox "$gt.ethnicity" autoselect>> <<option "caucasian">> <<option "asian">> <<option "black">> <<option "hispanic">> <</listbox>> </div> <div class="market-item"> ''Skin Tone'': <<listbox "$gt.skinColor" autoselect>> <<option "pale">> <<option "fair">> <<option "olive">> <<option "tan">> <<option "brown">> <<option "dark brown">> <</listbox>> </div> <div class="market-item"> ''Hair Color'': <<listbox "$gt.hairColor" autoselect>> <<option "black">> <<option "brown">> <<option "red">> <<option "blonde">> <<option "white">> <</listbox>> </div> <div class="market-item"> ''Eye Color'': <<listbox "$gt.eyeColor" autoselect>> <<option "brown">> <<option "hazel">> <<option "green">> <<option "blue">> <<option "gray">> <</listbox>> </div> <div class="market-item"> ''Appearance'': <<listbox "$gt.appearance" autoselect>> <<option "feminine">> <<option "masculine">> <<option "androgynous">> <</listbox>> </div> <div class="market-item"> ''Genitals'': <<listbox "$gt.genitals" autoselect>> <<option "female">> <<option "male">> <<option "both">> <<option "neither">> <</listbox>> </div> </diV> [[Custom parameters|custom customization]] [[Continue|history]]
While you may have questions about <<pp>> moral fiber, questions that you take care to keep for yourself, you cannot deny <<p>> is a <<if $gt.sex is "female">>beautiful<<else>> handsome<</if>> <<gender>>. What always strikes you the most about <<pp>>, however is <<pp>>: <<nobr>> <<if $physicalTrait != "girth">> <<link "Impressive Girth">> <<set $physicalTrait to "girth">> <<goto "history">> <</link>> <<else>> Impressive Girth <</if>>| <<if $physicalTrait != "muscles">> <<link "Powerful Musculature">> <<set $physicalTrait to "muscles">> <<goto "history">> <</link>> <<else>> Powerful Musculature <</if>>| <<if $gt.sex is "female" or $gt.appearance is "feminine">> <<if $physicalTrait != "chest">> <<link "Generous Chest">> <<set $physicalTrait to "chest">> <<goto "history">> <</link>> <<else>> Generous Chest <</if>> <</if>>| <<if $gt.genitals is "male" or $gt.genitals is "both">> <<if $physicalTrait != "dick">> <<link "Large Member">> <<set $physicalTrait to "dick">> <<goto "history">> <</link>> <<else>> Large Member <</if>>| <</if>> <<if $physicalTrait != "ass">> <<link "Considerable Behind">> <<set $physicalTrait to "ass">> <<goto "history">> <</link>> <<else>> Considerable Behind <</if>> <</nobr>> Before <<p>> came to the town you call home, it was a free territory, one of the last. Everyone knew it was only a matter of time before a giant would claim it from themselves, but they all still hoped your little island of peace would last forever. Of course, it was not the case. The $gt.title is young and small, for a giant. <<pc>> came from the east looking for a place to call <<pp>> own, where <<p>> could grow <<pp>> power in peace, away from the cutthroat life of the more densely populated regions. City name: <<textbox "$city.name" "Dustspring">> [Placeholder for trait selection] <<link "Continue">> <<if $physicalTrait is "girth">> <<set $gt.weight to 75>> <<elseif $physicalTrait is "muscles">> <<set $gt.muscles to 75>> <<elseif $physicalTrait is "chest">> <<set $gt.boobs to 75>> <<elseif $physicalTrait is "dick">> <<set $gt.dick to 75>> <<else>> <<set $gt.ass to 75>> <</if>> <<set $gt.chronoAge to $gt.bioAge>> <<goto "mainWindow">> <</link>>
!!Production and Consumption Reports <<nobr>><<set _title to "The " + $gt.title>> <<button "Finances">><<set $repLastVisited to "repFinances">><<replace "#screen">><<display "repFinances">><</replace>><</button>> <<button "Security">><<set $repLastVisited to "repSecurity">><<replace "#screen">><<display "repSecurity">><</replace>><</button>> <<button "_title">><<set $repLastVisited to "repGiant">><<replace "#screen">><<display "repGiant">><</replace>><</button>> <<button "Food">><<set $repLastVisited to "repFood">><<replace "#screen">><<display "repFood">><</replace>><</button>> <<button "Scrap">><<set $repLastVisited to "repScrap">><<replace "#screen">><<display "repScrap">><</replace>><</button>> <<button "Projects">><<set $repLastVisited to "repProjects">><<replace "#screen">><<display "repProjects">><</replace>><</button>> <</nobr>> <span id="screen"><<display $repLastVisited>></span> [[ [B]ack|mainWindow]]
!!The Workshops <<nobr>> <<button "Engineering">><<set $workshopLastVisited to "workshopEngineering">><<replace "#screen">><<display "workshopEngineering">><</replace>><</button>> <<button "Scavenging Ops">><<set $workshopLastVisited to "workshopScav">><<replace "#screen">><<display "workshopScav">><</replace>><</button>> <<button "Upgrades">><<set $workshopLastVisited to "workshopUpgrades">><<replace "#screen">><<display "workshopUpgrades">><</replace>><</button>> <</nobr>> <span id="screen"><<display $workshopLastVisited>></span> [[ [B]ack|mainWindow]]
<<if $tradeDiff > 0>>Commercial activity has @@color:lightGreen;increased@@ these last few weeks.<<elseif $tradeDiff < 0>>Commercial activity has @@color:red;slowed down@@ these last few weeks.<</if>> The city was able to collect <<print Math.trunc($taxRevenue)>> units of gold in taxes<<if $tariffsRevenue > 0>>, and <<print Math.trunc($tariffsRevenue)>> units of gold in tariffs<</if>>, while upkeep tallied up to <<print Math.trunc($upkeep)>> units of gold. Overall, the city's coffers this month have <<if $income < 0>>shrunk<<else>>grown<</if>> by <<if $income > 0>>@@color:lightGreen;<<print Math.trunc($income)>>@@<<else>>@@color:red;<<print Math.trunc($income)>>@@<</if>> units of gold.
<<nobr>> /* update relevant variables */ <<set $old.trade to $city.trade>> <<set $taxRevenue to 0>> <<set $tariffsRevenue to 0>> <<set $upkeep to 0>> <<set $revenue to 0>> <<set $income to 0>> <<set $tradeDiff to 0>> /* Trade */ /* Each factor sets a desired trade level, which is used to determine a weighted average. Then trade is changed by 10% towards that goal */ <<set _tradeLevel to 0>> <<if $taxLaw >= 2>> <<set _tradeLevel += 0>> <<elseif $taxLaw >= 1.5>> <<set _tradeLevel += 25>> <<elseif $taxLaw >= 1>> <<set _tradeLevel += 50>> <<elseif $taxLaw >= 0.5>> <<set _tradeLevel += 75>> <<elseif $taxLaw >= 0>> <<set _tradeLevel += 100>> <</if>> /* Tariffs have a weight of 2 */ <<if $tariffsLaw >= 2>> <<set _tradeLevel += 0>> <<elseif $tariffsLaw >= 1.5>> <<set _tradeLevel += 50>> <<elseif $tariffsLaw >= 1>> <<set _tradeLevel += 100>> <<elseif $tariffsLaw >= 0.5>> <<set _tradeLevel += 150>> <<elseif $tariffsLaw >= 0>> <<set _tradeLevel += 200>> <</if>> <<set _tradeLevel to _tradeLevel + $city.approval>> /* Safety has a weight of 2 */ <<set _tradeLevel to _tradeLevel + ($city.safety * 2)>> <<set _tradeLevel to _tradeLevel / 6>> <<set $tradeDiff to Math.trunc((_tradeLevel - $city.trade) * 0.1)>> <<set $city.trade to $city.trade + $tradeDiff>> /* taxation */ <<calcTaxes>> <<set $revenue to $revenue + $taxRevenue>> /* tariffs */ <<set _popScaleFactor to $city.pop * 0.0001>> <<set $tariffsRevenue to $city.trade * _popScaleFactor * $tariffsLaw>> <<set $revenue to $revenue + $tariffsRevenue>> /* upkeep */ <<calcWorkerUpkeep>> <<set $upkeep to $upkeep + $workerUpkeep>> /* Final calculation */ <<set $income to $revenue + $upkeep>> <<set $city.money to $city.money + $income>> <</nobr>>
<<if tags().includes('mainWindow') or tags().includes('menu') or tags().includes('report') or tags().includes('turnProcess')>><<print $year>>, <<month>> Turn <<print $turn>> <<calcTaxes>> The $gt.title: Size: <<print Math.trunc($gt.size)>> feet Happiness: <<nobr>> <<if $gt.happiness == 0>> @@color:red;<<print $gt.happiness>>/$servantsSatisfactionCap@@ <<elseif $gt.happiness == $servantsSatisfactionCap>> @@color:lightGreen;<<print $gt.happiness>>/$servantsSatisfactionCap@@ <<else>> <<print $gt.happiness>>/$servantsSatisfactionCap <</if>> <<if $gt.happiness > $old.happiness>> (@@color:lightGreen;<<print $gt.happiness - $old.happiness>>@@) <<elseif $gt.happiness < $old.happiness>> (@@color:red;<<print $gt.happiness - $old.happiness>>@@) <<else>> (@@color:yellow;0@@) <</if>><</nobr>> Favor: $gt.favor Wrath: $gt.wrath <<updateFoodConsumption>><<updateFoodProduction>> $city.name: Population: <<print Math.trunc($city.pop)>> Treasury: <<nobr>> <<if $city.money < 0>> @@color:red;<<print Math.trunc($city.money)>>@@ <<else>> <<print Math.trunc($city.money)>> <</if>> <<if $income > 0>> (@@color:lightGreen;+<<print Math.trunc($income)>>@@) <<elseif $income == 0>> (@@color:yellow;<<print Math.trunc($income)>>@@) <<else>> (@@color:red;<<print Math.trunc($income)>>@@) <</if>> <</nobr>> Approval: <<nobr>> <<if $city.approval == 0>> @@color:red;<<print $city.approval>>/$serviceApprovalCap@@ <<elseif $city.approval == $serviceApprovalCap>> @@color:lightGreen;<<print $city.approval>>/$serviceApprovalCap@@ <<else>> <<print $city.approval>>/$serviceApprovalCap <</if>> <<if $city.approval > $old.approval>> (@@color:lightGreen;+<<print $city.approval - $old.approval>>@@) <<elseif $city.approval < $old.approval>> (@@color:red;<<print $city.approval - $old.approval>>@@) <<else>> (@@color:yellow;0@@) <</if>><</nobr>> Safety: <<nobr>> <<if $city.safety == 0>> @@color:red;<<print $city.safety>>/$guardsSafetyCap@@ <<elseif $city.safety == $guardsSafetyCap>> @@color:lightGreen;<<print $city.safety>>/$guardsSafetyCap@@ <<else>> <<print $city.safety>>/$guardsSafetyCap <</if>> <<if $city.safety > $old.safety>> (@@color:lightGreen;+<<print $city.safety - $old.safety>>@@) <<elseif $city.safety < $old.safety>> (@@color:red;<<print $city.safety - $old.safety>>@@) <<else>> (@@color:yellow;0@@) <</if>><</nobr>> Trade: <<nobr>> <<if $city.trade == 0>> @@color:red;<<print $city.trade>>/100@@ <<elseif $city.trade == 100>> @@color:lightGreen;<<print $city.trade>>/100@@ <<else>> <<print $city.trade>>/100 <</if>> <<if $city.trade > $old.trade>> (@@color:lightGreen;+<<print $city.trade - $old.trade>>@@) <<elseif $city.trade < $old.trade>> (@@color:red;<<print $city.trade - $old.trade>>@@) <<else>> (@@color:yellow;0@@) <</if>><</nobr>> Food: <<if $foodProduced - $foodConsumed < 0>>@@color:red;<<print $foodProduced - $foodConsumed>>@@<<elseif $foodProduced - $foodConsumed == 0>>@@color:yellow;<<print $foodProduced - $foodConsumed>>@@<<else>>@@color:lightGreen;+<<print $foodProduced - $foodConsumed>>@@<</if>> | $city.foodStored Scrap: $city.scrap <</if>>
<<widget areReqMatched>><<nobr>> <<updateFoodConsumption>> <<updateServantsRequired>> <<updateGuardsRequired>> <<updateServiceRequired>> <<set $areReqMatched to true>> <<if $farmersRequired > $workers.farmers>> <<set $areReqMatched to false>> <<elseif $servantsRequired > $workers.servants>> <<set $areReqMatched to false>> <<elseif $serviceRequired > $workers.service>> <<set $areReqMatched to false>> <<elseif $soldiersRequired > $workers.soldiers>> <<set $areReqMatched to false>> <</if>> <</nobr>><</widget>> <<widget month>><<nobr>> <<if $month is 1>> January <<elseif $month is 2>> February <<elseif $month is 3>> March <<elseif $month is 4>> April <<elseif $month is 5>> May <<elseif $month is 6>> June <<elseif $month is 7>> July <<elseif $month is 8>> August <<elseif $month is 9>> September <<elseif $month is 10>> October <<elseif $month is 11>> November <<elseif $month is 12>> December <<else>> Error <</if>> <</nobr>><</widget>> <<widget assignWorkersForTasks>><<nobr>> <<if $taskDebuff === "increased guards numbers">> <<if $workers.freePops >= $guardsRequired - $workers.guards>> <<set $workers.guards to $guardsRequired>> <<set $workers.freePops to $workers.freePops - $guardsRequired>> <<elseif $workers.freePops > 0>> <<set $workers.guards to $workers.freePops>> <<set $workers.freePops to 0>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <<else>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <</if>> <</if>> <<if $taskDebuff === "increased servants numbers">> <<if $workers.freePops >= $servantsRequired - $workers.servants>> <<set $workers.servants to $servantsRequired>> <<set $workers.freePops to $workers.freePops - $servantsRequired>> <<elseif $workers.freePops > 0>> <<set $workers.servants to $workers.freePops>> <<set $workers.freePops to 0>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <<else>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <</if>> <</if>> <<if $taskDebuff === "increased service numbers">> <<if $workers.freePops >= $serviceRequired - $workers.service>> <<set $workers.service to $serviceRequired>> <<set $workers.freePops to $workers.freePops - $serviceRequired>> <<elseif $workers.freePops > 0>> <<set $workers.service to $workers.freePops>> <<set $workers.freePops to 0>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <<else>> <<set $taskWorkerMessage to "Not enough free workers to fulfill the request. Reassign some, or hope for the best">> <</if>> <</if>> <</nobr>><</widget>>
[WiP] [[ [B]ack|mainWindow]]
<<nobr>> /* Update relevant variables */ <<updateGuardsRequired>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.guards++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.guards to $workers.guards + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.guards to $workers.guards + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.guards to $workers.guards + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.guards to $workers.guards + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>>Remove: <<if $workers.guards >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.guards-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.guards >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.guards to $workers.guards - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.guards >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.guards to $workers.guards - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.guards >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.guards to $workers.guards - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.guards >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.guards to $workers.guards - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $guardsRequired > $workers.guards && $workers.freePops >= ($guardsRequired - $workers.guards)>> <<link "Auto">> <<if $workers.freePops > ($guardsRequired - $workers.guards)>> <<set $workers.freePops to $workers.freePops - ($guardsRequired - $workers.guards)>> <<set $workers.guards to $guardsRequired>> <<goto "workers">> <<else>> <<set $workers.guards to $workers.guards + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</link>> <<else>> Auto <</if>>| <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.guards to $workers.guards + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.guards > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.guards>> <<set $workers.guards to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<nobr>><<if $approvalChange > 0>>The citizens approve of your administration, your popularity has @@color:lightGreen;increased@@ this month<<elseif $approvalChange < 0>>The citizens are not happy about your policies, your popularity has @@color:red;decreased@@ this month<<else>>There were @@color:yellow;no major changes@@ to your popularity this month<</if>>.<</nobr>> <<nobr>>The city this month has <<if $safetyChange > 0>>become @@color:lightGreen;more secure@@<<else>>become @@color:red;less secure@@<</if>>. <<if $guardsRequired < $workers.guards>>There are plenty of guards patrolling the city's borders.<<if $safety < $guardsSafetyCap>> Soon bandits and roaming animals will become a distant threat.<</if>><<elseif $guardsRequired == $workers.guards>>There are enough guards to guarantee a decent amount of protection to the citizens.<<if $safety < $guardsSafetyCap>> The threat in the countryside and the slums will slowly disappear.<</if>><<else>>There are not enough guards to protect the city and its land, the situation is bound to worsen eventually.<</if>><</nobr>>
<<nobr>> /* updating relevant variables */ <<updateguardsRequired>> <<updateServiceRequired>> <<set $safetyChange to 0>> <<set $approvalChange to 0>> <<set $old.safety to $city.safety>> <<set $old.approval to $city.approval>> /* safety */ <<set _safetyRating to Math.clamp($workers.guards / $guardsRequired, 0, 2)>> /* _safetyRating determines how fast safety grows, from 0 (with 0 guards) to 2 (with double the required amount or more) */ <<if $city.safety < _safetyRating * $guardsSafetyCap>> <<set $safetyChange to _safetyRating * 5>> <<elseif $city.safety != _safetyRating * $guardsSafetyCap && $city.safety > 0>> <<set $safetyChange to -1 * $baseSafetyDecayRate>> <</if>> /* approval */ <<set _approvalRating to Math.clamp($workers.service / $serviceRequired, 0, 2)>> /* _approvalRating determines how fast approval grows, from 0 (with 0 service workers) to double (with double the required amount or more) */ <<if $city.approval < _approvalRating * $serviceApprovalCap>> <<set $approvalChange to _approvalRating * 5>> <<elseif $city.approval != _approvalRating * $serviceApprovalCap && $city.approval > 0>> <<set $approvalChange to -1 * $baseSafetyDecayRate>> <</if>> /* Famine */ <<if $foodScarcity>> <<set _lossDueToFoodScarcity to Math.clamp($foodConsumed / ($city.foodStored + $foodProduced) * 10, 0, 20)>> <<set $approvalChange to $approvalChange - _lossDueToFoodScarcity>> <</if>> /* Final calculation */ <<set $approvalChange to Math.trunc($approvalChange)>> <<set $safetyChange to Math.trunc($safetyChange)>> <<set $city.safety to Math.trunc(Math.clamp($city.safety + $safetyChange,0, $guardsSafetyCap))>> <<set $city.approval to Math.trunc(Math.clamp($city.approval + $approvalChange, 0, $serviceApprovalCap))>> <</nobr>>
<<widget checkWorkerCount>><<nobr>> <<set _expectedWorkerCount to Math.trunc($city.pop / 100)>> <<set _workerCount to $workers.freePops + $workers.farmers + $workers.scavengers + $workers.engineers + $workers.scientists + $workers.servants + $workers.service + $workers.guards>> <<if _workerCount != _expectedWorkerCount>> @@color:red;ERROR: unexpected worker count@@ Expected: <<print _expectedWorkerCount>> Obtained: <<print _workerCount>> <</if>> <</nobr>><</widget>>
<<nobr>> /* Update relevant variables */ <<updateServantsRequired>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.servants++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.servants to $workers.servants + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.servants to $workers.servants + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.servants to $workers.servants + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.servants to $workers.servants + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>>Remove: <<if $workers.servants >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.servants-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.servants >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.servants to $workers.servants - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.servants >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.servants to $workers.servants - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.servants >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.servants to $workers.servants - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.servants >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.servants to $workers.servants - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $servantsRequired > $workers.servants && $workers.freePops >= ($servantsRequired - $workers.servants)>> <<link "Auto">> <<if $workers.freePops > ($servantsRequired - $workers.servants)>> <<set $workers.freePops to $workers.freePops - ($servantsRequired - $workers.servants)>> <<set $workers.servants to $servantsRequired>> <<goto "workers">> <<else>> <<set $workers.servants to $workers.servants + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</link>> <<else>> Auto <</if>>| <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.servants to $workers.servants + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.servants > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.servants>> <<set $workers.servants to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<nobr>> /* Update relevant variables */ <<updateServiceRequired>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.service++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.service to $workers.service + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.service to $workers.service + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.service to $workers.service + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.service to $workers.service + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>>Remove: <<if $workers.service >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.service-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.service >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.service to $workers.service - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.service >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.service to $workers.service - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.service >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.service to $workers.service - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.service >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.service to $workers.service - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $serviceRequired > $workers.service && $workers.freePops >= ($serviceRequired - $workers.service)>> <<link "Auto">> <<if $workers.freePops > ($serviceRequired - $workers.service)>> <<set $workers.freePops to $workers.freePops - ($serviceRequired - $workers.service)>> <<set $workers.service to $serviceRequired>> <<goto "workers">> <<else>> <<set $workers.service to $workers.service + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</link>> <<else>> Auto <</if>>| <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.service to $workers.service + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.service > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.service>> <<set $workers.service to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<nobr>> <<link "Add 1">> <<if $abandonFields >= 1>> <<set $abandonFields to $abandonFields - 1>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + 1>> <<goto "farms">> <</if>> <</link>> | <<link "Add 5">> <<set _fields to 5>> <<if $abandonFields >= _fields>> <<set $abandonFields to $abandonFields - _fields>> <<goto "farms">> <<elseif $abandonFields > 0>> <<set _fields to _fields - $abandonFields>> <<set $abandonFields to 0>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <</if>> <</link>> | <<link "Add 10">> <<set _fields to 10>> <<if $abandonFields >= _fields>> <<set $abandonFields to $abandonFields - _fields>> <<goto "farms">> <<elseif $abandonFields > 0>> <<set _fields to _fields - $abandonFields>> <<set $abandonFields to 0>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <</if>> <</link>> | <<link "Add 20">> <<set _fields to 20>> <<if $abandonFields >= _fields>> <<set $abandonFields to $abandonFields - _fields>> <<goto "farms">> <<elseif $abandonFields > 0>> <<set _fields to _fields - $abandonFields>> <<set $abandonFields to 0>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <</if>> <</link>> | <<link "Add 50">> <<set _fields to 50>> <<if $abandonFields >= _fields>> <<set $abandonFields to $abandonFields - _fields>> <<goto "farms">> <<elseif $abandonFields > 0>> <<set _fields to _fields - $abandonFields>> <<set $abandonFields to 0>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <</if>> <</link>> | <<link "Add 100">> <<set _fields to 100>> <<if $abandonFields >= _fields>> <<set $abandonFields to $abandonFields - _fields>> <<goto "farms">> <<elseif $abandonFields > 0>> <<set _fields to _fields - $abandonFields>> <<set $abandonFields to 0>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <<else>> <<set $clearFields to $clearFields + _fields>> <<goto "farms">> <</if>> <</link>> | <<if (Math.trunc($foodConsumed / $baseFarmProd) + ($clearFields - $abandonFields)) != $city.land>> <<link "Match Requirement">> <<set $clearFields to 0>> <<set $abandonFields to 0>> <<set _fields to Math.trunc($foodConsumed / $baseFarmProd)>> <<if $city.land > _fields>> <<set $abandonFields to ($city.land - _fields)>> <<goto "farms">> <<else>> <<set $clearFields to ($city.land - _fields)>> <<goto "farms">> <</if>> <</link>> <<else>> Match requirement <</if>> <</nobr>> <<nobr>> <<if $city.land >= 1 + $abandonFields>> <<link "Remove 1">> <<set _fields to 1>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 1 <</if>> | <<if $city.land >= 5 + $abandonFields>> <<link "Remove 5">> <<set _fields to 5>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 5 <</if>> | <<if $city.land >= 10 + $abandonFields>> <<link "Remove 10">> <<set _fields to 10>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 10 <</if>> | <<if $city.land >= 20 + $abandonFields>> <<link "Remove 20">> <<set _fields to 20>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 20 <</if>> | <<if $city.land >= 50 + $abandonFields>> <<link "Remove 50">> <<set _fields to 50>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 50 <</if>> | <<if $city.land >= 100 + $abandonFields>> <<link "Remove 100">> <<set _fields to 100>> <<if $clearFields >= _fields>> <<set $clearFields to $clearFields - _fields>> <<goto "farms">> <<elseif $clearFields > 0>> <<set _fields to _fields - $clearFields>> <<set $clearFields to 0>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <<else>> <<set $abandonFields to $abandonFields + _fields>> <<goto "farms">> <</if>> <</link>> <<else>> Remove 100 <</if>> <</nobr>>
!!The Barracks <<nobr>> <<button "Guards">><<set $secLastVisited to "secGuards">><<replace "#screen">><<display "secGuards">><</replace>><</button>> <<button "Army">><<set $secLastVisited to "secArmy">><<replace "#screen">><<display "secArmy">><</replace>><</button>> <<button "Upgrades">><<set $secLastVisited to "secUpgrades">><<replace "#screen">><<display "secUpgrades">><</replace>><</button>> <</nobr>> <span id="screen"><<display $secLastVisited>></span> [[ [B]ack|mainWindow]]
<<nobr>> /* quick update to relevant variables */ <<updateFoodConsumption>> /* buttons */ <<if $workers.freePops >= 1 && ($workers.farmers + 1) <= $city.land>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.farmers++>> <<goto "farms">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5 && ($workers.farmers + 5) <= $city.land>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.farmers to $workers.farmers + 5>> <<goto "farms">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10 && ($workers.farmers + 10) <= $city.land>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.farmers to $workers.farmers + 10>> <<goto "farms">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20 && ($workers.farmers + 20) <= $city.land>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.farmers to $workers.farmers + 20>> <<goto "farms">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50 && ($workers.farmers + 50) <= $city.land>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.farmers to $workers.farmers + 50>> <<goto "farms">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100 && ($workers.farmers + 100) <= $city.land>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.farmers to $workers.farmers + 100>> <<goto "farms">> <</link>> <<else>> Add 100 <</if>>| <<if $farmersRequired > $workers.farmers && $workers.freePops >= $farmersRequired && $workers.farmers < $city.land && $farmersRequired <= $city.land>> <<link "Match food consumption">> <<if $workers.freePops > ($farmersRequired - $workers.farmers)>> <<set $workers.freePops to $workers.freePops - ($farmersRequired - $workers.farmers)>> <<set $workers.farmers to $farmersRequired>> <<goto "farms">> <<else>> <<set $workers.farmers to $workers.farmers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "farms">> <</if>> <</link>> <<else>> Match food consumption <</if>>| <<if $workers.freePops >= 1 && $workers.farmers < $city.land>> <<link "Fill">> <<if $workers.freePops > ($city.land - $workers.farmers)>> <<set $workers.freePops to $workers.freePops - ($city.land - $workers.farmers)>> <<set $workers.farmers to $city.land>> <<goto "farms">> <<else>> <<set $workers.farmers to $workers.farmers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "farms">> <</if>> <</link>> <<else>> Fill <</if>> <</nobr>> <<nobr>> <<if $workers.farmers >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.farmers-->> <<goto "farms">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.farmers >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.farmers to $workers.farmers - 5>> <<goto "farms">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.farmers >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.farmers to $workers.farmers - 10>> <<goto "farms">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.farmers >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.farmers to $workers.farmers - 20>> <<goto "farms">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.farmers >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.farmers to $workers.farmers - 50>> <<goto "farms">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.farmers >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.farmers to $workers.farmers - 100>> <<goto "farms">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.farmers > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.farmers>> <<set $workers.farmers to 0>> <<goto "farms">> <</link>> <<else>> Empty <</if>> <</nobr>>
<<nobr>> <<if $workers.freePops < Math.trunc($city.pop / 100)>> <<link "Unassign All">> <<set $workers.freePops to Math.trunc($city.pop / 100)>> <<set $workers.farmers to 0>> <<set $workers.service to 0>> <<set $workers.scavengers to 0>> <<set $workers.servants to 0>> <<set $workers.engineers to 0>> <<set $workers.guards to 0>> <<set $workers.scientists to 0>> <<goto "workers">> <</link>> <<else>> Unassign All <</if>> <</nobr>> <<nobr>> <<if $workers.freePops > 0>> <<areReqMatched>> <</if>> <<if $areReqMatched is false && $workers.freePops > 0>> <<link "Autoassign">> <<if $farmersRequired > $workers.farmers>> <<if $workers.freePops > ($farmersRequired - $workers.farmers)>> <<set $workers.freePops to $workers.freePops - ($farmersRequired - $workers.farmers)>> <<set $workers.farmers to $farmersRequired>> <<goto "workers">> <<else>> <<set $workers.farmers to $workers.farmers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</if>> <<if $servantsRequired > $workers.servants && $workers.freePops > 0>> <<if $workers.freePops > ($servantsRequired - $workers.servants)>> <<set $workers.freePops to $workers.freePops - ($servantsRequired - $workers.servants)>> <<set $workers.servants to $servantsRequired>> <<goto "workers">> <<else>> <<set $workers.servants to $workers.servants + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</if>> <<if $serviceRequired > $workers.service && $workers.freePops > 0>> <<if $workers.freePops > ($serviceRequired - $workers.service)>> <<set $workers.freePops to $workers.freePops - ($serviceRequired - $workers.service)>> <<set $workers.service to $serviceRequired>> <<goto "workers">> <<else>> <<set $workers.service to $workers.service + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</if>> <<if $guardsRequired > $workers.guards && $workers.freePops > 0>> <<if $workers.freePops > ($guardsRequired - $workers.guards)>> <<set $workers.freePops to $workers.freePops - ($guardsRequired - $workers.guards)>> <<set $workers.guards to $guardsRequired>> <<goto "workers">> <<else>> <<set $workers.guards to $workers.guards + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</if>> <</if>> <</link>> <<else>> Autoassign <</if>> <</nobr>>
<<updateAllRequired>> <div class="grid-container"> <div class="grid-item"> ''Farmers'': @@color:yellow;<<print $workers.farmers>>@@/@@color:yellow;<<print $farmersRequired>>@@. Max farmers: $city.land <<display "farm buttons">> </div> <div class="grid-item"> ''Scavenging'': Collecting scrap from the old world ruins. Currently, $workers.scavengers worker units are assigned to scavenge duty. They can produce around <<print Math.trunc($workers.scavengers * $baseScrapProd)>> units of scrap per month. <<display "scrap buttons">> </div> <div class="grid-item"> ''Military'': To effectively protect the city and its rural land, you need about <<print Math.trunc($city.land / $baseLandPerSoldier) + Math.trunc($city.pop / $basePopPerSoldier)>> squads of soldiers. Currently, $workers.soldiers squads are out patrolling. <<display "soldier buttons">> </div> <div class="grid-item"> ''City Services'': Service workers are workers dedicated to the wellbeing of the citizens: Cleaners, cooks, teachers, doctors, and more. The city needs <<print Math.trunc($city.pop / $basePopPerService)>> service worker teams to function well. Currently, it employs <<print $workers.service>>. <<display "service buttons">> </div> <div class="grid-item"> ''The $gt.title Servants'': For <<pp>> personal care, the $gt.title requires <<print Math.trunc($gt.size / $baseFeetPerServant)>> squads of servants. Currently $workers.servants are assigned to <<pp>>. <<display "servant buttons">> </div> <div class="grid-item"> scientists </div> <div class="grid-item"> engineers </div> <div class="grid-item"> Free worker units: @@color:yellow;<<print $workers.freePops>>@@ <<display "general worker buttons">> </div> </div>
<<set $Strength to 5>> <<numberinput "$Strength" $Strength 1 20>> <<set $opacity to 1>> <<numberslider "$opacity" $opacity 0 10 0.5>> <<set $StatPool to 30, $ST to 1, $DX to 10, $IQ to 1, $HT to 1>> You have <span id="stat-pool">$StatPool</span> points remaining to allocate. <<numberpool "$StatPool">> |''ST:''|<<numberinput "$ST" $ST 1 $DX>>| |''DX:''|<<numberinput "$DX" $DX 1 20>>| |''IQ:''|<<numberinput "$IQ" $IQ 1 20>>| |''HT:''|<<numberinput "$HT" $HT 1 20>>| <<onchange>> <<replace "#stat-pool">>$StatPool<</replace>> <</numberpool>>
<<one 'keyup'>> /* C */ <<which 67>> <<if tags().includes('report')>> <<goto "postTurn">> <</if>> /* Enter */ <<which 13>> <<if tags().includes('mainWindow')>> <<goto "preTurn">> <</if>> /* B */ <<which 66>> <<if tags().includes('menu')>> <<goto "mainWindow">> <</if>> /* 1 to 9 */ <<which 49>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "palace">> <</if>> <<which 50>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "laws">> <</if>> <<which 51>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "security">> <</if>> <<which 52>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "city">> <</if>> <<which 53>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "farms">> <</if>> <<which 54>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "industry">> <</if>> <<which 55>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "tech">> <</if>> <<which 56>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "reports">> <</if>> <<which 57>> <<if tags().includes('mainWindow') or tags().includes('menu')>> <<goto "workers">> <</if>> <</one>>
/* <<if tags().includes('mainWindow')>> <<link "End Turn">> <<goto "turnHandler">> <</link>> <</if>> */
<div class="title"> Game Over! </div> <div class="subtitle"> <<if $gameover.pop == 1>> $city.name no longer exist, its population lays dead or fled. The $gt.title makes quick work of you, then leaves, looking for greener pastures to settle on. <<elseif $gameover.wrath == 1>> Your incompetence, or bad luck, brought the $gt.title to exasperation. Your trial was quick, your sentence quicker. Your life is over. <<elseif $gameover.coup == 1>> The anger int he streets towards you have given the perfect opportunity to a dissident group to successfully carry out a coup d'etat against you. You were quickly replaced and exiled. Your name would soon be forgotten. <</if>> <<link "Restart">> <<script>>Engine.restart()<</script>> <</link>> </div>
!!End Of Month Report <<nobr>> <<button "General">><<replace "#report">><br><<display "generalReport">><</replace>><</button>> <<button "The Palace">><<replace "#report">>''<<print $gt.title>>'': <br><<display "gtReport">><</replace>><</button>> <<button "Population">><<replace "#report">>''Population'': <br><<display "popReport">><</replace>><</button>> <<button "Security">><<replace "#report">>''Security'': <br><<display "securityReport">><</replace>><</button>> <<button "Finances">><<replace "#report">>''Finance'': <br><<display "financeReport">><</replace>><</button>> <<button "Food">><<replace "#report">>''Food'': <br><<display "foodReport">><</replace>><</button>> <<button "Scavenging">><<replace "#report">>''Scavenging'': <br><<display "scrapReport">><</replace>><</button>> <</nobr>> <span id="report"> <<display "generalReport">> </span>
<table style="width:100%; border-width: 1px 0px; border-style: solid; border-color: white;"> <tr style=" border-width: 1px 0px; border-style: solid ; border-color: white;;"> <th style="width:25%">''The <<print $gt.title>>'':</th> <th style="width:25%">''Population'':</th> <th style="width:25%">''security'':</th> <th style="width:25%">''Finances'':</th> </tr> <tr style=" border-width: 1px 0px; border-style: solid ; border-color: white;;"> <td><<nobr>> Growth: @@color:lightGreen;+$growth@@ <<if $satisfactionChange > 0>> <br>Happiness: @@color:lightGreen;+<<print $satisfactionChange>>@@ <<elseif $satisfactionChange < 0>> <br>Happiness: @@color:red;<<print $satisfactionChange>>@@ <</if>> <<if $favorChange > 0>> <br>Favor: @@color:lightGreen;+<<print $favorChange>>@@ <<elseif $favorChange < 0>> <br>Favor: @@color:red;<<print $favorChange>>@@ <</if>> <<if $wrathChange > 0>> <br>Wrath: @@color:red;+<<print $wrathChange>>@@. <<elseif $wrathChange < 0>> <br>Wrath: @@color:lightGreen;<<print $wrathChange>>@@. <</if>> <</nobr>></td> <td><<nobr>> <<if $popDiff >= 0>> Citizens: @@color:lightGreen;+<<print $popDiff>>@@ <<elseif $popDiff < 0>> <br>Citizens: @@color:red;<<print $popDiff>>@@ <</if>> <<if $workerDiff != 0>> <<if $workerDiff > 0>> <br>Worker units: @@color:lightGreen;+<<print $workerDiff>>@@ <<elseif $workerDiff < 0>> <br>Worker Units: @@color:red;<<print $workerDiff>>@@ <</if>> <</if>> <</nobr>></td> <td><<nobr>> <<if $approvalChange >= 0>> Approval: @@color:lightGreen;+<<print $approvalChange>>@@ <<elseif $approvalChange < 0>> Approval: @@color:red;<<print $approvalChange>>@@ <</if>> <<if $safetyChange > 0>> <br>Safety: @@color:lightGreen;+<<print $safetyChange>>@@ <<elseif $safetyChange < 0>> <br>Safety: @@color:red;<<print $safetyChange>>@@ <</if>> <</nobr>></td> <td><<nobr>> <<if $income >= 0>> Treasury: @@color:lightGreen;+<<print Math.trunc($income)>>@@ <<elseif $income < 0>> Treasury: @@color:red;<<print $income>>@@ <</if>> <</nobr>></td> </tr> <tr style=" border-width: 1px 0px; border-style: solid ; border-color: white;;"> <th>''Food'':</th> <th>''Engineering'':</th> <th>''Research'':</th> <th>''Tasks'':</th> </tr> <tr style=" border-width: 1px 0px; border-style: solid ; border-color: white;;"> <td><<nobr>> <<if $foodProduced - $foodConsumed < 0>> Balance: @@color:red;<<print $foodProduced - $foodConsumed>> <<elseif $foodProduced - $foodConsumed == 0>> Balance: @@color:yellow;<<print $foodProduced - $foodConsumed>> <<else>> Balance: @@color:lightGreen;<<print $foodProduced - $foodConsumed>> <</if>> <<if $foodConsumed > $foodProduced>> <br>Stored: <<if Math.trunc($city.foodStored / ($foodConsumed - $foodProduced)) == 1>> @@color:yellow;1@@ month <<else>>@@color:yellow;<<print Math.trunc($city.foodStored / ($foodConsumed - $foodProduced))>>@@ months<</if>> <</if>> <br>Lost: <<if $foodLost > 0>>@@color:red;$foodLost@@<<else>>@@color:lightGreen;$foodLost@@<</if>> <<if $old.land < $city.land>> <br>@@color:yellow;<<print $city.land - $old.land>>@@ fields cleared <<elseif $old.land > $city.land>> <br>@@color:yellow;<<print $old.land - $city.land>>@@ fields abandoned <</if>> <</nobr>></td> <td><<nobr>> Scrap: @@color:yellow;<<print Math.trunc($workers.scavengers * $baseScrapProd)>>@@ units. <<if $uIDCompleted > 0>> <br>$finishedProject was completed. <<else>> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<if $constructionQueue[_i].active>> <br>Current project: <<print $constructionQueue[_i].name>> ($constructionQueue[_i].progress/$constructionQueue[_i].cost) <</if>> <</for>> <</if>> <</nobr>></td> <td><<nobr>> <<if $rIDCompleted > 0>> $finishedResearch was completed. <<else>> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<if $researchQueue[_i].active>> Current project: <<print $researchQueue[_i].name>> ($researchQueue[_i].progress/$researchQueue[_i].cost) <</if>> <</for>> <</if>> <</nobr>></td> <td><<nobr>> <<if !($monthlyTask is "none")>> <<if $taskCompleted is "yes">> @@color:lightGreen;Task completed@@ <<elseif $taskCompleted is "half">> @@color:yellow;Task partially completed@@ <<else>> @@color:red;Task not completed@@ <</if>> <</if>> <</nobr>></td> </tr> </table>
''Farmers'': The city currently employs @@color:yellow;<<print $workers.farmers>>@@ farmers. They can produce @@color:yellow;<<print Math.trunc($workers.farmers * $baseFarmProd)>>@@ units of food each month. The city need about @@color:yellow;<<print $foodConsumed>>@@ units of food each month. <<display "farmer buttons">>
''Avaliable'':<<nobr>> <<if !($pavedRoads.completed)>> <<if $city.money >= ($upgradeCostMult * 100) && !$pavedRoads.inQueue>> <br><<link "Paved Roads">> <<set $pavedRoads.inQueue to true>> <<set $constructionQueue.push($pavedRoads)>> <<set $city.money to $city.money - ($upgradeCostMult * 100)>> <<updateActive>> <<goto "farms">> <</link>> <br> //The rural land around the city could really use some improved roads, it would certainly benefit your farmers// <br> //+0.2 food per farmer// <<elseif $pavedRoads.inQueue>> <br>Paved Roads: In Construction <<else>> <br>Paved Roads: [Insufficient Funds] <</if>> <</if>> <</nobr>> ''Completed'':<<nobr>> <<if $pavedRoads.completed>> <br>Paved Roads: <br> The rural land around the city can count on on a sturdy network of roads, facilitating travel. <br> //+0.2 food per farmer// <</if>> <</nobr>>
''Fields'': The city controls @@color:yellow;<<print $city.land>>@@ fertile fields. Each can employ a unit of workers, but you will need an extra unit of guards every <<print $baseLandPerGuard>> fields, to protect your territory effectively. Currently, our fields require @@color:yellow;<<print Math.trunc($city.land / $baseLandPerGuard)>>@@ guards in total. With the current farming technology, the city needs @@color:yellow;<<print Math.trunc($foodConsumed / $baseFarmProd)>>@@ fields to feed its current population. You can schedule the clearing of new fields, or the abandonment of currently occupied ones. It will take a month for the work to be completed. <<display "fields buttons">> <<nobr>> <<if $clearFields > 0>>You are currently preparing @@color:yellow;<<print $clearFields>>@@ new fields<<elseif $abandonFields > 0>>You are currently planning to abandon @@color:yellow;<<print $abandonFields>>@@ fields. <</if>> <<if $clearFields != 0 or $abandonFields != 0>> <<link "CANCEL">> <<set $clearFields to 0>> <<set $abandonFields to 0>> <<goto "farms">> <</link>> <</if>> <</nobr>>
/* Game Over states */ <<if $city.pop < 100>> /* If city goes under 100, the game is over */ gameover <<set $gameover.pop to 1>> <<goto "gameover">> <<elseif $gt.wrath >= 100>> /* With wrath at 100, 15% chance of dying + 1% for every point above 100 */ <<set _roll to random(1,100)>> <<if _roll < 15 + $gt.wrath>> <<set $gameover.wrath to 1>> <<goto "gameover">> <</if>> <<elseif $city.approval <= 0>> /* With approval at 0, 15% chance of dying + 1% for very point of safety below 50 */ <<set _roll to random(1,100)>> <<if _roll < 15 + Math.clamp(50 - $city.safety,0, 100)>> <<set $gameover.coup to 1>> <<goto "gameover">> <</if>> <<else>> /* Fix for the multiple turns in a row bug */ <<timed 0.1s>> <<goto "turnHandler">> <</timed>> <</if>>
''Engineers'': The city currently employs @@color:yellow;<<print $workers.engineers>>@@ engineers. Each engineer contributes $baseProgressPerEngineer point of progress to the current project. <<display "engineer buttons">> <<display "constructionQueue">>
''Scavengers'': The city currently employs @@color:yellow;<<print $workers.scavengers>>@@ farmers. They can produce @@color:yellow;<<print Math.trunc($workers.scavengers * $baseScrapProd)>>@@ units of food each month. The city need about @@color:yellow;<<print $scrapConsumed>>@@ units of scrap each month. <<display "scavenger buttons">>
[WiP]
<<nobr>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.scavengers++>> <<goto "workers">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.scavengers to $workers.scavengers + 5>> <<goto "workers">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.scavengers to $workers.scavengers + 10>> <<goto "workers">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.scavengers to $workers.scavengers + 20>> <<goto "workers">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.scavengers to $workers.scavengers + 50>> <<goto "workers">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.scavengers to $workers.scavengers + 100>> <<goto "workers">> <</link>> <<else>> Add 100 <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.scavengers to $workers.scavengers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.scavengers >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.scavengers-->> <<goto "workers">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.scavengers >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.scavengers to $workers.scavengers - 5>> <<goto "workers">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.scavengers >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.scavengers to $workers.scavengers - 10>> <<goto "workers">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.scavengers >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.scavengers to $workers.scavengers - 20>> <<goto "workers">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.scavengers >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.scavengers to $workers.scavengers - 50>> <<goto "workers">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.scavengers >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.scavengers to $workers.scavengers - 100>> <<goto "workers">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.scavengers > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.scavengers>> <<set $workers.scavengers to 0>> <<goto "workers">> <</link>> <<else>> Empty <</if>> <</nobr>>
<<nobr>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.engineers++>> <<goto "workers">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.engineers to $workers.engineers + 5>> <<goto "workers">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.engineers to $workers.engineers + 10>> <<goto "workers">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.engineers to $workers.engineers + 20>> <<goto "workers">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.engineers to $workers.engineers + 50>> <<goto "workers">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.engineers to $workers.engineers + 100>> <<goto "workers">> <</link>> <<else>> Add 100 <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.engineers to $workers.engineers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.engineers >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.engineers-->> <<goto "workers">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.engineers >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.engineers to $workers.engineers - 5>> <<goto "workers">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.engineers >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.engineers to $workers.engineers - 10>> <<goto "workers">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.engineers >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.engineers to $workers.engineers - 20>> <<goto "workers">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.engineers >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.engineers to $workers.engineers - 50>> <<goto "workers">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.engineers >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.engineers to $workers.engineers - 100>> <<goto "workers">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.engineers > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.engineers>> <<set $workers.engineers to 0>> <<goto "workers">> <</link>> <<else>> Empty <</if>> <</nobr>>
<<nobr>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.engineers++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.engineers to $workers.engineers + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.engineers to $workers.engineers + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.engineers to $workers.engineers + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.engineers to $workers.engineers + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> Remove: <<if $workers.engineers >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.engineers-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.engineers >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.engineers to $workers.engineers - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.engineers >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.engineers to $workers.engineers - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.engineers >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.engineers to $workers.engineers - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.engineers >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.engineers to $workers.engineers - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.engineers to $workers.engineers + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.engineers > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.engineers>> <<set $workers.engineers to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
''Construction Queue'':<<nobr>> <<if $constructionQueue.length == 0>> //Empty// <<else>> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<capture _i>> <br> <<print $constructionQueue[_i].name>> <br> Progress: <<print $constructionQueue[_i].progress>>/<<print $constructionQueue[_i].cost>> <br> Active: <<if $constructionQueue[_i].active>> @@color:lightGreen;Yes@@<<else>> No<</if>> <br> <<link "Cancel">> <<cancelProject _i>> <<goto "industry">> <</link>> <<if !($constructionQueue[_i].active)>> | <<link "Make Active">><<makeProjectActive _i>><<goto "industry">><</link>><</if>> <</capture>> <</for>> <</if>> <</nobr>>
<<widget updateActive>> /* construction */ <<if $constructionQueue.length > 0>> <<set _isActive to false>> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<if $constructionQueue[_i].active>> <<set _isActive to true>> <</if>> <</for>> <<if !(_isActive)>> <<set $constructionQueue[0].active to true>> <</if>> <</if>> /* Research */ <<if $researchQueue.length > 0>> <<set _isActive to false>> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<if $researchQueue[_i].active>> <<set _isActive to true>> <</if>> <</for>> <<if !(_isActive)>> <<set $researchQueue[0].active to true>> <</if>> <</if>> <</widget>> <<widget makeProjectActive>><<nobr>> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<if $constructionQueue[_i].active>> <<set $constructionQueue[_i].active to false>> <</if>> <</for>> <<set $constructionQueue[$args[0]].active to true>> <</nobr>><</widget>> <<widget makeResearchActive>><<nobr>> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<if $researchQueue[_i].active>> <<set $researchQueue[_i].active to false>> <</if>> <</for>> <<set $researchQueue[$args[0]].active to true>> <</nobr>><</widget>> <<widget cancelProject>><<nobr>> /* List of all upgrades */ <<if $constructionQueue[_i].uID == $pavedRoads.uID>> <<set $pavedRoads.inQueue to false>> <<set $pavedRoads.active to false>> <</if>> <<set $constructionQueue.deleteAt(_i)>> <</nobr>><</widget>> <<widget cancelResearch>><<nobr>> /* List of all upgrades */ <<if $researchQueue[_i].uID == $mechanics1.uID>> <<set $mechanics1.inQueue to false>> <<set $mechanics1.active to false>> <</if>> <<set $researchQueue.deleteAt(_i)>> <</nobr>><</widget>> <<widget applyUpgrades>><<nobr>> /* reset upgrade variables */ <<set $farmerUpgradeBonus to 0>> /* add bonuses up in their relevant variables */ <<if $pavedRoads.completed>> <<set $farmerUpgradeBonus to $farmerUpgradeBonus + 0.2>> <</if>> <</nobr>><</widget>> <<widget applyResarch>><<nobr>> /* reset upgrade variables */ <<set $farmerUpgradeBonus to 0>> <<set $scavUpgradeBonus to 0>> /* add bonuses up in their relevant variables */ /* upgrades */ <<if $pavedRoads.completed>> <<set $farmerUpgradeBonus to $farmerUpgradeBonus + 0.2>> <</if>> /* research */ <<if $mechanics1.completed>> <<set $scavUpgradeBonus to $scavUpgradeBonus + 0.2>> <</if>> <</nobr>><</widget>>
/* upgrade variables */ <<set $farmerUpgradeBonus to 0>> <<set $scavUpgradeBonus to 0>> <<set $uIDCompleted to -1>> <<set $rIDCompleted to -1>> /* upgrades */ <<set $pavedRoads to { /* +0.2 food per farmer */ uID: 0, name: "Paved Roads", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >>
<<nobr>> /* Find the active project and update its status */ <<set $uIDCompleted to -1>> <<set $finishedProject to "none">> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<if $constructionQueue[_i].active>> <<set $constructionQueue[_i].progress to ($constructionQueue[_i].progress + ($workers.engineers * $baseProgressPerEngineer))>> <<if $constructionQueue[_i].progress >= $constructionQueue[_i].cost>> <<set $uIDCompleted to $constructionQueue[_i].uID>> <<set $finishedProject to $constructionQueue[_i].name>> <<set $constructionQueue.deleteAt(_i)>> <<break>> <</if>> <</if>> <</for>> /* Here we check which upgrade has finished and update it */ <<if $uIDCompleted == $pavedRoads.uID>> <<set $pavedRoads.completed to true>> <<set $pavedRoads.inQueue to false>> <<set $pavedRoads.active to false>> <<applyUpgrades>> <</if>> <</nobr>>
<<if $constructionQueue.length > 0>> ''Construction'': <<nobr>> <<if $uIDCompleted < 0>> <<for _i to 0; _i lt $constructionQueue.length; _i++>> <<if $constructionQueue[_i].active>> <<print $constructionQueue[_i].name>> is being worked on. <<if $workers.engineers > 0>> It will take approximately <<print Math.trunc(Math.clamp(($constructionQueue[_i].cost - $constructionQueue[_i].progress) / ($workers.engineers * $baseProgressPerEngineer)), 1, 9999)>> <</if>> <</if>> <</for>> <<else>> $finishedProject was completed! <</if>> <</nobr>> <</if>>
''Scientists'': The city currently employs @@color:yellow;<<print $workers.scientists>>@@ scientist. Each scientist contributes $baseProgressPerScientist point of progress to the current project. <<display "scientist buttons">> <<display "researchQueue">>
/* Research */ <<set $mechanics1 to { rID: 0, name: "Basic Mechanics", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >> /* +0.2 scrap per scavenger */ /* Unlocks tractors for farms */ <<set $electronics1 to { /* +0.2 points per scientist */ /* Unlocks computers for workshops */ rID: 1, name: "Basic Electronics", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >> <<set $medicine1 to { /* +0.02 pop growth */ /* Unlocks hospital for city */ rID: 2, name: "Basic Medicine", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >> <<set $chemistry to { /* +0.2 tax income from scavengers */ /* Unlocks refrigeration for farms */ rID: 3, name: "Chemistry", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >> <<set $titanomy1 to { /* +0.2 monthly growth for giant */ /* Unlocks flora giantification for farms */ rID: 4, name: "Basic Titanomy", cost: 20, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >> <<set $titanomy2 to { /* +0.3 monthly growth for giant */ /* Unlocks fauna giantification for farms */ rID: 5, name: "Advanced Titanomy", cost: 50, money: 100, progress: 0, completed: false, inQueue: false, active: false, paused: false } >>
[WiP]
''Research Queue'':<<nobr>> <<if $researchQueue.length == 0>> //Empty// <<else>> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<capture _i>> <br> <<print $researchQueue[_i].name>> <br> Progress: <<print $researchQueue[_i].progress>>/<<print $researchQueue[_i].cost>> <br> Active: <<if $researchQueue[_i].active>> @@color:lightGreen;Yes@@<<else>> No<</if>> <br> <<link "Cancel">> <<cancelResearch _i>> <<goto "tech">> <</link>> <<if !($researchQueue[_i].active)>> | <<link "Make Active">><<makeResearchActive _i>><<goto "tech">><</link>><</if>> <</capture>> <</for>> <</if>> <</nobr>>
<<nobr>> Add: <<if $workers.freePops >= 1>> <<link "1">> <<set $workers.freePops-->> <<set $workers.scientists++>> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.freePops >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.scientists to $workers.scientists + 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.freePops >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.scientists to $workers.scientists + 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.freePops >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.scientists to $workers.scientists + 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.freePops >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.scientists to $workers.scientists + 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> Remove: <<if $workers.scientists >= 1>> <<link "1">> <<set $workers.freePops++>> <<set $workers.scientists-->> <<goto "workers">> <</link>> <<else>> 1 <</if>>| <<if $workers.scientists >= 5>> <<link "5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.scientists to $workers.scientists - 5>> <<goto "workers">> <</link>> <<else>> 5 <</if>>| <<if $workers.scientists >= 10>> <<link "10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.scientists to $workers.scientists - 10>> <<goto "workers">> <</link>> <<else>> 10 <</if>>| <<if $workers.scientists >= 20>> <<link "20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.scientists to $workers.scientists - 20>> <<goto "workers">> <</link>> <<else>> 20 <</if>>| <<if $workers.scientists >= 50>> <<link "50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.scientists to $workers.scientists - 50>> <<goto "workers">> <</link>> <<else>> 50 <</if>> <</nobr>> <<nobr>> <<if $workers.freePops >= 1>> <<link "Add All">> <<set $workers.scientists to $workers.scientists + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "workers">> <</link>> <<else>> Add All <</if>> | <<if $workers.scientists > 0>> <<link "Remove All">> <<set $workers.freePops to $workers.freePops + $workers.scientists>> <<set $workers.scientists to 0>> <<goto "workers">> <</link>> <<else>> Remove All <</if>> <</nobr>>
<<nobr>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.scientists++>> <<goto "tech">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.scientists to $workers.scientists + 5>> <<goto "tech">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.scientists to $workers.scientists + 10>> <<goto "tech">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.scientists to $workers.scientists + 20>> <<goto "tech">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.scientists to $workers.scientists + 50>> <<goto "tech">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.scientists to $workers.scientists + 100>> <<goto "tech">> <</link>> <<else>> Add 100 <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.scientists to $workers.scientists + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "tech">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.scientists >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.scientists-->> <<goto "tech">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.scientists >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.scientists to $workers.scientists - 5>> <<goto "tech">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.scientists >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.scientists to $workers.scientists - 10>> <<goto "tech">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.scientists >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.scientists to $workers.scientists - 20>> <<goto "tech">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.scientists >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.scientists to $workers.scientists - 50>> <<goto "tech">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.scientists >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.scientists to $workers.scientists - 100>> <<goto "tech">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.scientists > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.scientists>> <<set $workers.scientists to 0>> <<goto "tech">> <</link>> <<else>> Empty <</if>> <</nobr>>
<<nobr>> <<if $mechanics1.completed>> <br>Basic Mechanics: <br> //The knowledge necessary to start restoring the tech of the old world// <br> //+0.2 scrap per scavenger// <br> //Unlocks: Advanced Mechanics, Tractors for the farms// <<else>> <<if $city.money >= ($upgradeCostMult * $mechanics1.money) && !$mechanics1.inQueue>> <br><<link "Basic Mechanics">> <<set $mechanics1.inQueue to true>> <<set $researchQueue.push($mechanics1)>> <<set $city.money to $city.money - ($upgradeCostMult * $mechanics1.money)>> <<updateActive>> <<goto "tech">> <</link>> <br> //The knowledge necessary to start restoring the tech of the old world// <br> //+0.2 scrap per scavenger// <br> //Unlocks: Advanced Mechanics, Tractors for the farms// <<elseif $mechanics1.inQueue>> <br>Basic Mechanics: <br> //Researching// <<else>> <br>Basic Mechanics: <br> //Insufficient Funds// <</if>> <</if>> <</nobr>>
<<nobr>> /* Find the active project and update its status */ <<set $rIDCompleted to -1>> <<set $finishedResearch to "none">> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<if $researchQueue[_i].active>> <<set $researchQueue[_i].progress to ($researchQueue[_i].progress + ($workers.scientists * $baseProgressPerScientist))>> <<if $researchQueue[_i].progress >= $researchQueue[_i].cost>> <<set $rIDCompleted to $researchQueue[_i].rID>> <<set $finishedResearch to $researchQueue[_i].name>> <<set $researchQueue.deleteAt(_i)>> <<break>> <</if>> <</if>> <</for>> /* Here we check which tech has finished and update it */ <<if $rIDCompleted == $mechanics1.rID>> <<set $mechanics1.completed to true>> <<set $mechanics1.inQueue to false>> <<set $mechanics1.active to false>> <<applyResearch>> <</if>> <</nobr>>
<<if $researchQueue.length > 0>> <<nobr>> <<if $rIDCompleted < 0>> <<for _i to 0; _i lt $researchQueue.length; _i++>> <<if $researchQueue[_i].active>> <<print $researchQueue[_i].name>> is being worked on. <<if $workers.scientists > 0>> It will take approximately <<print Math.trunc(Math.clamp(($researchQueue[_i].cost - $researchQueue[_i].progress) / ($workers.scientists * $baseProgressPerScientist)), 1, 9999)>> <</if>> <</if>> <</for>> <<else>> $finishedResearch was completed! <</if>> <</nobr>> <</if>>
''Safety'': Safety represents the security of the city and surrounding areas, from being mugged in the streets to being kidnapped by bandits roaming the countryside, to falling victims to wildlife. Low safety can negatively affect trade, high safety instead encourages immigration and trade. Safety Cap: $guardsSafetyCap Current effects of safety: Migration: +<<print Math.trunc($city.safety / 20)>> positive migration push ''Guards'': Guards are citizen militias, semi-professional soldiers called to protect the city and its territory from minor threats. Their primary effect is to raise or maintain @@color:yellow;safety@@. You need one guard for every $basePopPerGuard citizens, plus one guard for every $baseLandPerGuard fields. How many guards you effectively employ determines the maximum value safety can reach, and how fast, depending on the percentage of fulfillment of the requirement. Employing double the amount of required workers will double the speed of safety growth. Current guards requirement: $guardsRequired Current fulfillment: <<print Math.trunc(($workers.guards / $guardsRequired) * 100)>>% ($workers.guards) Derived maximum: <<print Math.trunc(Math.clamp(100 * ($workers.guards / $guardsRequired), 0, $guardsSafetyCap))>> Predicted safety change: <<nobr>> <<set _safetyChange to 0>> <<set _safetyRating to Math.clamp($workers.guards / $guardsRequired, 0, 2)>> <<if $city.safety < _safetyRating * $guardsSafetyCap>> <<set _safetyChange to _safetyRating * 5>> <<elseif $city.safety != _safetyRating * $guardsSafetyCap && $city.safety > 0>> <<set _safetyChange to -1 * $baseSafetyDecayRate>> <</if>> _safetyChange <</nobr>> <<display "guards buttons">>
[WiP]
''The Army'': Guards are trained citizens, tasked with maintaining the city and its surroundings safe. Together with the $gt.title, there is not much need to establish a permanent fighting force. You may, however, create special units for more //underhanded// operations like scouting, sabotage, and raiding enemy territory. [WiP]
<<nobr>> /* Update relevant variables */ <<updateGuardsRequired>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.guards++>> <<goto "security">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.guards to $workers.guards + 5>> <<goto "security">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.guards to $workers.guards + 10>> <<goto "security">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.guards to $workers.guards + 20>> <<goto "security">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.guards to $workers.guards + 50>> <<goto "security">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.guards to $workers.guards + 100>> <<goto "security">> <</link>> <<else>> Add 100 <</if>>| <<if $guardsRequired > $workers.guards && $workers.freePops >= ($guardsRequired - $workers.guards)>> <<link "Match Requirement">> <<if $workers.freePops > ($guardsRequired - $workers.guards)>> <<set $workers.freePops to $workers.freePops - ($guardsRequired - $workers.guards)>> <<set $workers.guards to $guardsRequired>> <<goto "security">> <<else>> <<set $workers.guards to $workers.guards + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "security">> <</if>> <</link>> <<else>> Match requirement <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.guards to $workers.guards + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "security">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.guards >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.guards-->> <<goto "security">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.guards >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.guards to $workers.guards - 5>> <<goto "security">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.guards >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.guards to $workers.guards - 10>> <<goto "security">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.guards >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.guards to $workers.guards - 20>> <<goto "security">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.guards >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.guards to $workers.guards - 50>> <<goto "security">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.guards >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.guards to $workers.guards - 100>> <<goto "security">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.guards > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.guards>> <<set $workers.guards to 0>> <<goto "security">> <</link>> <<else>> Empty <</if>> <</nobr>>
''The $gt.title'': <<display "giantDescription">>
''Happiness'': Happiness represents the satisfaction the $gt.title is feeling, and generally their state of wellbeing. Low happiness can lead to an accumulation of wrath, high happiness instead of favor. Happiness Cap: $servantsSatisfactionCap Current effects of happiness: Favor: <<nobr>> <<if $gt.happiness >= 60>> +<<print Math.trunc(Math.clamp((100 - $gt.happiness) / 5 + 1, 1, 5))>> points per month <<else>> Happiness too low <</if>><</nobr>> Wrath: <<nobr>> <<if $gt.happiness <= 40>> +<<print Math.trunc(Math.clamp($gt.happiness / 5 + 1, 1, 5)))>> points per month <<else>> Happiness too high <</if>><</nobr>> ''Servants'': Servants are workers dedicated to the wellbeing of the $gt.title. They dedicate all of their energy to <<po>>. Their primary effect is to raise or maintain @@color:yellow;happiness@@. You need one servant for every $baseFeetPerServant feet of height of the $gt.title. How many servants you effectively employ determines the maximum value happiness can reach, and how fast, depending on the percentage of fulfillment of the requirement. Employing double the amount of required workers will double the speed of happiness growth. Current servants requirement: <<print Math.trunc($gt.size / $baseFeetPerServant)>> Current fulfillment: <<print Math.trunc(($workers.servants / $servantsRequired) * 100)>>% ($workers.servants) Derived maximum: <<print Math.trunc(Math.clamp(100 * ($workers.servants / $servantsRequired), 0, $servantsSatisfactionCap))>> Predicted happiness change: <<nobr>> <<set _satisfactionRating to Math.clamp($workers.servants / $servantsRequired, 0, 2)>> <<set _satisfactionChange to 0>> <<if $gt.happiness < _satisfactionRating * $servantsSatisfactionCap>> <<set _satisfactionChange to _satisfactionRating * 5>> <<elseif $gt.happiness != _satisfactionRating * $servantsSatisfactionCap && $gt.happiness > 0>> <<set _satisfactionChange to -1 * $baseHappinessDecayRate>> <</if>> _satisfactionChange <</nobr>> <<display "servants buttons">>
Double-click this passage to edit it.
<<nobr>> The $gt.title belongs to the mysterious race of giants that has appeared on Earth two or so centuries ago.<<if !($gt.name === "Unknown")>><<ppc>> real name is $gt.name.<</if>> <<pc>> is <<gender>>, of <<print $gt.ethnicity>> ethnicity, with <<print $gt.hairColor>> hair, <<print $gt.skinColor>> skin and <<print $gt.eyeColor>> eyes. <<pc>> looks to be about <<print $gt.bioAge>> years old. Considering the unique biology of giants, however, <<pp>> true age might be quite different than what <<p>> appear as. <br> <<ppc>> figure is distinctively <<print $gt.appearance>>. If <<p>> was of human size, <<p>> could be described as being <<weight adjective>>, and <<muscles adjective>>, <<if $gt.appearance is "female" or $gt.appearance is "androgynous">> <<if $gt.genitals is "male" or $gt.genitals is "both">> with <<boobs adjective>> boobs, and a <<dick adjective>> dick, <<else>> with <<boobs adjective>> boobs, <</if>> <<else>> <<if $gt.genitals is "male" or $gt.genitals is "both">> a <<dick adjective>> dick, <</if>> <</if>>and a <<ass adjective>> ass. Of course, even their most petite features are magnified by their size, after all as a giant, <<pp>> most striking characteristic is <<pp>> size: <<print $gt.size>> feet in height, or about <<print Math.trunc($gt.size / 6)>> times a common human. <</nobr>>
<<widget weight>><<nobr>> /* args[0] == adjective will give you the adjective, "complete" or empty will give you a complete sentence */ <<if $gt.weight >= 85>> <<if $args[0] === "adjective">> obese <<else>> <<pc>> appears to be severely obese. <</if>> <<elseif $gt.weight >= 70>> <<if $args[0] === "adjective">> overweight <<else>> <<pc>> is quite overweight. <</if>> <<elseif $gt.weight >= 40>> <<if $args[0] === "adjective">> of average weight <</if>> <<elseif $gt.weight >= 20>> <<if $args[0] === "adjective">> skinny <<else>> <<pc>> looks quite skinny. <</if>> <<else>> <<if $args[0] === "adjective">> underweight <<else>> <<pc>> looks seriously underweight. <</if>> <</if>> <</nobr>><</widget>> <<widget muscles>><<nobr>> /* args[0] == adjective will give you the adjective, "complete" or empty will give you a complete sentence */ <<if $gt.muscles >= 85>> <<if $args[0] === "adjective">> extremely muscular <<else>> <<pc>> looks like a professional bodybuilder. <</if>> <<elseif $gt.muscles >= 70>> <<if $args[0] === "adjective">> quite muscular <<else>> <<pc>> is quite muscular. <</if>> <<elseif $gt.muscles >= 40>> <<if $args[0] === "adjective">> of average strength <</if>> <<elseif $gt.muscles >= 20>> <<if $args[0] === "adjective">> delicate <<else>> <<pc>> looks quite delicate. <</if>> <<else>> <<if $args[0] === "adjective">> frail <<else>> <<pc>> just looks very frail. <</if>> <</if>> <</nobr>><</widget>> <<widget boobs>><<nobr>> /* args[0] == adjective will give you the adjective, "complete" or empty will give you a complete sentence */ <<if $gt.boobs >= 85>> <<if $args[0] === "adjective">> huge <<else>> <<pc>> has a very generous chest. <</if>> <<elseif $gt.boobs >= 70>> <<if $args[0] === "adjective">> large <<else>> <<ppc>> boobs are quite impressive. <</if>> <<elseif $gt.boobs >= 40>> <<if $args[0] === "adjective">> average <</if>> <<elseif $gt.boobs >= 20>> <<if $args[0] === "adjective">> modest <<else>> <<ppc>> boobs are quite modest. <</if>> <<else>> <<if $args[0] === "adjective">> non-existent <<else>> <<ppc>> chest is nearly flat. <</if>> <</if>> <</nobr>><</widget>> <<widget ass>><<nobr>> /* args[0] == adjective will give you the adjective, "complete" or empty will give you a complete sentence */ <<if $gt.ass >= 85>> <<if $args[0] === "adjective">> huge <<else>> <<pc>> has a humongous ass. <</if>> <<elseif $gt.ass >= 70>> <<if $args[0] === "adjective">> large <<else>> <<ppc>> ass is unquestionably huge. <</if>> <<elseif $gt.ass >= 40>> <<if $args[0] === "adjective">> average <</if>> <<elseif $gt.ass >= 20>> <<if $args[0] === "adjective">> modest <<else>> <<pc>> has a little bubble butt. <</if>> <<else>> <<if $args[0] === "adjective">> non-existent <<else>> <<ppc>> ass is almost non-existent. <</if>> <</if>> <</nobr>><</widget>> <<widget dick>><<nobr>> /* args[0] == adjective will give you the adjective, "complete" or empty will give you a complete sentence */ <<if $gt.dick >= 85>> <<if $args[0] === "adjective">> huge <<else>> <<ppc>> dick is terrifyingly huge. <</if>> <<elseif $gt.dick >= 70>> <<if $args[0] === "adjective">> large <<else>> <<ppc>> cock is impressively large. <</if>> <<elseif $gt.dick >= 40>> <<if $args[0] === "adjective">> average <</if>> <<elseif $gt.dick >= 20>> <<if $args[0] === "adjective">> modest <<else>> <<pc>> member is rather modest, for a giant. <</if>> <<else>> <<if $args[0] === "adjective">> tiny <<else>> <<ppc>> dick is disroportionately small. <</if>> <</if>> <</nobr>><</widget>>
''Approval'': Approval represents your popularity among the citizens of the city. Should it fall too low, then a rebellion or a coup may become possibilities. High levels instead may bring positive effects such as a higher level of trade or lower costs of labor. Your approval has a certain cap determined by your current tech level, laws, and buildings. Approval Cap: $serviceApprovalCap Current effects for approval: [WiP] ''Services'': Service workers are workers dedicated to the wellbeing of the citizens: Cleaners, cooks, teachers, merchants, doctors, and more. Their primary effect is to raise or maintain @@color:yellow;approval@@. You need one service worker for every $basePopPerService citizens. How many service workers you effectively employ determines the maximum value approval can reach, and how fast, depending on the percentage of fulfillment of the requirement. Employing double the amount of required workers will double the speed of approval growth. Current service requirement: <<print Math.trunc($city.pop / $basePopPerService)>> Current fulfillment: <<print Math.trunc(($workers.service / $serviceRequired) * 100)>>% ($workers.service) Derived maximum: <<print Math.trunc(Math.clamp(100 * ($workers.service / $serviceRequired), 0, $serviceApprovalCap))>> Predicted approval change: <<nobr>> <<set _approvalRating to Math.clamp($workers.service / $serviceRequired, 0, 2)>> <<set _approvalChange to 0>> <<if $city.approval < _approvalRating * $serviceApprovalCap>> <<set _approvalChange to _approvalRating * 5>> <<elseif $city.approval != _approvalRating * $serviceApprovalCap && $city.approval > 0>> <<set _approvalChange to -1 * $baseSafetyDecayRate>> <</if>> _approvalChange <</nobr>> <<display "service buttons">>
<<calcTaxes>><<nobr>><table style="width:500px;"> <tr> <th> Taxes </th> <th> Per Worker </th> <th> Total </th> </tr> <tr> <td> Unemployed Workers </td> <td> $baseFreePopTax </td> <td> <<print Math.trunc($workers.freePops * $baseFreePopTax)>> </td> </tr> <tr> <td> Farmers </td> <td> $baseFarmerTax </td> <td> <<print Math.trunc($workers.farmers * $baseFarmerTax)>> </td> </tr> <tr> <td> Servants </td> <td> $baseServantTax </td> <td> <<print Math.trunc($workers.servants * $baseServantTax)>> </td> </tr> <tr> <td> Service </td> <td> $baseServiceTax </td> <td> <<print Math.trunc($workers.service * $baseServiceTax)>> </td> </tr> <tr> <td> Guards </td> <td> $baseGuardTax </td> <td> <<print Math.trunc($workers.guards * $baseGuardTax)>> </td> </tr> <tr> <td> Scavengers </td> <td> $baseScavengerTax </td> <td> <<print Math.trunc($workers.scavengers * $baseScavengerTax)>> </td> </tr> <tr> <td> Engineers </td> <td> $baseEngineerTax </td> <td> <<print Math.trunc($workers.engineers * $baseEngineerTax)>> </td> </tr> <tr> <td> Scientists </td> <td> $baseScientistTax </td> <td> <<print Math.trunc($workers.service * $baseScientistTax)>> </td> </tr> <tr> <td> </td> <td> Total </td> <td> <<if $taxRevenue > 0>>@@color:lightGreen;$taxRevenue@@<<elseif $taxRevenue == 0>>@@color:yellow;$taxRevenue@@<<else>>@@color:red;$taxRevenue@@<</if>> </td> </tr> </table> <</nobr>>
[WiP]
''Food Production'':<<updateFoodConsumption>> -Farmers: @@color:yellow;<<print Math.trunc($workers.farmers * ($baseFarmProd + $farmerUpgradeBonus))>>@@ //<<print ($baseFarmProd + $farmerUpgradeBonus)>> per farmer// ''Food Consumption'': -The $gt.title: @@color:yellow;$gtFoodConsumption@@ //The amount of food a human eats, multiplied by the number of times <<p>> is bigger than a human, cubed// -Population: @@color:yellow;$cityFoodConsumption@@ //1 per 100 citizens// With the current technology, @@color:yellow;<<print $baseFoodDecayRate>>@@% of the food in storage will spoil. Right now it corresponds to @@color:red;<<print Math.trunc($city.foodStored * 0.03)>>@@
<<nobr>> <<calcTaxes>><<calcWorkerUpkeep>><<calcTariffs>> <table style="width:500px; border-width: 1px 0px; border-style: solid; border-color: white;"> <tr> <th> </th> <th> Income </th> <th> Expenses </th> <th> Total </th> </tr> <tr> <td> Taxes </td> <td> <<print Math.trunc($taxRevenue)>> </td> <td> </td> <td> </td> </tr> <tr> <td> Tariffs </td> <td> <<print Math.trunc($tariffsRevenue)>> </td> <td> </td> <td> </td> </tr> <tr> <td> Workers Upkeep </td> <td> </td> <td> <<print Math.trunc($workerUpkeep)>> </td> <td> </td> </tr> <tr> <td> ''Total'' </td> <td> </td> <td> </td> <td> <<set _income to $taxRevenue + $tariffsRevenue + $workerUpkeep>> <<if _income > 0>> @@color:lightGreen;<<print Math.trunc(_income)>>@@ <<elseif _income == 0>> @@color:yellow;<<print Math.trunc(_income)>>@@ <<else>> @@color:red;<<print Math.trunc(_income)>>@@ <</if>> </td> </tr> </table> <</nobr>>
''Scavenging'': -Scavengers: @@color:yellow;<<print Math.trunc($workers.scavengers * ($baseScrapProd))>>@@ //<<print ($baseScrapProd)>> per scavenger//
[WiP]
[WiP]
[WiP]
/* Setting up new task for the new turn */ /* updating relevant variables */ <<set $lastTask to $monthlyTask>> <<set $monthlyTask to "none">> <<set $taskDebuff to "none">> <<set $taskWorkerMessage to "none">> <<set $taskRoll to -1>> <<updateAllRequired>> <<updateAvailableTasks>> /* rolls for a new task, with a 33% chance of not having a new task each turn */ <<set _roll to Math.trunc(random(1, ($availableTasks * 3)))>> <<if _roll <= $availableTasks>> <<if _roll <= 1 && !($lastTask === "moneyRequest")>> <<set $monthlyTask to "moneyRequest">> <<set $taskRoll to random(1,3)>> <<elseif _roll <= 2 && !($lastTask === "foodRequest")>> <<set $monthlyTask to "foodRequest">> <<set $taskRoll to random(1,3)>> <<elseif _roll <= 3 && !($lastTask === "scrapRequest")>> <<set $monthlyTask to "scrapRequest">> <<set $taskRoll to random(1,3)>> <<elseif _roll <= 4 && !($lastTask === "servantsRequest")>> <<set $monthlyTask to "servantsRequest">> <<set $taskRoll to random(1,2)>> <<elseif _roll <= 5 && !($lastTask === "serviceRequest")>> <<set $monthlyTask to "serviceRequest">> <<set $taskRoll to random(1,1)>> <<elseif _roll <= 6 && !($lastTask === "guardsRequest")>> <<set $monthlyTask to "guardsRequest">> <<set $taskRoll to random(1,1)>> <</if>> <<set $taskCompleted to "not yet">> <</if>> /* Calculating new market supplies */ <<set $startingFoodMarketSupply to Math.trunc(100 * ($city.pop / 1000))>> <<set $startingScrapMarketSupply to Math.trunc(50 * ($city.pop / 2000))>> <<set $foodMarketSupply to $startingFoodMarketSupply>> <<set $scrapMarketSupply to $startingScrapMarketSupply>> <<goto "mainWindow">>
<<nobr>> ''New Task'': <<if $taskRoll < 0>>Error: failed to roll<</if>> <br> /* list of tasks */ <<set _income to Math.clamp($income, 10, 10 + $income), _scrapIncome to Math.clamp($scrapIncome, 10, 10 + $scrapIncome)>> <<if $monthlyTask === "moneyRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is 1>> An artist visited your city recently, and the $gt.title was awestruck by his skills. <<pc>> wish to become his patron and ordered yout o provide the funds to do so. <br>//It will take between <<print Math.trunc(_income * 1.5)>> and <<print Math.trunc(_income * 2.5)>> units of gold to fulfill the task// <<elseif $taskRoll is 2>> A prospector amazed the citizens and the $gt.title with a machine from the old world he recovered and fixed. The spectacle of lights, holograms, music, and sounds was indeed quite spectacular. The $gt.title ordered you to dedicate resources to the recovery and restoration of these old world machines. <br>//It will take between <<print Math.trunc(_income * 1.5)>> and <<print Math.trunc(_income * 2.5)>> units of gold to fulfill the task// <<elseif $taskRoll is 3>> Words of a skilled giant jewelry maker operating not far from the city reached the ears of the $gt.title. Impressed, <<p>> decided to commission a piece worthy of their status to her. <br>//It will take between <<print Math.trunc(_income * 1.5)>> and <<print Math.trunc(_income * 2.5)>> units of gold to fulfill the task// <</if>> <<set _cost to _income * (random(15, 25) * 0.1)>> <br><<if $city.money >= _cost>> <<linkreplace "Fulfill Request">> <<set $city.money to $city.money - _cost>> <<set $taskCompleted to "yes">> <<goto "mainWindow">> <</linkreplace>> <<elseif $city.money > (_cost * 0.3)>> <<linkreplace "Fulfill Request">> <<set $city.money to 0>> <<set $taskCompleted to "half">> <<goto "mainWindow">> <</linkreplace>> <<else>> <<linkreplace "Fulfill Request">> <<set $taskCompleted to "no">> <<goto "mainWindow">> <</linkreplace>> <</if>> <</if>> <<elseif $monthlyTask === "foodRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is 1>> A number of representatives from small neighbouring communities have come to meet with the $gt.title and pledge their allegiance to <<po>>. Delighted, <<p>> ordered two days of celebration, and a large feast to be prepared <br>//It will take between <<print $gtFoodConsumption * 1.5>> and <<print $gtFoodConsumption * 2.5>> units of food to fulfill the task// <<elseif $taskRoll is 2>> The metabolism of giants can sometimes be unpredictable, this last few weeks the $gt.title's hunger was significantly higher than usual. Unsurprisingly <<p>> ordered to have extra supplies delivered to <<po>> throughout the month. <br>//It will take between <<print $gtFoodConsumption * 1.5>> and <<print $gtFoodConsumption * 2.5>> units of food to fulfill the task// <<elseif $taskRoll is 3>> Word of a newborn giant in a city state not too far from $city.name reached the $gt.title's ears. <<pc>> decided to visit the city and congratulate the human parents and the city's leaders personally, bringing food and supplies for a large feast in the newborns' honor with <<po>>. <br>//It will take between <<print $gtFoodConsumption * 1.5>> and <<print $gtFoodConsumption * 2.5>> units of food to fulfill the task// <</if>> <<set _cost to $gtFoodConsumption * (random(15, 25) * 0.1)>> <br><<if $city.foodStored >= _cost>> <<linkreplace "Fulfill Request">> <<set $city.foodStored to $city.foodStored - _cost>> <<set $taskCompleted to "yes">> <<goto "mainWindow">> <</linkreplace>> <<elseif $city.foodStored > (_cost * 0.3)>> <<linkreplace "Fulfill Request">> <<set $city.foodStored to 0>> <<set $taskCompleted to "half">> <<goto "mainWindow">> <</linkreplace>> <<else>> <<linkreplace "Fulfill Request">> <<set $taskCompleted to "no">> <<goto "mainWindow">> <</linkreplace>> <</if>> <</if>> <<elseif $monthlyTask === "scrapRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is 1>> The $gt.title, unsatisfied with one of the palace's wings, decided to renovate the building. To do so, <<p>> needs good raw materials, and has ordered you to provide them. <br>//It will take between <<print _scrapIncome * 1.5>> and <<print _scrapIncome * 2.5>> units of scrap to fulfill the task// <<elseif $taskRoll is 2>> A group of scavengers has found an old world plane in decent conditions. The city engineers are skeptical that it will ever be able to fly, but the machine fascinated the $gt.title enough that <<p>> wants it repaired at all costs. <br>//It will take between <<print _scrapIncome * 1.5>> and <<print _scrapIncome * 2.5>> units of scrap to fulfill the task// <<elseif $taskRoll is 3>> A travelling merchant brought a metallic carcass in front of the $gt.title, claiming it to be an old world superweapon. The city engineers believe it to be a badly assembled pile of rust and steel, but the $gt.title still wants to attempt a restoration, of wathever it was. <br>//It will take between <<print _scrapIncome * 1.5>> and <<print _scrapIncome * 2.5>> units of scrap to fulfill the task// <</if>> <<set _cost to _scrapIncome * (random(15, 25) * 0.1)>> <br><<if $city.scrap >= _cost>> <<linkreplace "Fulfill Request">> <<set $city.scrap to $city.scrap - _cost>> <<set $taskCompleted to "yes">> <<goto "mainWindow">> <</linkreplace>> <<elseif $city.scrap > (_cost * 0.3)>> <<linkreplace "Fulfill Request">> <<set $city.scrap to 0>> <<set $taskCompleted to "half">> <<goto "mainWindow">> <</linkreplace>> <<else>> <<linkreplace "Fulfill Request">> <<set $taskCompleted to "no">> <<goto "mainWindow">> <</linkreplace>> <</if>> <</if>> <<elseif $monthlyTask === "servantsRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is 1>> A scandal exploded among the <<print $gt.title>>'s servants, when one of your agents discovered some were circulating revealing photos of their giant overlord. If you act quickly and decisively, you may manage to bury the scandal, and avoid being blamed for your poor vigilance. <br>//Up to 10% of the citizens employed as servants will be forced to leave the city// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $taskDebuff to "servants exiled">> <<goto "mainWindow">> <</linkreplace>> <<elseif $taskRoll is "deactivated">> Unsatisfied with <<pp>> wardrobe, the $gt.title ordered <<pp>> servants to fabricate brand new clothes for <<po>>. The titanic affair is beyond the ability of the current workforce to accomplish, and so they will need additional hands to complete everything in time. <br>//The number of servants required this month will be 50% higher// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $currentWorkerNumber to $workers.servants>> <<set $taskDebuff to "increased servants numbers">> <<assignWorkersForTasks>> <<goto "mainWindow">> <</linkreplace>> <<elseif $taskRoll is 2>> Working directly under the $gt.title is, at best, not pleasant, at worst life threatening. Many servants are organizing a mass protest to ask for better conditions, or at least better pay. You could placate them with some extra pay this month, or call their bluff. <br>//The gold cost of servants will be doubled for this month// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $taskDebuff to "servants double pay">> <<goto "mainWindow">> <</linkreplace>> <</if>> <</if>> <<elseif $monthlyTask === "serviceRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is "deactivated">> The $gt.title has decided to organize a big sports event, involving the city and the neighbouring communities. <<pc>> ordered to recruit all available service workers to make it happen. <br>//You will need 30% more service workers this month// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $currentWorkerNumber to $workers.service>> <<set $taskDebuff to "increased service numbers">> <<assignWorkersForTasks>> <<goto "mainWindow">> <</linkreplace>> <<elseif $taskRoll is 1>> The $gt.title decided to organize a fair, an old tradition in the land she comes from. Many service workers seem eager to get started, but you will need to cover for the extra hours of work. <br>//The tax income from service workers will be halved for this month// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $taskDebuff to "service double pay">> <<goto "mainWindow">> <</linkreplace>> <<else>> [placeholder] <</if>> <</if>> <<elseif $monthlyTask === "guardsRequest">> <<if $taskCompleted === "not yet">> <<if $taskRoll is 1>> Eager for action, the $gt.title ordered you to organize some mock battles, where the city's militia will have to //defeat// <<po>>. <br>//Up to 10% of the citizens employed as guards may die or suffer career ending injuries// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $taskDebuff to "war games">> <<goto "mainWindow">> <</linkreplace>> <<elseif $taskRoll is "deactivated">> There is a small community on the fringe of the city's territory that refuses to recognize the $gt.title as their ruler. The village is too small to bother with personally, so <<p>> ordered your guards to deal with it on <<pp>> behalf. <br>//The number of guards workers required this month will be 50% higher// <br><<linkreplace "Fulfill Request">> <<set $taskCompleted to "yes">> <<set $currentWorkerNumber to $workers.guards>> <<set $taskDebuff to "increased guards numbers">> <<assignWorkersForTasks>> <<goto "mainWindow">> <</linkreplace>> <<else>> [placeholder] <</if>> <</if>> <</if>> <</nobr>>
<<nobr>> <<if !($monthlyTask is "none")>> <<if $monthlyTask is "moneyRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>With the necessary funds, the $gt.title was able to acquire some fine piece of art, at least fine according to <<pp>> tastes. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>With not enough funds, the $gt.title had to gently coerce the artist to part with some of his better pieces. The artist has swore never to return to $city.name. <<else>> <br>With no funds available, the $gt.title tried to //gently// convince the artist to part with one of is pieces. From what you heard, he barely made it out of the city alive, and swore never to return. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> With the necessary funds, the machine was acquired and restored. Its tricks of lights and sound were quite the source of entertainment, for both citizens and the $gt.title, a memory of a better age. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>With not enough funds, the city's engineers were not able to repair the machine properly. It provided some entertainment for a few days, before breaking once more, for the final time. <<else>> <br>With no funds available, the $gt.title took the decision of //requisitioning// the machine, but shortly after it finally broke down, for the last time. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <br>With the necessary funds, the $gt.title was able to commission a good piece of jewelry for themselves. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>With not enough funds, the $gt.title was unable to commission a piece from the famous artisan, and decided to go for his less expensive but less talented apprentice. <<else>> <br>With no funds, the $gt.title was forced to forget about the artisan, at least for the time being. The palace was a very dangerous place for a few days. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <<elseif $monthlyTask is "foodRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>The celebration went surprisingly well, the representatives left impressed and amazed, and the $gt.title thoroughly satisfied. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>While the feast disappointed the $gt.title, the event went decently. The representatives left sufficiently impressed. <<else>> <br>While the representatives left sufficiently impressed by the power of the $gt.title, the lack of a feast annoyed <<po>> immensely. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <br>With the additional supplies, the <<print $gt.title>>'s hunger was kept under control. <<pc>> is pleased by your management. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>While the extra supplies helped, the $gt.title had quite an uncomfortable month. <<else>> <br>The lack of sufficient food left the $gt.title extremely irritated for the entire month. Your failure to deliver did not go unnoticed. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <br>The $gt.title came back satisfied from <<pp>> trip to the neighbouring city state. <<pc>> left quite the impression and reinforced <<pp>> dominion over the region. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>The $gt.title came back disappointed from <<pp>> trip to the neighbouring city state. Still, <<pp>> visit left quite the impression and reinforced <<pp>> dominion over the region. <<else>> <br>The $gt.title came back very disappointed from <<pp>> trip to the neighbouring city state. <<pc>> still left a lasting impression, though not as strong as <<p>> would have liked. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <<elseif $monthlyTask is "scrapRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>The renovation went swimmingly, and the $gt.title was quite pleased. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>Without enough materials, the scope of the renovation had to be reduced. The $gt.title was disappointed. <<else>> <br>Without materials, the renovation could not begin. The $gt.title was very disappointed in your shortcomings. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <br>The plane was repaired was, surprisingly, was able to fly for a little while, before falling out of the sky. Despite the setback, the $gt.title was pleased. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>Due to limited resources, the plane was only partially restored and was unable to take flight at all. The $gt.title was disappointed. <<else>> <br>Without the necessary resources, the plane eventually lost its battle with time and fell apart. The $gt.title ordered the carcass to be thrown away, disappointed by your failure. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <br>The //weapon// was repaired, or more accurately cleaned and rearranged into something that could resemble a human made object. Despite the lack of any real utility, the $gt.title seemes happy to keep it as an eccentric artistic piece in the palace. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>The //weapon// could not be fully repaired, the pile of rusting metal fell apart a few weeks afterwards. The $gt.title ordered it to to be melted and transformed into something useful. <<else>> <br>The //weapon// was in such a poor state that, mere even days after it was bought, it completely fell apart. The $gt.title angrily ordered the pile of rust to be thrown into the ocean. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <<elseif $monthlyTask is "servantsRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>Acting swiftly, you ordered the responsibles apprehended and exiled or disappeared. It may not have been merciful, but more people would have died if you did not act. In total, @@color:red;<<print $accidentalDeaths>>@@ citizens were lost. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<else>> <br>The scandal exploded, as your agents predicted. Fortunately a massacre was avoided, as the $gt.title was surprisingly flattered by the whole affair, only a few of the worst offenders were //retired//. Still, <<p>> was quite disappointed by your incompetence. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <br>You spoke directly with the organizers and came to an agreement. Extra pay this month will be sufficient to calm most of the servants, the rest will fall in line. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>You spoke directly with the organizers. While you did not manage to come to a solid agreement, they promised to limit their protests for what extra pay you could afford, thus avoiding angering the $gt.title further. <<else>> <br>The servants' protest escalated, until it met a rather swift end once it finally annoyed the $gt.title sufficiently. Things went back to normal, but the $gt.title was ratehr displeased by your poor management of the situation. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <br> <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<else>> <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <<elseif $monthlyTask is "serviceRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>The fair was organized and it was quite the success. The days of festivities became a bright spot in everyone's memory, and the $gt.tile was quite pleased with the result. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $taskCompleted is "half">> <br>The fair was organized, but the lack of funds made things difficult. The end result was a rather forgettable festivity. The $gt.title was a bit disappointed. <<else>> <br>With no funds, the plans for the fair stalled and eventually died down. Your $gt.title was not happy with your inability to deliver. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <br> <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<else>> <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <<elseif $monthlyTask is "guardsRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br>The war games were organized. Several mock battles were fought between the militias and the $gt.title. <<pc>> was thoroughly entertained, but @@color:red;<<print $accidentalDeaths>>@@ guards were severely injured, if not worse. <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<else>> <br>With the collaboration of the guard captain and some sweet words, you managed to push back the war games enough times that $gt.title lost the taste for it. <<pc>> was not happy about your obstructionism. <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <<if $taskCompleted is "yes">> <<if $workers.guards >= $guardsRequired>> <br> <br>@@color:lightGreen;+15 favor@@ <br>@@color:lightGreen;+5 trust@@ <<elseif $workers.guards >= $old.guards>> <br> <<else>> <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <<else>> <br>@@color:red;+15 wrath@@ <br>@@color:red;-5 trust@@ <</if>> <</if>> <</if>> <</if>> <</nobr>>
<<nobr>> <<set $favorChange to 0>> <<set $wrathChange to 0>> <<if !($monthlyTask is "none")>> <<if $monthlyTask is "moneyRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <<elseif $monthlyTask is "foodRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <<elseif $monthlyTask is "scrapRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $taskCompleted is "no">> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <<elseif $monthlyTask is "servantsRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<elseif $taskRoll == 2>> <<if $taskCompleted is "yes">> <<if $workers.servants >= $servantsRequired>> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $workers.servants >= $old.servants>> <br> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <<elseif $monthlyTask is "serviceRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <<if $workers.service >= $serviceRequired>> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $workers.service >= $old.service>> <br> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <<elseif $monthlyTask is "guardsRequest">> <<if $taskRoll == 1>> <<if $taskCompleted is "yes">> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<if $taskCompleted is "yes">> <<if $workers.guards >= $guardsRequired>> <br> <<set $favorChange += 15>> <<set $gt.trust += 5>> <<elseif $workers.guards >= $old.guards>> <br> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <<else>> <<set $wrathChange += 15>> <<set $gt.trust -= 5>> <</if>> <</if>> <</if>> <</if>> <</nobr>>
<<nobr>> /* Update relevant variables */ <<updateServiceRequired>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.service++>> <<goto "city">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.service to $workers.service + 5>> <<goto "city">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.service to $workers.service + 10>> <<goto "city">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.service to $workers.service + 20>> <<goto "city">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.service to $workers.service + 50>> <<goto "city">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.service to $workers.service + 100>> <<goto "city">> <</link>> <<else>> Add 100 <</if>>| <<if $serviceRequired > $workers.service && $workers.freePops >= ($serviceRequired - $workers.service)>> <<link "Match Requirement">> <<if $workers.freePops > ($serviceRequired - $workers.service)>> <<set $workers.freePops to $workers.freePops - ($serviceRequired - $workers.service)>> <<set $workers.service to $serviceRequired>> <<goto "city">> <<else>> <<set $workers.service to $workers.service + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "city">> <</if>> <</link>> <<else>> Match requirement <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.service to $workers.service + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "city">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.service >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.service-->> <<goto "city">> <</link>> <<else>> Remove 1 <</if>>| <<if $workers.service >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.service to $workers.service - 5>> <<goto "city">> <</link>> <<else>> Remove 5 <</if>>| <<if $workers.service >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.service to $workers.service - 10>> <<goto "city">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.service >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.service to $workers.service - 20>> <<goto "city">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.service >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.service to $workers.service - 50>> <<goto "city">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.service >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.service to $workers.service - 100>> <<goto "city">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.service > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.service>> <<set $workers.service to 0>> <<goto "city">> <</link>> <<else>> Empty <</if>> <</nobr>>
<<nobr>> /* Update relevant variables */ <<updateServantsRequired>> <<if $workers.freePops >= 1>> <<link "Add 1">> <<set $workers.freePops-->> <<set $workers.servants++>> <<goto "palace">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.freePops >= 5>> <<link "Add 5">> <<set $workers.freePops to $workers.freePops - 5>> <<set $workers.servants to $workers.servants + 5>> <<goto "palace">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.freePops >= 10>> <<link "Add 10">> <<set $workers.freePops to $workers.freePops - 10>> <<set $workers.servants to $workers.servants + 10>> <<goto "palace">> <</link>> <<else>> Add 10 <</if>>| <<if $workers.freePops >= 20>> <<link "Add 20">> <<set $workers.freePops to $workers.freePops - 20>> <<set $workers.servants to $workers.servants + 20>> <<goto "palace">> <</link>> <<else>> Add 20 <</if>>| <<if $workers.freePops >= 50>> <<link "Add 50">> <<set $workers.freePops to $workers.freePops - 50>> <<set $workers.servants to $workers.servants + 50>> <<goto "palace">> <</link>> <<else>> Add 50 <</if>>| <<if $workers.freePops >= 100>> <<link "Add 100">> <<set $workers.freePops to $workers.freePops - 100>> <<set $workers.servants to $workers.servants + 100>> <<goto "palace">> <</link>> <<else>> Add 100 <</if>>| <<if $servantsRequired > $workers.servants && $workers.freePops >= ($servantsRequired - $workers.servants)>> <<link "Match Requirement">> <<if $workers.freePops > ($servantsRequired - $workers.servants)>> <<set $workers.freePops to $workers.freePops - ($servantsRequired - $workers.servants)>> <<set $workers.servants to $servantsRequired>> <<goto "palace">> <<else>> <<set $workers.servants to $workers.servants + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "palace">> <</if>> <</link>> <<else>> Match requirement <</if>>| <<if $workers.freePops >= 1>> <<link "Add all">> <<set $workers.servants to $workers.servants + $workers.freePops>> <<set $workers.freePops to 0>> <<goto "palace">> <</link>> <<else>> Add all <</if>> <</nobr>> <<nobr>> <<if $workers.servants >= 1>> <<link "Remove 1">> <<set $workers.freePops++>> <<set $workers.servants-->> <<goto "palace">> <</link>> <<else>> Add 1 <</if>>| <<if $workers.servants >= 5>> <<link "Remove 5">> <<set $workers.freePops to $workers.freePops + 5>> <<set $workers.servants to $workers.servants - 5>> <<goto "palace">> <</link>> <<else>> Add 5 <</if>>| <<if $workers.servants >= 10>> <<link "Remove 10">> <<set $workers.freePops to $workers.freePops + 10>> <<set $workers.servants to $workers.servants - 10>> <<goto "palace">> <</link>> <<else>> Remove 10 <</if>>| <<if $workers.servants >= 20>> <<link "Remove 20">> <<set $workers.freePops to $workers.freePops + 20>> <<set $workers.servants to $workers.servants - 20>> <<goto "palace">> <</link>> <<else>> Remove 20 <</if>>| <<if $workers.servants >= 50>> <<link "Remove 50">> <<set $workers.freePops to $workers.freePops + 50>> <<set $workers.servants to $workers.servants - 50>> <<goto "palace">> <</link>> <<else>> Remove 50 <</if>>| <<if $workers.servants >= 100>> <<link "Remove 100">> <<set $workers.freePops to $workers.freePops + 100>> <<set $workers.servants to $workers.servants - 100>> <<goto "palace">> <</link>> <<else>> Remove 100 <</if>>| <<if $workers.servants > 0>> <<link "Empty">> <<set $workers.freePops to $workers.freePops + $workers.servants>> <<set $workers.servants to 0>> <<goto "palace">> <</link>> <<else>> Empty <</if>> <</nobr>>
''Population'': Your base population growth is mostly determined by your technology level and your laws. Natural Births: +<<print 100 * $basePopGrowth>>% each turn (currently <<print Math.trunc($city.pop * $basePopGrowth)>>) Natural Deaths: +<<print 100 * $basePopDeath>>% each turn (currently <<print Math.trunc($city.pop * $basePopDeath)>>) Natural Growth: +<<print 100 * ($basePopGrowth - $basePopDeath)>>% (currently <<print Math.trunc($city.pop * ($basePopDeath - $basePopDeath))>>) ''Migration'': Migration is a combination of various factors. The resulting migration push is then transformed into a percentage increase (by dividing by 500). Positive Push from high safety: +<<print Math.trunc($city.safety / 20)>> points Negative Push from food scarcity: -<<print Math.trunc(Math.clamp($turnsOfFamine, 0, 20))>> points Net Migration Push: <<print Math.trunc($city.safety / 20) - Math.trunc(Math.clamp($turnsOfFamine, 0, 20))>> points Predicted outcome: <<print (Math.trunc($city.safety / 20) - Math.trunc(Math.clamp($turnsOfFamine, 0, 20))) / 500>>% (currently <<print Math.trunc($city.pop * ((Math.trunc($city.safety / 20) - Math.trunc(Math.clamp($turnsOfFamine, 0, 20))) / 400))>>)
The $gt.title never revealed to you <<pp>> true name. You never really needed to know, <<p>> prohibited anyone from using anything else than <<pp>> chosen title. Gender:<<nobr>> <<sexC>> | <<link "Switch">> <<if $gt.sex == "female">> <<set $gt.sex to "male">> <<set $gt.appearance to "masculine">> <<set $gt.genitals to "male">> <<set $gt.title to "Lord">> <<goto "customization">> <<else>> <<set $gt.sex to "female">> <<set $gt.appearance to "female">> <<set $gt.genitals to "female">> <<set $gt.title to "Lady">> <<goto "customization">> <</if>> <</link>> <</nobr>> Name: <<textbox "$gt.name" "Unknown">> Title: <<textbox "$gt.title" $gt.title>> Age: <<numberinput "$gt.bioAge" 20 18 35>> Ethnicity: <<textbox "$gt.ethnicity" $gt.ethnicity>> Skin Tone: <<textbox "$gt.skinColor" $gt.skinColor>> Hair Color: <<textbox "$gt.hairColor" $gt.hairColor>> Eye Color: <<textbox "$gt.eyeColor" $gt.eyeColor>> Appearance: <<listbox "$gt.appearance" autoselect>> <<option "feminine">> <<option "masculine">> <<option "androgynous">> <</listbox>> Genitals: <<listbox "$gt.genitals" autoselect>> <<option "female">> <<option "male">> <<option "both">> <<option "neither">> <</listbox>> [[Continue|history]]
''The Market'': Here you can buy and sell resources. Prices are determined by your trade flow level, and the available supply this month.<<calcPrices>> <div class="marketGrid"> <div class="market-item"> ''Food'': Available: $foodMarketSupply <<if $foodMarketDiff > 0>>($foodMarketDiff bought this month)<<else>>(<<print -1 * $foodMarketDiff>> sold this month)<</if>> Price (per unit): $foodMarketBuyPrice (buying) / $foodMarketSellPrice (selling) <<display "food market buttons">> </div> <div class="market-item"> ''Scrap'': Available: $scrapMarketSupply <<if $scrapMarketDiff > 0>>($scrapMarketDiff bought this month)<<else>>(<<print -1 * $scrapMarketDiff>> sold this month)<</if>> Price (per unit): $scrapMarketBuyPrice (buying) / $scrapMarketSellPrice (selling) <<display "scrap market buttons">> </div> </div> ''Trade Flow'': There are various factors that influence the amount of commercial activity within your city. Major factors: Tariffs: Current taxation policy is pushing trade towards <<nobr>> <<if $tariffsLaw >= 2>> @@color:red;very low@@ levels (0) <<elseif $tariffsLaw >= 1.5>> @@color:red;low@@ levels (25) <<elseif $tariffsLaw >= 1>> @@color:yellow;average@@ levels (50) <<elseif $tariffsLaw >= 0.5>> @@color:lightGreen;high@@ levels (75) <<elseif $tariffsLaw >= 0>> @@color:lightGreen;very high@@ levels (100) <</if>> <</nobr>> Safety: Current safety levels is pushing trade towards <<nobr>> <<set _safetyTarget to 5 * Math.trunc($city.safety / 5)>> <<if $city.safety >= 80>> @@color:lightGreen;very high@@ levels <<elseif $city.safety >= 60>> @@color:lightGreen;high@@ levels <<elseif $city.safety >= 40>> @@color:yellow;average@@ levels <<elseif $city.safety >= 20>> @@color:red;low@@ levels <<elseif $city.safety >= 0>> @@color:red;very low@@ levels <</if>> (_safetyTarget) <</nobr>> Minor factors (Half as impactful): Taxes: Current taxation policy is pushing trade towards <<nobr>> <<if $taxLaw >= 2>> @@color:red;very low@@ levels (0) <<elseif $taxLaw >= 1.5>> @@color:red;low@@ levels (25) <<elseif $taxLaw >= 1>> @@color:yellow;average@@ levels (50) <<elseif $taxLaw >= 0.5>> @@color:lightGreen;high@@ levels (75) <<elseif $taxLaw >= 0>> @@color:lightGreen;very high@@ levels (100) <</if>> <</nobr>> Approval: Current approval levels is pushing trade towards <<nobr>> <<set _approvalTarget to 5 * Math.trunc($city.approval / 5)>> <<if $city.approval >= 80>> @@color:lightGreen;very high@@ levels <<elseif $city.approval >= 60>> @@color:lightGreen;high@@ levels <<elseif $city.approval >= 40>> @@color:yellow;average@@ levels <<elseif $city.approval >= 20>> @@color:red;low@@ levels <<elseif $city.approval >= 0>> @@color:red;very low@@ levels <</if>> (_approvalTarget) <</nobr>>
<<widget calcTaxes>><<nobr>> <<set $taxRevenue to 0>> <<set $farmTax to 0>> <<set $servantsTax to 0>> <<set $scavTax to 0>> <<set $serviceTax to 0>> <<set $soldierTax to 0>> <<set $engineerTax to 0>> <<set $scientistTax to 0>> <<set $freePopTax to 0>> <<set $farmTax to ($workers.farmers * $baseFarmerTax)>> <<set $soldierTax to ($workers.guards * $baseGuardTax)>> <<set $scavTax to ($workers.scavengers * $baseScavengerTax)>> <<set $engineerTax to ($workers.engineers * $baseEngineerTax)>> <<set $scientistTax to ($workers.scientists * $baseScientistTax)>> <<set $freePopTax to ($workers.freePops * $baseFreePopTax)>> <<set $serviceTax to($workers.service * $baseServiceTax)>> <<set $servantsTax to ($workers.servants * $baseServantTax)>> <<set $taxRevenue to ($farmTax + $scavTax + $serviceTax + $soldierTax + $engineerTax + $scientistTax + $freePopTax + $servantsTax)>> <</nobr>><</widget>> <<widget calcWorkerUpkeep>><<nobr>> <<set $workerUpkeep to 0>> <<set $farmUpkeep to 0>> <<set $servantsUpkeep to 0>> <<set $scavUpkeep to 0>> <<set $serviceUpkeep to 0>> <<set $soldierUpkeep to 0>> <<set $engineerUpkeep to 0>> <<set $scientistUpkeep to 0>> <<set $freePopUpkeep to 0>> <<set $farmUpkeep to ($workers.farmers * $baseFarmerUpkeep)>> <<set $soldierUpkeep to ($workers.guards * $baseGuardUpkeep)>> <<set $scavUpkeep to ($workers.scavengers * $baseScavengerUpkeep)>> <<set $engineerUpkeep to ($workers.engineers * $baseEngineerUpkeep)>> <<set $scientistUpkeep to ($workers.scientists * $baseScientistUpkeep)>> <<set $freePopUpkeep to ($workers.freePops * $baseFreePopUpkeep)>> <<if $taskDebuff is "service double pay">> <<set $serviceUpkeep to ($workers.service * $baseServiceUpkeep)>> <<set $serviceUpkeep *= 2>> <<else>> <<set $serviceUpkeep to($workers.service * $baseServiceUpkeep)>> <</if>> <<if $taskDebuff is "servants double pay">> <<set $servantsUpkeep to ($workers.servants * $baseServantUpkeep)>> <<set $servantsUpkeep *= 2>> <<else>> <<set $servantsUpkeep to ($workers.servants * $baseServantUpkeep)>> <</if>> <<set $workerUpkeep to ($farmUpkeep + $scavUpkeep + $serviceUpkeep + $soldierUpkeep + $engineerUpkeep + $scientistUpkeep + $freePopUpkeep + $servantsUpkeep)>> <</nobr>><</widget>> <<widget calcTariffs>><<nobr>> <<set _popScaleFactor to $city.pop * 0.0001>> <<set $tariffsRevenue to $city.trade * _popScaleFactor * $tariffsLaw>> <</nobr>><</widget>> <<widget calcPrices>><<nobr>> <<set _tradeFactor to (50 + $city.trade) / 100>> <<set _foodSupplyFactor to ($startingFoodMarketSupply / $foodMarketSupply)>> <<set _scrapSupplyFactor to ($startingScrapMarketSupply / $scrapMarketSupply)>> <<set $foodMarketDiff to $startingFoodMarketSupply - $foodMarketSupply>> <<set $scrapMarketDiff to $startingScrapMarketSupply - $scrapMarketSupply>> <<set $foodMarketBuyPrice to Math.trunc($baseFoodPrice * $buyMarkup * _tradeFactor * _foodSupplyFactor)>> <<set $scrapMarketBuyPrice to Math.trunc($baseScrapPrice * $buyMarkup * _tradeFactor * _scrapSupplyFactor)>> <<set $foodMarketSellPrice to Math.trunc($baseFoodPrice * $sellMarkup / _tradeFactor * _foodSupplyFactor)>> <<set $scrapMarketSellPrice to Math.trunc($baseScrapPrice * $sellMarkup / _tradeFactor * _scrapSupplyFactor)>> <</nobr>><</widget>>
<<nobr>> Buy: <<if $city.money >= $foodMarketBuyPrice * 1 && $foodMarketSupply >= 1>> <<link "1">> <<set $city.money to $city.money - $foodMarketBuyPrice * 1>> <<set $foodMarketSupply to $foodMarketSupply - 1>> <<set $city.foodStored to $city.foodStored + 1>> <<goto "city">> <</link>> <<else>> 1 <</if>>| <<if $city.money >= $foodMarketBuyPrice * 5 && $foodMarketSupply >= 5>> <<link "5">> <<set $city.money to $city.money - $foodMarketBuyPrice * 5>> <<set $foodMarketSupply to $foodMarketSupply - 5>> <<set $city.foodStored to $city.foodStored + 5>> <<goto "city">> <</link>> <<else>> 5 <</if>>| <<if $city.money >= $foodMarketBuyPrice * 10 && $foodMarketSupply >= 10>> <<link "10">> <<set $city.money to $city.money - $foodMarketBuyPrice * 10>> <<set $foodMarketSupply to $foodMarketSupply - 10>> <<set $city.foodStored to $city.foodStored + 10>> <<goto "city">> <</link>> <<else>> 10 <</if>>| <<if $city.money >= $foodMarketBuyPrice * 20 && $foodMarketSupply >= 20>> <<link "20">> <<set $city.money to $city.money - $foodMarketBuyPrice * 20>> <<set $foodMarketSupply to $foodMarketSupply - 20>> <<set $city.foodStored to $city.foodStored + 20>> <<goto "city">> <</link>> <<else>> 20 <</if>>| <<if $city.money >= $foodMarketBuyPrice * 50 && $foodMarketSupply >= 50>> <<link "50">> <<set $city.money to $city.money - $foodMarketBuyPrice * 50>> <<set $foodMarketSupply to $foodMarketSupply - 50>> <<set $city.foodStored to $city.foodStored + 50>> <<goto "city">> <</link>> <<else>> 50 <</if>>| <<if $city.money >= $foodMarketBuyPrice * 100 && $foodMarketSupply >= 100>> <<link "100">> <<set $city.money to $city.money - $foodMarketBuyPrice * 100>> <<set $foodMarketSupply to $foodMarketSupply - 100>> <<set $city.foodStored to $city.foodStored + 100>> <<goto "city">> <</link>> <<else>> 100 <</if>> <br>Sell: <<if $city.foodStored >= 1>> <<link "1">> <<set $city.money to $city.money + $foodMarketSellPrice * 1>> <<set $foodMarketSupply to $foodMarketSupply + 1>> <<set $city.foodStored to $city.foodStored - 1>> <<goto "city">> <</link>> <<else>> 1 <</if>>| <<if $city.foodStored >= 5>> <<link "5">> <<set $city.money to $city.money + $foodMarketSellPrice * 5>> <<set $foodMarketSupply to $foodMarketSupply + 5>> <<set $city.foodStored to $city.foodStored - 5>> <<goto "city">> <</link>> <<else>> 5 <</if>>| <<if $city.foodStored >= 10>> <<link "10">> <<set $city.money to $city.money + $foodMarketSellPrice * 10>> <<set $foodMarketSupply to $foodMarketSupply + 10>> <<set $city.foodStored to $city.foodStored - 10>> <<goto "city">> <</link>> <<else>> 10 <</if>>| <<if $city.foodStored >= 20>> <<link "20">> <<set $city.money to $city.money + $foodMarketSellPrice * 20>> <<set $foodMarketSupply to $foodMarketSupply + 20>> <<set $city.foodStored to $city.foodStored - 20>> <<goto "city">> <</link>> <<else>> 20 <</if>>| <<if $city.foodStored >= 50>> <<link "50">> <<set $city.money to $city.money + $foodMarketSellPrice * 50>> <<set $foodMarketSupply to $foodMarketSupply + 50>> <<set $city.foodStored to $city.foodStored - 50>> <<goto "city">> <</link>> <<else>> 50 <</if>>| <<if $city.foodStored >= 100>> <<link "100">> <<set $city.money to $city.money + $foodMarketSellPrice * 100>> <<set $foodMarketSupply to $foodMarketSupply + 100>> <<set $city.foodStored to $city.foodStored - 100>> <<goto "city">> <</link>> <<else>> 100 <</if>> <</nobr>>
<<nobr>> Buy: <<if $city.money >= $scrapMarketBuyPrice * 1 && $scrapMarketSupply >= 1>> <<link "1">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 1>> <<set $scrapMarketSupply to $scrapMarketSupply - 1>> <<set $city.scrap to $city.scrap + 1>> <<goto "city">> <</link>> <<else>> 1 <</if>>| <<if $city.money >= $scrapMarketBuyPrice * 5 && $scrapMarketSupply >= 5>> <<link "5">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 5>> <<set $scrapMarketSupply to $scrapMarketSupply - 5>> <<set $city.scrap to $city.scrap + 5>> <<goto "city">> <</link>> <<else>> 5 <</if>>| <<if $city.money >= $scrapMarketBuyPrice * 10 && $scrapMarketSupply >= 10>> <<link "10">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 10>> <<set $scrapMarketSupply to $scrapMarketSupply - 10>> <<set $city.scrap to $city.scrap + 10>> <<goto "city">> <</link>> <<else>> 10 <</if>>| <<if $city.money >= $scrapMarketBuyPrice * 20 && $scrapMarketSupply >= 20>> <<link "20">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 20>> <<set $scrapMarketSupply to $scrapMarketSupply - 20>> <<set $city.scrap to $city.scrap + 20>> <<goto "city">> <</link>> <<else>> 20 <</if>>| <<if $city.money >= $scrapMarketBuyPrice * 50 && $scrapMarketSupply >= 50>> <<link "50">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 50>> <<set $scrapMarketSupply to $scrapMarketSupply - 50>> <<set $city.scrap to $city.scrap + 50>> <<goto "city">> <</link>> <<else>> 50 <</if>>| <<if $city.money >= $scrapMarketBuyPrice * 100 && $scrapMarketSupply >= 100>> <<link "100">> <<set $city.money to $city.money - $scrapMarketBuyPrice * 100>> <<set $scrapMarketSupply to $scrapMarketSupply - 100>> <<set $city.scrap to $city.scrap + 100>> <<goto "city">> <</link>> <<else>> 100 <</if>> <br>Sell: <<if $city.scrap >= 1>> <<link "1">> <<set $city.money to $city.money + $foodMarketSellPrice * 1>> <<set $scrapMarketSupply to $scrapMarketSupply + 1>> <<set $city.scrap to $city.scrap - 1>> <<goto "city">> <</link>> <<else>> 1 <</if>>| <<if $city.scrap >= 5>> <<link "5">> <<set $city.money to $city.money + $foodMarketSellPrice * 5>> <<set $scrapMarketSupply to $scrapMarketSupply + 5>> <<set $city.scrap to $city.scrap - 5>> <<goto "city">> <</link>> <<else>> 5 <</if>>| <<if $city.scrap >= 10>> <<link "10">> <<set $city.money to $city.money + $foodMarketSellPrice * 10>> <<set $scrapMarketSupply to $scrapMarketSupply + 10>> <<set $city.scrap to $city.scrap - 10>> <<goto "city">> <</link>> <<else>> 10 <</if>>| <<if $city.scrap >= 20>> <<link "0">> <<set $city.money to $city.money + $foodMarketSellPrice * 20>> <<set $scrapMarketSupply to $scrapMarketSupply + 20>> <<set $city.scrap to $city.scrap - 20>> <<goto "city">> <</link>> <<else>> 20 <</if>>| <<if $city.scrap >= 50>> <<link "50">> <<set $city.money to $city.money + $foodMarketSellPrice * 50>> <<set $scrapMarketSupply to $scrapMarketSupply + 50>> <<set $city.scrap to $city.scrap - 50>> <<goto "city">> <</link>> <<else>> 50 <</if>>| <<if $city.scrap >= 100>> <<link "100">> <<set $city.money to $city.money + $foodMarketSellPrice * 100>> <<set $scrapMarketSupply to $scrapMarketSupply + 100>> <<set $city.scrap to $city.scrap - 100>> <<goto "city">> <</link>> <<else>> 100 <</if>> <</nobr>>