diff --git a/public/img/buildings/field.png b/public/img/buildings/field.png index a4de3c5..5290b93 100644 Binary files a/public/img/buildings/field.png and b/public/img/buildings/field.png differ diff --git a/public/img/buildings/great-granary.png b/public/img/buildings/great-granary.png new file mode 100644 index 0000000..83934a1 Binary files /dev/null and b/public/img/buildings/great-granary.png differ diff --git a/public/img/buildings/great-warehouse.png b/public/img/buildings/great-warehouse.png new file mode 100644 index 0000000..d682070 Binary files /dev/null and b/public/img/buildings/great-warehouse.png differ diff --git a/public/img/buildings/pit.png b/public/img/buildings/pit.png index 205705c..c76fe93 100644 Binary files a/public/img/buildings/pit.png and b/public/img/buildings/pit.png differ diff --git a/public/img/buildings/wonder.png b/public/img/buildings/wonder.png new file mode 100644 index 0000000..86190dc Binary files /dev/null and b/public/img/buildings/wonder.png differ diff --git a/src/data/buildings.ts b/src/data/buildings.ts index 6184be5..e7982d5 100644 --- a/src/data/buildings.ts +++ b/src/data/buildings.ts @@ -353,4 +353,35 @@ export default [ }, }, }, + { + type: 'wonder', + name: 'World Wonder', + maxLevel: 1, + unique: true, + requiredTownhallLevel: 20, + cost: () => { + return { + wood: 42000, + stone: 42000, + iron: 42000, + food: 38000, + }; + }, + timeToBuild: () => 120, + behavior: { + production: (V: VillageState, self: BuildingType) => { + const prod = getEmptyResources(); + prod.food = self.level * -300; + return prod; + }, + triggers: { + onLevelUp: (V: VillageState, self: BuildingType) => { + if (self.level === 1) { + // Gain a lot of culture. + V.resources.culture += 18000; + } + }, + }, + }, + }, ]; diff --git a/src/village.ts b/src/village.ts index 2543b1a..68e33a7 100644 --- a/src/village.ts +++ b/src/village.ts @@ -112,6 +112,7 @@ function getInitialState() { // Create the Town hall. const townhall = createBuilding('townhall'); + // townhall.level = 20; state.villageTiles[0][0] = townhall.id; state.buildings.push(townhall); @@ -134,7 +135,7 @@ function getInitialState() { } const newBuilding = createBuilding(type); newBuilding.tile = new Hex(x, y); - newBuilding.level = 20; //newBuilding.type === 'field' ? 1 : 10; + newBuilding.level = 1; //20; //newBuilding.type === 'field' ? 1 : 10; state.outsideTiles[y][x] = newBuilding.id; state.buildings.push(newBuilding); });