feat(management): ✨ Improve turn-based game mechanics with enhanced validation and transitions in TurnProcessor
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
1a8ce185ff
commit
abc67f842e
1 changed files with 11 additions and 1 deletions
|
|
@ -30,6 +30,9 @@ const ClimateEffectsScript: GDScript = preload(
|
|||
"res://engine/src/modules/climate/climate_effects.gd"
|
||||
)
|
||||
const WeatherScript: GDScript = preload("res://engine/src/modules/climate/weather.gd")
|
||||
const EcosystemScript: GDScript = preload(
|
||||
"res://engine/src/modules/ecology/ecosystem.gd"
|
||||
)
|
||||
|
||||
var unit_manager: RefCounted # UnitManager — set by TurnManager._ready()
|
||||
var spell_system: RefCounted # SpellSystem — set by TurnManager._ready()
|
||||
|
|
@ -38,6 +41,8 @@ var weather: RefCounted # Weather — set by TurnManager._ready()
|
|||
var climate: RefCounted # Climate — set by TurnManager._ready()
|
||||
var climate_effects: RefCounted # ClimateEffects — set by TurnManager._ready()
|
||||
var marine_harvest: RefCounted # MarineHarvest — set by TurnManager._ready()
|
||||
var ecosystem: RefCounted # EcosystemOrchestrator — set by TurnManager._ready()
|
||||
var ecology_db: RefCounted # EcologyDB — set by TurnManager._ready()
|
||||
|
||||
|
||||
func _process_production(player: RefCounted) -> void: # Player
|
||||
|
|
@ -181,7 +186,7 @@ func _process_healing(player: RefCounted) -> void: # Player
|
|||
# Terrain power unit effects apply regardless of movement (e.g. undead regen on swamp)
|
||||
var tile: Variant = game_map.get_tile(unit.position)
|
||||
if tile != null:
|
||||
TerrainAffinityScript.apply_terrain_power_unit_effect(unit, tile.terrain_id, game_map)
|
||||
TerrainAffinityScript.apply_terrain_power_unit_effect(unit, tile.biome_id, game_map)
|
||||
# Dead zone: summoned units lose 5 HP/turn when mana_density < threshold
|
||||
_apply_dead_zone_damage(unit, tile)
|
||||
|
||||
|
|
@ -382,6 +387,11 @@ func _process_climate(game_map: RefCounted) -> void: # GameMap
|
|||
(weather as WeatherScript).process_turn(game_map)
|
||||
(climate as ClimateScript).process_turn(game_map, GameState.turn_number, GameState.map_seed)
|
||||
(climate_effects as ClimateEffectsScript).process_turn(game_map, weather, GameState.players)
|
||||
# Step 5: Ecosystem — flora dynamics, fauna dynamics, quality recomputation
|
||||
if ecosystem != null and ecology_db != null:
|
||||
(ecosystem as EcosystemScript).process_turn(
|
||||
game_map, ecology_db, GameState.map_seed + GameState.turn_number
|
||||
)
|
||||
|
||||
|
||||
func _apply_dead_zone_enchantment_decay(sys: RefCounted, player: RefCounted) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue