|
- "use strict";
-
- const resourceTypes = {
- "food": {
- name: "Food"
- }
- }
- const buildings = {
- "micro": {
- "name": "Micro",
- "plural": "Micros",
- "desc": "A tasty, squirmy treat.",
- "cost": 1e1,
- "prod": 1e-1/1
- },
- "anthro": {
- "name": "Anthro",
- "plural": "Anthros",
- "desc": "Something more substantial to sate your hunger.",
- "cost": 1e2,
- "prod": 1e0/1.1
- },
- "car": {
- "name": "Car",
- "plural": "Cars",
- "desc": "Crunchy shell, tasty center.",
- "cost": 1e3,
- "prod": 1e1/1.2
- },
- "bus": {
- "name": "Bus",
- "plural": "Buses",
- "desc": "Probably the worst place to be when a macro is aroud.",
- "cost": 1e4,
- "prod": 1e2/1.3
- },
- "house": {
- "name": "House",
- "plural": "Houses",
- "desc": "Home sweet home - but it doesn't taste sweet?",
- "cost": 1e5,
- "prod": 1e3/1.4
- },
- "apartment": {
- "name": "Apartment",
- "plural": "Apartments",
- "desc": "More snacks, less packaging.",
- "cost": 1e6,
- "prod": 1e4/1.5
- },
- "block": {
- "name": "Block",
- "plural": "Blocks",
- "desc": "A whole pile of buildings.",
- "cost": 1e7,
- "prod": 1e5/1.6
- },
- "town": {
- "name": "Town",
- "plural": "Towns",
- "desc": "'Tourist trap' has never been this literal.",
- "cost": 1e8,
- "prod": 1e6/1.7
- },
- "city": {
- "name": "City",
- "plural": "Cities",
- "desc": "Please no sitty on our city.",
- "cost": 1e9,
- "prod": 1e7/1.8
- },
- "metro": {
- "name": "Metropolis",
- "plural": "Metropolises",
- "desc": "A big ol' city. Tasty, too.",
- "cost": 1e10,
- "prod": 1e8/1.9
- },
- "county": {
- "name": "County",
- "plural": "Counties",
- "desc": "Why salt the land when you can slurp it?",
- "cost": 1e11,
- "prod": 1e9/2
- },
- "state": {
- "name": "State",
- "plural": "States",
- "desc": "The United States is made up of...43 states - no, 42...",
- "cost": 1e12,
- "prod": 1e10/2.1
- },
- "country": {
- "name": "Country",
- "plural": "Countries",
- "desc": "One nation, under paw.",
- "cost": 1e13,
- "prod": 1e11/2.2
- },
- "continent": {
- "name": "Continent",
- "plural": "Continents",
- "desc": "Earth-shattering appetite!",
- "cost": 1e14,
- "prod": 1e12/2.3
- },
- "planet": {
- "name": "Planet",
- "plural": "Planets",
- "desc": "Earth appetite!",
- "cost": 1e15,
- "prod": 1e13/2.4
- }
- }
-
- const effect_types = {
- "prod": {
- "apply": function(effect, productivity) {
- return productivity * effect.amount;
- },
- "desc": function(effect) {
- return round(effect.amount, 2) + "x food production from " + buildings[effect.target].plural;
- }
- },
- "prod-all": {
- "apply": function(effect, productivity) {
- return productivity * effect.amount;
- },
- "desc": function(effect) {
- return round((effect.amount - 1) * 100) + "% increase to food production";
- }
- }
- }
-
- const upgrades = {
- "micro-prod-1": {
- "name": "Bigger Micros",
- "desc": "A macro micro? Certainly more filling.",
- "cost": {
- "food": buildings.micro.cost * 10
- },
- "effects": [
- {
- "type": "prod",
- "target": "micro",
- "amount": 2,
- }
- ],
- "prereqs": {
- "buildings": {
- "micro": 1
- }
- }
- },
- "micro-prod-2": {
- "name": "Beefy Micros",
- "desc": "25% more protein, 10% fewer carbs.",
- "cost": {
- "food": buildings.micro.cost * 50
- },
- "effects": [
- {
- "type": "prod",
- "target": "micro",
- "amount": 2.25,
- }
- ],
- "prereqs": {
- "buildings": {
- "micro": 5
- },
- "upgrades": [
- "micro-prod-1"
- ]
- }
- },
- "anthro-prod-1": {
- "name": "Willing Prey",
- "desc": "Why bother chasing it down?",
- "cost": {
- "food": buildings.anthro.cost * 5
- },
- "effects": [
- {
- "type": "prod",
- "target": "anthro",
- "amount": 2,
- }
- ],
- "prereqs": {
- "buildings": {
- "anthro": 1
- }
- }
- },
- "anthro-prod-2": {
- "name": "Mesmerized Prey",
- "desc": "Why bother walking over to it?",
- "cost": {
- "food": buildings.anthro.cost * 50
- },
- "effects": [
- {
- "type": "prod",
- "target": "anthro",
- "amount": 2.25,
- }
- ],
- "prereqs": {
- "buildings": {
- "anthro": 10
- },
- "upgrades": [
- "anthro-prod-1"
- ]
- }
- },
- "prod-1": {
- "name": "Sloth Metabolism",
- "desc": "Burn those calories. Eventually.",
- "cost": {
- "food": 5e2
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e1
- }
- },
- },
- "prod-2": {
- "name": "Decent Metabolism",
- "desc": "Picking up the pace.",
- "cost": {
- "food": 5e3
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e2
- },
- "upgrades": [
- "prod-1"
- ]
- },
- },
- "prod-3": {
- "name": "Perky Metabolism",
- "desc": "Sweat a little.",
- "cost": {
- "food": 5e4
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e3
- },
- "upgrades": [
- "prod-2"
- ]
- },
- },
- "prod-4": {
- "name": "Quick Metabolism",
- "desc": "Burn those calories.",
- "cost": {
- "food": 5e5
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e4
- },
- "upgrades": [
- "prod-3"
- ]
- },
- },
- "prod-5": {
- "name": "Speedy Metabolism",
- "desc": "More prey, more power.",
- "cost": {
- "food": 5e6
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e5
- },
- "upgrades": [
- "prod-4"
- ]
- },
- },
- "prod-6": {
- "name": "Fast Metabolism",
- "desc": "You're a furnace.",
- "cost": {
- "food": 5e7
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e6
- },
- "upgrades": [
- "prod-5"
- ]
- },
- },
- "prod-7": {
- "name": "Powerful Metabolism",
- "desc": "Digest them all.",
- "cost": {
- "food": 5e8
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": 1e7
- },
- "upgrades": [
- "prod-6"
- ]
- },
- },
- }
|