Add opening battle capture events
This commit is contained in:
@@ -173,6 +173,7 @@ func _init() -> void:
|
||||
_check_event_gated_multi_cell_objective_markers(failures)
|
||||
_check_turn_gated_objective_does_not_create_marker(failures)
|
||||
_check_opening_battle_requires_castle_capture(failures)
|
||||
_check_opening_battle_capture_events(failures)
|
||||
_check_sishui_gate_extended_pressure(failures)
|
||||
_check_xingyang_ambush_extended_pressure(failures)
|
||||
_check_qingzhou_campaign_extended_pressure(failures)
|
||||
@@ -361,6 +362,39 @@ func _check_opening_battle_requires_castle_capture(failures: Array[String]) -> v
|
||||
failures.append("opening battle should end after the turn 11 last rally falls and castle is captured, got %s" % str(state.battle_status))
|
||||
|
||||
|
||||
func _check_opening_battle_capture_events(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
failures.append("opening capture event smoke could not load scenario")
|
||||
return
|
||||
|
||||
var dialogue_batches := []
|
||||
state.dialogue_requested.connect(func(lines: Array) -> void:
|
||||
dialogue_batches.append(lines)
|
||||
)
|
||||
|
||||
var cao_cao: Dictionary = state.get_unit("cao_cao")
|
||||
cao_cao["pos"] = Vector2i(6, 5)
|
||||
state._run_events("unit_reaches_tile", BattleStateScript.TEAM_PLAYER, 3, cao_cao)
|
||||
if int(state.get_inventory_snapshot().get("bean", 0)) != 1:
|
||||
failures.append("opening village capture should grant one Bean")
|
||||
if state.get_battle_gold_reward() != 80:
|
||||
failures.append("opening village capture should grant 80 battle gold, got %d" % state.get_battle_gold_reward())
|
||||
var village_objective := str(state.objectives.get("victory", ""))
|
||||
if not village_objective.contains("마을 보급") or not village_objective.contains("동쪽 성채"):
|
||||
failures.append("opening village capture should update the active objective: %s" % village_objective)
|
||||
if dialogue_batches.size() < 1:
|
||||
failures.append("opening village capture should show contextual dialogue")
|
||||
|
||||
cao_cao["pos"] = Vector2i(20, 1)
|
||||
state._run_events("unit_reaches_tile", BattleStateScript.TEAM_PLAYER, 4, cao_cao)
|
||||
var castle_objective := str(state.objectives.get("victory", ""))
|
||||
if not castle_objective.contains("성채를 장악") or not castle_objective.contains("마지막 황건 잔당"):
|
||||
failures.append("opening castle capture should update the active objective: %s" % castle_objective)
|
||||
if dialogue_batches.size() < 2:
|
||||
failures.append("opening castle capture should show contextual dialogue")
|
||||
|
||||
|
||||
func _check_log_contains(failures: Array[String], logs: Array, expected: String) -> void:
|
||||
for log_entry in logs:
|
||||
if str(log_entry) == expected:
|
||||
|
||||
Reference in New Issue
Block a user