|
- "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": 1.2e3,
- "prod": 1e1/1.2
- },
- "bus": {
- "name": "Bus",
- "plural": "Buses",
- "desc": "Probably the worst place to be when a macro is aroud.",
- "cost": 1.4e4,
- "prod": 1e2/1.3
- },
- "house": {
- "name": "House",
- "plural": "Houses",
- "desc": "Home sweet home - but it doesn't taste sweet?",
- "cost": 1.6e5,
- "prod": 1e3/1.4
- },
- "apartment": {
- "name": "Apartment",
- "plural": "Apartments",
- "desc": "More snacks, less packaging.",
- "cost": 1.8e6,
- "prod": 1e4/1.5
- },
- "block": {
- "name": "Block",
- "plural": "Blocks",
- "desc": "A whole pile of buildings.",
- "cost": 2e7,
- "prod": 1e5/1.6
- },
- "town": {
- "name": "Town",
- "plural": "Towns",
- "desc": "'Tourist trap' has never been this literal.",
- "cost": 2.2e8,
- "prod": 1e6/1.7
- },
- "city": {
- "name": "City",
- "plural": "Cities",
- "desc": "Please no sitty on our city.",
- "cost": 2.4e9,
- "prod": 1e7/1.8
- },
- "metro": {
- "name": "Metropolis",
- "plural": "Metropolises",
- "desc": "A big ol' city. Tasty, too.",
- "cost": 2.6e10,
- "prod": 1e8/1.9
- },
- "county": {
- "name": "County",
- "plural": "Counties",
- "desc": "Why salt the land when you can slurp it?",
- "cost": 2.8e11,
- "prod": 1e9/2
- },
- "state": {
- "name": "State",
- "plural": "States",
- "desc": "The United States is made up of...43 states - no, 42...",
- "cost": 3e12,
- "prod": 1e10/2.1
- },
- "country": {
- "name": "Country",
- "plural": "Countries",
- "desc": "One nation, under paw.",
- "cost": 3.2e13,
- "prod": 1e11/2.2
- },
- "continent": {
- "name": "Continent",
- "plural": "Continents",
- "desc": "Earth-shattering appetite!",
- "cost": 3.4e14,
- "prod": 1e12/2.3
- },
- "planet": {
- "name": "Planet",
- "plural": "Planets",
- "desc": "Earth appetite!",
- "cost": 3.6e15,
- "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";
- }
- },
- "helper": {
- "apply": function(effect, productivity, helperCount) {
- return productivity * (1 + effect.amount * helperCount);
- },
- "desc": function(effect) {
- return "+" + round(effect.amount * 100) + "% food/sec from " + buildings[effect.helped].name + " for every " + buildings[effect.helper].name + " owned.";
- }
- }
- }
-
- let upgrades = {
- "anthro-help-micro-1": {
- "name": "Servants",
- "desc": "Why bother walking anywhere, really?",
- "cost": {
- "food": buildings.anthro.cost * 25 + buildings.micro.cost * 50
- },
- "effects": [
- {
- "type": "helper",
- "helper": "anthro",
- "helped": "micro",
- "amount": 0.01
- }
- ],
- "prereqs": {
- "buildings": {
- "anthro": 10
- },
- "upgrades": [
- "anthro-prod-1"
- ]
- }
- }
-
- }
-
- function createTemplateUpgrades() {
- console.log("qwewq");
- createProdUpgrades();
- createProdAllUpgrades();
- }
-
- const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100];
-
- function createProdUpgrades() {
- for (const [key, value] of Object.entries(prodUpgradeText)) {
- let counter = 1;
- let prefix = key + "-prod-";
- for (let contents of value) {
- upgrades[prefix + counter] = {
- "name": contents.name,
- "desc": contents.desc,
- "cost": {
- "food": buildings[key].cost * 5 * Math.pow(10,counter - 1)
- },
- "effects": [
- {
- "type": "prod",
- "amount": 2 + (counter - 1) * 0.25,
- "target": key
- }
- ]
- };
-
- upgrades[prefix + counter]["prereqs"] = {};
- upgrades[prefix + counter]["prereqs"]["buildings"] = {};
- upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1];
-
- if (counter > 1) {
- upgrades[prefix + counter]["prereqs"]["upgrades"] = [
- prefix + (counter - 1)
- ];
- }
-
- counter += 1;
- }
- }
- }
-
- function createProdAllUpgrades() {
- let prefix = "prod-all-"
-
- let counter = 1;
-
- for (let contents of prodAllUpgradeText) {
- upgrades[prefix + counter] = {
- "name": contents.name,
- "desc": contents.desc,
- "cost": {
- "food": 5 * Math.pow(10, counter+1)
- },
- "effects": [
- {
- "type": "prod-all",
- "amount": 1.05
- }
- ],
- "prereqs": {
- "productivity": {
- "food": Math.pow(10, counter)
- }
- }
- };
-
- if (counter > 1) {
- upgrades[prefix + counter]["prereqs"].upgrades = [
- prefix + (counter - 1)
- ];
- }
- }
- }
-
- let prodUpgradeText = {
- "micro": [
- {
- "name": "Bigger Micros",
- "desc": "A macro micro? It's more filling, for sure.",
- },
- {
- "name": "Beefy Micros",
- "desc": "25% more protein, 10% fewer carbs."
- },
- {
- "name": "Delicious Micros",
- "desc": "Betcha' can't eat just one."
- },
- {
- "name": "Irresistable Micros",
- "desc": "Genetically engineered to be delectable."
- },
- {
- "name": "Exquisite Micros",
- "desc": "Dangerously delicious."
- }
- ],
- "anthro": [
- {
- "name": "Willing Prey",
- "desc": "Why bother chasing down your meal?"
- },
- {
- "name": "Fattened Prey",
- "desc": "9 calories per gram!"
- },
- {
- "name": "Mesmerized Prey",
- "desc": "Why bother walking to your meal?"
- },
- {
- "name": "Food-Safe Lubricant",
- "desc": "Ease them down your gullet with ease. Thanks, chemistry!"
- },
- {
- "name": "Mandatory Meal Training",
- "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%."
- }
- ],
- "car": [
- {
- "name": "HOV Lane",
- "desc": "Think of the environment! And of your impending digestion, I guess."
- },
- {
- "name": "Lightweight Frames",
- "desc": "Although crunchy, the shell around the snacks isn't very appetizing."
- },
- {
- "name": "Traffic Engineering",
- "desc": "Maximizing throughput into your gullet."
- },
- {
- "name": "Super Highways",
- "desc": "Six lanes! Fresh pavement! A ravenous maw!"
- },
- {
- "name": "Stacked Cars",
- "desc": "When we couldn't make the roads any wider, we tried stacking the cars higher."
- }
- ],
- "bus": [
- {
- "name": "Bus Passes",
- "desc": "Save on greenhouse emissions. Save your predator's effort. Everyone wins!"
- },
- {
- "name": "Double Deckers",
- "desc": "Stack 'em up! Slurp 'em down!"
- },
- {
- "name": "Articulated Buses",
- "desc": "The bend really helps them slip down your throat."
- }
- ],
- "house": [
- {
- "name": "Remodeling",
- "desc": "Strip out that icky asbestos."
- },
- {
- "name": "Suburbia",
- "desc": "It's like a buffet line!"
- },
-
- ]
- }
-
- let prodAllUpgradeText = [
- {
- "name": "Sloth Metabolism",
- "desc": "Burn those calories. Eventually."
- },
- {
- "name": "Decent Metabolism",
- "desc": "Picking up the pace."
- },
- {
- "name": "Perky Metabolism",
- "desc": "Sweat a little."
- },
- {
- "name": "Quick Metabolism",
- "desc": "Burn those calories."
- },
- {
- "name": "Speedy Metabolism",
- "desc": "More prey, more power."
- },
- {
- "name": "Fast Metabolism",
- "desc": "You're a furnace. Fueled by people."
- },
- {
- "name": "Powerful Metabolism",
- "desc": "Digest them all."
- }
- ]
|