대화구조 수정

This commit is contained in:
2026-07-30 13:20:13 +09:00
parent 2413483853
commit 519e351fa5
15 changed files with 778 additions and 17 deletions

View File

@@ -12,7 +12,8 @@ public class StoryBeat
[Tooltip("이 대화가 일어나는 장소")]
public LocationData Location;
[Tooltip("대화를 거는 캐릭터")]
[Tooltip("대화를 거는 캐릭터. 비우면 '장소 비트' — 말을 거는 대상 없이 " +
"이 장소에 입장하면 자동으로 재생된다 (서술·챕터 진입 연출 등)")]
public CharacterData Character;
[Tooltip("재생할 대화 그래프 (.dlg = DialogGroup)")]
@@ -21,6 +22,10 @@ public class StoryBeat
[Tooltip("활성 조건 (진행도/호감도 범위 + 트리거)")]
public DialogCondition Condition = new();
[Tooltip("켜면 한 번 완료한 뒤에는 다시 후보에 오르지 않는다. " +
"장소 비트처럼 입장할 때마다 반복되면 안 되는 대화에 필수")]
public bool OnceOnly;
[Tooltip("이 대화를 처음 완료하면 메인 진행도 +N (필수 대화가 아니면 0)")]
[Min(0)] public int ProgressOnComplete;

View File

@@ -42,10 +42,21 @@ public StoryBeat FindBeat(DialogGroup group)
return null;
}
// character가 null이면 "장소 비트"(Character를 비워 둔 항목)를 찾는다 —
// 말을 거는 대상 없이 장소 입장 시 자동 재생되는 대화다.
private static bool IsPlayable(StoryBeat beat, LocationData location, CharacterData character)
{
if (beat.Location != location || beat.Character != character || beat.Group == null)
return false;
// 1회성 비트는 완료 이력이 있으면 후보에서 빠진다 (장소 비트가 입장마다 반복되는 것 방지)
if (beat.OnceOnly)
{
var story = StoryManager.Instance;
if (story != null && story.IsDialogCompleted(beat.Group.name))
return false;
}
return beat.Condition == null || beat.Condition.IsMet(character);
}
}