Clarify battle audio cues

This commit is contained in:
2026-06-21 00:28:57 +09:00
parent c656a8088d
commit 24b352b87b
3 changed files with 82 additions and 25 deletions

View File

@@ -95,8 +95,8 @@ const UI_SFX_VOLUME_DB := -4.0
const DEFAULT_AUDIO_VOLUME_PERCENT := 75
const AUDIO_MUTED_DB := -80.0
const MAX_RECENT_SFX_KEYS := 32
const AUDIO_PREVIEW_SFX_KEYS := ["menu_confirm", "footstep", "slash"]
const AUDIO_PREVIEW_LABEL := "확인음 · 발소리 · 타격음"
const AUDIO_PREVIEW_SFX_KEYS := ["menu_confirm", "footstep", "slash", "defeat_sting", "item_pickup"]
const AUDIO_PREVIEW_LABEL := "확인음 · 발소리 · 타격음 · 퇴각음 · 보급음"
const FLOATING_TEXT_LIFETIME := 1.0
const FLOATING_TEXT_RISE := 42.0
const OBJECTIVE_NOTICE_DURATION := 2.6
@@ -3578,9 +3578,9 @@ func _create_hud() -> void:
settings_bgm_volume_row.add_child(settings_bgm_volume_value_label)
settings_sfx_toggle = CheckButton.new()
settings_sfx_toggle.text = "효과음: 선택·발소리·전투"
settings_sfx_toggle.text = "효과음: 선택·발소리·전투·보급"
settings_sfx_toggle.custom_minimum_size = Vector2(374, 30)
settings_sfx_toggle.tooltip_text = "메뉴 선택음, 이동 발소리, 공격과 책략 효과음을 켜거나 끕니다."
settings_sfx_toggle.tooltip_text = "메뉴 선택음, 이동 발소리, 공격·책략·퇴각·보급 효과음을 켜거나 끕니다."
settings_sfx_toggle.toggled.connect(_on_settings_sfx_toggled)
settings_column.add_child(settings_sfx_toggle)
@@ -3602,7 +3602,7 @@ func _create_hud() -> void:
settings_sfx_volume_slider.step = 5.0
settings_sfx_volume_slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
settings_sfx_volume_slider.custom_minimum_size = Vector2(194, 30)
settings_sfx_volume_slider.tooltip_text = "선택음과 전투 효과음 크기를 조절합니다."
settings_sfx_volume_slider.tooltip_text = "선택음, 이동음, 전투음, 보급음 크기를 조절합니다."
settings_sfx_volume_slider.value_changed.connect(_on_settings_sfx_volume_changed)
settings_sfx_volume_row.add_child(settings_sfx_volume_slider)
@@ -3623,7 +3623,7 @@ func _create_hud() -> void:
settings_audio_reset_button = Button.new()
settings_audio_reset_button.text = "기본값 듣기"
settings_audio_reset_button.custom_minimum_size = Vector2(374, 32)
settings_audio_reset_button.tooltip_text = "음악과 효과음을 켜고 75%로 되돌린 뒤 현재 음악, 확인음, 발소리, 타격음을 재생합니다."
settings_audio_reset_button.tooltip_text = "음악과 효과음을 켜고 75%로 되돌린 뒤 현재 음악, 확인음, 발소리, 타격음, 퇴각음, 보급음을 재생합니다."
settings_audio_reset_button.pressed.connect(_on_settings_audio_reset_pressed)
settings_column.add_child(settings_audio_reset_button)
@@ -5248,10 +5248,10 @@ func _create_hud() -> void:
title_bgm_volume_row.add_child(title_bgm_volume_value_label)
title_sfx_toggle = CheckButton.new()
title_sfx_toggle.text = "효과음: 클릭·발소리·전투"
title_sfx_toggle.text = "효과음: 클릭·발소리·전투·보급"
title_sfx_toggle.custom_minimum_size = Vector2(350, 30)
title_sfx_toggle.button_pressed = title_sfx_enabled
title_sfx_toggle.tooltip_text = "메뉴 클릭음, 이동 발소리, 공격과 책략 효과음을 켜거나 끕니다."
title_sfx_toggle.tooltip_text = "메뉴 클릭음, 이동 발소리, 공격·책략·퇴각·보급 효과음을 켜거나 끕니다."
title_sfx_toggle.toggled.connect(_on_title_sfx_toggled)
title_settings_column.add_child(title_sfx_toggle)
@@ -5298,7 +5298,7 @@ func _create_hud() -> void:
"TitleAudioResetButton",
"status",
"기본값 듣기",
"음악과 효과음을 켜고 75%로 되돌린 뒤 현재 음악, 확인음, 발소리, 타격음을 재생합니다.",
"음악과 효과음을 켜고 75%로 되돌린 뒤 현재 음악, 확인음, 발소리, 타격음, 퇴각음, 보급음을 재생합니다.",
Vector2(350, 32)
)
title_audio_reset_button.pressed.connect(_on_title_audio_reset_pressed)
@@ -5728,26 +5728,59 @@ func _play_ui_cancel() -> void:
func _play_log_sfx(message: String) -> void:
if message.contains(" but misses.") or message.contains("헛쳤다"):
var normalized := message.strip_edges()
if normalized.is_empty():
return
if normalized.contains(" but misses.") or normalized.contains("헛쳤다"):
_play_sfx("guard_block")
elif message.begins_with("Objective updated:") or message.begins_with("Defeat condition updated:") or message.begins_with("군령 갱신:") or message.begins_with("패배 조건 갱신:"):
elif normalized.begins_with("Objective updated:") or normalized.begins_with("Defeat condition updated:") or normalized.begins_with("군령 갱신:") or normalized.begins_with("패배 조건 갱신:"):
_play_ui_confirm()
elif message.ends_with(" withdraws from the battlefield.") or message.ends_with("전장을 물러났다."):
_play_ui_confirm()
elif message.contains(" attacks ") or message.contains(" counterattacks ") or message.contains(" 공격 ") or message.contains(" 반격 "):
if message.contains(" for ") or message.contains("피해"):
elif _log_message_is_unit_defeat(normalized):
_play_sfx("defeat_sting")
elif _log_message_is_supply(normalized):
_play_sfx("item_pickup")
elif _log_message_is_movement(normalized) or _log_message_is_reinforcement(normalized):
_play_sfx("footstep")
elif normalized.contains(" attacks ") or normalized.contains(" counterattacks ") or normalized.contains(" 공격 ") or normalized.contains(" 반격 "):
if normalized.contains(" for ") or normalized.contains("피해"):
_play_sfx("hit_heavy")
elif message.contains(" casts ") or message.contains(" 시전 ") or message.contains("펼쳐"):
if message.contains("restoring") or message.contains(" until ") or message.contains("회복") or message.contains("지원"):
elif normalized.contains(" casts ") or normalized.contains(" 시전 ") or normalized.contains("펼쳐"):
if normalized.contains("restoring") or normalized.contains(" until ") or normalized.contains("회복") or normalized.contains("지원"):
_play_sfx("skill_cast")
else:
_play_sfx("fire_skill")
elif message.contains(" uses ") or message.contains(" equips ") or message.contains(" 사용:") or message.contains("장착") or message.contains("해제") or message.contains(" 매입:") or message.contains(" 매각:") or message.contains("군자금") or message.begins_with("Received ") or message.begins_with("전리품:"):
elif normalized.contains(" uses ") or normalized.contains(" equips ") or normalized.contains(" 사용:") or normalized.contains("장착") or normalized.contains("해제") or normalized.contains(" 매입:") or normalized.contains(" 매각:"):
_play_sfx("item_pickup")
elif message.contains("공적") or message.contains("품계") or message.contains("승급"):
elif normalized.contains("공적") or normalized.contains("품계") or normalized.contains("승급"):
_play_sfx("menu_confirm")
func _log_message_is_unit_defeat(message: String) -> bool:
return (
message.ends_with(" withdraws from the battlefield.")
or message.ends_with("전장을 물러났다.")
or message.ends_with(" 퇴각.")
or message.contains("으로 퇴각.")
)
func _log_message_is_supply(message: String) -> bool:
if message.begins_with("Received ") or message.begins_with("전리품:"):
return true
return _battle_event_log_matches(message, ["보급고", "치료소", "창고", "군자금"])
func _log_message_is_movement(message: String) -> bool:
for token in ["으로 진군.", "으로 압박.", "으로 접근.", "에 당도.", "에 진형을 잡았다.", "에 닿았다.", "발을 들였다."]:
if message.contains(token):
return true
return message.contains(" moves to ") or message.contains(" advances to ") or message.contains(" arrives at ")
func _log_message_is_reinforcement(message: String) -> bool:
return _battle_event_log_matches(message, ["잔병이 합류", "약탈대", "원군", "증원", "마지막 황건대", "마지막 반격", "잔당"])
func _announce_battle_status_audio() -> void:
if state.battle_status == BattleState.STATUS_ACTIVE:
last_announced_battle_status = ""