Show auto attack forecasts in battle HUD
This commit is contained in:
@@ -631,6 +631,10 @@ func _check_scene_auto_attack_safe_origin_and_counter_preview(failures: Array[St
|
||||
for marker in scene._target_selection_marker_entries():
|
||||
if bool(marker.get("requires_move", false)):
|
||||
failures.append("formal attack targeting should not show move+attack origin routes: %s" % str(marker))
|
||||
scene.hover_cell = Vector2i(5, 3)
|
||||
scene._update_forecast()
|
||||
if scene.forecast_label.text.contains("행공"):
|
||||
failures.append("formal attack targeting forecast should not describe auto move+attack: %s" % scene.forecast_label.text)
|
||||
scene.basic_attack_targeting = false
|
||||
scene._refresh_ranges()
|
||||
|
||||
@@ -638,6 +642,10 @@ func _check_scene_auto_attack_safe_origin_and_counter_preview(failures: Array[St
|
||||
var safe_badge := scene._target_preview_badge()
|
||||
if str(safe_badge.get("kind", "")) != "advance" or str(safe_badge.get("text", "")).contains("반"):
|
||||
failures.append("safe auto attack hover should not show counter risk: %s" % str(safe_badge))
|
||||
scene._update_forecast()
|
||||
var safe_forecast: String = scene.forecast_label.text
|
||||
if not safe_forecast.contains("행공") or not safe_forecast.contains("진 4,4") or safe_forecast.contains("사거리 밖"):
|
||||
failures.append("safe auto attack forecast should describe the chosen advance origin: %s" % safe_forecast)
|
||||
|
||||
scene._handle_board_click(_screen_for_cell(Vector2i(5, 3)))
|
||||
cao_cao = scene.state.get_unit("cao_cao")
|
||||
@@ -657,15 +665,21 @@ func _check_scene_auto_attack_safe_origin_and_counter_preview(failures: Array[St
|
||||
risky_scene.briefing_panel.visible = false
|
||||
risky_scene.result_panel.visible = false
|
||||
risky_scene._clear_pending_move_state()
|
||||
for unit in risky_scene.state.units:
|
||||
if unit.get("team", "") == BattleStateScript.TEAM_ENEMY:
|
||||
unit["pos"] = Vector2i(risky_scene.state.map_size.x - 2, risky_scene.state.map_size.y - 2)
|
||||
var risky_attacker: Dictionary = risky_scene.state.get_unit("cao_cao")
|
||||
var risky_enemy: Dictionary = risky_scene.state.get_unit("yellow_turban_1")
|
||||
risky_attacker["pos"] = Vector2i(1, 3)
|
||||
risky_attacker["move"] = 8
|
||||
risky_attacker["range"] = 1
|
||||
risky_attacker["min_range"] = 1
|
||||
risky_attacker["atk"] = 80
|
||||
risky_attacker["agi"] = 0
|
||||
risky_attacker["hp"] = 40
|
||||
risky_attacker["max_hp"] = 40
|
||||
risky_attacker["moved"] = false
|
||||
risky_attacker["acted"] = false
|
||||
risky_enemy["pos"] = Vector2i(5, 3)
|
||||
risky_enemy["range"] = 1
|
||||
risky_enemy["min_range"] = 1
|
||||
@@ -682,6 +696,14 @@ func _check_scene_auto_attack_safe_origin_and_counter_preview(failures: Array[St
|
||||
var risky_badge := risky_scene._auto_attack_target_preview_badge_for_origin(risky_attacker, risky_enemy, Vector2i(4, 3))
|
||||
if not str(risky_badge.get("text", "")).contains("반") or not ["counter", "danger"].has(str(risky_badge.get("kind", ""))):
|
||||
failures.append("risky auto attack badge should show counter risk: %s" % str(risky_badge))
|
||||
if not risky_scene.state.select_unit("cao_cao"):
|
||||
failures.append("could not select Cao Cao for risky auto attack forecast")
|
||||
else:
|
||||
risky_scene.hover_cell = Vector2i(5, 3)
|
||||
risky_scene._update_forecast()
|
||||
var risky_forecast: String = risky_scene.forecast_label.text
|
||||
if not risky_forecast.contains("행공") or not risky_forecast.contains("반격"):
|
||||
failures.append("risky auto attack forecast should show counter risk: %s" % risky_forecast)
|
||||
risky_enemy["controllable"] = false
|
||||
var escort_preview := risky_scene._auto_attack_preview_for_origin(risky_attacker, risky_enemy, Vector2i(4, 3))
|
||||
if bool(escort_preview.get("counter_in_range", false)):
|
||||
|
||||
Reference in New Issue
Block a user