From 89011e8dd3bcc23a0243d0feb69784a52461f71a Mon Sep 17 00:00:00 2001 From: autocommit Date: Wed, 15 Apr 2026 03:04:43 -0700 Subject: [PATCH] =?UTF-8?q?feat(entities):=20=E2=9C=A8=20Add=20original=20?= =?UTF-8?q?owner=20tracking=20to=20City=20entities=20for=20domination=20vi?= =?UTF-8?q?ctory=20condition=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/src/entities/city.gd | 8 ++++++++ 1 file changed, 8 insertions(+) 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: