feat(entities): ✨ Add original owner tracking to City entities for domination victory condition logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
5e31628a10
commit
89011e8dd3
1 changed files with 8 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue