fix(@projects/@magic-civilization): 🐛 adjust scout hp thresholds and lair logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
fb9aa7295a
commit
00082cb69a
2 changed files with 8 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue