Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
/* The Final Earth 2: building upgrades and modes, city upgrades and policies, made by tools/gen_upgrades.py
* from the original's buildingUpgradesInfo.json, cityUpgradesInfo.json, policiesInfo.json, classes and
* lang_en.csv. Don't edit: edit the generator. */
#include "upgrades.h"
#include "classes.h"
#include "data.h"
#include "pcls.h"
const UpgradeInfo upgrade_info[] = {
{.name = "Flowers", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Flowers", .text = "Flowers improve the happiness of residents. Improves housing quality by 5.", .cost = {[M_FOOD] = 1, [M_WOOD] = 2}, .layer = LAYER_MID, .sprite = SPR_UPGRADE_FLOWERS, .frames = 3, .bonusAttractiveness = 5, .next = 255},
{.name = "MachinePartsFactoryEfficiency", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Scrap Metal Recycling", .text = "Two stone is now used to make a machine part instead of three.", .cost = {[M_STONE] = 5, [M_MACHINEPARTS] = 10, [M_KNOWLEDGE] = 20}, .layer = -1, .next = 255},
{.name = "StoneUsingFactoryDisabled", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Disable Factory", .text = "The factory will fully halt production and not use any stone.", .layer = -1, .next = 255},
{.name = "RefinedStoneUsingFactoryDisabled", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Disable Factory", .text = "The factory will fully halt production and not use any refined metals.", .layer = -1, .next = 255},
{.name = "MachinePartsFactoryTurbo", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Turbo Boost", .text = "The factory will work twice as fast, but also use two more stone per machine part.", .cost = {[M_KNOWLEDGE] = 10}, .layer = -1, .next = 255},
{.name = "CensusData", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Census Data", .text = "Workers produce a small amount of knowledge based on the number of citizens.", .layer = -1, .next = 255},
{.name = "NightMayor", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Night Mayor", .text = "Nightclubs have 2 more capacity per worker here.", .layer = -1, .next = 255},
{.name = "RefinedMetalsFactoryHack", .kind = UK_BUILDING_MODE, .unlockFlags = 0, .title = "Firmware Modding", .text = "The factory will work 50% faster, but also use one more stone per unit of refined metal produced.", .cost = {[M_KNOWLEDGE] = 1337}, .layer = -1, .next = 255},
{.name = "FactoryWorking", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Enable Factory", .text = "The factory will work normally.", .layer = -1, .next = 255},
{.name = "LabWorking", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Enable Lab", .text = "The lab will work normally.", .layer = -1, .next = 255},
{.name = "LabDisabled", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Disable Lab", .text = "The lab will not use any machine parts nor produce knowledge. It can still boost Refined Metal Factories.", .layer = -1, .next = 255},
{.name = "FarmingResearch", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Genetic Crop Engineering", .text = "Crops of adjacent farms produce 7 more food per harvest.", .cost = {[M_WOOD] = 30, [M_MACHINEPARTS] = 10, [M_KNOWLEDGE] = 30}, .layer = LAYER_MID, .sprite = SPR_UPGRADE_FARMBOOST, .frames = 1, .next = 255},
{.name = "TreePlantationResearch", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Tree Growth Gas", .text = "Trees in adjacent tree plantations grow 20% faster.", .cost = {[M_WOOD] = 10, [M_MACHINEPARTS] = 20, [M_KNOWLEDGE] = 70}, .layer = LAYER_MAIN, .sprite = SPR_TREEGROWTHBOOST, .frames = 1, .next = 255},
{.name = "BetterPickaxes", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Better Pickaxes", .text = "Use better pickaxes to improve mining speed by 20%.", .cost = {[M_WOOD] = 3, [M_STONE] = 3, [M_KNOWLEDGE] = 3}, .layer = LAYER_BG, .sprite = SPR_IMPROVEDPICKAXES, .frames = 1, .next = 255},
{.name = "AIMining", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "AI-assisted Mining", .text = "Use a computer system to improve mining speed by 30%.", .cost = {[M_COMPUTERCHIPS] = 10, [M_KNOWLEDGE] = 1500}, .layer = LAYER_BG, .sprite = SPR_AIMINING, .frames = 1, .next = 255},
{.name = "DieShrink", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Die Shrink", .text = "The factory will work 50% faster and use two less units of refined metals per computer chip.", .cost = {[M_MACHINEPARTS] = 50, [M_REFINEDMETAL] = 10, [M_COMPUTERCHIPS] = 5, [M_KNOWLEDGE] = 1000}, .layer = LAYER_MID, .sprite = SPR_DIESHRINK, .frames = 1, .next = 255},
{.name = "BetterLightShow", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Better Light Show", .text = "The entertainment capacity of the building will be doubled.", .cost = {[M_MACHINEPARTS] = 20, [M_COMPUTERCHIPS] = 2, [M_KNOWLEDGE] = 100}, .layer = -1, .next = 255},
{.name = "MedicalEducation", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Improved Medical Education", .text = "The quality of this building will be increased by 25% of the education happiness.", .cost = {[M_FOOD] = 100, [M_WOOD] = 10, [M_KNOWLEDGE] = 100}, .layer = -1, .next = 255},
{.name = "AIAssistedDiagnosis", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Computer-Aided Diagnosis", .text = "The quality of this building will be increased by 25 and its capacity will be doubled.", .cost = {[M_STONE] = 20, [M_MACHINEPARTS] = 50, [M_COMPUTERCHIPS] = 25, [M_KNOWLEDGE] = 1000}, .layer = LAYER_BG, .sprite = SPR_SMARTDIAGNOSE, .frames = 1, .next = 255},
{.name = "StoneTeleporterRemote", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Remote Control", .text = "The worker of the rock teleporter can teleport stone even if they're somewhere else. This allows them to help mine stone as well.", .cost = {[M_MACHINEPARTS] = 2, [M_COMPUTERCHIPS] = 5, [M_KNOWLEDGE] = 500}, .layer = LAYER_BG, .sprite = SPR_STONETELEPORTER_REMOTE, .frames = 1, .next = 255},
{.name = "BiggerTV", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Bigger TV", .text = "Improves housing quality by 5. Adds capacity for one resident.", .cost = {[M_STONE] = 2, [M_COMPUTERCHIPS] = 1, [M_KNOWLEDGE] = 100}, .layer = LAYER_BG, .sprite = SPR_BIGGERTV, .frames = 1, .bonusAttractiveness = 5, .next = 255},
{.name = "ModernHomePlant", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Air-Cleaning Plant", .text = "A plant that's been cultivated to be extremely good at cleaning the air. Improves housing quality by 10 and makes residents live longer.", .cost = {[M_FOOD] = 20, [M_WOOD] = 10, [M_KNOWLEDGE] = 500}, .layer = LAYER_BG, .sprite = SPR_MODERNHOMEPLANT, .frames = 10, .lockedFrames = 3, .bonusAttractiveness = 10, .next = 255},
{.name = "HeatedBed", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Heated Bed", .text = "Improves housing quality by 20.", .cost = {[M_WOOD] = 10, [M_MACHINEPARTS] = 5, [M_COMPUTERCHIPS] = 1, [M_KNOWLEDGE] = 750}, .layer = -1, .bonusAttractiveness = 20, .next = 255},
{.name = "SmartChairs", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Smart Chairs", .text = "Improves housing quality by 10.", .cost = {[M_WOOD] = 4, [M_MACHINEPARTS] = 4, [M_COMPUTERCHIPS] = 4, [M_KNOWLEDGE] = 1000}, .layer = LAYER_BG, .sprite = SPR_SMARTCHAIRS, .frames = 1, .bonusAttractiveness = 10, .next = 255},
{.name = "ModernConveniences", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Modern Conveniences", .text = "Improves housing quality by 15.", .cost = {[M_WOOD] = 5, [M_MACHINEPARTS] = 5, [M_REFINEDMETAL] = 2, [M_KNOWLEDGE] = 100}, .layer = LAYER_BG, .sprite = SPR_MODERNCONVENIENCES, .frames = 1, .bonusAttractiveness = 15, .next = 255},
{.name = "WorkshopKnowledge", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Pet Projects", .text = "Gather knowledge.", .layer = LAYER_BG, .sprite = SPR_WORKSHOP_PETPROJECTS, .frames = 1, .next = 255},
{.name = "WorkshopMachineParts", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Craft Machine Parts", .text = "Create machine parts from wood.", .layer = LAYER_BG, .sprite = SPR_WORKSHOP_MAKEMACHINEPARTS, .frames = 1, .next = 255},
{.name = "StarDatabase", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Star Database", .text = "This building produces 50% more knowledge. If the Precise Universe Mapping upgrade from the Supercomputer has been researched, it produces 500% more knowledge instead.", .cost = {[M_STONE] = 5, [M_COMPUTERCHIPS] = 5, [M_KNOWLEDGE] = 100}, .layer = LAYER_BG, .sprite = SPR_COMPUTER_OBSERVATORY, .frames = 1, .next = 255},
{.name = "SofterBeds", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Extremely Soft Beds", .text = "Improves housing quality by 10.", .cost = {[M_FOOD] = 12, [M_WOOD] = 6, [M_KNOWLEDGE] = 50}, .layer = LAYER_BG, .sprite = SPR_SOFTERBEDS, .frames = 1, .bonusAttractiveness = 10, .next = 255},
{.name = "SmartLights", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Smart Lights", .text = "Improves housing quality by 15.", .cost = {[M_REFINEDMETAL] = 5, [M_COMPUTERCHIPS] = 1, [M_KNOWLEDGE] = 200}, .layer = LAYER_BG, .sprite = SPR_SMARTLIGHTS, .frames = 1, .bonusAttractiveness = 15, .noCache = 1, .next = 255},
{.name = "LivingComputer", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Living Computer", .text = "Improves housing quality by 20.", .cost = {[M_FOOD] = 25, [M_WOOD] = 50, [M_COMPUTERCHIPS] = 1, [M_KNOWLEDGE] = 2000}, .layer = LAYER_BG, .sprite = SPR_ALIENHOUSE_LIVINGCOMPUTER, .frames = 7, .bonusAttractiveness = 20, .next = 255},
{.name = "BetterTools", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Better Tools", .text = "Improves housing quality by 20.", .cost = {[M_MACHINEPARTS] = 10, [M_REFINEDMETAL] = 6, [M_COMPUTERCHIPS] = 2, [M_KNOWLEDGE] = 3000}, .layer = LAYER_BG, .sprite = SPR_TINKERERSHOUSE_BETTERTOOLS, .frames = 4, .bonusAttractiveness = 20, .next = 255},
{.name = "MisdirectorNormal", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Enable", .text = "The Misdirector is predictably unpredictable.", .layer = -1, .next = 255},
{.name = "MisdirectorAlways", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Overclock", .text = "Any attempt at teleportation will bring people here. Perfect to stop excess productivity.\\nThe knowledge gain per misdirection is reduced by 90% because the device is overloaded.", .cost = {[M_KNOWLEDGE] = 5000}, .layer = -1, .next = 255},
{.name = "MisdirectorMostlyDisabled", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Mostly Disable", .text = "There's an OFF button. It mostly works.", .layer = -1, .next = 255},
{.name = "MisdirectorDisabled", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Disable", .text = "With some effort, the Misdirector can be tamed.", .cost = {[M_KNOWLEDGE] = 50000}, .layer = -1, .next = 255},
{.name = "IndoorPond", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Indoor Pond", .text = "Improves housing quality by 15.", .cost = {[M_FOOD] = 20, [M_STONE] = 100, [M_KNOWLEDGE] = 10000}, .layer = LAYER_BG, .sprite = SPR_COMMUNITYHOUSE_INDOORPOND, .frames = 1, .bonusAttractiveness = 15, .next = 255},
{.name = "CHProduceStone", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Rock", .text = "Produce stone.", .layer = -1, .next = 255},
{.name = "CHProduceWood", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Tree", .text = "Produce wood.", .layer = -1, .next = 255},
{.name = "CHProduceFood", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Crops", .text = "Produce food.", .layer = -1, .next = 255},
{.name = "PickaxeTech", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Peer-Reviewed Pickaxe Part Papers", .text = "The boost to stone production is increased and scales faster with knowledge production.", .cost = {[M_COMPUTERCHIPS] = 25, [M_KNOWLEDGE] = 2500}, .layer = LAYER_BG, .sprite = SPR_STONERESEARCHCENTRE_PICKAXETECH, .frames = 1, .next = 255},
{.name = "FossilScanner", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Fossil Detector", .text = "Whenever a rock teleporter teleports a meteoroid, there is a tiny chance that a fossil is detected in it. When this happens, you gain 10000 knowledge.", .cost = {[M_COMPUTERCHIPS] = 2000, [M_KNOWLEDGE] = 150000}, .layer = LAYER_BG, .sprite = SPR_STONERESEARCHCENTRE_COMPUTER, .frames = 1, .next = 255},
{.name = "UltimateScrewdriver", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Ultra-High-Tech Screwdriver", .text = "You gain two more knowledge for each machine part used.", .cost = {[M_STONE] = 1, [M_MACHINEPARTS] = 1, [M_COMPUTERCHIPS] = 5, [M_KNOWLEDGE] = 10000}, .layer = LAYER_BG, .sprite = SPR_EXPERIMENTATIONLAB_SCREWDRIVER, .frames = 1, .noCache = 1, .next = 255},
{.name = "AutomaticWaterManagement", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Automatic Water Management", .text = "The passive growth speed of these trees is tripled.", .cost = {[M_MACHINEPARTS] = 5, [M_COMPUTERCHIPS] = 5, [M_KNOWLEDGE] = 5000}, .layer = -1, .next = 255},
{.name = "CulinaryHerbs", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Culinary Herbs", .text = "Increases the capacity of restaurants to the left and right of the garden.", .layer = -1, .next = 255},
{.name = "MedicalHerbs", .kind = UK_BUILDING_MODE, .unlockFlags = UF_DEFAULT, .title = "Medicinal Herbs", .text = "Improves the medical happiness. Herb gardens can't provide more than 20% of the medical happiness in total.", .cost = {[M_KNOWLEDGE] = 25}, .layer = -1, .next = 255},
{.name = "ComfortableCouch", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Comfortable Couch", .text = "Improves housing quality by 15.", .cost = {[M_FOOD] = 20, [M_WOOD] = 5, [M_KNOWLEDGE] = 200}, .layer = LAYER_BG, .sprite = SPR_COMFORTABLECOUCH, .frames = 1, .bonusAttractiveness = 15, .next = 255},
{.name = "SmartSpeaker", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Somewhat Smart Speaker", .text = "Improves housing quality by 10.", .cost = {[M_WOOD] = 2, [M_MACHINEPARTS] = 2, [M_COMPUTERCHIPS] = 2, [M_KNOWLEDGE] = 1000}, .layer = LAYER_BG, .sprite = SPR_SMARTSPEAKER, .frames = 1, .bonusAttractiveness = 10, .next = 255},
{.name = "SoundProofing", .kind = UK_BUILDING_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Soundproofing", .text = "Improves housing quality by 12.", .cost = {[M_WOOD] = 20, [M_STONE] = 10, [M_KNOWLEDGE] = 3000}, .layer = -1, .bonusAttractiveness = 12, .next = 255},
{.name = "RefinedMetalFactoryEfficiency", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Optimized Temperature Curve", .text = "The factory works faster and uses one less stone per unit of refined metal produced.", .cost = {[M_MACHINEPARTS] = 20, [M_COMPUTERCHIPS] = 3, [M_KNOWLEDGE] = 10000}, .layer = -1, .next = 255},
{.name = "TheMachineUpgrade", .kind = UK_BUILDING_UPGRADE, .unlockFlags = 0, .title = "Machine Tuning", .text = "The Machine produces 50% more materials and it sometimes also produces graphene and rocket fuel. If it's ever destroyed, Secret Society of the Key members stay alive longer. Members of the Feather Alliance live longer.", .cost = {[M_COMPUTERCHIPS] = 5000, [M_GRAPHENE] = 1000, [M_ROCKETFUEL] = 20000, [M_KNOWLEDGE] = 50000}, .layer = -1, .next = 255},
{.name = "UniverseMapping", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Precise Universe Mapping", .text = "Rock Teleporters teleport bigger meteoroids.", .cost = {[M_KNOWLEDGE] = 25000}, .layer = -1, .next = 255},
{.name = "OptimizedChipLayouts", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Optimized Chip Layouts", .text = "Computer Chip Factories work 33% faster.", .cost = {[M_KNOWLEDGE] = 50000}, .layer = -1, .next = 255},
{.name = "MedicalMachineLearning", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Medical Machine Learning", .text = "Makes your citizens live longer.", .cost = {[M_KNOWLEDGE] = 100000}, .layer = -1, .next = 255},
{.name = "WoodenLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Wooden Living", .text = "Improves the house quality of all Wooden Houses by 10.", .cost = {[M_KNOWLEDGE] = 200}, .layer = -1, .next = 255},
{.name = "SpaciousLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Spacious Living", .text = "Improves the house quality of all Spacious Houses by 15.", .cost = {[M_KNOWLEDGE] = 250}, .layer = -1, .next = 255},
{.name = "SlimyLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = 0, .title = "Slimy Living", .text = "Improves the house quality of all Alien Houses by 25. Also unlocks a building upgrade for them.", .cost = {[M_KNOWLEDGE] = 500}, .layer = -1, .next = 255},
{.name = "SecretiveLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_NOT_WITH_ALL, .title = "Secretive Living", .text = "Improves the house quality of the Secret Society of the Key by 25.", .cost = {[M_KNOWLEDGE] = 200}, .layer = -1, .next = 255},
{.name = "MechanicalLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = 0, .title = "Mechanical Living", .text = "Adds capacity for one more resident in all Mechanical Houses and Tinkerers' Houses.", .cost = {[M_KNOWLEDGE] = 8000}, .layer = -1, .next = 255},
{.name = "SuperSpaciousLiving", .kind = UK_CITY_UPGRADE, .unlockFlags = 0, .title = "Societal Living", .text = "Adds capacity for one more resident in all Spacious Houses.", .cost = {[M_KNOWLEDGE] = 9500}, .layer = -1, .next = 255},
{.name = "BirthControl", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Birth Control", .text = "Allows you to decrease or increase the population growth.", .cost = {[M_KNOWLEDGE] = 100}, .layer = -1, .next = 255},
{.name = "BuildingRecycling", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Building Recycling", .text = "When you destroy a building, you get back half its cost.", .cost = {[M_KNOWLEDGE] = 25}, .layer = -1, .next = 62},
{.name = "BuildingRecycling2", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_NOT_WITH_ALL, .title = "Smart Demolition (Currently: Building Recycling)", .text = "When you destroy a building, you get back 75% of its cost (currently 50%).", .cost = {[M_KNOWLEDGE] = 125}, .layer = -1, .next = 63},
{.name = "BuildingRecycling3", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_NOT_WITH_ALL, .title = "Sustainable Building (Currently: Smart Demolition)", .text = "When you destroy a building, you get back 90% of its cost (currently 75%).", .titleDone = "Sustainable Building", .textDone = "When you destroy a building, you get back 90% of its cost.", .cost = {[M_KNOWLEDGE] = 500}, .layer = -1, .next = 255},
{.name = "ChipBinning", .kind = UK_CITY_UPGRADE, .unlockFlags = 0, .title = "Chip Binning", .text = "Computer Chip Factories work 20% faster.", .cost = {[M_KNOWLEDGE] = 5000}, .layer = -1, .next = 255},
{.name = "EcoFarmUpgrade", .kind = UK_CITY_UPGRADE, .unlockFlags = 0, .title = "Permaculture", .text = "Eco farms produce more food.", .cost = {[M_KNOWLEDGE] = 1250}, .layer = -1, .next = 255},
{.name = "GeneEditing", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Gene Editing", .text = "Allows you to plant the purple and red forests and grass from Wooded Worlds, and the blue flowers from Bridge Worlds.", .cost = {[M_KNOWLEDGE] = 5000}, .layer = -1, .next = 255},
{.name = "LibraryAllowDuplicates", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Metropolis", .text = "Allows you to build the following unique buildings a second time: Workshop, Experimental Farm, Observatory, Art Colony, Computing Research Center, Living Research Center, Lab Escape Room, and Supercomputer. Their city upgrades are still available only once.", .cost = {[M_KNOWLEDGE] = 200000}, .layer = -1, .next = 255},
{.name = "ConnectedMachines", .kind = UK_CITY_UPGRADE, .unlockFlags = UF_DEFAULT, .title = "Connected Machines", .text = "The production of The Machine is increased by 50% for each Machine in an associated city.", .cost = {[M_KNOWLEDGE] = 500000}, .layer = -1, .next = 255},
{.name = "FoodRationing", .kind = UK_POLICY, .unlockFlags = UF_DEFAULT, .title = "Food Rationing", .text = "Your citizens consume half as much food. However, their happiness is reduced by a third if it's above 10.", .layer = -1, .next = 255},
{.name = "SmallerClasses", .kind = UK_POLICY, .unlockFlags = UF_DEFAULT, .title = "Smaller Class Sizes", .text = "Schools give a 15% better education, but their capacity is reduced by a third.", .layer = -1, .next = 255},
{.name = "MandatoryOvertime", .kind = UK_POLICY, .unlockFlags = UF_DEFAULT, .title = "Mandatory Overtime", .text = "Your citizens work two hours per day longer. Their happiness goes down gradually while this policy is implemented. After you end it, happiness starts to restore again slowly after a day.", .layer = -1, .next = 255},
};
const int nupgrades = sizeof upgrade_info / sizeof upgrade_info[0];
/* what each class offers in its window: upgrade_info indexes + 1 (0: none) */
const ClassUpgrades class_upgrades[CLS_COUNT] = {
[CLS_NormalHouse] = {.up = {U_Flowers + 1}},
[CLS_AlienHouse] = {.up = {U_LivingComputer + 1}},
[CLS_ModernRusticHome] = {.up = {U_ModernConveniences + 1}},
[CLS_ComfortableHouse] = {.up = {U_ComfortableCouch + 1, U_SmartSpeaker + 1}},
[CLS_MechanicalHouse] = {.up = {U_HeatedBed + 1}},
[CLS_SpaciousHouse] = {.up = {U_SmartLights + 1, U_SofterBeds + 1}},
[CLS_CuttingEdgeHome] = {.up = {U_BiggerTV + 1, U_ModernHomePlant + 1, U_SmartChairs + 1}},
[CLS_Loft] = {.up = {U_SoundProofing + 1}},
[CLS_TinkerersHome] = {.up = {U_BetterTools + 1}},
[CLS_FarmHouse] = {.up = {U_IndoorPond + 1}, .mode = {U_CHProduceFood + 1, U_CHProduceStone + 1, U_CHProduceWood + 1}},
[CLS_StoneMine] = {.up = {U_BetterPickaxes + 1, U_AIMining + 1}},
[CLS_MachinePartsFactory] = {.up = {U_MachinePartsFactoryEfficiency + 1}, .mode = {U_FactoryWorking + 1, U_MachinePartsFactoryTurbo + 1, U_StoneUsingFactoryDisabled + 1}},
[CLS_Laboratory] = {.up = {U_FarmingResearch + 1, U_TreePlantationResearch + 1}},
[CLS_TreePlantation] = {.up = {U_AutomaticWaterManagement + 1}},
[CLS_StoneTeleporter] = {.up = {U_StoneTeleporterRemote + 1}},
[CLS_RefinedMetalFactory] = {.up = {U_RefinedMetalFactoryEfficiency + 1}, .mode = {U_FactoryWorking + 1, U_RefinedMetalsFactoryHack + 1, U_StoneUsingFactoryDisabled + 1}},
[CLS_ComputerChipFactory] = {.up = {U_DieShrink + 1}, .mode = {U_FactoryWorking + 1, U_RefinedStoneUsingFactoryDisabled + 1}},
[CLS_ExperimentationLab] = {.up = {U_UltimateScrewdriver + 1}, .mode = {U_LabWorking + 1, U_LabDisabled + 1}},
[CLS_HerbGarden] = {.mode = {U_CulinaryHerbs + 1, U_MedicalHerbs + 1}},
[CLS_MedicalClinic] = {.up = {U_MedicalEducation + 1, U_AIAssistedDiagnosis + 1}, .city = {U_BirthControl + 1}},
[CLS_FactoryPub] = {.up = {U_RefinedMetalFactoryEfficiency + 1}, .mode = {U_FactoryWorking + 1, U_RefinedMetalsFactoryHack + 1, U_StoneUsingFactoryDisabled + 1}},
[CLS_NightClub] = {.up = {U_BetterLightShow + 1}},
[CLS_Workshop] = {.mode = {U_WorkshopMachineParts + 1, U_WorkshopKnowledge + 1}, .city = {U_BuildingRecycling + 1, U_BuildingRecycling2 + 1, U_BuildingRecycling3 + 1}},
[CLS_ExperimentalFarm] = {.city = {U_EcoFarmUpgrade + 1}},
[CLS_Observatory] = {.up = {U_StarDatabase + 1}},
[CLS_CityHall] = {.mode = {U_CensusData + 1, U_NightMayor + 1}, .pol = {U_FoodRationing + 1, U_SmallerClasses + 1, U_MandatoryOvertime + 1}},
[CLS_StoneResearchCenter] = {.up = {U_PickaxeTech + 1, U_FossilScanner + 1}},
[CLS_ComputerResearchCenter] = {.city = {U_ChipBinning + 1}},
[CLS_LivingResearchCenter] = {.city = {U_WoodenLiving + 1, U_SpaciousLiving + 1, U_SlimyLiving + 1, U_SecretiveLiving + 1, U_MechanicalLiving + 1, U_SuperSpaciousLiving + 1}},
[CLS_Misdirector] = {.mode = {U_MisdirectorNormal + 1, U_MisdirectorAlways + 1, U_MisdirectorMostlyDisabled + 1, U_MisdirectorDisabled + 1}},
[CLS_TheMachine] = {.up = {U_TheMachineUpgrade + 1}},
[CLS_IntergalacticLibrary] = {.city = {U_GeneEditing + 1, U_LibraryAllowDuplicates + 1, U_ConnectedMachines + 1}},
[CLS_Supercomputer] = {.city = {U_UniverseMapping + 1, U_OptimizedChipLayouts + 1, U_MedicalMachineLearning + 1}},
};
int upgrade_find(const char *name) {
for (int i = 0; i < nupgrades; i++)
if (!strcmp(upgrade_info[i].name, name)) return i;
return -1;
}