연의 전기 실행 수정 — 캡처 도구의 메모리 저장 표시를 Play 끝에 끔(SaveMemoryFlagGuard) · 시험 「전 스테이지 열기」 = 연의 편도 열림 · 서장 출전 = 출정 1장 학습 판 + 깬 판이어도 연출 다시 (PD 2026-11-18 「이 PC 에서 연의전기가 실행이 안돼」)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
38f4aebb84
commit
ae250225b4
|
|
@ -0,0 +1,23 @@
|
|||
using TKS.OutGame;
|
||||
using UnityEditor;
|
||||
|
||||
namespace TKS.EditorTools
|
||||
{
|
||||
/// <summary>
|
||||
/// 캡처 도구(CaptureUI · CaptureOutGame · ScenarioCapture · TitleCapture · 기믹 캡처)가 켜는 에디터 SessionState 「메모리 저장」 표시(SaveStore.MemoryFlagKey)를
|
||||
/// Play 가 끝나면 끈다 — 그 도구를 열린 에디터에서 돌리면 표시가 에디터를 다시 켤 때까지 남아, 그 뒤 PD 의 Play 가 모두 빈 메모리 저장(진행 기록 0)으로 돌았음
|
||||
/// (2026-11-18 PD 「이 PC 에서 연의전기가 실행이 안돼」 · 실측 = SessionState TKS_SAVE_MEMORY true · 실제 save.json 마지막 저장 11-17).
|
||||
/// 도구는 Play 진입 전에 켜고 그 Play 한 번 안에서 찍으므로 Play 가 끝난 뒤 끄면 도구 동작은 그대로다.
|
||||
/// </summary>
|
||||
[InitializeOnLoad]
|
||||
static class SaveMemoryFlagGuard
|
||||
{
|
||||
static SaveMemoryFlagGuard()
|
||||
{
|
||||
EditorApplication.playModeStateChanged += s =>
|
||||
{
|
||||
if (s == PlayModeStateChange.EnteredEditMode) SessionState.EraseBool(SaveStore.MemoryFlagKey);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e5b65456e01b10644bed1eebf6d765fc
|
||||
|
|
@ -1080,6 +1080,13 @@ namespace TKS.OutGame
|
|||
/// <summary>출전 = 입장 판정(서장 · 잠김 · 열전 잠김 · 군량) → 안 되면 알림 · 되면 상세를 닫고 전투(ArenaScreen.ScenarioGo).</summary>
|
||||
public void Go(string id, bool hard)
|
||||
{
|
||||
var pb = ContentTables.Find("scenario_battles", "s_id", id);
|
||||
if (pb != null && pb.I("n_no") == 0) // 서장 = 출정 학습 판으로(ArenaScreen.PrologueGo · 2026-11-18)
|
||||
{
|
||||
CloseDetail();
|
||||
screen.PrologueGo(id);
|
||||
return;
|
||||
}
|
||||
var why = ScenarioModeRules.Can(S.Db, S.Save, id, hard, S.Now);
|
||||
if (why != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,9 +113,55 @@ namespace TKS.OutGame
|
|||
Root.Modal(b.S("s_title_ko"), body, bt.ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 서장(편 n_no 0 · 도원결의 = 출정 n_spec_chapter 장 학습 판 1 ~ n_acts) 출전 — 아직 안 깬 첫 막(모두 깼으면 1막)을 일반 출정으로 연다
|
||||
/// (월드맵 경유 · 군량 · 시나리오 이벤트 · 학습 안내 · 보상 = 출정 규칙 그대로). false = 서장 아님.
|
||||
/// 2026-11-18 PD 「이 PC 에서 연의전기가 실행이 안돼」 — 서장은 「1장 학습 판」 알림만 띄우고 들어가지 않았음.
|
||||
/// </summary>
|
||||
static int prologueLast;
|
||||
|
||||
internal bool PrologueGo(string id)
|
||||
{
|
||||
var b = ContentTables.Find("scenario_battles", "s_id", id);
|
||||
if (b == null || b.I("n_no") != 0) return false;
|
||||
var map = Root.Map;
|
||||
var cfg = Root.Battle.Config;
|
||||
if (map == null || !map.HasData)
|
||||
{
|
||||
Root.Toast("월드맵 자료 없음");
|
||||
return true;
|
||||
}
|
||||
int ch = b.I("n_spec_chapter"), acts = Mathf.Max(1, b.I("n_acts")), pick = 0;
|
||||
for (int s = acts; s >= 1; s--)
|
||||
{
|
||||
var st = S.Save.Stage(ch, s, false);
|
||||
if (st == null || st.clears == 0) pick = s; // 안 깬 막 중 가장 앞
|
||||
}
|
||||
if (pick == 0) pick = prologueLast % acts + 1; // 모두 깼으면 1막 → 2막 → 3막 차례로 다시 보기
|
||||
prologueLast = pick;
|
||||
int ci = -1;
|
||||
for (int i = 0; i < cfg.chapters.Length; i++)
|
||||
if (cfg.chapters[i].no == ch) ci = i;
|
||||
var list = ci >= 0 ? cfg.StagesOfChapter(ch) : new List<int>();
|
||||
int node = -1;
|
||||
for (int n = 0; n < list.Count; n++)
|
||||
if (cfg.stages[list[n]].stage == pick) node = n;
|
||||
if (node < 0)
|
||||
{
|
||||
Root.Toast(ch + "-" + pick + " 스테이지 없음");
|
||||
return true;
|
||||
}
|
||||
if (map.TryEnter != null && !map.TryEnter(list[node])) return true; // 군량(시험 메뉴 「군량 면제」면 통과)
|
||||
ScenarioEvent.AllowReplay(ch, pick); // 연의 전기에서 들어오면 깬 판이어도 시작·승리 연출을 다시 튼다
|
||||
Root.OpenWorldMap();
|
||||
map.EnterStage(ci, node);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>편 id 출전(연의 · 열전) — 아트 화면 상세의 출전 버튼도 이것.</summary>
|
||||
internal void ScenarioGo(string id, bool hard)
|
||||
{
|
||||
if (PrologueGo(id)) return;
|
||||
var cfg = Root.Battle.Config;
|
||||
var stage = new BalanceConfig.StageDef { title = id, subtitle = "연의 전기", kind = StageKind.Normal, aiAccuracy = 1f, aiAggroRange = 999f };
|
||||
var b = ContentTables.Find("scenario_battles", "s_id", id);
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ namespace TKS.OutGame
|
|||
public static bool Unlocked(SaveData d, ContentRow b)
|
||||
{
|
||||
if (d.scenario.serverView) return d.scenario.serverUnlocked.Contains(b.S("s_id"));
|
||||
if (TestOptions.UnlockAllStages) return true; // 플레이 테스트 「전 스테이지 열기」 = 연의 전기 편도 모두 열림(2026-11-18 PD 「이 PC 에서 연의전기가 실행이 안돼」)
|
||||
int ch, st;
|
||||
if (!ArenaRules.ParseStageKey(b.S("s_unlock_stage"), out ch, out st)) return true;
|
||||
var s = d.Stage(ch, st, false);
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ namespace TKS
|
|||
{
|
||||
Mode = TutorialMode.Auto;
|
||||
current = null;
|
||||
replayChapter = replayStage = 0;
|
||||
fainted.Clear();
|
||||
faintTint.Clear();
|
||||
faintKeep.Clear();
|
||||
|
|
@ -137,8 +138,22 @@ namespace TKS
|
|||
}
|
||||
|
||||
/// <summary>이 판 · 이 발동에 틀 연출이 있는가(켜짐 · 표 행 있음 · 처음 깸 · 가상 실행·연무장 아님 · slot 배우가 있으면 학습 판 배치가 켜져 있을 때만).</summary>
|
||||
static int replayChapter, replayStage;
|
||||
|
||||
/// <summary>
|
||||
/// 다음에 이 판을 시작할 때 이미 깬 판이어도 연출을 다시 튼다(연의 전기 서장 「도원결의」 출전 = 이야기를 보러 들어옴 · 2026-11-18 PD 「결과물을 보고 피드백」).
|
||||
/// 다른 판이 시작되면 풀린다.
|
||||
/// </summary>
|
||||
public static void AllowReplay(int chapter, int stage)
|
||||
{
|
||||
replayChapter = chapter;
|
||||
replayStage = stage;
|
||||
}
|
||||
|
||||
public static bool Wants(BattleManager bm, BalanceConfig.StageDef stage, string trigger, bool cleared, int turn = 0)
|
||||
{
|
||||
if (stage != null && trigger == "stage_start" && (stage.chapter != replayChapter || stage.stage != replayStage)) replayChapter = replayStage = 0;
|
||||
if (cleared && stage != null && stage.chapter == replayChapter && stage.stage == replayStage) cleared = false;
|
||||
if (!Enabled || Sim.Active || bm == null || stage == null || bm.Mode != null || cleared) return false;
|
||||
var g = ScenarioData.Events(stage.chapter, stage.stage, trigger, turn);
|
||||
if (g.Count == 0) return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue