diff --git a/src/game/engine/src/modules/management/turn_processor.gd b/src/game/engine/src/modules/management/turn_processor.gd index 89c671ee..9f9d2e16 100644 --- a/src/game/engine/src/modules/management/turn_processor.gd +++ b/src/game/engine/src/modules/management/turn_processor.gd @@ -276,7 +276,7 @@ func _apply_building_bonuses(city: CityScript, building_id: String) -> void: func _process_city_healing(player: RefCounted) -> void: for city_ref: Variant in player.cities: if city_ref is CityScript: - (city_ref as CityScript).heal_per_turn() + (city_ref as CityScript).heal_per_turn(GameState.turn_number) func _process_healing(player: RefCounted) -> void: # Player diff --git a/src/simulator/api-gdext/src/lib.rs b/src/simulator/api-gdext/src/lib.rs index 3066fac5..247f5e3a 100644 --- a/src/simulator/api-gdext/src/lib.rs +++ b/src/simulator/api-gdext/src/lib.rs @@ -1251,10 +1251,18 @@ impl GdCity { self.inner.heal(amount.max(0) as u32); } - /// Heal the city by the standard per-turn amount (20 HP). Skips destroyed cities. + /// Heal the city by the standard per-turn amount (20 HP). Skips destroyed + /// cities and cities recently attacked (see mc_city::City::heal_per_turn). #[func] - fn heal_per_turn(&mut self) { - self.inner.heal_per_turn(); + fn heal_per_turn(&mut self, current_turn: i64) { + self.inner.heal_per_turn(current_turn.max(0) as u32); + } + + /// Mark the city as having taken combat damage on `turn`. Call when a + /// combat result assigns non-zero city damage. + #[func] + fn mark_attacked(&mut self, turn: i64) { + self.inner.mark_attacked(turn.max(0) as u32); } }