fix(@projects/@magic-civilization): 🐛 adjust scout behavior and habitat abandonment threshold

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-17 05:03:46 -07:00
parent b5effb39b9
commit 0903526dd5
2 changed files with 15 additions and 13 deletions

View file

@ -3,7 +3,7 @@
"canopy_weight": 0.2,
"fungi_weight": 0.2,
"habitat_abandon_threshold": 0.3,
"habitat_abandon_turns": 60,
"habitat_abandon_turns": 200,
"habitat_thriving_threshold": 0.7,
"capacity_per_10_tiles": 20.0,
"maturity_age_base": 5,

View file

@ -929,18 +929,20 @@ func _play_turn() -> void:
continue
if u.get("can_found_city") == true or u.get("can_build_improvements") == true:
continue
# Scouts redirect to lair-clearing — they're weak fighters, not siege assets
if u.type_id == "dwarf_scout":
var s_max_hp: int = u.get_max_hp()
var s_hp_ok: bool = s_max_hp <= 0 or u.hp >= int(s_max_hp * 0.25)
if s_hp_ok:
var s_lair: Vector2i = _find_nearest_low_lair(u.position, 2)
if s_lair != Vector2i(-1, -1):
u.is_fortified = false
u.fortified_turns = 0
_move_toward(u, s_lair, game_map)
_try_attack_adjacent_lair(u, game_map)
continue
# Scouts always redirect to lair-clearing; warriors redirect when far from target
var dist_to_target: int = HexUtilsScript.hex_distance(u.position, target)
var u_max_hp: int = u.get_max_hp()
var w_hp_ok: bool = u_max_hp <= 0 or u.hp >= int(u_max_hp * 0.25)
var is_scout: bool = u.type_id == "dwarf_scout"
var lair_tier_cap: int = 2 if is_scout else 3
if w_hp_ok and (is_scout or dist_to_target > 12):
var w_lair: Vector2i = _find_nearest_low_lair(u.position, lair_tier_cap)
if w_lair != Vector2i(-1, -1):
u.is_fortified = false
u.fortified_turns = 0
_move_toward(u, w_lair, game_map)
_try_attack_adjacent_lair(u, game_map)
continue
# Un-fortify before moving
u.is_fortified = false
u.fortified_turns = 0