Clarify combat result reports
This commit is contained in:
@@ -123,6 +123,10 @@ func _capture_viewport_set(spec: Dictionary, output_dir: String, captures: Array
|
||||
await _settle()
|
||||
await _capture_frame(scene, output_dir, label, "12_post_move_item_picker", captures, failures)
|
||||
|
||||
_prepare_combat_result_frame(scene)
|
||||
await _settle()
|
||||
await _capture_frame(scene, output_dir, label, "13_battle_combat_result", captures, failures)
|
||||
|
||||
scene.queue_free()
|
||||
await _settle()
|
||||
|
||||
@@ -194,12 +198,48 @@ func _prepare_post_move_action_frame(scene, picker_mode: String) -> void:
|
||||
scene.queue_redraw()
|
||||
|
||||
|
||||
func _prepare_combat_result_frame(scene) -> void:
|
||||
scene._hide_command_hint()
|
||||
scene._hide_post_move_menu()
|
||||
scene._hide_post_move_picker()
|
||||
scene._hide_tactic_menu()
|
||||
scene._hide_item_menu()
|
||||
scene._hide_equip_menu()
|
||||
scene._clear_pending_move_state()
|
||||
scene.selected_skill_id = ""
|
||||
scene.selected_item_id = ""
|
||||
scene.basic_attack_targeting = false
|
||||
var cao_cao: Dictionary = scene.state.get_unit("cao_cao")
|
||||
var enemy: Dictionary = scene.state.get_unit("yellow_turban_1")
|
||||
if cao_cao.is_empty() or enemy.is_empty():
|
||||
return
|
||||
cao_cao["pos"] = Vector2i(2, 3)
|
||||
cao_cao["moved"] = false
|
||||
cao_cao["acted"] = false
|
||||
cao_cao["atk"] = maxi(48, int(cao_cao.get("atk", 0)))
|
||||
cao_cao["agi"] = 999
|
||||
enemy["pos"] = Vector2i(3, 3)
|
||||
enemy["alive"] = true
|
||||
enemy["hp"] = 90
|
||||
enemy["max_hp"] = 90
|
||||
enemy["def"] = 1
|
||||
scene.state.rng.seed = 1
|
||||
scene.state.select_unit("cao_cao")
|
||||
scene._refresh_ranges()
|
||||
scene._focus_board_on_cell(Vector2i(3, 3))
|
||||
scene.state.try_attack_selected("yellow_turban_1")
|
||||
scene._update_hud()
|
||||
scene.queue_redraw()
|
||||
|
||||
|
||||
func _screen_for_cell(scene, cell: Vector2i) -> Vector2:
|
||||
var rect: Rect2 = scene._rect_for_cell(cell)
|
||||
return rect.position + rect.size * 0.5
|
||||
|
||||
|
||||
func _capture_frame(_scene, output_dir: String, viewport_label: String, frame_label: String, captures: Array[Dictionary], failures: Array[String]) -> void:
|
||||
Input.warp_mouse(Vector2(12, 12))
|
||||
await _settle()
|
||||
var texture := get_root().get_texture()
|
||||
if texture == null:
|
||||
failures.append("viewport texture missing for %s/%s" % [viewport_label, frame_label])
|
||||
|
||||
Reference in New Issue
Block a user