diff --git a/src/game/engine/src/entities/city.gd b/src/game/engine/src/entities/city.gd index f9b64d13..d30cc29d 100644 --- a/src/game/engine/src/entities/city.gd +++ b/src/game/engine/src/entities/city.gd @@ -22,6 +22,12 @@ var city_name: String = "" ## Whether this is the player's capital city. var is_capital: bool = false +## Player index of the capital's original founder. Persists through capture +## (unlike `is_capital`, which flips to false when the city changes hands). +## -1 means this city was never a capital. Used by VictoryManager to detect +## domination via "own every opponent's original capital". +var original_capital_owner: int = -1 + ## Turn this city was founded. var turn_founded: int = 0 @@ -98,6 +104,8 @@ func _init(city_id: String = "", starting_buildings: Array[String] = []) -> void func found(name: String, col: int, row: int, capital: bool, turn: int) -> void: city_name = name is_capital = capital + if capital and original_capital_owner < 0: + original_capital_owner = owner turn_founded = turn position = Vector2i(col, row) if _gd_city == null: