Building in construction…
- { :else if building.type === 'university' } -diff --git a/src/data/buildings.ts b/src/data/buildings.ts index 27fbe75..f00b359 100644 --- a/src/data/buildings.ts +++ b/src/data/buildings.ts @@ -194,5 +194,29 @@ export default [ recruitmentTime: (V: VillageState, self: BuildingType) => 2 - 0.06 * self.level, }, }, - } + }, + { + type: 'barracks', + name: 'Barracks', + cost: (level: number) => { + return { + wood: level * 100, + stone: level * 100, + iron: level * 100, + food: 0, + }; + }, + behavior: { + production: (V: VillageState, self: BuildingType) => { + const prod = getEmptyResources(); + const intakePerMinute = Math.ceil(self.level / 3) * 3; + prod.food = -intakePerMinute; + return prod; + }, + units: { + type: 'soldier', + recruitmentTime: (V: VillageState, self: BuildingType) => 1 - 0.03 * self.level, + }, + }, + }, ]; diff --git a/src/data/units.ts b/src/data/units.ts index 49e996c..47f4450 100644 --- a/src/data/units.ts +++ b/src/data/units.ts @@ -13,4 +13,17 @@ export default [ foodIntakePerMinute: 2, }, }, + { + type: 'soldier', + name: 'Soldier', + cost: { + wood: 15, + stone: 5, + iron: 40, + food: 0, + }, + behavior: { + foodIntakePerMinute: 1, + }, + }, ]; diff --git a/src/hud/BuildingPanel.svelte b/src/hud/BuildingPanel.svelte index 9018b59..297e144 100644 --- a/src/hud/BuildingPanel.svelte +++ b/src/hud/BuildingPanel.svelte @@ -3,7 +3,7 @@ import showBuildingPanel from "../stores/showBuildingPanel"; import { getBuilding } from "../utils"; import village from "../village"; - import UniversityPanel from "./UniversityPanel.svelte"; + import BuildingRecruitment from "./BuildingRecruitment.svelte"; function close() { showBuildingPanel.set(null); @@ -35,8 +35,8 @@
Building in construction…
- { :else if building.type === 'university' } -Create Philosophers
+Recruit { unit.name }s