Add story beats to Puyang Raid
This commit is contained in:
@@ -474,6 +474,44 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zhang_liao_vanguard_falls",
|
||||
"once": true,
|
||||
"when": { "type": "unit_defeated", "team": "enemy", "unit_ids": ["zhang_liao_vanguard"] },
|
||||
"actions": [
|
||||
{
|
||||
"type": "dialogue",
|
||||
"lines": [
|
||||
{ "speaker": "Zhang Liao", "display_speaker": "장료", "side": "right", "text": "야습대의 창끝이 빠르다. 그러나 여포 장군의 말발굽은 이미 깨어났다." },
|
||||
{ "speaker": "Dian Wei", "display_speaker": "전위", "side": "right", "text": "앞줄은 꺾었습니다. 다음 말발굽도 제 도끼 앞에서 멈출 것입니다." },
|
||||
{ "speaker": "Cao Cao", "display_speaker": "조조", "side": "left", "text": "장료의 선봉을 밀어냈다. 군영 안쪽을 장악하며 포위망을 버텨라." }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "set_objective",
|
||||
"victory": "장료 선봉을 꺾었다. 복양 군영을 장악하며 여포군 포위망을 버텨라."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "lu_bu_banner_falls",
|
||||
"once": true,
|
||||
"when": { "type": "unit_defeated", "team": "enemy", "unit_ids": ["lu_bu_banner"] },
|
||||
"actions": [
|
||||
{
|
||||
"type": "dialogue",
|
||||
"lines": [
|
||||
{ "speaker": "Lu Bu", "display_speaker": "여포", "side": "right", "text": "기치 하나가 쓰러졌다고 복양이 열린 줄 아느냐. 말머리를 돌려 저 깃발을 물어라!" },
|
||||
{ "speaker": "Dian Wei", "display_speaker": "전위", "side": "right", "text": "기치가 꺾였으니 저들의 눈도 흔들립니다. 주공, 군영 안쪽으로 밀어붙이십시오." },
|
||||
{ "speaker": "Cao Cao", "display_speaker": "조조", "side": "left", "text": "여포의 기세가 잠시 갈라졌다. 군영을 붙들고 남은 포위망을 부숴라." }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "set_objective",
|
||||
"victory": "여포 기치병을 꺾었다. 복양 군영을 장악하고 남은 포위망을 격파하라."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "turn_5_pressure",
|
||||
"once": true,
|
||||
|
||||
@@ -27,10 +27,12 @@ func _init() -> void:
|
||||
_check_sishui_gate_event_dialogue_structure(failures)
|
||||
_check_xingyang_ambush_event_dialogue_structure(failures)
|
||||
_check_qingzhou_campaign_event_dialogue_structure(failures)
|
||||
_check_puyang_raid_event_dialogue_structure(failures)
|
||||
_check_opening_battle_story_beats(failures)
|
||||
_check_sishui_gate_story_beats(failures)
|
||||
_check_xingyang_ambush_story_beats(failures)
|
||||
_check_qingzhou_campaign_story_beats(failures)
|
||||
_check_puyang_raid_story_beats(failures)
|
||||
_check_pixel_unit_helpers(failures)
|
||||
|
||||
if failures.is_empty():
|
||||
@@ -393,6 +395,55 @@ func _check_qingzhou_campaign_event_dialogue_structure(failures: Array[String])
|
||||
failures.append("Qingzhou Campaign last stand event should clarify the final objective")
|
||||
|
||||
|
||||
func _check_puyang_raid_event_dialogue_structure(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/005_puyang_raid.json"):
|
||||
failures.append("could not load Puyang Raid for event dialogue structure")
|
||||
return
|
||||
for event_id in [
|
||||
"opening_dialogue",
|
||||
"turn_2_alarm",
|
||||
"turn_3_lu_bu_arrives",
|
||||
"turn_5_pressure",
|
||||
"turn_6_zhang_liao_closes",
|
||||
"turn_9_lu_bu_encirclement",
|
||||
"zhang_liao_vanguard_falls",
|
||||
"lu_bu_banner_falls"
|
||||
]:
|
||||
var event := _event_by_id(state, event_id)
|
||||
if event.is_empty():
|
||||
failures.append("Puyang Raid missing event: %s" % event_id)
|
||||
continue
|
||||
if not _event_has_dialogue_action(event):
|
||||
failures.append("Puyang Raid event should include contextual dialogue: %s" % event_id)
|
||||
var vanguard_event := _event_by_id(state, "zhang_liao_vanguard_falls")
|
||||
if not vanguard_event.is_empty():
|
||||
var when: Dictionary = vanguard_event.get("when", {})
|
||||
if str(when.get("type", "")) != "unit_defeated":
|
||||
failures.append("Zhang Liao vanguard defeat event should trigger when the unit is defeated")
|
||||
var unit_ids: Array = when.get("unit_ids", [])
|
||||
if not unit_ids.has("zhang_liao_vanguard"):
|
||||
failures.append("Zhang Liao vanguard defeat event should watch zhang_liao_vanguard")
|
||||
if not _event_has_set_objective_action(vanguard_event):
|
||||
failures.append("Zhang Liao vanguard defeat event should clarify the next objective")
|
||||
var lu_bu_banner_event := _event_by_id(state, "lu_bu_banner_falls")
|
||||
if not lu_bu_banner_event.is_empty():
|
||||
var when: Dictionary = lu_bu_banner_event.get("when", {})
|
||||
if str(when.get("type", "")) != "unit_defeated":
|
||||
failures.append("Lu Bu banner defeat event should trigger when the unit is defeated")
|
||||
var unit_ids: Array = when.get("unit_ids", [])
|
||||
if not unit_ids.has("lu_bu_banner"):
|
||||
failures.append("Lu Bu banner defeat event should watch lu_bu_banner")
|
||||
if not _event_has_set_objective_action(lu_bu_banner_event):
|
||||
failures.append("Lu Bu banner defeat event should clarify the next objective")
|
||||
var lu_bu_arrival_event := _event_by_id(state, "turn_3_lu_bu_arrives")
|
||||
if not lu_bu_arrival_event.is_empty() and not _event_has_set_objective_action(lu_bu_arrival_event):
|
||||
failures.append("Puyang Raid Lu Bu arrival event should clarify the pressure objective")
|
||||
var encirclement_event := _event_by_id(state, "turn_9_lu_bu_encirclement")
|
||||
if not encirclement_event.is_empty() and not _event_has_set_objective_action(encirclement_event):
|
||||
failures.append("Puyang Raid encirclement event should clarify the final objective")
|
||||
|
||||
|
||||
func _check_opening_battle_story_beats(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
@@ -533,6 +584,56 @@ func _check_qingzhou_campaign_story_beats(failures: Array[String]) -> void:
|
||||
failures.append("Qingzhou chief defeat objective should still point to the village road and remaining enemies")
|
||||
|
||||
|
||||
func _check_puyang_raid_story_beats(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/005_puyang_raid.json"):
|
||||
failures.append("could not load Puyang Raid for story beat checks")
|
||||
return
|
||||
|
||||
var dialogue_batches: Array = []
|
||||
state.dialogue_requested.connect(func(lines: Array) -> void:
|
||||
dialogue_batches.append(lines)
|
||||
)
|
||||
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 2)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_PLAYER, 5)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
|
||||
if dialogue_batches.size() < 5:
|
||||
failures.append("Puyang Raid should add dialogue beats for each major night raid pressure phase")
|
||||
var victory_text := str(state.objectives.get("victory", ""))
|
||||
if not victory_text.contains("포위망") or not victory_text.contains("군영"):
|
||||
failures.append("Puyang Raid turn 9 event should update the victory objective for the encirclement")
|
||||
if not state._condition_gate_open({"after_event": "turn_9_lu_bu_encirclement"}):
|
||||
failures.append("Puyang Raid final objective gate should open after the turn 9 encirclement")
|
||||
|
||||
var zhang_liao: Dictionary = state.get_unit("zhang_liao_vanguard")
|
||||
if zhang_liao.is_empty():
|
||||
failures.append("Puyang Raid should include Zhang Liao vanguard for the defeat story beat")
|
||||
else:
|
||||
zhang_liao["alive"] = false
|
||||
state._run_events("unit_defeated", BattleStateScript.TEAM_ENEMY, 9, zhang_liao)
|
||||
if dialogue_batches.size() < 6:
|
||||
failures.append("Puyang Raid should show dialogue when Zhang Liao vanguard falls")
|
||||
var vanguard_objective_text := str(state.objectives.get("victory", ""))
|
||||
if not vanguard_objective_text.contains("군영") or not vanguard_objective_text.contains("포위망"):
|
||||
failures.append("Zhang Liao vanguard defeat objective should still point to camp control and the encirclement")
|
||||
|
||||
var lu_bu_banner: Dictionary = state.get_unit("lu_bu_banner")
|
||||
if lu_bu_banner.is_empty():
|
||||
failures.append("Puyang Raid should include Lu Bu banner for the final pressure story beat")
|
||||
else:
|
||||
lu_bu_banner["alive"] = false
|
||||
state._run_events("unit_defeated", BattleStateScript.TEAM_ENEMY, 9, lu_bu_banner)
|
||||
if dialogue_batches.size() < 7:
|
||||
failures.append("Puyang Raid should show dialogue when Lu Bu banner falls")
|
||||
var banner_objective_text := str(state.objectives.get("victory", ""))
|
||||
if not banner_objective_text.contains("군영") or not banner_objective_text.contains("포위망"):
|
||||
failures.append("Lu Bu banner defeat objective should still point to camp control and the encirclement")
|
||||
|
||||
|
||||
func _event_by_id(state, event_id: String) -> Dictionary:
|
||||
for event in state.battle_events:
|
||||
if typeof(event) == TYPE_DICTIONARY and str(event.get("id", "")) == event_id:
|
||||
|
||||
Reference in New Issue
Block a user