feat: Add Planner citizen type with automated city expansion
This commit is contained in:
16
events.js
16
events.js
@@ -96,6 +96,11 @@ function setupBuyButtons() {
|
||||
logAction("Click on map to place a new Soldier citizen.");
|
||||
});
|
||||
|
||||
document.getElementById('buyPlannerBtn').addEventListener('click', () => {
|
||||
purchaseMode = "Planner";
|
||||
logAction("Click on map to place a new Planner citizen.");
|
||||
});
|
||||
|
||||
document.getElementById('buyMarketBtn').addEventListener('click', () => {
|
||||
purchaseMode = "Market";
|
||||
logAction("Click on map to place a Market site.");
|
||||
@@ -395,6 +400,17 @@ function setupCanvasClick() {
|
||||
}
|
||||
break;
|
||||
|
||||
case "Planner":
|
||||
if(money >= COST_PLANNER) {
|
||||
addMoney(-COST_PLANNER, "Buy Planner");
|
||||
let c = createCitizen(randomName(), worldX, worldY, "Planner");
|
||||
citizens.push(c);
|
||||
logAction(`Purchased new Planner @(${Math.floor(worldX)},${Math.floor(worldY)})`);
|
||||
} else {
|
||||
logAction("Not enough money to buy Planner!");
|
||||
}
|
||||
break;
|
||||
|
||||
case "Spawner":
|
||||
if(money >= COST_SPAWNER) {
|
||||
addMoney(-COST_SPAWNER, "Buy Spawner");
|
||||
|
||||
Reference in New Issue
Block a user