feat(@projects/@magic-civilization): integrate rust border expansion logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-12 22:56:15 -07:00
parent 9632bd2526
commit c4c6083d51
2 changed files with 3 additions and 16 deletions

View file

@ -417,19 +417,10 @@ func _process_culture(player: RefCounted, game_map: RefCounted) -> void:
if not city_ref is CityScript:
continue
var c: CityScript = city_ref as CityScript
var tile_json: String = BuildableHelperScript.build_tile_yields_json(c, game_map)
var can_expand: bool = c.process_culture(tile_json)
if not can_expand:
continue
# Build candidates JSON for Rust border expansion
var candidates_json: String = _build_border_candidates_json(c, game_map, player)
var claimed: Vector2i = c.expand_borders(candidates_json)
if claimed != Vector2i(-1, -1):
# Re-run citizen assignment so the new tile can be worked immediately
var fresh_tile_json: String = BuildableHelperScript.build_tile_yields_json(
c, game_map
)
c.auto_assign_citizens(fresh_tile_json)
var tile: Resource = game_map.get_tile(claimed)
if tile != null:
tile.owner = player.index

View file

@ -324,13 +324,9 @@ impl City {
// pop 1→2→starvation→1 when adjacent tiles lack food.
yields.food += 4.0;
yields.production += 2.0;
yields.gold += 3.0;
// Science baseline 5.0 (was 1.0): tech costs in age-of-dwarves scale
// 20..320 across a 50-tech tree, so 1 sci/turn/city caps empires at
// ~7 techs by T150. 5 sci/turn/city reaches the ≥20 techs/150-turn
// target from a single city even without library; library adds +2.
yields.science += 5.0;
yields.culture += 2.0;
yields.gold += 1.0;
yields.science += 1.0;
yields.culture += 1.0;
// Sum worked tile yields
for wt in &self.worked_tiles {