File tree Expand file tree Collapse file tree
src/core/execution/nation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ export class NationStructureBehavior {
7474 continue ;
7575 }
7676
77- if ( this . shouldBuildStructure ( structureType , cityCount ) ) {
77+ if (
78+ this . shouldBuildStructure ( structureType , cityCount , hasCoastalTiles )
79+ ) {
7880 if ( this . maybeSpawnStructure ( structureType ) ) {
7981 return true ;
8082 }
@@ -92,14 +94,25 @@ export class NationStructureBehavior {
9294 * Determines if we should build more of this structure type based on
9395 * the current city count and the configured ratio.
9496 */
95- private shouldBuildStructure ( type : UnitType , cityCount : number ) : boolean {
97+ private shouldBuildStructure (
98+ type : UnitType ,
99+ cityCount : number ,
100+ hasCoastalTiles : boolean ,
101+ ) : boolean {
96102 const config = STRUCTURE_RATIOS [ type ] ;
97103 if ( config === undefined ) {
98104 return false ;
99105 }
100106
107+ let ratio = config . ratioPerCity ;
108+
109+ // Heavily reduce factory spawning if we have coastal tiles
110+ if ( type === UnitType . Factory && hasCoastalTiles ) {
111+ ratio *= 0.25 ;
112+ }
113+
101114 const owned = this . player . unitsOwned ( type ) ;
102- const targetCount = Math . floor ( cityCount * config . ratioPerCity ) ;
115+ const targetCount = Math . floor ( cityCount * ratio ) ;
103116
104117 return owned < targetCount ;
105118 }
You can’t perform that action at this time.
0 commit comments