Skip to content

Commit

Permalink
New Buildings for V4 (#87)
Browse files Browse the repository at this point in the history
* feat: new buildings

* feat: modified techs to reduce cost and upkeep of new buildings

* fix: Adjust some values

---------

Co-authored-by: Adrian Kunz <[email protected]>
  • Loading branch information
Maiswaffeln and Clashsoft authored Jun 22, 2024
1 parent 0810aac commit 14e18f9
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 4 deletions.
30 changes: 30 additions & 0 deletions src/game-logic/buildings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,36 @@ export const BUILDINGS = {
fuel: 10, // fuel_production tech tree
},
},
shipyard: {
id: 'shipyard',
cost: {
minerals: 50, // cheap_buildings tech tree
alloys: 75, // cheap_buildings tech tree
},
upkeep: {
minerals: 10, // efficient_buildings tech tree
energy: 5, // efficient_buildings tech tree
fuel: 5, // efficient_buildings tech tree
alloys: 10, // efficient_buildings tech tree
},
production: {
},
},
fortress: {
id: 'fortress',
cost: {
minerals: 75, // cheap_buildings tech tree
alloys: 75, // cheap_buildings tech tree
},
upkeep: {
minerals: 5, // efficient_buildings tech tree
energy: 8, // efficient_buildings tech tree
fuel: 8, // efficient_buildings tech tree
alloys: 5, // efficient_buildings tech tree
},
production: {
},
},
} as const satisfies Record<string, Building>;
export type BuildingName = keyof typeof BUILDINGS;
export const BUILDING_NAMES = Object.keys(BUILDINGS) as BuildingName[];
63 changes: 59 additions & 4 deletions src/game-logic/technologies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,30 @@ export const TECHNOLOGIES: Record<string, Technology> = {
},
],
},
cheap_buildings_3: { // reduced advanced building costs
id: 'cheap_buildings_3',
tags: ['engineering', 'construction'],
cost: 4,
requires: ['cheap_buildings_2'],
effects: [
{
variable: 'buildings.shipyard.cost.alloys',
multiplier: 0.85,
},
{
variable: 'buildings.shipyard.cost.minerals',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.cost.alloys',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.cost.minerals',
multiplier: 0.85,
},
],
},

/** buildings: reduce energy upkeep */
efficient_buildings_1: { // reduced basic building energy upkeep
Expand All @@ -340,6 +364,10 @@ export const TECHNOLOGIES: Record<string, Technology> = {
variable: 'buildings.factory.upkeep.energy',
multiplier: 0.85,
},
{
variable: 'buildings.farm.upkeep.fuel',
multiplier: 0.85,
},
],
},
efficient_buildings_2: { // reduced advanced building energy upkeep
Expand All @@ -364,6 +392,18 @@ export const TECHNOLOGIES: Record<string, Technology> = {
variable: 'buildings.exchange.upkeep.energy',
multiplier: 0.85,
},
{
variable: 'buildings.mine.upkeep.fuel',
multiplier: 0.85,
},
{
variable: 'buildings.shipyard.upkeep.fuel',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.upkeep.fuel',
multiplier: 0.85,
},
],
},
efficient_buildings_3: {
Expand All @@ -377,19 +417,34 @@ export const TECHNOLOGIES: Record<string, Technology> = {
multiplier: 0.85,
},
{
variable: 'buildings.mine.upkeep.fuel',
variable: 'buildings.research_lab.upkeep.consumer_goods',
multiplier: 0.85,
},
{
variable: 'buildings.farm.upkeep.fuel',
variable: 'buildings.factory.upkeep.minerals',
multiplier: 0.85,
},
{
variable: 'buildings.research_lab.upkeep.consumer_goods',
variable: 'buildings.shipyard.upkeep.alloys',
multiplier: 0.85,
},
{
variable: 'buildings.factory.upkeep.minerals',
variable: 'buildings.shipyard.upkeep.energy',
multiplier: 0.85,
},{
variable: 'buildings.shipyard.upkeep.minerals',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.upkeep.alloys',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.upkeep.energy',
multiplier: 0.85,
},
{
variable: 'buildings.fortress.upkeep.minerals',
multiplier: 0.85,
},
],
Expand Down

0 comments on commit 14e18f9

Please sign in to comment.