Add selectable camp conversations
This commit is contained in:
@@ -29,6 +29,13 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
var briefing := state.get_briefing()
|
||||
if (briefing.get("camp_dialogue", []) as Array).is_empty():
|
||||
failures.append("001 briefing should expose camp dialogue")
|
||||
var conversations: Array = briefing.get("camp_conversations", [])
|
||||
if conversations.size() < 3:
|
||||
failures.append("001 briefing should expose at least three camp conversations")
|
||||
else:
|
||||
_check_camp_conversation(failures, conversations[0], "cao_cao_strategy", "officer", "cao_cao")
|
||||
_check_camp_conversation(failures, conversations[1], "xiahou_dun_vanguard", "officer", "xiahou_dun")
|
||||
_check_camp_conversation(failures, conversations[2], "northern_woods_cache", "topic", "")
|
||||
var merchant := state.get_shop_merchant()
|
||||
if merchant.is_empty() or (merchant.get("lines", []) as Array).is_empty():
|
||||
failures.append("001 shop should expose merchant lines")
|
||||
@@ -63,6 +70,21 @@ func _check_scene_texture_loading(failures: Array[String]) -> void:
|
||||
var panacea: Dictionary = scene.state.get_item_def("panacea")
|
||||
if scene._load_art_texture(str(panacea.get("icon", ""))) == null:
|
||||
failures.append("battle scene should load panacea icon texture")
|
||||
var conversations: Array = scene.state.get_briefing().get("camp_conversations", [])
|
||||
if not conversations.is_empty():
|
||||
var first_lines: Array = (conversations[0] as Dictionary).get("lines", [])
|
||||
if not first_lines.is_empty():
|
||||
var first_line: Dictionary = first_lines[0]
|
||||
if scene._load_art_texture(str(first_line.get("portrait", ""))) == null:
|
||||
failures.append("battle scene should load camp conversation speaker portrait")
|
||||
var scene_conversations: Array = scene._camp_conversation_entries()
|
||||
if scene_conversations.size() < 3:
|
||||
failures.append("battle scene should expose camp conversation entries")
|
||||
var strategy := scene._camp_conversation_by_id("cao_cao_strategy")
|
||||
if strategy.is_empty():
|
||||
failures.append("battle scene should find Cao Cao camp conversation by id")
|
||||
elif not scene._format_camp_conversation_button_text(strategy).contains("Cao Cao"):
|
||||
failures.append("camp conversation button text should include label/speaker")
|
||||
scene.free()
|
||||
|
||||
|
||||
@@ -94,6 +116,26 @@ func _check_attack_motion_signal(failures: Array[String]) -> void:
|
||||
failures.append("attack motion signal missing expected Cao Cao attack: %s" % str(motions))
|
||||
|
||||
|
||||
func _check_camp_conversation(failures: Array[String], conversation: Dictionary, expected_id: String, expected_group: String, expected_officer_id: String) -> void:
|
||||
if str(conversation.get("id", "")) != expected_id:
|
||||
failures.append("camp conversation id mismatch: expected %s got %s" % [expected_id, str(conversation.get("id", ""))])
|
||||
if str(conversation.get("group", "")) != expected_group:
|
||||
failures.append("camp conversation group mismatch for %s" % expected_id)
|
||||
if str(conversation.get("officer_id", "")) != expected_officer_id:
|
||||
failures.append("camp conversation officer mismatch for %s" % expected_id)
|
||||
if str(conversation.get("label", "")).is_empty():
|
||||
failures.append("camp conversation label missing for %s" % expected_id)
|
||||
var lines: Array = conversation.get("lines", [])
|
||||
if lines.is_empty():
|
||||
failures.append("camp conversation lines missing for %s" % expected_id)
|
||||
return
|
||||
var first_line: Dictionary = lines[0]
|
||||
if str(first_line.get("text", "")).is_empty():
|
||||
failures.append("camp conversation first text missing for %s" % expected_id)
|
||||
if expected_group == "officer" and str(first_line.get("portrait", "")).is_empty():
|
||||
failures.append("camp conversation officer portrait missing for %s" % expected_id)
|
||||
|
||||
|
||||
func _check_image_path(failures: Array[String], path: String, context: String) -> void:
|
||||
if path.is_empty():
|
||||
failures.append("%s has an empty image path" % context)
|
||||
|
||||
Reference in New Issue
Block a user