|
|
|
@@ -302,7 +302,9 @@ function createTemplateUpgrades() { |
|
|
|
createHelperUpgrades(); |
|
|
|
createClickVictimUpgrades(); |
|
|
|
createPowerupFreqUpgrades(); |
|
|
|
createFreeBuildingPowerups(); |
|
|
|
deepFreeze(upgrades); |
|
|
|
deepFreeze(powerups); |
|
|
|
} |
|
|
|
|
|
|
|
const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100]; |
|
|
|
@@ -1198,27 +1200,19 @@ const powerups = { |
|
|
|
name: "Free Food", |
|
|
|
description: "Tasty!", |
|
|
|
icon: "fa-drumstick-bite", |
|
|
|
prereqs: state => true, |
|
|
|
effect: state => state.resources.food += state.currentProductivity.food * 60, |
|
|
|
popup: (self, e) => { |
|
|
|
clickPopup("GULP!", "gulp", [e.clientX, e.clientY]); |
|
|
|
clickPopup("+60 seconds of food", "food", [e.clientX, e.clientY]); |
|
|
|
} |
|
|
|
}, |
|
|
|
"free-car": { |
|
|
|
name: "Free Car", |
|
|
|
description: "It's FREE!", |
|
|
|
icon: "fa-car", |
|
|
|
effect: state => state.belongings.car.count += 1, |
|
|
|
popup: (self, e) => { |
|
|
|
clickPopup("CAR!", "gulp", [e.clientX, e.clientY]); |
|
|
|
clickPopup("+1 car", "food", [e.clientX, e.clientY]); |
|
|
|
} |
|
|
|
}, |
|
|
|
"double": { |
|
|
|
name: "Double Dip", |
|
|
|
description: "Doubled productivity!", |
|
|
|
icon: "fa-cogs", |
|
|
|
duration: 10000, |
|
|
|
prereqs: state => true, |
|
|
|
effect: state => state.currentProductivity.food *= 2, |
|
|
|
popup: (self, e) => { |
|
|
|
clickPopup("VROOM!", "gulp", [e.clientX, e.clientY]); |
|
|
|
@@ -1226,6 +1220,32 @@ const powerups = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function createFreeBuildingPowerups() { |
|
|
|
const prefix = "free-"; |
|
|
|
Object.entries(freeBuildingPowerupText).forEach(([building, text]) => { |
|
|
|
const key = prefix + building; |
|
|
|
|
|
|
|
powerups[key] = { |
|
|
|
name: text.name, |
|
|
|
description: text.desc, |
|
|
|
icon: buildings[building].icon, |
|
|
|
prereqs: state => state.belongings[building].count > 0 && state.belongings[building].count < 100, |
|
|
|
effect: state => state.belongings[building].count += 1, |
|
|
|
popup: (self, e) => clickPopup("+1 " + buildings[building].name, "food", [e.clientX, e.clientY]) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const freeBuildingPowerupText = { |
|
|
|
car: { |
|
|
|
name: "Free Car", |
|
|
|
desc: "It's FREE!" |
|
|
|
}, |
|
|
|
bus: { |
|
|
|
name: "Deserted Bus", |
|
|
|
desc: "Just kidding. It's full of people." |
|
|
|
} |
|
|
|
} |
|
|
|
deepFreeze(prodUpgradeText); |
|
|
|
deepFreeze(prodAllUpgradeText); |
|
|
|
deepFreeze(clickUpgradeText); |
|
|
|
|