From 00082cb69aa5df8dbb042fe68a4ef08c9a930732 Mon Sep 17 00:00:00 2001 From: Natalie Date: Fri, 17 Apr 2026 04:43:35 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20adjust=20scout=20hp=20thresholds=20and=20lair=20?= =?UTF-8?q?logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- public/resources/ecology/fauna/land.json | 2 +- src/game/engine/scenes/tests/auto_play.gd | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/resources/ecology/fauna/land.json b/public/resources/ecology/fauna/land.json index 02c12102..3cd1ee09 100644 --- a/public/resources/ecology/fauna/land.json +++ b/public/resources/ecology/fauna/land.json @@ -3,7 +3,7 @@ "canopy_weight": 0.2, "fungi_weight": 0.2, "habitat_abandon_threshold": 0.3, - "habitat_abandon_turns": 10, + "habitat_abandon_turns": 60, "habitat_thriving_threshold": 0.7, "capacity_per_10_tiles": 20.0, "maturity_age_base": 5, diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index 005d317f..343d341f 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -929,10 +929,10 @@ 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 when healthy — they're weak fighters anyway + # 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.5) + 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): @@ -960,7 +960,7 @@ func _play_turn() -> void: # Scouts and warriors seek low-tier lairs during build phase. var lair_target: Vector2i = Vector2i(-1, -1) var u_max_hp: int = u.get_max_hp() - var hp_ok: bool = u_max_hp <= 0 or u.hp >= int(u_max_hp * 0.5) + var hp_ok: bool = u_max_hp <= 0 or u.hp >= int(u_max_hp * 0.25) var lair_max_tier: int = 2 if u.type_id == "dwarf_scout" else 3 if hp_ok: lair_target = _find_nearest_low_lair(u.position, lair_max_tier) @@ -1611,8 +1611,10 @@ func _try_attack_adjacent_lair(unit: Variant, game_map: RefCounted) -> void: return if not ClassDB.class_exists("GdCombatResolver"): return - var neighbors: Array[Vector2i] = HexUtilsScript.get_neighbors(unit.position) - for n: Vector2i in neighbors: + # Check own tile first (unit moved onto lair), then neighbors + var candidates: Array[Vector2i] = [unit.position] + candidates.append_array(HexUtilsScript.get_neighbors(unit.position)) + for n: Vector2i in candidates: var norm: Vector2i = HexUtilsScript.normalize_position( n, game_map.width, game_map.height, game_map.wrap_mode )