첫 실행 흐름 — 인트로 → 서장 1~3막 → 본영 안내 → 무료 1회 등용(간옹) → 편성 → 출정 1-1 스킬 튜토리얼 → 군영 소개(PD 2026-11-24 「작업한 모든 내용을 푸시」)

- OutGame/FirstFlow: FirstFlow(지휘) · FirstFlowGuide(포트레이트 대화 장치) · IntroScreen(인트로) · FirstFlowSortie(출정 1-1 스킬 튜토리얼) · FirstFlowData(표 읽기 · 검사)
- 표 Resources/UI/FirstFlow first_flow_{config,lines,intro,text}.csv · gacha.csv(free_first_ten 0 · first_pull_hero) · content_modes_config(scenario reward_prologue hero:10) · scn_text · sound_bgm
- 새 유저 = 영웅 없음 → 서장 3막 결과 화면에서 유비 획득 → 1회 무료 등용 첫 장 = 간옹(흐름 세이브만) → 편성 안내 → 출정 1-1(적 셋 일격 · 간옹 회복 안내) → 군영 장소 포커스
- 서장 막 잇기(PrologueRules.WinContinue · OutGameRoot.SettleMode · BattleManager.LeaveMode) · 연의 전기 화면의 서장은 그대로(결과 화면)
- 군영 화면 = 그림이 화면보다 큰 쪽(가로 · 세로) 스크롤 · ArenaHub.Focus
- 시험 메뉴 TKS/테스트/첫 실행 흐름 — 처음부터 보기(시험 세이브) · TKS/Import Gacha
- 테스트 FirstFlowTests 12 + 캡처 2(Explicit) · 그림은 임시(여인 = npc_woman · 인트로 = 색 판)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-11-24 19:08:19 +09:00
parent 8accc37896
commit 8254bcb73d
49 changed files with 3520 additions and 29 deletions

View File

@ -8,7 +8,8 @@ pity,80
pity_pickup_featured,1 pity_pickup_featured,1
pickup_share,0.5 pickup_share,0.5
pickup_exclusive,1 pickup_exclusive,1
free_first_ten,1 free_first_ten,0
daily_free,1 daily_free,1
ten_count,10 ten_count,10
ten_guarantee_rarity,2 ten_guarantee_rarity,2
first_pull_hero,jianyong

1 key value
8 pity_pickup_featured 1
9 pickup_share 0.5
10 pickup_exclusive 1
11 free_first_ten 1 0
12 daily_free 1
13 ten_count 10
14 ten_guarantee_rarity 2
15 first_pull_hero jianyong

View File

@ -25,3 +25,4 @@ mode_skilltest,bgm_battle,스킬 테스트 장면
battle_normal,bgm_battle,출정 일반 battle_normal,bgm_battle,출정 일반
battle_elite,bgm_battle,출정 정예 battle_elite,bgm_battle,출정 정예
battle_boss,bgm_boss,출정 보스 battle_boss,bgm_boss,출정 보스
screen_IntroScreen,bgm_story,인트로(첫 실행 흐름 · 연의 전기와 같은 음악 · 2026-11-24)

1 # 화면 · 전투 → 배경음악(2026-11-20 사운드 1차 · 기획 = 개발요청_사운드_2026-11-20 §3-가 · 코드 = SoundHooks)
25 battle_normal,bgm_battle,출정 일반
26 battle_elite,bgm_battle,출정 정예
27 battle_boss,bgm_boss,출정 보스
28 screen_IntroScreen,bgm_story,인트로(첫 실행 흐름 · 연의 전기와 같은 음악 · 2026-11-24)

View File

@ -56,6 +56,7 @@ scenario,power_mult_normal,1.1,연의(보통)의 기준 값 — 편별 맞춤
scenario,power_mult_hard,1.4,열전(어려움) — 적 체력 · 공격력에 (이 값 ÷ power_mult_normal)을 곱한다(1.27배) + scenario_rules.s_value_hard 의 조건 강화 scenario,power_mult_hard,1.4,열전(어려움) — 적 체력 · 공격력에 (이 값 ÷ power_mult_normal)을 곱한다(1.27배) + scenario_rules.s_value_hard 의 조건 강화
scenario,reward_normal,shard:10,첫 승리 · 조각 = 그 편 주역(보옥 삭제 · PD 2026-11-24 ⑦) scenario,reward_normal,shard:10,첫 승리 · 조각 = 그 편 주역(보옥 삭제 · PD 2026-11-24 ⑦)
scenario,reward_hard,shard:20,첫 승리 · 조각 = 그 편 주역(보옥 · 금 상자 삭제 · PD 2026-11-24) scenario,reward_hard,shard:20,첫 승리 · 조각 = 그 편 주역(보옥 · 금 상자 삭제 · PD 2026-11-24)
scenario,reward_prologue,hero:10,서장(n_no 0 · 도원결의) 첫 승리 꾸러미 — hero = 그 편 주역(s_reward_hero) 영웅을 얻는다(이미 보유 = 그 수만큼 조각) · 줄이 없으면 reward_normal · PD 2026-11-24 「최초 게임 시작 시 연의 전기 보상으로 3성 유비를 획득 · 연의 전기 완료 시 결과 화면으로 알림」
raid,unlock_stage,1-1,임시 1-1(즉시 개방 · PD 2026-11-18 테스트 지시) · 원래 값 = 3-15 · 3장 클리어 뒤 열림 raid,unlock_stage,1-1,임시 1-1(즉시 개방 · PD 2026-11-18 테스트 지시) · 원래 값 = 3-15 · 3장 클리어 뒤 열림
raid,main_days,7,PD 확정(2026-11-17) — 메인 맹장은 한 주 동안 머문다 · 주가 바뀔 때 raid_rotation.n_order 의 다음 순서로 raid,main_days,7,PD 확정(2026-11-17) — 메인 맹장은 한 주 동안 머문다 · 주가 바뀔 때 raid_rotation.n_order 의 다음 순서로
raid,sub_days,1,PD 확정(2026-11-17) — 서브 맹장은 매일 1명씩 바뀐다 raid,sub_days,1,PD 확정(2026-11-17) — 서브 맹장은 매일 1명씩 바뀐다

1 s_mode s_key s_value Memo
56 scenario power_mult_hard 1.4 열전(어려움) — 적 체력 · 공격력에 (이 값 ÷ power_mult_normal)을 곱한다(1.27배) + scenario_rules.s_value_hard 의 조건 강화
57 scenario reward_normal shard:10 첫 승리 · 조각 = 그 편 주역(보옥 삭제 · PD 2026-11-24 ⑦)
58 scenario reward_hard shard:20 첫 승리 · 조각 = 그 편 주역(보옥 · 금 상자 삭제 · PD 2026-11-24)
59 scenario reward_prologue hero:10 서장(n_no 0 · 도원결의) 첫 승리 꾸러미 — hero = 그 편 주역(s_reward_hero) 영웅을 얻는다(이미 보유 = 그 수만큼 조각) · 줄이 없으면 reward_normal · PD 2026-11-24 「최초 게임 시작 시 연의 전기 보상으로 3성 유비를 획득 · 연의 전기 완료 시 결과 화면으로 알림」
60 raid unlock_stage 1-1 임시 1-1(즉시 개방 · PD 2026-11-18 테스트 지시) · 원래 값 = 3-15 · 3장 클리어 뒤 열림
61 raid main_days 7 PD 확정(2026-11-17) — 메인 맹장은 한 주 동안 머문다 · 주가 바뀔 때 raid_rotation.n_order 의 다음 순서로
62 raid sub_days 1 PD 확정(2026-11-17) — 서브 맹장은 매일 1명씩 바뀐다

View File

@ -33,13 +33,15 @@ MonoBehaviour:
- key: pickup_exclusive - key: pickup_exclusive
value: 1 value: 1
- key: free_first_ten - key: free_first_ten
value: 1 value: 0
- key: daily_free - key: daily_free
value: 1 value: 1
- key: ten_count - key: ten_count
value: 10 value: 10
- key: ten_guarantee_rarity - key: ten_guarantee_rarity
value: 2 value: 2
- key: first_pull_hero
value: jianyong
pool: pool:
- heroId: liubei - heroId: liubei
inPool: 1 inPool: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c8f929bd7e63a7e4aa300c58e1783ec3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,39 @@
# 첫 실행 흐름 값 표(PD 2026-11-24 · 요청서 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md) — 코드 = OutGame/FirstFlow(FirstFlow · FirstFlowGuide · IntroScreen)
# 형식 = 키 · 값(값 안 | = 칸) · 좌표 = 설계 화면 1080×1920 px · 색 = #RRGGBB 또는 #RRGGBBAA · 문구 = first_flow_text.csv · 대사 줄 = first_flow_lines.csv · 인트로 장 = first_flow_intro.csv
# 가신(retainer) = OutGame 표 gacha.csv first_ten_hero 의 영웅(이름 · 그림 · 첫 10회 무료 등용의 마지막 장) — 이 표에는 영웅 id 를 적지 않는다
s_key,s_value,s_note
prologue_battle,taoyuan,서장 편 id(scenario_battles s_id · n_no 0) — 이 편의 막을 연의 전기 화면 없이 차례로 연다
start_delay_sec,0.5,대사가 나올 화면에 들어온 뒤 첫 줄이 뜨기까지(초 · 본영 로비가 밝아지고 0.5초 뒤)
fade,940|#000000,막 사이 · 3막 뒤 검정 페이드 = 정렬 순서|색(어두워지는 시간 = scenario_event_config fade_sec)
act_in,0.15|0.25,다음 막을 연 뒤 = 검정 유지(초)|걷히는 시간(초) · 아래에 다음 막 시작 연출의 검은 화면이 이어짐
lobby_in,0.2|0.6,3막 뒤 본영 로비 = 검정 유지(초)|밝아지는 시간(초)
start_heroes,,새 유저가 처음 가진 영웅(| 로 여럿 · 비어 있음 = 없음) — 서장 보상으로 유비 · 등용으로 가신을 얻는다(economy.csv start_heroes 는 이 흐름에서 뺀다 · PD 2026-11-24 「보유한 유닛은 유비 그리고 등용으로 얻은 유닛들로만」)
camp_focus_sec,0.45,군영 장소 소개: 그 장소로 화면이 옮겨 가는 시간(초 · 대사 줄 s_on_show focus:<장소 id>)
sortie_stage,1-1,스킬 튜토리얼이 나오는 출정 스테이지(장-판 · 그 스테이지를 처음 깨기 전의 판 · 유비와 가신이 출전했을 때 · PD 2026-11-24 3차 「튜토리얼을 제공해 적들을 섬멸」)
sortie_cluster,-1.0:3.0|0:3.5|1.0:3.0,모아 놓는 적 자리(유비에서 x:y 칸 · | 로 여럿 · 유비에게 가까운 적부터 · 판 밖이면 안으로) — 하나라도 맞으면 한 번에 쓰러짐 · 가운데(둘째)가 시작 대사를 함
sortie_hp_pct,0.5,모여 있던 적을 쓰러뜨린 뒤 유비에게 남기는 체력(최대 체력 비율 · PD 「반격 피해로 체력이 50% 감소 된 상태」)
sortie_timing,0.4|0.4,대사 연출 = 시작 전 뜸|카메라가 옮겨 간 뒤 뜸(초)
canvas,470|0.33,대화 장치 캔버스 = 정렬 순서|카메라에서 거리(아웃게임 위 덮개 450 위 · 타이틀 850 아래)
dim,#000000A6,어둡게 덮는 색(말하기 = 화면 전체 · 가리키기 · 누르기 = 대상 밖)
talk,190|40|150,대화 칸 = 화면 아래에서 y|대상과의 간격|화면 위끝 여백(대상과 겹치면 대상 위로 올라감)
bubble,430|620|250|0,말풍선(말하기) = 왼 x|폭|높이|대화 칸 아래에서 y · 그림 = Scenario/bubble(9 분할)
bubble_small,300|750|250|0,말풍선(가리키기 · 누르기 = 포트레이트를 작게) = 왼 x|폭|높이|아래에서 y
bubble_text,38|28|#3D2112|44|40|34|1.15|40,대사 글자 = 크기|최소 크기|색|좌우 여백|위 여백|아래 여백|줄 간격|초당 글자 수(누르면 전부 표시)
name_tag,40|0|56|30|26|#FFFFFF,이름표 = 말풍선 왼쪽에서 x|말풍선 위끝에서 y(가운데)|높이|글자|좌우 여백|글자 색 · 그림 = Scenario/name_tag · 바탕색 = speaker.* 4번째
portrait,250|170|400|340,포트레이트(말하기) = 가운데 x|가운데 y(대화 칸 아래에서)|그림 크기|둥근 받침 크기
portrait_small,180|140|300|260,포트레이트(가리키기 · 누르기) = 가운데 x|가운데 y|그림 크기|받침 크기
next_mark,34|-44|34|#B8433A|0.9,다음 표시(▼) = 글자 크기|말풍선 오른쪽에서 x|아래에서 y|색|깜박임 주기(초)
focus_frame,10|8|#F2B33D|1.0|0.55,대상 강조 테 = 대상 둘레 여백|테 굵기|색(금빛)|숨쉬기 주기(초)|가장 흐릴 때(0~1)
finger,150|0.22|-0.18|16|0.7,손가락(누르기 줄 · 테마 아이콘 tut_hand) = 크기|대상 가운데에서 x(폭 비율)|y(높이 비율)|까딱임 px|주기(초)
speaker.helper,ff_name_helper|UI/Guide/helper_|npc_woman|#8A5A2B|#F6D5CF,도우미 여인 = 이름 키|그림 경로 앞부분(+ 표정 normal · smile · wistful)|납품 전 임시 유닛 그림(Units/<이름>)|이름표 색|받침 색
speaker.retainer,|||#3F6B4A|#DDE8D8,가신 = 이름 · 그림은 gacha.csv first_ten_hero 의 영웅(칸을 비움)|||이름표 색|받침 색
intro_canvas,860|0.28,인트로 캔버스 = 정렬 순서|카메라에서 거리(타이틀 850 위 · 씬 페이드 950 아래)
intro_bg,#1B1D24,인트로 바탕색
intro_open_sec,0.6,첫 장 = 검정에서 밝아지는 시간(초)
intro_scroll,UI/Scenario/parts/part_scroll_big|10|150|1060|1560,두루마리 틀 = 그림|왼 x|위 y|폭|높이(연의 전기 두루마리를 다시 씀 · 9 분할)
intro_picture,150|372|780|930,그림 칸 = 왼 x|위 y|폭|높이(이 칸 밖은 가려짐 · 납품 그림 = first_flow_intro s_picture)
intro_caption,150|1314|780|150|44|30|#101014E6|#FFF2D9,자막 띠 = 왼 x|위 y|폭|높이|글자|최소 글자|띠 색|글자 색
intro_dots,1490|22|26|#B8433A|#C9B48F,장 점 = 위 y|크기|사이|지금 장 색|나머지 색
intro_hint,1790|34|#9A9AA5,아래 안내 글 = 위 y|글자|색
intro_skip,40|60|190|80|34|,건너뛰기 버튼 = 오른쪽에서 x|위 y|폭|높이|글자|나타나는 시간(초 · 빈칸 = scenario_event_config skip_show_after_sec)
intro_end,2.2|0.8|0.85|0.9|0.3,마지막 장 끝 = 확대 배율|확대 중심 x|y(0~1 · 오른쪽 위 주점 간판 쪽)|확대 + 검정 페이드 시간(초)|건너뛰기 때 검정 페이드 시간(초)
1 # 첫 실행 흐름 값 표(PD 2026-11-24 · 요청서 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md) — 코드 = OutGame/FirstFlow(FirstFlow · FirstFlowGuide · IntroScreen)
2 # 형식 = 키 · 값(값 안 | = 칸) · 좌표 = 설계 화면 1080×1920 px · 색 = #RRGGBB 또는 #RRGGBBAA · 문구 = first_flow_text.csv · 대사 줄 = first_flow_lines.csv · 인트로 장 = first_flow_intro.csv
3 # 가신(retainer) = OutGame 표 gacha.csv first_ten_hero 의 영웅(이름 · 그림 · 첫 10회 무료 등용의 마지막 장) — 이 표에는 영웅 id 를 적지 않는다
4 s_key,s_value,s_note
5 prologue_battle,taoyuan,서장 편 id(scenario_battles s_id · n_no 0) — 이 편의 막을 연의 전기 화면 없이 차례로 연다
6 start_delay_sec,0.5,대사가 나올 화면에 들어온 뒤 첫 줄이 뜨기까지(초 · 본영 로비가 밝아지고 0.5초 뒤)
7 fade,940|#000000,막 사이 · 3막 뒤 검정 페이드 = 정렬 순서|색(어두워지는 시간 = scenario_event_config fade_sec)
8 act_in,0.15|0.25,다음 막을 연 뒤 = 검정 유지(초)|걷히는 시간(초) · 아래에 다음 막 시작 연출의 검은 화면이 이어짐
9 lobby_in,0.2|0.6,3막 뒤 본영 로비 = 검정 유지(초)|밝아지는 시간(초)
10 start_heroes,,새 유저가 처음 가진 영웅(| 로 여럿 · 비어 있음 = 없음) — 서장 보상으로 유비 · 등용으로 가신을 얻는다(economy.csv start_heroes 는 이 흐름에서 뺀다 · PD 2026-11-24 「보유한 유닛은 유비 그리고 등용으로 얻은 유닛들로만」)
11 camp_focus_sec,0.45,군영 장소 소개: 그 장소로 화면이 옮겨 가는 시간(초 · 대사 줄 s_on_show focus:<장소 id>)
12 sortie_stage,1-1,스킬 튜토리얼이 나오는 출정 스테이지(장-판 · 그 스테이지를 처음 깨기 전의 판 · 유비와 가신이 출전했을 때 · PD 2026-11-24 3차 「튜토리얼을 제공해 적들을 섬멸」)
13 sortie_cluster,-1.0:3.0|0:3.5|1.0:3.0,모아 놓는 적 자리(유비에서 x:y 칸 · | 로 여럿 · 유비에게 가까운 적부터 · 판 밖이면 안으로) — 하나라도 맞으면 한 번에 쓰러짐 · 가운데(둘째)가 시작 대사를 함
14 sortie_hp_pct,0.5,모여 있던 적을 쓰러뜨린 뒤 유비에게 남기는 체력(최대 체력 비율 · PD 「반격 피해로 체력이 50% 감소 된 상태」)
15 sortie_timing,0.4|0.4,대사 연출 = 시작 전 뜸|카메라가 옮겨 간 뒤 뜸(초)
16 canvas,470|0.33,대화 장치 캔버스 = 정렬 순서|카메라에서 거리(아웃게임 위 덮개 450 위 · 타이틀 850 아래)
17 dim,#000000A6,어둡게 덮는 색(말하기 = 화면 전체 · 가리키기 · 누르기 = 대상 밖)
18 talk,190|40|150,대화 칸 = 화면 아래에서 y|대상과의 간격|화면 위끝 여백(대상과 겹치면 대상 위로 올라감)
19 bubble,430|620|250|0,말풍선(말하기) = 왼 x|폭|높이|대화 칸 아래에서 y · 그림 = Scenario/bubble(9 분할)
20 bubble_small,300|750|250|0,말풍선(가리키기 · 누르기 = 포트레이트를 작게) = 왼 x|폭|높이|아래에서 y
21 bubble_text,38|28|#3D2112|44|40|34|1.15|40,대사 글자 = 크기|최소 크기|색|좌우 여백|위 여백|아래 여백|줄 간격|초당 글자 수(누르면 전부 표시)
22 name_tag,40|0|56|30|26|#FFFFFF,이름표 = 말풍선 왼쪽에서 x|말풍선 위끝에서 y(가운데)|높이|글자|좌우 여백|글자 색 · 그림 = Scenario/name_tag · 바탕색 = speaker.* 4번째
23 portrait,250|170|400|340,포트레이트(말하기) = 가운데 x|가운데 y(대화 칸 아래에서)|그림 크기|둥근 받침 크기
24 portrait_small,180|140|300|260,포트레이트(가리키기 · 누르기) = 가운데 x|가운데 y|그림 크기|받침 크기
25 next_mark,34|-44|34|#B8433A|0.9,다음 표시(▼) = 글자 크기|말풍선 오른쪽에서 x|아래에서 y|색|깜박임 주기(초)
26 focus_frame,10|8|#F2B33D|1.0|0.55,대상 강조 테 = 대상 둘레 여백|테 굵기|색(금빛)|숨쉬기 주기(초)|가장 흐릴 때(0~1)
27 finger,150|0.22|-0.18|16|0.7,손가락(누르기 줄 · 테마 아이콘 tut_hand) = 크기|대상 가운데에서 x(폭 비율)|y(높이 비율)|까딱임 px|주기(초)
28 speaker.helper,ff_name_helper|UI/Guide/helper_|npc_woman|#8A5A2B|#F6D5CF,도우미 여인 = 이름 키|그림 경로 앞부분(+ 표정 normal · smile · wistful)|납품 전 임시 유닛 그림(Units/<이름>)|이름표 색|받침 색
29 speaker.retainer,|||#3F6B4A|#DDE8D8,가신 = 이름 · 그림은 gacha.csv first_ten_hero 의 영웅(칸을 비움)|||이름표 색|받침 색
30 intro_canvas,860|0.28,인트로 캔버스 = 정렬 순서|카메라에서 거리(타이틀 850 위 · 씬 페이드 950 아래)
31 intro_bg,#1B1D24,인트로 바탕색
32 intro_open_sec,0.6,첫 장 = 검정에서 밝아지는 시간(초)
33 intro_scroll,UI/Scenario/parts/part_scroll_big|10|150|1060|1560,두루마리 틀 = 그림|왼 x|위 y|폭|높이(연의 전기 두루마리를 다시 씀 · 9 분할)
34 intro_picture,150|372|780|930,그림 칸 = 왼 x|위 y|폭|높이(이 칸 밖은 가려짐 · 납품 그림 = first_flow_intro s_picture)
35 intro_caption,150|1314|780|150|44|30|#101014E6|#FFF2D9,자막 띠 = 왼 x|위 y|폭|높이|글자|최소 글자|띠 색|글자 색
36 intro_dots,1490|22|26|#B8433A|#C9B48F,장 점 = 위 y|크기|사이|지금 장 색|나머지 색
37 intro_hint,1790|34|#9A9AA5,아래 안내 글 = 위 y|글자|색
38 intro_skip,40|60|190|80|34|,건너뛰기 버튼 = 오른쪽에서 x|위 y|폭|높이|글자|나타나는 시간(초 · 빈칸 = scenario_event_config skip_show_after_sec)
39 intro_end,2.2|0.8|0.85|0.9|0.3,마지막 장 끝 = 확대 배율|확대 중심 x|y(0~1 · 오른쪽 위 주점 간판 쪽)|확대 + 검정 페이드 시간(초)|건너뛰기 때 검정 페이드 시간(초)

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8c227a73b69500d4cbd1399d1b495926
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
# 첫 실행 흐름 인트로 표(PD 2026-11-24 · 요청서 §2-7 · 기획 원본 = tables/first_flow_intro.csv) — 코드 = OutGame/FirstFlow/IntroScreen.cs
# s_picture = Resources 경로(그림이 없으면 s_dummy_color 색 판 + s_dummy_key 글자) · f_sec = 그 장을 보여 주는 시간(터치 = 다음 장)
# e_in = fade(앞 장 위로 서서히) · slide(오른쪽에서 밀려 들어옴) · f_in_sec = 등장 시간 · f_scale_from → f_scale_to = 그 장 동안 확대(f_pivot_x · y = 확대 중심 0~1 · 왼쪽 아래 기준)
# f_rise = 그 장 동안 위로 오르는 양(그림 높이 비율) · f_shake = 등장이 끝날 때 한 번 흔들림(px · 0 = 없음)
n_cut,f_sec,s_picture,s_caption_key,s_dummy_color,s_dummy_key,e_in,f_in_sec,f_scale_from,f_scale_to,f_pivot_x,f_pivot_y,f_rise,f_shake,Memo
1,5,UI/Intro/intro_cut_1,ff_intro_1,#3B3540,ff_intro_dummy_1,fade,0.6,1.04,1.04,0.5,0.5,0.02,0,검정에서 밝아짐 · 그림이 아래에서 위로 아주 천천히 오름(높이의 2 %)
2,5,UI/Intro/intro_cut_2,ff_intro_2,#7C3B22,ff_intro_dummy_2,slide,0.4,1.04,1.04,0.5,0.5,0,14,오른쪽에서 왼쪽으로 밀리며 등장 + 화면 흔들림 한 번
3,6,UI/Intro/intro_cut_3,ff_intro_3,#5B5438,ff_intro_dummy_3,fade,0.4,1.0,1.12,0.5,0.45,0,0,청년 뒷모습으로 천천히 확대 · 끝 = first_flow_config intro_end(주점 간판으로 확대 → 검정)
1 # 첫 실행 흐름 인트로 표(PD 2026-11-24 · 요청서 §2-7 · 기획 원본 = tables/first_flow_intro.csv) — 코드 = OutGame/FirstFlow/IntroScreen.cs
2 # s_picture = Resources 경로(그림이 없으면 s_dummy_color 색 판 + s_dummy_key 글자) · f_sec = 그 장을 보여 주는 시간(터치 = 다음 장)
3 # e_in = fade(앞 장 위로 서서히) · slide(오른쪽에서 밀려 들어옴) · f_in_sec = 등장 시간 · f_scale_from → f_scale_to = 그 장 동안 확대(f_pivot_x · y = 확대 중심 0~1 · 왼쪽 아래 기준)
4 # f_rise = 그 장 동안 위로 오르는 양(그림 높이 비율) · f_shake = 등장이 끝날 때 한 번 흔들림(px · 0 = 없음)
5 n_cut,f_sec,s_picture,s_caption_key,s_dummy_color,s_dummy_key,e_in,f_in_sec,f_scale_from,f_scale_to,f_pivot_x,f_pivot_y,f_rise,f_shake,Memo
6 1,5,UI/Intro/intro_cut_1,ff_intro_1,#3B3540,ff_intro_dummy_1,fade,0.6,1.04,1.04,0.5,0.5,0.02,0,검정에서 밝아짐 · 그림이 아래에서 위로 아주 천천히 오름(높이의 2 %)
7 2,5,UI/Intro/intro_cut_2,ff_intro_2,#7C3B22,ff_intro_dummy_2,slide,0.4,1.04,1.04,0.5,0.5,0,14,오른쪽에서 왼쪽으로 밀리며 등장 + 화면 흔들림 한 번
8 3,6,UI/Intro/intro_cut_3,ff_intro_3,#5B5438,ff_intro_dummy_3,fade,0.4,1.0,1.12,0.5,0.45,0,0,청년 뒷모습으로 천천히 확대 · 끝 = first_flow_config intro_end(주점 간판으로 확대 → 검정)

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 110b104b1de29814b8cf50a3b6310caa
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
# 첫 실행 흐름 대사 줄 표(PD 2026-11-24 · 요청서 §2-2 ~ §2-6 + 2차 지시: 무료 1회 등용 · 편성 안내 · 군영 진언 문구) — 코드 = OutGame/FirstFlow/FirstFlow.cs · 문구 = first_flow_text.csv(s_text_key)
# e_speaker = helper(도우미 여인) · retainer(가신 = gacha.csv first_pull_hero) · l_screen = 이 줄이 나올 수 있는 화면(; 로 여럿) lobby 본영 · recruit 명장 등용 · formation 편성 · worldmap 월드맵 · camp 군영
# e_mode = talk 말하기(화면 어둡게 · 터치로 다음) · point 가리키기(s_target 만 밝게 · 눌리지 않음 · 터치로 다음) · press 누르게 함(s_target 만 밝게 + 금빛 테 + 손가락 · 그 대상만 눌림 · 누르면 다음)
# s_target = 화면/오브젝트 이름(+ 로 여럿 = 합친 칸 · {retainer} = 가신 영웅 id) · e_face = normal · smile · wistful · none(그림 그대로) · e_done = next 다음 줄 · lobby 스스로 본영 로비로 · end 흐름 끝
# s_on_show = 줄이 뜰 때 할 일(banner:<등용 배너 id> = 그 배너를 고름 · focus:<군영 장소 id> = 그 장소로 화면을 옮김) · s_on_done = 줄이 끝난 뒤 할 일(save_formation = 편성 화면의 지금 편성을 저장)
# s_skip_if 가 참이면 n_skip_to 줄로 건너뜀(first_pull_done = 첫 등용을 이미 함 · retainer_placed = 가신이 이미 출전 편성에 있음)
# n_gate = 이 줄의 화면이 아닌 본영 로비에 있을 때 다시 보여 줄 줄(그 화면으로 이끄는 누르기 줄 · 진행 기록은 그대로) · s_wait = 이 조건이 참일 때만(stage_clear:장-판 = 그 출정 스테이지를 이김)
n_step,e_speaker,l_screen,e_mode,s_target,e_face,s_text_key,e_done,s_on_show,s_on_done,s_skip_if,n_skip_to,n_gate,s_wait,Memo
1,helper,lobby,talk,,smile,ff_line_01,next,,,,,,,
2,helper,lobby,talk,,smile,ff_line_02,next,,,,,,,
3,helper,lobby,talk,,normal,ff_line_03,next,,,,,,,
4,helper,lobby,press,lobby/Side_등용,smile,ff_line_04,next,,,first_pull_done,6,,,누르면 거래 화면 명장 등용 탭 · 첫 등용을 이미 한 세이브 = 6번으로 건너뜀
5,helper,recruit,press,recruit/Single,smile,ff_line_05,next,banner:shu,,first_pull_done,6,4,,「1회 등용」(상시 배너의 오늘 무료 1회) · 첫 장 = 가신(gacha.csv first_pull_hero) · 등용 쪽 = s_on_show banner:<gacha_banners banner_id>(제안값 촉)
6,retainer,recruit;lobby,talk,,none,ff_line_06,next,,,,,,,카드를 닫은 뒤 · 말하는 이 retainer = gacha.csv first_pull_hero 의 영웅
7,helper,recruit;lobby,talk,,normal,ff_line_07,lobby,,,retainer_placed,10,,,끝나면 스스로 본영 로비로 · 가신이 이미 출전 편성에 있으면 10번으로 건너뜀
8,helper,lobby,press,lobby/Content_formation,smile,ff_line_08,next,,,retainer_placed,10,,,누르면 편성 화면
9,helper,formation,press,formation/C_{retainer},smile,ff_line_09,next,,save_formation,retainer_placed,10,8,,가신 카드({retainer} = 가신 영웅 id)를 누르면 빈 자리에 서고 그 편성을 바로 저장(s_on_done) = 출전 편성 · PD 2026-11-24 2차 「1회 뽑기로 얻은 간옹을 데리고 출전」
10,helper,formation;lobby,talk,,smile,ff_line_10,lobby,,,,,,,PD 원문 · 끝나면 스스로 본영 로비로(e_done lobby)
11,helper,lobby,press,lobby/Sortie,wistful,ff_line_11,next,,,,,,,누르면 월드맵 · 여인의 안내는 여기까지
12,retainer,worldmap;lobby,talk,,none,ff_line_12,lobby,,,,,,stage_clear:1-1,출정 1-1 을 이긴 뒤 결과 화면을 닫으면(s_wait) · 끝나면 스스로 본영 로비로
13,retainer,lobby,press,lobby/Content_camp,none,ff_line_13,next,,,,,,,누르면 군영 화면
14,retainer,camp,talk,,none,ff_line_14,next,,,,,13,,
15,retainer,camp,point,camp/Press_hall+Tag_hall,none,ff_line_15,next,focus:hall,,,,13,,가리키기 = 그 장소로 화면을 옮기고 그 장소만 밝게 · 눌리지 않음(누름 칸 + 이름표)
16,retainer,camp,point,camp/Press_tower+Tag_tower,none,ff_line_16,next,focus:tower,,,,13,,
17,retainer,camp,point,camp/Press_yard+Tag_yard,none,ff_line_17,next,focus:yard,,,,13,,
18,retainer,camp,point,camp/Press_ring+Tag_ring,none,ff_line_18,next,focus:ring,,,,13,,
19,retainer,camp,point,camp/Press_gate+Tag_gate,none,ff_line_19,next,focus:gate,,,,13,,
20,retainer,camp,talk,,none,ff_line_20,end,,,,,13,,끝나면 안내 끝 = 첫 실행 흐름 끝(e_done end)
1 # 첫 실행 흐름 대사 줄 표(PD 2026-11-24 · 요청서 §2-2 ~ §2-6 + 2차 지시: 무료 1회 등용 · 편성 안내 · 군영 진언 문구) — 코드 = OutGame/FirstFlow/FirstFlow.cs · 문구 = first_flow_text.csv(s_text_key)
2 # e_speaker = helper(도우미 여인) · retainer(가신 = gacha.csv first_pull_hero) · l_screen = 이 줄이 나올 수 있는 화면(; 로 여럿) lobby 본영 · recruit 명장 등용 · formation 편성 · worldmap 월드맵 · camp 군영
3 # e_mode = talk 말하기(화면 어둡게 · 터치로 다음) · point 가리키기(s_target 만 밝게 · 눌리지 않음 · 터치로 다음) · press 누르게 함(s_target 만 밝게 + 금빛 테 + 손가락 · 그 대상만 눌림 · 누르면 다음)
4 # s_target = 화면/오브젝트 이름(+ 로 여럿 = 합친 칸 · {retainer} = 가신 영웅 id) · e_face = normal · smile · wistful · none(그림 그대로) · e_done = next 다음 줄 · lobby 스스로 본영 로비로 · end 흐름 끝
5 # s_on_show = 줄이 뜰 때 할 일(banner:<등용 배너 id> = 그 배너를 고름 · focus:<군영 장소 id> = 그 장소로 화면을 옮김) · s_on_done = 줄이 끝난 뒤 할 일(save_formation = 편성 화면의 지금 편성을 저장)
6 # s_skip_if 가 참이면 n_skip_to 줄로 건너뜀(first_pull_done = 첫 등용을 이미 함 · retainer_placed = 가신이 이미 출전 편성에 있음)
7 # n_gate = 이 줄의 화면이 아닌 본영 로비에 있을 때 다시 보여 줄 줄(그 화면으로 이끄는 누르기 줄 · 진행 기록은 그대로) · s_wait = 이 조건이 참일 때만(stage_clear:장-판 = 그 출정 스테이지를 이김)
8 n_step,e_speaker,l_screen,e_mode,s_target,e_face,s_text_key,e_done,s_on_show,s_on_done,s_skip_if,n_skip_to,n_gate,s_wait,Memo
9 1,helper,lobby,talk,,smile,ff_line_01,next,,,,,,,
10 2,helper,lobby,talk,,smile,ff_line_02,next,,,,,,,
11 3,helper,lobby,talk,,normal,ff_line_03,next,,,,,,,
12 4,helper,lobby,press,lobby/Side_등용,smile,ff_line_04,next,,,first_pull_done,6,,,누르면 거래 화면 명장 등용 탭 · 첫 등용을 이미 한 세이브 = 6번으로 건너뜀
13 5,helper,recruit,press,recruit/Single,smile,ff_line_05,next,banner:shu,,first_pull_done,6,4,,「1회 등용」(상시 배너의 오늘 무료 1회) · 첫 장 = 가신(gacha.csv first_pull_hero) · 등용 쪽 = s_on_show banner:<gacha_banners banner_id>(제안값 촉)
14 6,retainer,recruit;lobby,talk,,none,ff_line_06,next,,,,,,,카드를 닫은 뒤 · 말하는 이 retainer = gacha.csv first_pull_hero 의 영웅
15 7,helper,recruit;lobby,talk,,normal,ff_line_07,lobby,,,retainer_placed,10,,,끝나면 스스로 본영 로비로 · 가신이 이미 출전 편성에 있으면 10번으로 건너뜀
16 8,helper,lobby,press,lobby/Content_formation,smile,ff_line_08,next,,,retainer_placed,10,,,누르면 편성 화면
17 9,helper,formation,press,formation/C_{retainer},smile,ff_line_09,next,,save_formation,retainer_placed,10,8,,가신 카드({retainer} = 가신 영웅 id)를 누르면 빈 자리에 서고 그 편성을 바로 저장(s_on_done) = 출전 편성 · PD 2026-11-24 2차 「1회 뽑기로 얻은 간옹을 데리고 출전」
18 10,helper,formation;lobby,talk,,smile,ff_line_10,lobby,,,,,,,PD 원문 · 끝나면 스스로 본영 로비로(e_done lobby)
19 11,helper,lobby,press,lobby/Sortie,wistful,ff_line_11,next,,,,,,,누르면 월드맵 · 여인의 안내는 여기까지
20 12,retainer,worldmap;lobby,talk,,none,ff_line_12,lobby,,,,,,stage_clear:1-1,출정 1-1 을 이긴 뒤 결과 화면을 닫으면(s_wait) · 끝나면 스스로 본영 로비로
21 13,retainer,lobby,press,lobby/Content_camp,none,ff_line_13,next,,,,,,,누르면 군영 화면
22 14,retainer,camp,talk,,none,ff_line_14,next,,,,,13,,
23 15,retainer,camp,point,camp/Press_hall+Tag_hall,none,ff_line_15,next,focus:hall,,,,13,,가리키기 = 그 장소로 화면을 옮기고 그 장소만 밝게 · 눌리지 않음(누름 칸 + 이름표)
24 16,retainer,camp,point,camp/Press_tower+Tag_tower,none,ff_line_16,next,focus:tower,,,,13,,
25 17,retainer,camp,point,camp/Press_yard+Tag_yard,none,ff_line_17,next,focus:yard,,,,13,,
26 18,retainer,camp,point,camp/Press_ring+Tag_ring,none,ff_line_18,next,focus:ring,,,,13,,
27 19,retainer,camp,point,camp/Press_gate+Tag_gate,none,ff_line_19,next,focus:gate,,,,13,,
28 20,retainer,camp,talk,,none,ff_line_20,end,,,,,13,,끝나면 안내 끝 = 첫 실행 흐름 끝(e_done end)

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2c106b3f4f0764e4ab4758b8f4668969
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,42 @@
# 첫 실행 흐름 글자 표(PD 2026-11-24 · 기획 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md · 문구 원본 = tables/first_flow_lobby.csv · first_flow_intro.csv + PD 2차 지시)
# 대사 한 줄 = 28자 안 · 최대 3줄(말풍선 폭에 맞춰 스스로 줄바꿈) · 문구만 고치면 반영(코드 수정 없음) · 코드 = OutGame/FirstFlow
s_key,ko,en,note
ff_name_helper,탁현의 여인,,도우미 이름표(가칭 · PD 확인 대기 · first_flow_helper.csv)
ff_line_01,대인! 탁현 주점에서 건달들을 물리치시는 모습을 보았어요.,,대사 1 · 여인 · 문구 = 제안(기획 표 줄 1)
ff_line_02,백성을 위해 나서 주신 모습에 감동했어요. 작은 힘이라도 보태고 싶어 찾아왔답니다.,,대사 2 · 여인 · 문구 = 제안(기획 표 줄 2)
ff_line_03,이곳이 대인의 본영이에요. 싸움을 준비하는 곳이지요.,,대사 3 · 여인 · 문구 = 제안(기획 표 줄 3)
ff_line_04,대인의 소문을 듣고 장수들이 모여들고 있어요. 등용에서 맞이해 보세요!,,대사 4 · 여인 · 문구 = 제안(기획 표 줄 4)
ff_line_05,첫 분은 대가 없이 맞이하실 수 있답니다.,,대사 5 · 여인 · PD 2026-11-24 2차 「뽑기는 1회만 무료」 · 문구 = 제안
ff_line_06,주공! 탁현의 간옹입니다. 주공을 도와 한 황실을 다시 일으키는 데 이 몸을 바치겠습니다.,,대사 6 · 간옹 · 문구 = 제안(기획 표 줄 6)
ff_line_07,출정하시기 전에 먼저 편성을 하셔야 해요. 새로 오신 분을 진영에 세워 볼까요?,,대사 7 · 여인 · PD 2026-11-24 2차 「출정하기 전에 편성을 먼저 해야한다는 안내」 · 문구 = 제안
ff_line_08,편성은 이쪽이에요.,,대사 8 · 여인 · 문구 = 제안
ff_line_09,새로 맞이한 장수를 누르면 빈 자리에 섭니다.,,대사 9 · 여인 · 문구 = 제안
ff_line_10,황건적 소탕을 위해 출정하신다고 하셨죠? 제가 가는 길을 안내해드리겠어요.,,대사 10 · 여인 · PD 원문(기획 표 줄 7)
ff_line_11,여기서부터가 싸움터로 가는 길이에요. 언젠가 인연이 닿으면 다시 뵐 수 있겠지요.,,대사 11 · 여인 · 문구 = 제안(기획 표 줄 8)
ff_line_12,황건적들의 세력이 점점 강해지고 있는 것 같습니다. 저놈들과 맞서려면 군영을 꾸리는 것이 좋겠습니다.,,대사 12 · 가신 · PD 2026-11-24 2차 원문(오탈자 「맞서러면」 → 「맞서려면」)
ff_line_13,군영은 이쪽입니다. 함께 둘러보시지요.,,대사 13 · 간옹 · 문구 = 제안(기획 표 줄 10)
ff_line_14,이곳이 군영입니다. 싸우며 힘을 기르는 곳들이 모여 있습니다.,,대사 14 · 간옹 · 문구 = 제안(기획 표 줄 11)
ff_line_15,연의 전기에서는 지나온 이야기를 다시 보고 새 이야기에 도전하실 수 있습니다.,,대사 15 · 간옹 · 문구 = 제안(기획 표 줄 12)
ff_line_16,천하제일 탑은 한 층씩 올라가며 겨루는 곳입니다.,,대사 16 · 간옹 · 문구 = 제안(기획 표 줄 13)
ff_line_17,훈련장에서는 전술 훈련과 병법 훈련으로 군을 단련합니다.,,대사 17 · 간옹 · 문구 = 제안(기획 표 줄 14)
ff_line_18,투기장에서는 다른 군주의 군과 겨루게 됩니다.,,대사 18 · 간옹 · 문구 = 제안(기획 표 줄 15)
ff_line_19,성문 밖에는 이름난 맹장이 나타납니다. 토벌전에서 힘을 겨뤄 보십시오.,,대사 19 · 간옹 · 문구 = 제안(기획 표 줄 16)
ff_line_20,마구간과 천하 쟁패는 아직 준비 중입니다. 마음 가는 곳부터 들러 보시지요.,,대사 20 · 간옹 · 문구 = 제안(기획 표 줄 17)
ff_intro_1,한나라 말. 조정은 기울고 백성은 굶주렸다.,,인트로 1장 자막
ff_intro_dummy_1,그림 1 — 기울어진 궁궐 지붕 · 텅 빈 곳간 · 고개 숙인 백성 서넛(먹색 바탕 + 붉은 노을),,인트로 1장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
ff_intro_2,누런 두건의 무리가 들불처럼 일어났다. 황건적의 난.,,인트로 2장 자막
ff_intro_dummy_2,그림 2 — 누런 두건을 두른 무리가 횃불을 들고 마을로 밀려옴 · 하늘에 누런 깃발,,인트로 2장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
ff_intro_3,184년 탁현. 의용군을 모으는 방 앞에 돗자리 장수 한 사람이 서 있었다.,,인트로 3장 자막
ff_intro_dummy_3,그림 3 — 탁현 성문 옆 의용군 모집 방문 앞 구경꾼들 · 돗자리를 멘 청년의 뒷모습 · 오른쪽 위에 주점 간판,,인트로 3장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
ff_intro_skip,건너뛰기 >>,,인트로 건너뛰기 버튼(연의 연출 건너뛰기와 같은 문구)
ff_intro_hint,화면을 누르면 다음 장,,인트로 아래 안내 글
ff_retry,다시 도전,,첫 실행 흐름의 서장 패배 결과 창 버튼(그 막을 처음부터 다시)
ff_sortie_enemy,오~ 손님이 오셨군. 얼마나 가지고 있을지 기대되는데? 크크큭...,,시작 대사(모아 놓은 적 가운데 하나) · PD 원문
ff_sortie_victim,너희들의 악행을 끝내주겠다.,,유비 대사 · PD 원문
ff_sortie_tip_skill,유비의 「이도류 검법」을 시전하면 이번 턴에 두번 행동할 수 있습니다.,,유비 스킬 안내 카드 · PD 2026-11-24 「동작에 맞게 고침」(원문 「다음 턴에서」 → 스킬 표 설명 「다음 행동이 2번 행동 가능」에 맞춰 「이번 턴에」)
ff_sortie_retainer,주공 무리하시면 안됩니다.,,가신 대사(모여 있던 적을 쓰러뜨린 뒤) · PD 원문
ff_sortie_tip_heal,간옹의 유세 스킬을 아군에게 사용하면 아군을 회복시킬 수 있습니다.,,가신 스킬 안내 카드 · PD 원문
ff_sortie_bar_select,{0}을(를) 눌러 고르세요.,,안내 띠: 영웅을 고르게 함({0} = 영웅 이름) · 문구 = 제안
ff_sortie_bar_skill,스킬 버튼을 누르세요.,,안내 띠: 스킬 버튼 · 문구 = 제안
ff_sortie_bar_attack,모여 있는 적을 향해 끌어당겨 공격하세요.,,안내 띠: 유비 스킬을 건 뒤 · 문구 = 제안
ff_sortie_bar_aim,{0} 쪽으로 끌어당겨 쏘면 회복합니다.,,안내 띠: 가신 스킬을 건 뒤({0} = 유비) · 가신의 스킬 = 다음 사격이 아군에 맞으면 회복 · 문구 = 제안
1 # 첫 실행 흐름 글자 표(PD 2026-11-24 · 기획 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md · 문구 원본 = tables/first_flow_lobby.csv · first_flow_intro.csv + PD 2차 지시)
2 # 대사 한 줄 = 28자 안 · 최대 3줄(말풍선 폭에 맞춰 스스로 줄바꿈) · 문구만 고치면 반영(코드 수정 없음) · 코드 = OutGame/FirstFlow
3 s_key,ko,en,note
4 ff_name_helper,탁현의 여인,,도우미 이름표(가칭 · PD 확인 대기 · first_flow_helper.csv)
5 ff_line_01,대인! 탁현 주점에서 건달들을 물리치시는 모습을 보았어요.,,대사 1 · 여인 · 문구 = 제안(기획 표 줄 1)
6 ff_line_02,백성을 위해 나서 주신 모습에 감동했어요. 작은 힘이라도 보태고 싶어 찾아왔답니다.,,대사 2 · 여인 · 문구 = 제안(기획 표 줄 2)
7 ff_line_03,이곳이 대인의 본영이에요. 싸움을 준비하는 곳이지요.,,대사 3 · 여인 · 문구 = 제안(기획 표 줄 3)
8 ff_line_04,대인의 소문을 듣고 장수들이 모여들고 있어요. 등용에서 맞이해 보세요!,,대사 4 · 여인 · 문구 = 제안(기획 표 줄 4)
9 ff_line_05,첫 분은 대가 없이 맞이하실 수 있답니다.,,대사 5 · 여인 · PD 2026-11-24 2차 「뽑기는 1회만 무료」 · 문구 = 제안
10 ff_line_06,주공! 탁현의 간옹입니다. 주공을 도와 한 황실을 다시 일으키는 데 이 몸을 바치겠습니다.,,대사 6 · 간옹 · 문구 = 제안(기획 표 줄 6)
11 ff_line_07,출정하시기 전에 먼저 편성을 하셔야 해요. 새로 오신 분을 진영에 세워 볼까요?,,대사 7 · 여인 · PD 2026-11-24 2차 「출정하기 전에 편성을 먼저 해야한다는 안내」 · 문구 = 제안
12 ff_line_08,편성은 이쪽이에요.,,대사 8 · 여인 · 문구 = 제안
13 ff_line_09,새로 맞이한 장수를 누르면 빈 자리에 섭니다.,,대사 9 · 여인 · 문구 = 제안
14 ff_line_10,황건적 소탕을 위해 출정하신다고 하셨죠? 제가 가는 길을 안내해드리겠어요.,,대사 10 · 여인 · PD 원문(기획 표 줄 7)
15 ff_line_11,여기서부터가 싸움터로 가는 길이에요. 언젠가 인연이 닿으면 다시 뵐 수 있겠지요.,,대사 11 · 여인 · 문구 = 제안(기획 표 줄 8)
16 ff_line_12,황건적들의 세력이 점점 강해지고 있는 것 같습니다. 저놈들과 맞서려면 군영을 꾸리는 것이 좋겠습니다.,,대사 12 · 가신 · PD 2026-11-24 2차 원문(오탈자 「맞서러면」 → 「맞서려면」)
17 ff_line_13,군영은 이쪽입니다. 함께 둘러보시지요.,,대사 13 · 간옹 · 문구 = 제안(기획 표 줄 10)
18 ff_line_14,이곳이 군영입니다. 싸우며 힘을 기르는 곳들이 모여 있습니다.,,대사 14 · 간옹 · 문구 = 제안(기획 표 줄 11)
19 ff_line_15,연의 전기에서는 지나온 이야기를 다시 보고 새 이야기에 도전하실 수 있습니다.,,대사 15 · 간옹 · 문구 = 제안(기획 표 줄 12)
20 ff_line_16,천하제일 탑은 한 층씩 올라가며 겨루는 곳입니다.,,대사 16 · 간옹 · 문구 = 제안(기획 표 줄 13)
21 ff_line_17,훈련장에서는 전술 훈련과 병법 훈련으로 군을 단련합니다.,,대사 17 · 간옹 · 문구 = 제안(기획 표 줄 14)
22 ff_line_18,투기장에서는 다른 군주의 군과 겨루게 됩니다.,,대사 18 · 간옹 · 문구 = 제안(기획 표 줄 15)
23 ff_line_19,성문 밖에는 이름난 맹장이 나타납니다. 토벌전에서 힘을 겨뤄 보십시오.,,대사 19 · 간옹 · 문구 = 제안(기획 표 줄 16)
24 ff_line_20,마구간과 천하 쟁패는 아직 준비 중입니다. 마음 가는 곳부터 들러 보시지요.,,대사 20 · 간옹 · 문구 = 제안(기획 표 줄 17)
25 ff_intro_1,한나라 말. 조정은 기울고 백성은 굶주렸다.,,인트로 1장 자막
26 ff_intro_dummy_1,그림 1 — 기울어진 궁궐 지붕 · 텅 빈 곳간 · 고개 숙인 백성 서넛(먹색 바탕 + 붉은 노을),,인트로 1장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
27 ff_intro_2,누런 두건의 무리가 들불처럼 일어났다. 황건적의 난.,,인트로 2장 자막
28 ff_intro_dummy_2,그림 2 — 누런 두건을 두른 무리가 횃불을 들고 마을로 밀려옴 · 하늘에 누런 깃발,,인트로 2장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
29 ff_intro_3,184년 탁현. 의용군을 모으는 방 앞에 돗자리 장수 한 사람이 서 있었다.,,인트로 3장 자막
30 ff_intro_dummy_3,그림 3 — 탁현 성문 옆 의용군 모집 방문 앞 구경꾼들 · 돗자리를 멘 청년의 뒷모습 · 오른쪽 위에 주점 간판,,인트로 3장 임시 그림(색 판) 위 글자 · 그림 납품 뒤에는 쓰지 않음
31 ff_intro_skip,건너뛰기 >>,,인트로 건너뛰기 버튼(연의 연출 건너뛰기와 같은 문구)
32 ff_intro_hint,화면을 누르면 다음 장,,인트로 아래 안내 글
33 ff_retry,다시 도전,,첫 실행 흐름의 서장 패배 결과 창 버튼(그 막을 처음부터 다시)
34 ff_sortie_enemy,오~ 손님이 오셨군. 얼마나 가지고 있을지 기대되는데? 크크큭...,,시작 대사(모아 놓은 적 가운데 하나) · PD 원문
35 ff_sortie_victim,너희들의 악행을 끝내주겠다.,,유비 대사 · PD 원문
36 ff_sortie_tip_skill,유비의 「이도류 검법」을 시전하면 이번 턴에 두번 행동할 수 있습니다.,,유비 스킬 안내 카드 · PD 2026-11-24 「동작에 맞게 고침」(원문 「다음 턴에서」 → 스킬 표 설명 「다음 행동이 2번 행동 가능」에 맞춰 「이번 턴에」)
37 ff_sortie_retainer,주공 무리하시면 안됩니다.,,가신 대사(모여 있던 적을 쓰러뜨린 뒤) · PD 원문
38 ff_sortie_tip_heal,간옹의 유세 스킬을 아군에게 사용하면 아군을 회복시킬 수 있습니다.,,가신 스킬 안내 카드 · PD 원문
39 ff_sortie_bar_select,{0}을(를) 눌러 고르세요.,,안내 띠: 영웅을 고르게 함({0} = 영웅 이름) · 문구 = 제안
40 ff_sortie_bar_skill,스킬 버튼을 누르세요.,,안내 띠: 스킬 버튼 · 문구 = 제안
41 ff_sortie_bar_attack,모여 있는 적을 향해 끌어당겨 공격하세요.,,안내 띠: 유비 스킬을 건 뒤 · 문구 = 제안
42 ff_sortie_bar_aim,{0} 쪽으로 끌어당겨 쏘면 회복합니다.,,안내 띠: 가신 스킬을 건 뒤({0} = 유비) · 가신의 스킬 = 다음 사격이 아군에 맞으면 회복 · 문구 = 제안

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 928ae6d01dfddec4f8056cd1be751715
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -65,3 +65,4 @@ scn_cond_finisher,마무리 일격,,임시 이름 · 기획 확인 필요
scn_cond_per_turn_count,턴마다 횟수,,임시 이름 · 기획 확인 필요 scn_cond_per_turn_count,턴마다 횟수,,임시 이름 · 기획 확인 필요
scn_cond_miss_limit,빗맞힘 제한,,임시 이름 · 기획 확인 필요 scn_cond_miss_limit,빗맞힘 제한,,임시 이름 · 기획 확인 필요
scn_cond_hold_in_zone,구역 지키기,,임시 이름 · 기획 확인 필요 scn_cond_hold_in_zone,구역 지키기,,임시 이름 · 기획 확인 필요
scn_reward_hero,{0} {1} 획득,,서장 첫 승리 보상 줄({0} 영웅 이름 · {1} 별 · reward_prologue hero · PD 2026-11-24)

1 # 연의 전기 화면 글자 표(PD 2026-11-18 「연의 전기 통과」 · 연무장 허브 · 투기장과 같은 방식 · 한글 하드코딩 금지) — 화면의 모든 글자 = 이 표의 키 · 바뀌는 값 = {0} {1} 자리 · 편 이름 · 조건 문장 = 기획 표 scenario_battles(게임 데이터)
65 scn_cond_per_turn_count,턴마다 횟수,,임시 이름 · 기획 확인 필요
66 scn_cond_miss_limit,빗맞힘 제한,,임시 이름 · 기획 확인 필요
67 scn_cond_hold_in_zone,구역 지키기,,임시 이름 · 기획 확인 필요
68 scn_reward_hero,{0} {1} 획득,,서장 첫 승리 보상 줄({0} 영웅 이름 · {1} 별 · reward_prologue hero · PD 2026-11-24)

View File

@ -99,6 +99,39 @@ namespace TKS.EditorTools
Debug.Log(msg); Debug.Log(msg);
} }
/// <summary>
/// 명장 등용 표(gacha · gacha_pool · gacha_banners)만 임포트(2026-11-24 · 첫 실행 흐름 first_ten_hero) — 전체 해석·검증 뒤 GachaConfig 하나만 쓴다(오류 시 불변 ·
/// 전체 임포트가 CostumeDb 의 알파 경계를 비우는 일을 피함). CLI: -executeMethod TKS.EditorTools.DataImporter.ImportGacha
/// </summary>
[MenuItem("TKS/Import Gacha (명장 등용 표 임포트)")]
public static void ImportGacha()
{
var r = OutGameTables.Parse(ReadFiles());
if (r.errors.Count > 0)
{
foreach (var e in r.errors) Debug.LogError("[TKS] 아웃게임 표 오류 · " + e);
Debug.LogError("[TKS] 명장 등용 임포트 중단(오류 " + r.errors.Count + ") · 자산 변경 없음");
OutGameTables.Destroy(r);
return;
}
var so = r.data.Gacha;
string msg = "[TKS] 명장 등용 임포트 완료 · 값 " + so.values.entries.Count + " · 풀 " + so.pool.Count + " · 배너 " + so.banners.Count + " · 첫 등용 확정 영웅 「" + so.FirstPullHero + "」";
var path = AssetFolder + "/GachaConfig.asset";
var existing = AssetDatabase.LoadAssetAtPath<GachaConfig>(path);
so.name = "GachaConfig";
if (existing == null) AssetDatabase.CreateAsset(so, path);
else
{
EditorUtility.CopySerialized(so, existing);
existing.name = "GachaConfig";
EditorUtility.SetDirty(existing);
}
AssetDatabase.SaveAssets();
foreach (var x in r.data.All)
if (x != null && !AssetDatabase.Contains(x)) Object.DestroyImmediate(x);
Debug.Log(msg);
}
/// <summary> /// <summary>
/// 장비 등급 7 · 병종 장비 · 장별 드랍 표만 임포트(2026-11-20) — 전체 해석·검증 뒤 GearDb · HeroDb(hero_gear) · PromotionTable · AwakenDb(awaken_slots) 넷만 쓴다(오류 시 불변 · /// 장비 등급 7 · 병종 장비 · 장별 드랍 표만 임포트(2026-11-20) — 전체 해석·검증 뒤 GearDb · HeroDb(hero_gear) · PromotionTable · AwakenDb(awaken_slots) 넷만 쓴다(오류 시 불변 ·
/// 다른 작업의 표 변경이 다른 자산에 섞이지 않게). CLI: -executeMethod TKS.EditorTools.DataImporter.ImportGear /// 다른 작업의 표 변경이 다른 자산에 섞이지 않게). CLI: -executeMethod TKS.EditorTools.DataImporter.ImportGear

View File

@ -92,9 +92,75 @@ namespace TKS.EditorTools
Debug.Log("[TKS 테스트] 꾸미기 지급 " + n + "개 · 보유 " + root.Session.Save.costumes.Count); Debug.Log("[TKS 테스트] 꾸미기 지급 " + n + "개 · 보유 " + root.Session.Save.costumes.Count);
} }
// 첫 실행 흐름(2026-11-24) — 내 세이브를 지우지 않고 새 유저의 흐름(인트로 → 서장 1 ~ 3막 → 본영 · 등용 · 출정 1-1 · 군영 소개)을 본다
// 「처음부터 보기」 하나만 누르면 된다(시험 세이브를 켜고 + 새로 만듦) — 2026-11-24 PD 「시험 세이브 지우기 해도 처음부터 시작되지 않아」
// (그 전 = 켜기 · 지우기가 따로였고 「모두 끄기」가 켜 둔 것을 꺼서 내 세이브로 실행됨)
const string FirstFlowFreshItem = Root + "첫 실행 흐름 — 처음부터 보기 (시험 세이브 새로 · 내 세이브는 그대로)";
const string FirstFlowItem = Root + "첫 실행 흐름 — 시험 세이브 쓰는 중 (체크를 끄면 내 세이브)";
const string FirstFlowDeleteKey = "TKS_FF_DELETE_PENDING";
static string FirstFlowSavePath
{
get { return Path.Combine(Application.persistentDataPath, OutGame.SaveStore.FirstFlowTestFile); }
}
/// <summary>시험 세이브를 켜고 새로 만든다 → 다음 Play = 인트로부터. Play 중이면 Play 를 끈 뒤에 지운다(돌던 세션이 세이브를 다시 쓰지 않게). CLI: -executeMethod TKS.EditorTools.TestMenu.FirstFlowFresh</summary>
[MenuItem(FirstFlowFreshItem, false, 55)]
public static void FirstFlowFresh()
{
TestOptions.FirstFlowSave = true;
if (EditorApplication.isPlayingOrWillChangePlaymode)
{
SessionState.SetBool(FirstFlowDeleteKey, true);
EditorApplication.isPlaying = false;
Notify("첫 실행 흐름: Play 를 끄고 시험 세이브를 새로 만듭니다 — 다시 Play 하면 인트로부터");
return;
}
if (File.Exists(FirstFlowSavePath)) File.Delete(FirstFlowSavePath);
Notify("첫 실행 흐름: 시험 세이브를 새로 만들었습니다 — Play 하면 인트로부터 (내 세이브는 그대로)");
}
/// <summary>시험 세이브를 쓰는가(체크) — 끄면 내 세이브 · 다시 켜면 시험 세이브의 이어 하던 곳부터.</summary>
[MenuItem(FirstFlowItem, false, 56)]
public static void FirstFlowSave()
{
TestOptions.FirstFlowSave = !TestOptions.FirstFlowSave;
Notify(TestOptions.FirstFlowSave ? "첫 실행 흐름: 시험 세이브를 씁니다(이어 하던 곳부터 · 다음 Play 부터)" : "첫 실행 흐름: 내 세이브로 돌아갑니다(다음 Play 부터)");
}
[MenuItem(FirstFlowItem, true)]
static bool FirstFlowSaveCheck() { Menu.SetChecked(FirstFlowItem, TestOptions.FirstFlowSave); return true; }
[InitializeOnLoadMethod]
static void FirstFlowHook()
{
EditorApplication.playModeStateChanged += s =>
{
if (s == PlayModeStateChange.EnteredEditMode && SessionState.GetBool(FirstFlowDeleteKey, false))
{
SessionState.EraseBool(FirstFlowDeleteKey);
if (File.Exists(FirstFlowSavePath)) File.Delete(FirstFlowSavePath);
Notify("첫 실행 흐름: 시험 세이브를 새로 만들었습니다 — Play 하면 인트로부터 (내 세이브는 그대로)");
}
// Play 를 켤 때마다 어느 세이브로 도는지 알림(시험 세이브를 켜 둔 채 내 세이브인 줄 아는 일이 없게)
if (s == PlayModeStateChange.EnteredPlayMode && TestOptions.FirstFlowSave)
Notify("시험 세이브로 Play 중(첫 실행 흐름) — 내 세이브는 쓰지 않음 · 끄기 = TKS/테스트/첫 실행 흐름 — 시험 세이브 쓰는 중");
};
}
/// <summary>콘솔 + 에디터 창 위 알림(막지 않는 알림 · 대화 상자 아님).</summary>
static void Notify(string msg)
{
Debug.Log("[TKS 테스트] " + msg);
foreach (var w in Resources.FindObjectsOfTypeAll<EditorWindow>())
if (w != null && (w.GetType().Name == "GameView" || w is SceneView)) w.ShowNotification(new GUIContent(msg), 4.0);
}
[MenuItem(Root + "모두 끄기", false, 60)] [MenuItem(Root + "모두 끄기", false, 60)]
static void AllOff() static void AllOff()
{ {
if (TestOptions.FirstFlowSave) Notify("첫 실행 흐름: 시험 세이브도 끔 — 내 세이브로 돌아갑니다(다시 보려면 「처음부터 보기」)");
TestOptions.FirstFlowSave = false;
TestOptions.UnlockAllStages = false; TestOptions.UnlockAllStages = false;
TestOptions.StandardSpec = false; TestOptions.StandardSpec = false;
TestOptions.LineupIds = ""; TestOptions.LineupIds = "";

View File

@ -230,6 +230,15 @@ namespace TKS.OutGame
} }
} }
/// <summary>그 장소가 화면 가운데에 오게 화면을 옮긴다(sec 초 · 0 = 바로) · 장소가 없으면 false — 장소 소개의 포커스(PD 2026-11-24).</summary>
public bool Focus(string spotId, float sec)
{
var s = SpotOf(spotId);
if (s == null || Fitter == null) return false;
Fitter.FocusOn(s.press, sec);
return true;
}
public Spot SpotOf(string id) public Spot SpotOf(string id)
{ {
foreach (var s in Spots) foreach (var s in Spots)
@ -282,8 +291,8 @@ namespace TKS.OutGame
Scroll = View.gameObject.AddComponent<ScrollRect>(); Scroll = View.gameObject.AddComponent<ScrollRect>();
Scroll.viewport = View; Scroll.viewport = View;
Scroll.content = Content; Scroll.content = Content;
Scroll.horizontal = true; Scroll.horizontal = true; // 끌 수 있는 방향(가로 · 세로)은 화면 맞춤(ArenaHubView.Fit)이 그림과 화면 크기로 정한다
Scroll.vertical = false; Scroll.vertical = true;
Scroll.movementType = ScrollRect.MovementType.Clamped; Scroll.movementType = ScrollRect.MovementType.Clamped;
Scroll.scrollSensitivity = 60f; // UiKit.ScrollGrid 와 같음 Scroll.scrollSensitivity = 60f; // UiKit.ScrollGrid 와 같음

View File

@ -46,8 +46,61 @@ namespace TKS.OutGame
float oy = (box.center.y - canvasSize.y * 0.5f) * z; float oy = (box.center.y - canvasSize.y * 0.5f) * z;
float mx = Mathf.Max(0f, (canvasSize.x * z - r.width) * 0.5f); float mx = Mathf.Max(0f, (canvasSize.x * z - r.width) * 0.5f);
float my = Mathf.Max(0f, (canvasSize.y * z - r.height) * 0.5f); float my = Mathf.Max(0f, (canvasSize.y * z - r.height) * 0.5f);
if (scroll != null) scroll.StopMovement(); if (scroll != null)
{
scroll.StopMovement();
// 끌어서 볼 수 있는 방향 = 그림이 화면보다 큰 쪽만(가로 · 세로 따로) — 화면에 다 보이는 쪽은 움직이지 않는다
// (PD 2026-11-24 「상/하/좌/우 화면의 여백까지 스크롤 · 화면 전체가 보일 경우는 스크롤이 필요 없지만 스크롤 가능할 경우 스크롤」 · 그 전 = 가로만)
scroll.horizontal = mx > 0.5f;
scroll.vertical = my > 0.5f;
}
focusing = false;
content.anchoredPosition = new Vector2(Mathf.Clamp(ox, -mx, mx), Mathf.Clamp(oy, -my, my)); content.anchoredPosition = new Vector2(Mathf.Clamp(ox, -mx, mx), Mathf.Clamp(oy, -my, my));
} }
bool focusing;
Vector2 focusFrom, focusTo;
float focusT, focusSec;
/// <summary>그림 좌표(캔버스 px · 왼쪽 위 기준)의 한 점이 화면 가운데에 오게 한 자리(그림이 화면 밖으로 비지 않게 자름).</summary>
public Vector2 PositionFor(Vector2 canvasPoint)
{
var r = ((RectTransform)transform).rect;
float z = Zoom;
float mx = Mathf.Max(0f, (canvasSize.x * z - r.width) * 0.5f);
float my = Mathf.Max(0f, (canvasSize.y * z - r.height) * 0.5f);
float ox = (canvasSize.x * 0.5f - canvasPoint.x) * z;
float oy = (canvasPoint.y - canvasSize.y * 0.5f) * z;
return new Vector2(Mathf.Clamp(ox, -mx, mx), Mathf.Clamp(oy, -my, my));
}
/// <summary>그 점으로 화면을 옮긴다(sec 초 동안 부드럽게 · 0 = 바로) — 장소 소개(첫 실행 흐름의 군영 안내)의 포커스.</summary>
public void FocusOn(Vector2 canvasPoint, float sec)
{
if (content == null || Zoom <= 0f) return;
if (scroll != null) scroll.StopMovement();
focusFrom = content.anchoredPosition;
focusTo = PositionFor(canvasPoint);
focusT = 0f;
focusSec = sec;
focusing = sec > 0f && (focusTo - focusFrom).sqrMagnitude > 0.25f;
if (!focusing) content.anchoredPosition = focusTo;
}
/// <summary>포커스 이동이 끝났는가(테스트 · 안내가 자리 잡기를 기다림).</summary>
public bool Focusing
{
get { return focusing; }
}
void Update()
{
if (!focusing) return;
focusT += Time.unscaledDeltaTime;
float k = Mathf.Clamp01(focusT / focusSec);
k = k * k * (3f - 2f * k);
content.anchoredPosition = Vector2.Lerp(focusFrom, focusTo, k);
if (focusT >= focusSec) focusing = false;
}
} }
} }

View File

@ -120,6 +120,15 @@ namespace TKS.OutGame
/// — 2026-11-18 PD 「연의 전기 스테이지와 일반 출정 스테이지는 별개 · 완전히 별개의 스테이지 개념으로」(그 전 = 출정 월드맵 1-1 ~ 1-3 으로 들어감). false = 서장 아님. /// — 2026-11-18 PD 「연의 전기 스테이지와 일반 출정 스테이지는 별개 · 완전히 별개의 스테이지 개념으로」(그 전 = 출정 월드맵 1-1 ~ 1-3 으로 들어감). false = 서장 아님.
/// </summary> /// </summary>
internal bool PrologueGo(string id, int act = 0) internal bool PrologueGo(string id, int act = 0)
{
return PrologueGo(id, act, null);
}
/// <summary>
/// flow = 첫 실행 흐름이 여는 서장(연의 전기 화면을 거치지 않음 · PD 2026-11-24) — 막 승리 = 결과 화면 없이 flow 가 다음 막(마지막 막 = 본영)으로 · 패배 = 그 막을 처음부터 다시.
/// null = 연의 전기 화면의 막 버튼 · 출전 버튼(막 승리 = 결과 화면 → 연의 전기 화면 · 지금 그대로).
/// </summary>
internal bool PrologueGo(string id, int act, FirstFlow flow)
{ {
ScenarioData.Reload(); // 막을 시작할 때마다 연출 · 안내 · 배치 표를 다시 읽음(Play 중 표 수정 = 다음 막 시작부터 · 2026-11-19 PD 「수정 요청한 항목만 바로바로 반영하고 확인」) ScenarioData.Reload(); // 막을 시작할 때마다 연출 · 안내 · 배치 표를 다시 읽음(Play 중 표 수정 = 다음 막 시작부터 · 2026-11-19 PD 「수정 요청한 항목만 바로바로 반영하고 확인」)
ContentTables.Reload(); ContentTables.Reload();
@ -147,6 +156,12 @@ namespace TKS.OutGame
Root.Toast(w); Root.Toast(w);
return true; return true;
} }
if (flow != null)
{
rules.WinContinue = () => flow.OnActWin(rules);
Root.StartMode(ScenarioModeRules.Kind, id, 0, stage, 0, ScenarioPage, rules, () => flow.OnActExit(rules));
return true;
}
Root.StartMode(ScenarioModeRules.Kind, id, 0, stage, 0, ScenarioPage, rules); Root.StartMode(ScenarioModeRules.Kind, id, 0, stage, 0, ScenarioPage, rules);
return true; return true;
} }

View File

@ -70,6 +70,11 @@ namespace TKS.OutGame
public bool FreeFirstTen { get { return values.I("free_first_ten") > 0; } } public bool FreeFirstTen { get { return values.I("free_first_ten") > 0; } }
public int TenCount { get { return values.I("ten_count"); } } public int TenCount { get { return values.I("ten_count"); } }
public int TenGuaranteeRarity { get { return values.I("ten_guarantee_rarity"); } } public int TenGuaranteeRarity { get { return values.I("ten_guarantee_rarity"); } }
/// <summary>
/// 첫 실행 흐름의 첫 등용에서 첫 장으로 확정되는 영웅 id(gacha.csv first_pull_hero · 줄이 없거나 비어 있으면 확정 없음 = 모두 확률)
/// — PD 2026-11-24 「등용 진행 시 … 책사(가신) 중 한명을 반드시 획득」 → 「튜토리얼 종료 후 뽑기는 1회만 무료 · 1회 뽑기로 얻은 간옹을 데리고 출전」.
/// </summary>
public string FirstPullHero { get { return values.Has("first_pull_hero") ? values.S("first_pull_hero").Trim() : ""; } }
/// <summary>희귀도 등급(1~3) 확률 p_r1~p_r3.</summary> /// <summary>희귀도 등급(1~3) 확률 p_r1~p_r3.</summary>
public float P(int rarity) public float P(int rarity)

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 14873e1a3c2e8b6498ea4d05f3dc42ff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,647 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TKS.OutGame
{
/// <summary>
/// 첫 실행 흐름 지휘(PD 2026-11-24 「최초 게임 실행 시 게임 Flow」 · 요청서 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md) —
/// 타이틀 → 인트로(IntroScreen) → 서장 1 → 2 → 3막(연의 전기 화면 · 결과 화면 없이 검정 페이드로 이어짐) → 본영 로비 → 대사 줄(first_flow_lines):
/// 여인의 인사 → 「등용」 → 「10회 등용」(첫 무료 · 마지막 장 = 가신) → 가신의 한마디 → 「출정」 → (출정 1-1 첫 승리) → 가신의 진언 → 「군영」 → 군영 장소 소개 → 끝.
/// 들어가는 조건 = 기기 세이브 모드 · 서장 마지막 막을 이긴 기록이 없음 · 흐름을 끝낸 기록이 없음(세이브 firstFlow) — 서장을 이미 끝낸 세이브 = 지금처럼 로비.
/// 메모리 세이브(자동 테스트 · 검증 캡처) = 건너뜀(ForceOn 으로 켬). 진행 = 세이브 firstFlow.line(끝낸 마지막 줄) — 도중에 꺼도 다음 줄부터, 그 줄의 화면에 들어왔을 때 이어진다.
/// 값 · 문구 · 대상 · 영웅 · 배너 · 스테이지 = 표(FirstFlowData · C45). 1 ~ 3막의 연출 · 안내 · 배치 표와 연의 전기 화면의 서장 다시 보기는 건드리지 않는다.
/// </summary>
public class FirstFlow : MonoBehaviour
{
/// <summary>테스트: 메모리 세이브에서도 흐름을 켠다(기본 = 메모리 세이브는 건너뜀 · 기존 테스트 「Battle 씬 2 프레임 안 로비」).</summary>
public static bool ForceOn;
OutGameRoot root;
ScreenFader fader;
bool talking;
bool switching;
bool lastWin;
float eligibleSince = -1f;
int eligibleStep;
Coroutine chain;
Coroutine afterAct;
public FirstFlowGuide Guide { get; private set; }
/// <summary>출정 첫 스테이지의 스킬 튜토리얼(FirstFlowSortie).</summary>
public FirstFlowSortie Sortie { get; private set; }
/// <summary>지금 화면에 떠 있는 대사 줄(없으면 null · 테스트).</summary>
public FirstFlowData.Line Current { get; private set; }
public static FirstFlow Create(OutGameRoot root)
{
var go = new GameObject("FirstFlow");
go.transform.SetParent(root.transform, false);
var f = go.AddComponent<FirstFlow>();
f.root = root;
f.Sortie = FirstFlowSortie.Create(root, f);
return f;
}
OutGameSession S
{
get { return root.Session; }
}
FirstFlowState State
{
get { return S.Save.firstFlow; }
}
/// <summary>이 세션에서 첫 실행 흐름을 쓰는가 — 표 있음 · 기기 세이브 모드 · 메모리 세이브가 아님(ForceOn 이면 켬).</summary>
public bool Available
{
get { return root != null && S != null && S.FirstFlowAvailable && (ForceOn || !SaveStore.MemoryOnly) && FirstFlowData.Ready; }
}
/// <summary>흐름에 들어와 있고 아직 끝나지 않았는가.</summary>
public bool Active
{
get { return Available && State.started && !State.done; }
}
/// <summary>대사 · 막 전환 · 인트로 중(뒤로 가기를 받지 않음).</summary>
public bool Busy
{
get { return talking || switching || IntroScreen.Current != null; }
}
public bool Switching
{
get { return switching; }
}
string PrologueId
{
get { return FirstFlowData.Str("prologue_battle"); }
}
int PrologueActs
{
get
{
var b = ContentTables.Find("scenario_battles", "s_id", PrologueId);
return b != null && b.I("n_no") == 0 ? Mathf.Max(1, b.I("n_acts")) : 0;
}
}
bool PrologueDone
{
get
{
int acts = PrologueActs;
return acts <= 0 || ScenarioModeRules.ActsCleared(S.Save, PrologueId) >= acts;
}
}
// ---------- 시작(타이틀 누름 뒤 · Battle 씬) ----------
/// <summary>
/// 게임 시작 — 첫 실행(서장을 끝내지 않은 새 세이브)이면 인트로(아직 안 봤으면) → 아직 이기지 못한 첫 막을 열고 true(호출 쪽은 로비를 띄우지 않는다).
/// false = 지금처럼 본영 로비(서장을 끝낸 세이브 · 메모리 세이브 · 서버 모드 · 표 없음) — 서장 뒤 대사가 남아 있으면 로비에서 이어진다.
/// </summary>
public bool BootBegin()
{
if (!Available) return false;
var st = State;
if (st.done) return false;
bool prologueDone = PrologueDone;
if (!st.started)
{
if (prologueDone) return false; // 서장을 이미 끝낸 예전 세이브 = 흐름에 들어가지 않음
st.started = true;
if (S.IsNewUser) ResetRoster(); // 새 유저 = 표 start_heroes 만 보유(비어 있음 = 없음) → 서장 보상으로 유비 · 등용으로 가신
S.Commit();
}
if (prologueDone) return false; // 서장 뒤에 끈 세이브 = 로비에서 대사를 이어 감
int act = ScenarioModeRules.NextAct(S.Save, PrologueId, PrologueActs);
if (!st.intro && IntroScreen.CanShow)
{
root.SetBattleHud(false); // 인트로 밑에서 전투 HUD · 조작이 돌지 않게(1막을 열 때 다시 켜짐)
IntroScreen.Show(root.Cam, () =>
{
State.intro = true;
S.Commit();
if (!StartAct(act)) root.ShowLobby();
});
return true;
}
return StartAct(act);
}
/// <summary>
/// 새 유저의 보유 영웅을 표(first_flow_config start_heroes · | 로 여럿 · 비어 있음 = 없음)대로 맞춘다 — PD 2026-11-24
/// 「최초 게임 실행 시 보유한 유닛은 유비(연의 전기로 획득), 그리고 [등용] 보상으로 얻은 유닛들로만」(기본 지급 = economy.csv start_heroes 를 이 흐름에서만 뺀다).
/// </summary>
void ResetRoster()
{
var keep = new HashSet<string>();
foreach (var id in FirstFlowData.List("start_heroes"))
if (id.Trim().Length > 0) keep.Add(id.Trim());
var d = S.Save;
d.heroes.RemoveAll(h => !keep.Contains(h.id));
d.units.RemoveAll(u => !keep.Contains(u.id));
HeroRules.Sanitize(S.Db, d, S.FormationSlots); // 편성 칸에서 없는 영웅을 비움
}
/// <summary>출전 편성이 비어 있으면 보유 영웅을 앞 칸부터 세운다(서장 보상으로 유비를 얻은 직후 = 로비에 유비만).</summary>
void FillEmptyLineup()
{
var d = S.Save;
var p = d.ActivePreset;
if (p == null) return;
foreach (var id in p.slots)
if (!string.IsNullOrEmpty(id)) return;
int at = 0;
foreach (var h in d.heroes)
{
if (at >= p.slots.Count) break;
p.slots[at++] = h.id;
}
if (at > 0) S.Commit();
}
/// <summary>서장 막을 연의 전기 화면 없이 연다 · false = 못 엶(표 없음 · 군량 부족 …).</summary>
bool StartAct(int act)
{
if (!root.Arena.PrologueGo(PrologueId, act, this)) return false;
return FlowRules(root.Battle) != null;
}
/// <summary>지금 전투가 첫 실행 흐름이 연 서장 막인가(그 규칙 · 아니면 null).</summary>
static PrologueRules FlowRules(BattleManager b)
{
var r = b != null && b.Mode != null ? b.Mode.rules as PrologueRules : null;
return r != null && r.WinContinue != null ? r : null;
}
// ---------- 서장 막 잇기 ----------
/// <summary>막 승리 연출이 끝남(결과 화면 대신) — 막 기록 · 보상은 지금 규칙대로 처리하고 검정 페이드 → 다음 막(마지막 막 = 본영 로비).</summary>
internal bool OnActWin(PrologueRules r)
{
if (!Available) return false;
if (r.LastAct) return false; // 마지막 막 = 결과 화면으로 서장 보상(유비 획득)을 알림(PD 2026-11-24) → 닫으면 본영(OnActExit)
root.SettleMode(true);
if (afterAct != null) StopCoroutine(afterAct); // 앞 막 전환의 페이드가 아직 걷히는 중 = 그 페이드를 이어 받음
afterAct = StartCoroutine(AfterAct(r));
return true;
}
IEnumerator AfterAct(PrologueRules r)
{
switching = true;
root.SetBattleHud(false);
var f = Fader();
if (ScenarioEvent.EndedBlack) f.Alpha = 1f; // 승리 연출이 검게 끝남(3막) = 그대로 이어 받음
else yield return f.FadeTo(1f, ScenarioData.EvCfg("fade_sec"));
bool next = !r.LastAct && StartAct(r.Act + 1);
if (!next)
{
root.Battle.LeaveMode();
root.ShowLobby();
}
var io = FirstFlowData.List(next ? "act_in" : "lobby_in"); // 검정 유지 | 밝아지는 시간
yield return Hold(ScreenTable.At(io, 0, 0.15f));
yield return f.FadeTo(0f, ScreenTable.At(io, 1, 0.3f));
DropFader();
switching = false;
afterAct = null;
}
/// <summary>결과 창을 닫은 뒤 — 패배 · 포기 = 그 막을 처음부터 다시(연의 전기 화면으로 나가지 않음) · 마지막 막 승리 = 본영 로비(출전 편성 = 얻은 유비).</summary>
internal void OnActExit(PrologueRules r)
{
if (!lastWin && StartAct(r.Act)) return;
FillEmptyLineup();
root.ShowLobby();
}
/// <summary>컨텐츠 모드 결과가 채워진 직후 — 첫 실행 흐름의 서장 패배 = 버튼 글자 「다시 도전」.</summary>
internal void OnModeResult(BattleResultPanel panel, bool win)
{
lastWin = win;
if (!win && panel != null && FlowRules(root.Battle) != null) panel.SetOkText(FirstFlowData.T("ff_retry"));
}
ScreenFader Fader()
{
if (fader != null) return fader;
var fd = FirstFlowData.List("fade"); // 정렬 순서 | 색
fader = ScreenFader.Create(root.Cam, (int)ScreenTable.At(fd, 0, 940f), ScreenTable.Col(fd, 1, Color.black));
return fader;
}
void DropFader()
{
if (fader != null) Destroy(fader.gameObject);
fader = null;
}
static IEnumerator Hold(float sec)
{
for (float t = 0f; t < sec; t += Time.unscaledDeltaTime) yield return null;
}
void OnDestroy()
{
DropFader();
}
// ---------- 대사 줄 ----------
void Update()
{
if (talking || switching || root == null || root.Session == null) return;
if (!Active)
{
eligibleSince = -1f;
return;
}
var show = Eligible();
if (show == null)
{
eligibleSince = -1f;
return;
}
// 그 화면에 들어온 뒤 잠깐 뜸을 들이고 시작(본영 로비가 밝아지고 0.5초 뒤 · 표 start_delay_sec)
if (eligibleSince < 0f || eligibleStep != show.step)
{
eligibleSince = Time.unscaledTime;
eligibleStep = show.step;
}
if (Time.unscaledTime - eligibleSince < FirstFlowData.Num("start_delay_sec", 0.5f)) return;
eligibleSince = -1f;
chain = StartCoroutine(Run(show));
}
/// <summary>지금 화면에서 시작할 줄 — 다음 줄(건너뛰기 처리 뒤)이 이 화면의 줄이면 그 줄 · 아니고 본영 로비에 있으면 그 화면으로 이끄는 줄(n_gate) · 없으면 null.</summary>
FirstFlowData.Line Eligible()
{
if (Blocked()) return null;
var next = Next();
if (next == null) return null;
if (!WaitOk(next)) return null;
if (ScreenOk(next)) return next;
if (next.gate > 0 && OnScreen(FirstFlowData.ScreenLobby))
{
var g = FirstFlowData.LineOf(next.gate);
if (g != null && Targets(g) != null) return g;
}
return null;
}
/// <summary>다른 창 · 화면 전환이 떠 있어 대사를 시작하지 않는 때.</summary>
bool Blocked()
{
return root.ModalVisible || root.ResultVisible || SceneSwitch.Current != null || BootFlow.Current != null || TitleScreen.Current != null || IntroScreen.Current != null || LoadingScreen.Current != null;
}
/// <summary>끝낸 줄의 다음 줄 — 건너뛰는 조건(s_skip_if)이 참이면 n_skip_to 로 기록을 옮긴다 · 다음 줄이 없으면 흐름 끝.</summary>
FirstFlowData.Line Next()
{
for (int guard = 0; guard < 64; guard++)
{
var l = FirstFlowData.LineOf(State.line + 1);
if (l == null)
{
Finish();
return null;
}
if (l.skipIf.Length == 0 || !SkipCond(l.skipIf)) return l;
State.line = Mathf.Max(State.line + 1, l.skipTo - 1);
S.Commit();
}
return null;
}
bool SkipCond(string cond)
{
if (cond == FirstFlowData.SkipFirstPullDone) return S.Save.gacha.total > 0;
if (cond == FirstFlowData.SkipRetainerPlaced)
{
var p = S.Save.ActivePreset;
return p != null && RetainerId.Length > 0 && p.slots.Contains(RetainerId);
}
return false;
}
/// <summary>가신 = gacha.csv first_pull_hero 의 영웅 id(첫 등용의 첫 장).</summary>
public string RetainerId
{
get { return S.Db.Gacha.FirstPullHero; }
}
/// <summary>서장 보상으로 얻는 영웅(scenario_battles 서장 편의 s_reward_hero = 유비) — 출정 첫 스테이지 스킬 튜토리얼의 주인공.</summary>
public string VictimId
{
get
{
var b = ContentTables.Find("scenario_battles", "s_id", PrologueId);
return b != null ? b.S("s_reward_hero") : "";
}
}
bool WaitOk(FirstFlowData.Line l)
{
if (l.wait.Length == 0) return true;
int ch, st;
string key = FirstFlowData.Arg(l.wait, FirstFlowData.WaitStageClear);
if (key == null || !FirstFlowData.ParseStage(key, out ch, out st)) return true;
var rec = S.Save.Stage(ch, st, false);
return rec != null && rec.clears > 0;
}
bool ScreenOk(FirstFlowData.Line l)
{
foreach (var sc in l.screens)
if (OnScreen(sc) && (!l.HasTarget || l.targetScreen == sc))
return true;
return false;
}
bool OnScreen(string sc)
{
switch (sc)
{
case FirstFlowData.ScreenLobby: return root.LobbyVisible;
case FirstFlowData.ScreenRecruit: return root.ScreensVisible && root.Current == root.Trade && root.Trade.Page == 0 && !root.Trade.ResultVisible;
case FirstFlowData.ScreenMap: return root.Map != null && root.Map.IsVisible && !root.Map.PopupVisible && root.Battle.Phase == BattlePhase.Setup;
case FirstFlowData.ScreenCamp: return root.ScreensVisible && root.Current == root.Arena && root.Arena.HubVisible;
case FirstFlowData.ScreenFormation: return root.ScreensVisible && root.Current == root.Formation;
}
return false;
}
RectTransform ScreenRoot(string sc)
{
switch (sc)
{
case FirstFlowData.ScreenLobby: return root.Lobby.Rt;
case FirstFlowData.ScreenRecruit: return root.Trade.Rt;
case FirstFlowData.ScreenCamp: return root.Arena.Rt;
case FirstFlowData.ScreenFormation: return root.Formation.Rt;
}
return null;
}
/// <summary>줄의 대상 오브젝트들(화면 안에서 이름으로 찾음 · 켜져 있는 것만) — 하나라도 못 찾으면 null.</summary>
List<RectTransform> Targets(FirstFlowData.Line l)
{
if (!l.HasTarget) return null;
var sr = ScreenRoot(l.targetScreen);
if (sr == null) return null;
var list = new List<RectTransform>();
var all = sr.GetComponentsInChildren<RectTransform>(false);
foreach (var raw in l.targetNames)
{
string name = raw.Replace(FirstFlowData.RetainerToken, RetainerId); // 예 C_{retainer} = 편성 화면의 가신 카드
RectTransform hit = null;
foreach (var rt in all)
if (rt.name == name)
{
hit = rt;
break;
}
if (hit == null) return null;
list.Add(hit);
}
return list;
}
/// <summary>누르게 하는 줄의 대상이 눌렸는가를 받는 것 — 버튼(onClick) 또는 TapDrag(편성 화면의 영웅 카드 · OnTap).</summary>
class PressHook
{
Button btn;
TapDrag tap;
System.Action prevTap;
UnityEngine.Events.UnityAction onClick;
public static PressHook Of(List<RectTransform> targets)
{
if (targets == null) return null;
foreach (var t in targets)
{
var b = t.GetComponent<Button>() ?? t.GetComponentInChildren<Button>(false);
if (b != null) return new PressHook { btn = b };
var d = t.GetComponent<TapDrag>() ?? t.GetComponentInChildren<TapDrag>(false);
if (d != null) return new PressHook { tap = d };
}
return null;
}
/// <summary>대상이 아직 화면에 있는가.</summary>
public bool Alive
{
get { return btn != null ? btn.gameObject.activeInHierarchy : tap != null && tap.gameObject.activeInHierarchy; }
}
/// <summary>대상의 원래 동작이 끝난 바로 뒤에 onPress 를 부르게 건다.</summary>
public void Attach(System.Action onPress)
{
if (btn != null)
{
onClick = () => onPress();
btn.onClick.AddListener(onClick);
}
else if (tap != null)
{
prevTap = tap.OnTap;
tap.OnTap = () =>
{
if (prevTap != null) prevTap();
onPress();
};
}
}
public void Detach()
{
if (btn != null && onClick != null) btn.onClick.RemoveListener(onClick);
if (tap != null) tap.OnTap = prevTap;
onClick = null;
}
/// <summary>대상을 누른다(테스트).</summary>
public void Invoke()
{
if (btn != null) btn.onClick.Invoke();
else if (tap != null && tap.OnTap != null) tap.OnTap();
}
}
IEnumerator Run(FirstFlowData.Line first)
{
talking = true;
var line = first;
while (line != null)
{
OnShow(line);
yield return null; // 배너 고름 · 화면 전환 뒤 한 프레임(자리 잡기)
while (root.Arena != null && root.Arena.Hub != null && root.Arena.Hub.Fitter != null && root.Arena.Hub.Fitter.Focusing && root.Arena.HubVisible) yield return null; // 군영 포커스 이동이 끝난 뒤 가리킴
var targets = Targets(line);
var btn = line.mode == FirstFlowData.Press ? PressHook.Of(targets) : null;
string mode = line.mode;
if (mode == FirstFlowData.Press && btn == null)
{
Debug.LogWarning("[TKS] 첫 실행 흐름: 줄 " + line.step + " 누를 대상을 찾지 못함 → 말하기로 보여 줌");
mode = FirstFlowData.Talk;
}
if (mode == FirstFlowData.Point && targets == null) mode = FirstFlowData.Talk;
EnsureGuide().Show(Request(line, mode, targets));
Current = line;
bool pressed = false;
if (btn != null)
{
var at = line;
btn.Attach(() =>
{
pressed = true;
After(at); // 눌린 그 자리에서(같은 누름으로 뽑기 · 화면 전환이 저장되는 것과 같이)
Mark(at.step);
});
}
bool aborted = false;
while (true)
{
if (btn != null ? pressed : Guide.Taps > 0) break;
if (!StillOn(line, btn))
{
aborted = true;
break;
}
yield return null;
}
if (btn != null) btn.Detach();
Guide.Taps = 0;
if (aborted) break;
Sound.PlayUi(SoundKeys.UiTab);
if (btn == null) After(line);
Mark(line.step);
if (line.done == FirstFlowData.DoneEnd)
{
Finish();
break;
}
if (line.done == FirstFlowData.DoneLobby) root.ShowLobby(); // 대사가 끝나면 스스로 본영 로비로(뒤로 가기를 시키지 않음)
var next = Next();
if (next == null || Blocked() || !WaitOk(next) || !ScreenOk(next)) break; // 다음 줄은 그 화면에 들어왔을 때(Update)
line = next;
}
Current = null;
if (Guide != null) Guide.Hide();
talking = false;
chain = null;
}
/// <summary>줄이 뜨는 동안 그 화면이 그대로인가(화면이 바뀌면 줄을 거두고 다시 판단) — 누르기 줄은 버튼이 살아 있는가도.</summary>
bool StillOn(FirstFlowData.Line l, PressHook btn)
{
if (btn != null && !btn.Alive) return false;
if (!Active) return false;
foreach (var sc in l.screens)
if (OnScreen(sc))
return true;
return false;
}
/// <summary>줄이 끝난 뒤 할 일(s_on_done) — save_formation = 편성 화면의 지금 편성을 저장(가신을 세운 편성이 출전 편성이 됨).</summary>
void After(FirstFlowData.Line l)
{
if (l.onDone == FirstFlowData.AfterSaveFormation && root.Formation != null && root.Current == root.Formation) root.Formation.SaveNow();
}
/// <summary>줄을 끝냄으로 기록(다시 보여 준 앞 줄은 기록을 바꾸지 않음).</summary>
void Mark(int step)
{
if (step <= State.line) return;
State.line = step;
S.Commit();
}
void Finish()
{
if (State.done) return;
State.done = true;
S.Commit();
}
/// <summary>줄이 뜰 때 할 일(s_on_show) — banner:&lt;id&gt; = 명장 등용 화면에서 그 배너를 고름.</summary>
void OnShow(FirstFlowData.Line l)
{
string bid = FirstFlowData.Arg(l.onShow, FirstFlowData.OnShowBanner);
if (bid != null && root.Trade != null && (root.Trade.Banner == null || root.Trade.Banner.id != bid)) root.Trade.SelectBanner(bid);
string spot = FirstFlowData.Arg(l.onShow, FirstFlowData.OnShowFocus); // 군영 장소 소개 = 그 장소로 화면을 옮긴 뒤 가리킴
if (spot != null && root.Arena != null && root.Arena.Hub != null && root.Arena.HubVisible) root.Arena.Hub.Focus(spot, FirstFlowData.Num("camp_focus_sec", 0.45f));
}
FirstFlowGuide EnsureGuide()
{
if (Guide == null) Guide = FirstFlowGuide.Create(root.transform, root.Cam);
return Guide;
}
/// <summary>말하는 이(표 speaker.&lt;id&gt; = 이름 키 | 그림 경로 앞부분 | 임시 유닛 그림 | 이름표 색 | 받침 색) — 가신 = gacha.csv first_ten_hero 의 영웅(이름 · 그림).</summary>
FirstFlowGuide.Request Request(FirstFlowData.Line l, string mode, List<RectTransform> targets)
{
var sp = FirstFlowData.List("speaker." + l.speaker);
var q = new FirstFlowGuide.Request
{
mode = mode,
text = FirstFlowData.T(l.textKey),
targets = mode == FirstFlowData.Talk ? null : targets,
tagTint = ScreenTable.Col(sp, 3, new Color(0.45f, 0.32f, 0.2f)),
plate = ScreenTable.Col(sp, 4, new Color(1f, 1f, 1f, 0f)),
};
string nameKey = ScreenTable.Str(sp, 0), prefix = ScreenTable.Str(sp, 1), fallback = ScreenTable.Str(sp, 2);
HeroDb.Hero hero = l.speaker == FirstFlowData.Retainer ? S.Def(RetainerId) : null;
q.name = nameKey.Length > 0 ? FirstFlowData.T(nameKey) : hero != null ? hero.nameKo : "";
if (prefix.Length > 0)
{
q.portrait = Resources.Load<Sprite>(prefix + l.face); // 납품 그림(표정별)
if (q.portrait == null) q.portrait = Resources.Load<Sprite>(prefix + "normal");
}
if (q.portrait == null && hero != null) q.portrait = UiKit.ArtSprite(hero.art);
if (q.portrait == null && fallback.Length > 0) q.portrait = UnitArt.Portrait(fallback); // 납품 전 임시 = 유닛 그림
return q;
}
// ---------- 테스트 · 캡처 ----------
/// <summary>지금 왜 대사가 뜨지 않는가를 한 줄로(테스트 실패 글 · 확인용).</summary>
public string DebugState()
{
if (root == null || root.Session == null) return "세션 없음";
var n = FirstFlowData.LineOf(State.line + 1);
return "active=" + Active + " line=" + State.line + " done=" + State.done + " talking=" + talking + " switching=" + switching
+ " modal=" + root.ModalVisible + " result=" + root.ResultVisible + " scene=" + (SceneSwitch.Current != null) + " boot=" + (BootFlow.Current != null)
+ " title=" + (TitleScreen.Current != null) + " intro=" + (IntroScreen.Current != null) + " loading=" + (LoadingScreen.Current != null)
+ " lobby=" + OnScreen(FirstFlowData.ScreenLobby) + " recruit=" + OnScreen(FirstFlowData.ScreenRecruit) + " map=" + OnScreen(FirstFlowData.ScreenMap) + " camp=" + OnScreen(FirstFlowData.ScreenCamp)
+ (n != null ? " next=" + n.step + " wait=" + WaitOk(n) + " screen=" + ScreenOk(n) : " next=없음")
+ " mapVisible=" + (root.Map != null && root.Map.IsVisible) + " mapPopup=" + (root.Map != null && root.Map.PopupVisible) + " phase=" + root.Battle.Phase;
}
/// <summary>화면 누름 1회(대사 넘김).</summary>
public void TapForTest()
{
if (Guide != null) Guide.Tap();
}
/// <summary>누르게 하는 줄의 대상 버튼을 누른다 · 그런 줄이 떠 있지 않으면 false.</summary>
public bool PressTargetForTest()
{
if (Current == null || Guide == null || Guide.Mode != FirstFlowData.Press) return false;
var b = PressHook.Of(Targets(Current));
if (b == null) return false;
b.Invoke();
return true;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e7e4d6f64a53ff54697a55b3628a539e

View File

@ -0,0 +1,409 @@
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
namespace TKS.OutGame
{
/// <summary>
/// 첫 실행 흐름 표(PD 2026-11-24 「최초 게임 실행 시 게임 Flow」 · 요청서 = 조직 레포 공유/기획팀_산출물/삼국지슬링샷/개발요청_최초실행흐름_2026-11-24.md) —
/// Resources/UI/FirstFlow: first_flow_config(값 · 좌표 · 색 · 시간 · ScreenTable 형식) · first_flow_lines(대사 줄) · first_flow_intro(인트로 장) · first_flow_text(글자 · UiText).
/// 문구 · 수치 · 영웅 · 배너 · 스테이지는 모두 표에서 읽는다(C45) — 가신(retainer) = gacha.csv first_ten_hero 의 영웅.
/// </summary>
public static class FirstFlowData
{
public const string Folder = "UI/FirstFlow/";
public const string ConfigPath = Folder + "first_flow_config";
public const string LinesPath = Folder + "first_flow_lines";
public const string IntroPath = Folder + "first_flow_intro";
public const string TextPath = Folder + "first_flow_text";
public const string Talk = "talk";
public const string Point = "point";
public const string Press = "press";
public const string DoneNext = "next";
public const string DoneLobby = "lobby";
public const string DoneEnd = "end";
public const string Helper = "helper";
public const string Retainer = "retainer";
public const string ScreenLobby = "lobby";
public const string ScreenRecruit = "recruit";
public const string ScreenMap = "worldmap";
public const string ScreenCamp = "camp";
public const string ScreenFormation = "formation";
/// <summary>건너뛰는 조건(s_skip_if): 첫 등용을 이미 함 · 가신이 이미 출전 편성에 있음.</summary>
public const string SkipFirstPullDone = "first_pull_done";
public const string SkipRetainerPlaced = "retainer_placed";
/// <summary>줄이 끝난 뒤 할 일(s_on_done): 편성 화면의 지금 편성을 저장.</summary>
public const string AfterSaveFormation = "save_formation";
/// <summary>대상 이름 안의 자리 표시 = 가신(gacha.csv first_pull_hero)의 영웅 id.</summary>
public const string RetainerToken = "{retainer}";
public const string WaitStageClear = "stage_clear";
public const string OnShowBanner = "banner";
/// <summary>줄이 뜰 때 할 일(s_on_show): focus:&lt;군영 장소 id&gt; = 그 장소로 화면을 옮김.</summary>
public const string OnShowFocus = "focus";
static readonly string[] Modes = { Talk, Point, Press };
static readonly string[] Dones = { DoneNext, DoneLobby, DoneEnd };
static readonly string[] Speakers = { Helper, Retainer };
static readonly string[] Screens = { ScreenLobby, ScreenRecruit, ScreenMap, ScreenCamp, ScreenFormation };
static readonly string[] Skips = { SkipFirstPullDone, SkipRetainerPlaced };
/// <summary>대사 한 줄(first_flow_lines).</summary>
public class Line
{
public int step;
public string speaker = "";
public string[] screens = new string[0];
public string mode = Talk;
/// <summary>대상이 있는 화면(s_target 의 / 앞) · 오브젝트 이름들(+ 로 여럿 = 합친 칸).</summary>
public string targetScreen = "";
public string[] targetNames = new string[0];
public string face = "";
public string textKey = "";
public string done = DoneNext;
public string onShow = "";
public string onDone = "";
public string skipIf = "";
public int skipTo;
public int gate;
public string wait = "";
public bool HasTarget
{
get { return targetScreen.Length > 0 && targetNames.Length > 0; }
}
public bool OnScreen(string screen)
{
return System.Array.IndexOf(screens, screen) >= 0;
}
}
/// <summary>인트로 한 장(first_flow_intro).</summary>
public class Cut
{
public int no;
public float sec;
public string picture = "";
public string captionKey = "";
public Color dummyColor = Color.gray;
public string dummyKey = "";
public string enter = "fade";
public float enterSec;
public float scaleFrom = 1f;
public float scaleTo = 1f;
public Vector2 pivot = new Vector2(0.5f, 0.5f);
public float rise;
public float shake;
}
static bool loaded;
static ScreenTable cfg;
static readonly List<Line> lines = new List<Line>();
static readonly List<Cut> cuts = new List<Cut>();
static readonly Dictionary<string, Dictionary<string, string>> texts = new Dictionary<string, Dictionary<string, string>>();
/// <summary>표를 다시 읽게 한다(테스트 · 표 교체).</summary>
public static void Reload()
{
loaded = false;
}
static void Ensure()
{
if (loaded) return;
loaded = true;
lines.Clear();
cuts.Clear();
cfg = ScreenTable.Load(ConfigPath);
// 글자 표 = 여기서 직접 읽는다(UiText 의 표 보관은 Play 를 다시 켜도 남아 고친 문구가 반영되지 않음 — 문구는 PD 가 자주 고친다)
texts.Clear();
var rows = UiText.Rows(TextPath);
if (rows != null)
foreach (var r in rows)
{
string k = S(r, "s_key");
if (k.Length > 0) texts[k] = r;
}
rows = UiText.Rows(LinesPath);
if (rows != null)
foreach (var r in rows)
{
var l = new Line
{
step = I(r, "n_step"),
speaker = S(r, "e_speaker"),
screens = Split(S(r, "l_screen"), ';'),
mode = S(r, "e_mode"),
face = S(r, "e_face"),
textKey = S(r, "s_text_key"),
done = S(r, "e_done").Length > 0 ? S(r, "e_done") : DoneNext,
onShow = S(r, "s_on_show"),
onDone = S(r, "s_on_done"),
skipIf = S(r, "s_skip_if"),
skipTo = I(r, "n_skip_to"),
gate = I(r, "n_gate"),
wait = S(r, "s_wait"),
};
string t = S(r, "s_target");
int slash = t.IndexOf('/');
if (slash > 0)
{
l.targetScreen = t.Substring(0, slash).Trim();
l.targetNames = Split(t.Substring(slash + 1), '+');
}
if (l.step > 0) lines.Add(l);
}
lines.Sort((a, b) => a.step.CompareTo(b.step));
rows = UiText.Rows(IntroPath);
if (rows != null)
foreach (var r in rows)
{
var c = new Cut
{
no = I(r, "n_cut"),
sec = F(r, "f_sec", 5f),
picture = S(r, "s_picture"),
captionKey = S(r, "s_caption_key"),
dummyKey = S(r, "s_dummy_key"),
enter = S(r, "e_in"),
enterSec = F(r, "f_in_sec", 0f),
scaleFrom = F(r, "f_scale_from", 1f),
scaleTo = F(r, "f_scale_to", 1f),
pivot = new Vector2(F(r, "f_pivot_x", 0.5f), F(r, "f_pivot_y", 0.5f)),
rise = F(r, "f_rise", 0f),
shake = F(r, "f_shake", 0f),
};
Color col;
if (ColorUtility.TryParseHtmlString(S(r, "s_dummy_color"), out col)) c.dummyColor = col;
if (c.no > 0) cuts.Add(c);
}
cuts.Sort((a, b) => a.no.CompareTo(b.no));
}
/// <summary>값 표(없으면 null = 첫 실행 흐름 없음).</summary>
public static ScreenTable Cfg
{
get
{
Ensure();
return cfg;
}
}
public static List<Line> Lines
{
get
{
Ensure();
return lines;
}
}
public static List<Cut> Cuts
{
get
{
Ensure();
return cuts;
}
}
/// <summary>표가 있어 흐름을 돌릴 수 있는가(값 표 + 대사 줄).</summary>
public static bool Ready
{
get
{
Ensure();
return cfg != null && lines.Count > 0;
}
}
public static bool HasText(string key)
{
Ensure();
return !string.IsNullOrEmpty(key) && texts.ContainsKey(key);
}
/// <summary>글자 표(first_flow_text) 키 → 지금 언어 글자(빈 칸 = ko · 키 없음 = 키 그대로 · UiText 와 같은 규칙).</summary>
public static string T(string key)
{
Ensure();
Dictionary<string, string> r;
if (string.IsNullOrEmpty(key) || !texts.TryGetValue(key, out r)) return key ?? "";
string v;
if (r.TryGetValue(UiText.Lang, out v) && v.Length > 0) return v;
return r.TryGetValue(UiText.Fallback, out v) ? v : key;
}
public static Line LineOf(int step)
{
foreach (var l in Lines)
if (l.step == step)
return l;
return null;
}
public static int LastStep
{
get { return Lines.Count > 0 ? Lines[Lines.Count - 1].step : 0; }
}
// ---------- 값 표 읽기 ----------
public static string Str(string key, string def = "")
{
return Cfg != null ? Cfg.S(key, def) : def;
}
public static float Num(string key, float def = 0f)
{
return Cfg != null ? Cfg.Num(key, def) : def;
}
public static string[] List(string key)
{
return Cfg != null && Cfg.Has(key) ? Cfg.L(key) : new string[0];
}
public static Color Col(string key, Color def)
{
return Cfg != null && Cfg.Has(key) ? Cfg.Color(key, def) : def;
}
/// <summary>「장-판」 글자를 장 · 판으로(예 1-1).</summary>
public static bool ParseStage(string key, out int chapter, out int stage)
{
chapter = stage = 0;
var p = (key ?? "").Split('-');
return p.Length == 2 && int.TryParse(p[0].Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out chapter)
&& int.TryParse(p[1].Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out stage) && chapter > 0 && stage > 0;
}
/// <summary>「이름:값」 칸의 값(이름이 다르면 null).</summary>
public static string Arg(string cell, string name)
{
if (string.IsNullOrEmpty(cell)) return null;
int i = cell.IndexOf(':');
if (i <= 0 || cell.Substring(0, i).Trim() != name) return null;
return cell.Substring(i + 1).Trim();
}
// ---------- 표 검사(임포트 · 테스트 — 오류 문장 목록 · 0 = 통과) ----------
public static readonly string[] RequiredKeys =
{
"prologue_battle", "canvas", "dim", "start_delay_sec", "talk", "bubble", "bubble_small", "bubble_text", "name_tag", "portrait", "portrait_small", "next_mark",
"focus_frame", "finger", "speaker.helper", "speaker.retainer", "fade", "act_in", "lobby_in",
"start_heroes", "camp_focus_sec", "sortie_stage", "sortie_cluster", "sortie_hp_pct", "sortie_timing",
"intro_canvas", "intro_bg", "intro_open_sec", "intro_scroll", "intro_picture", "intro_caption", "intro_dots", "intro_hint", "intro_skip", "intro_end",
};
public static List<string> Check(OutGameData db, BalanceConfig balance)
{
var e = new List<string>();
Reload();
if (Cfg == null)
{
e.Add(ConfigPath + ": 표 없음");
return e;
}
foreach (var k in RequiredKeys)
if (!Cfg.Has(k)) e.Add(ConfigPath + ": 필수 키 「" + k + "」 없음");
string pid = Str("prologue_battle");
var pb = ContentTables.Find("scenario_battles", "s_id", pid);
if (pb == null || pb.I("n_no") != 0) e.Add(ConfigPath + ": prologue_battle 「" + pid + "」 = scenario_battles 의 서장(n_no 0)이 아님");
if (Lines.Count == 0) e.Add(LinesPath + ": 줄 없음");
bool needRetainer = false;
for (int i = 0; i < Lines.Count; i++)
{
var l = Lines[i];
string at = LinesPath + " n_step " + l.step + ": ";
if (l.step != i + 1) e.Add(at + "줄 번호가 1부터 차례가 아님");
if (System.Array.IndexOf(Speakers, l.speaker) < 0) e.Add(at + "e_speaker 「" + l.speaker + "」");
if (System.Array.IndexOf(Modes, l.mode) < 0) e.Add(at + "e_mode 「" + l.mode + "」");
if (System.Array.IndexOf(Dones, l.done) < 0) e.Add(at + "e_done 「" + l.done + "」");
if (l.screens.Length == 0) e.Add(at + "l_screen 비었음");
foreach (var sc in l.screens)
if (System.Array.IndexOf(Screens, sc) < 0) e.Add(at + "l_screen 「" + sc + "」");
if (l.mode != Talk && !l.HasTarget) e.Add(at + l.mode + " 줄에 s_target 없음");
if (l.HasTarget && System.Array.IndexOf(Screens, l.targetScreen) < 0) e.Add(at + "s_target 화면 「" + l.targetScreen + "」");
if (l.HasTarget && !l.OnScreen(l.targetScreen)) e.Add(at + "s_target 화면이 l_screen 에 없음");
if (!HasText(l.textKey)) e.Add(at + "s_text_key 「" + l.textKey + "」 가 글자 표에 없음");
if (l.skipIf.Length > 0 && System.Array.IndexOf(Skips, l.skipIf) < 0) e.Add(at + "s_skip_if 「" + l.skipIf + "」");
if (l.onDone.Length > 0 && l.onDone != AfterSaveFormation) e.Add(at + "s_on_done 「" + l.onDone + "」");
if (l.skipIf.Length > 0 && (LineOf(l.skipTo) == null || l.skipTo <= l.step)) e.Add(at + "n_skip_to " + l.skipTo);
if (l.gate != 0 && (LineOf(l.gate) == null || l.gate >= l.step || LineOf(l.gate).mode != Press || !LineOf(l.gate).OnScreen(ScreenLobby))) e.Add(at + "n_gate " + l.gate + " = 본영 로비의 누르기 줄이 아님");
if (l.wait.Length > 0)
{
int ch, st;
string key = Arg(l.wait, WaitStageClear);
if (key == null || !ParseStage(key, out ch, out st)) e.Add(at + "s_wait 「" + l.wait + "」");
else if (balance != null && StageOf(balance, ch, st) == null) e.Add(at + "s_wait 스테이지 " + key + " 없음");
}
if (l.onShow.Length > 0)
{
string bid = Arg(l.onShow, OnShowBanner);
if (bid == null && Arg(l.onShow, OnShowFocus) == null) e.Add(at + "s_on_show 「" + l.onShow + "」");
else if (bid != null && db != null && db.Gacha != null && db.Gacha.Get(bid) == null) e.Add(at + "s_on_show 배너 「" + bid + "」 가 gacha_banners.csv 에 없음");
}
if (l.speaker == Retainer) needRetainer = true;
}
if (Lines.Count > 0 && Lines[Lines.Count - 1].done != DoneEnd) e.Add(LinesPath + ": 마지막 줄의 e_done 이 end 가 아님");
if (needRetainer && db != null && db.Gacha != null && (db.Gacha.FirstPullHero.Length == 0 || db.Heroes == null || db.Heroes.Get(db.Gacha.FirstPullHero) == null))
e.Add("gacha.csv: first_pull_hero 가 비어 가신(retainer) 대사를 말할 영웅이 없음");
if (Cuts.Count == 0) e.Add(IntroPath + ": 장 없음");
for (int i = 0; i < Cuts.Count; i++)
{
var c = Cuts[i];
string at = IntroPath + " n_cut " + c.no + ": ";
if (c.no != i + 1) e.Add(at + "장 번호가 1부터 차례가 아님");
if (c.sec <= 0f) e.Add(at + "f_sec");
if (!HasText(c.captionKey)) e.Add(at + "s_caption_key 「" + c.captionKey + "」 가 글자 표에 없음");
if (c.enter != "fade" && c.enter != "slide") e.Add(at + "e_in 「" + c.enter + "」");
if (c.scaleFrom <= 0f || c.scaleTo <= 0f) e.Add(at + "f_scale");
}
int ach, ast;
if (!ParseStage(Str("sortie_stage"), out ach, out ast) || (balance != null && StageOf(balance, ach, ast) == null)) e.Add(ConfigPath + ": sortie_stage 「" + Str("sortie_stage") + "」 스테이지 없음");
foreach (var k in new[] { "ff_name_helper", "ff_intro_skip", "ff_intro_hint", "ff_retry", "ff_sortie_enemy", "ff_sortie_victim", "ff_sortie_tip_skill", "ff_sortie_retainer", "ff_sortie_tip_heal",
"ff_sortie_bar_select", "ff_sortie_bar_skill", "ff_sortie_bar_attack", "ff_sortie_bar_aim" })
if (!HasText(k)) e.Add(TextPath + ": 키 「" + k + "」 없음");
return e;
}
public static BalanceConfig.StageDef StageOf(BalanceConfig cfg, int chapter, int stage)
{
if (cfg == null || cfg.stages == null) return null;
foreach (var s in cfg.stages)
if (s.chapter == chapter && s.stage == stage)
return s;
return null;
}
static string S(Dictionary<string, string> r, string k)
{
string v;
return r.TryGetValue(k, out v) && v != null ? v.Trim() : "";
}
static int I(Dictionary<string, string> r, string k)
{
int v;
return int.TryParse(S(r, k), NumberStyles.Integer, CultureInfo.InvariantCulture, out v) ? v : 0;
}
static float F(Dictionary<string, string> r, string k, float def)
{
float v;
return float.TryParse(S(r, k), NumberStyles.Float, CultureInfo.InvariantCulture, out v) ? v : def;
}
static string[] Split(string s, char sep)
{
var list = new List<string>();
foreach (var p in (s ?? "").Split(sep))
if (p.Trim().Length > 0) list.Add(p.Trim());
return list.ToArray();
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ed59d8db068b1594db970805bd20f607

View File

@ -0,0 +1,405 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TKS.OutGame
{
/// <summary>
/// 포트레이트 대화 장치(첫 실행 흐름 · PD 2026-11-24 · 요청서 §2-2) — 왼쪽 아래 포트레이트 + 오른쪽 말풍선(이름표 · 다음 표시) ·
/// talk = 화면 전체 어둡게(터치 = 다음) · point = 대상만 밝게(눌리지 않음 · 터치 = 다음) · press = 대상만 밝게 + 금빛 테 + 손가락(그 대상만 눌림).
/// 대상이 대화 칸과 겹치면 대화 칸이 대상 위로 올라간다(와이어프레임 wire_sortie · wire_recruit).
/// 캔버스(P41): 루트 = Static · Dim(어두운 판 4장 + 구멍 막이 = 줄이 바뀔 때만) · Talk(포트레이트 · 말풍선 · 이름표 = 줄이 바뀔 때만) ·
/// 대사 글자 · 다음 표시 = 말풍선 안 중첩 Frame · Fx(금빛 테 숨쉬기 · 손가락 까딱임) = Frame.
/// 그림 = 다시 씀(연의 말풍선 Scenario/bubble · name_tag · 학습 안내 손가락 tut_hand) · 좌표 · 크기 · 색 = 표 first_flow_config.
/// </summary>
public class FirstFlowGuide : MonoBehaviour
{
public class Request
{
public string mode = FirstFlowData.Talk;
public string name = "";
public Color tagTint = Color.gray;
public Color plate = Color.white;
public Sprite portrait;
public string text = "";
public List<RectTransform> targets;
}
const float DesignW = 1080f;
RectTransform root;
RectTransform dimLayer;
RectTransform talkLayer;
RectTransform fxLayer;
readonly Image[] dims = new Image[4];
Image holeBlock;
RectTransform block;
Image plate;
Image portrait;
Image bubble;
Image nameTag;
Text nameText;
Text body;
Text nextMark;
readonly Image[] frame = new Image[4];
Image finger;
Request req;
float shownChars;
float charsPerSec = 40f;
float clock;
Rect hole;
bool hasHole;
float nextPeriod = 0.9f;
float framePeriod = 1f, frameMin = 0.5f;
float fingerBob = 16f, fingerPeriod = 0.7f;
Vector2 fingerHome;
Color frameColor = Color.yellow;
/// <summary>대사 칸이 떠 있는가.</summary>
public bool Shown { get; private set; }
/// <summary>지금 줄의 방식 · 말하는 이 · 전체 대사(테스트 · 캡처).</summary>
public string Mode { get { return req != null ? req.mode : ""; } }
public string SpeakerName { get { return req != null ? req.name : ""; } }
public string FullText { get { return req != null ? req.text : ""; } }
/// <summary>대사가 아직 한 글자씩 나오는 중인가.</summary>
public bool Typing { get { return Shown && req != null && shownChars < req.text.Length; } }
/// <summary>대사가 다 나온 뒤의 화면 누름 수(지휘 쪽이 읽고 0 으로 돌린다).</summary>
public int Taps;
/// <summary>밝게 남긴 칸(루트 좌표 · 없으면 null · 테스트).</summary>
public Rect? Hole { get { return hasHole ? hole : (Rect?)null; } }
public bool FingerShown { get { return finger != null && finger.gameObject.activeSelf; } }
public bool PortraitShown { get { return portrait != null && portrait.sprite != null; } }
public static FirstFlowGuide Create(Transform parent, Camera cam)
{
var go = new GameObject("FirstFlowGuide");
go.transform.SetParent(parent, false);
var g = go.AddComponent<FirstFlowGuide>();
g.Build(cam);
go.SetActive(false);
return g;
}
static string[] L(string key)
{
return FirstFlowData.List(key);
}
static float At(string[] a, int i, float def)
{
return ScreenTable.At(a, i, def);
}
void Build(Camera cam)
{
var cv = L("canvas");
UiLayer.Root(gameObject, cam, (int)At(cv, 0, 470f), At(cv, 1, 0.33f), UiLayer.Reference, UiRate.Static);
root = (RectTransform)transform;
// 어두운 판 4장(대상 둘레) + 구멍 막이(가리키기 = 대상도 눌리지 않게) — 눌림 = 대사 넘김
dimLayer = UiLayer.Group("Dim", root, UiRate.Event, true);
var dimCol = FirstFlowData.Col("dim", new Color(0f, 0f, 0f, 0.62f));
for (int i = 0; i < 4; i++) dims[i] = Panel("Dim" + i, dimLayer, dimCol);
holeBlock = Panel("HoleBlock", dimLayer, new Color(0f, 0f, 0f, 0f));
holeBlock.canvasRenderer.cullTransparentMesh = true; // 누름만 · 그리지 않음
// 금빛 테 · 손가락(매 프레임 움직임)
fxLayer = UiLayer.Group("Fx", root, UiRate.Frame, false);
var ff = L("focus_frame"); // 여백 | 테 굵기 | 색 | 숨쉬기 주기 | 가장 흐릴 때
frameColor = ScreenTable.Col(ff, 2, new Color(0.95f, 0.7f, 0.24f));
framePeriod = Mathf.Max(0.1f, At(ff, 3, 1f));
frameMin = Mathf.Clamp01(At(ff, 4, 0.55f));
for (int i = 0; i < 4; i++)
{
frame[i] = UiKit.Rect("Frame" + i, fxLayer, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).gameObject.AddComponent<Image>();
frame[i].color = frameColor;
frame[i].raycastTarget = false;
}
var fg = L("finger"); // 크기 | 대상 가운데에서 x(폭 비율) | y(높이 비율) | 까딱임 px | 주기
float fs = At(fg, 0, 150f);
finger = UiKit.Rect("Finger", fxLayer, new Vector2(0.5f, 0.5f), new Vector2(0.12f, 0.85f), Vector2.zero, new Vector2(fs, fs)).gameObject.AddComponent<Image>(); // 피벗 = 손가락 끝(학습 안내와 같음)
finger.sprite = UISkin.Icon("tut_hand");
if (finger.sprite == null)
{
finger.sprite = UiKit.Circle;
finger.rectTransform.pivot = new Vector2(0.5f, 0.5f);
finger.rectTransform.sizeDelta = new Vector2(fs * 0.45f, fs * 0.45f);
}
finger.raycastTarget = false;
fingerBob = At(fg, 3, 16f);
fingerPeriod = Mathf.Max(0.1f, At(fg, 4, 0.7f));
// 대화 칸(화면 아래 가운데 · 설계 폭 1080 기준 좌표)
talkLayer = UiLayer.Group("Talk", root, UiRate.Event, true);
block = UiKit.Rect("Block", talkLayer, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), Vector2.zero, new Vector2(DesignW, 10f));
plate = UiKit.Rect("Plate", block, Vector2.zero, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).gameObject.AddComponent<Image>();
plate.sprite = UiKit.Circle;
plate.raycastTarget = false;
portrait = UiKit.Rect("Portrait", block, Vector2.zero, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).gameObject.AddComponent<Image>();
portrait.preserveAspect = true;
portrait.raycastTarget = false;
bubble = UiKit.Rect("Bubble", block, Vector2.zero, Vector2.zero, Vector2.zero, Vector2.zero).gameObject.AddComponent<Image>();
bubble.sprite = Resources.Load<Sprite>("Scenario/bubble");
bubble.type = bubble.sprite != null ? Image.Type.Sliced : Image.Type.Simple;
bubble.raycastTarget = true;
Clickable(bubble);
var bt = L("bubble_text"); // 글자 | 최소 글자 | 색 | 좌우 여백 | 위 여백 | 아래 여백 | 줄 간격 | 초당 글자 수
body = UiKit.Title(UiKit.FillLabel(bubble.transform, "", (int)At(bt, 0, 38f), ScreenTable.Col(bt, 2, new Color(0.24f, 0.13f, 0.07f)), TextAnchor.MiddleLeft, false));
body.rectTransform.offsetMin = new Vector2(At(bt, 3, 44f), At(bt, 5, 34f));
body.rectTransform.offsetMax = new Vector2(-At(bt, 3, 44f), -At(bt, 4, 40f));
body.horizontalOverflow = HorizontalWrapMode.Wrap;
body.verticalOverflow = VerticalWrapMode.Truncate;
body.resizeTextForBestFit = true;
body.resizeTextMinSize = (int)At(bt, 1, 28f);
body.resizeTextMaxSize = (int)At(bt, 0, 38f);
body.lineSpacing = At(bt, 6, 1.15f);
body.raycastTarget = false;
charsPerSec = Mathf.Max(1f, At(bt, 7, 40f));
UiLayer.Nest(body.gameObject, UiRate.Frame, false); // 한 글자씩 나오는 동안만 바뀜 — 포트레이트 · 말풍선을 다시 묶지 않게
var nm = L("next_mark"); // 글자 크기 | 말풍선 오른쪽에서 x | 아래에서 y | 색 | 깜박임 주기
nextMark = UiKit.Label(bubble.transform, "▼", (int)At(nm, 0, 34f), ScreenTable.Col(nm, 3, new Color(0.72f, 0.26f, 0.23f)), TextAnchor.MiddleCenter,
new Vector2(1f, 0f), new Vector2(0.5f, 0.5f), new Vector2(At(nm, 1, -44f), At(nm, 2, 34f)), new Vector2(60f, 60f));
nextMark.raycastTarget = false;
nextPeriod = Mathf.Max(0.1f, At(nm, 4, 0.9f));
UiLayer.Nest(nextMark.gameObject, UiRate.Frame, false);
var nt = L("name_tag"); // 말풍선 왼쪽에서 x | 말풍선 위끝에서 y(가운데) | 높이 | 글자 | 좌우 여백 | 글자 색
nameTag = UiKit.Rect("NameTag", bubble.transform, new Vector2(0f, 1f), new Vector2(0f, 0.5f), new Vector2(At(nt, 0, 40f), At(nt, 1, 0f)), new Vector2(200f, At(nt, 2, 56f))).gameObject.AddComponent<Image>();
nameTag.sprite = Resources.Load<Sprite>("Scenario/name_tag");
nameTag.type = nameTag.sprite != null ? Image.Type.Sliced : Image.Type.Simple;
nameTag.raycastTarget = false;
nameText = UiKit.Title(UiKit.FillLabel(nameTag.transform, "", (int)At(nt, 3, 30f), ScreenTable.Col(nt, 5, Color.white)), true);
nameText.horizontalOverflow = HorizontalWrapMode.Overflow;
nameText.raycastTarget = false;
}
Image Panel(string name, Transform parent, Color c)
{
var img = UiKit.Rect(name, parent, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).gameObject.AddComponent<Image>();
img.color = c;
img.raycastTarget = true;
Clickable(img);
return img;
}
void Clickable(Image img)
{
var b = img.gameObject.AddComponent<Button>();
b.transition = Selectable.Transition.None;
b.onClick.AddListener(Tap);
}
// ---------- 보이기 · 숨기기 ----------
public void Show(Request q)
{
req = q ?? new Request();
Shown = true;
Taps = 0;
shownChars = 0f;
clock = 0f;
gameObject.SetActive(true);
bool small = req.mode != FirstFlowData.Talk;
var bb = L(small ? "bubble_small" : "bubble"); // 왼 x | 폭 | 높이 | 아래에서 y
if (bb.Length < 3) bb = L("bubble");
var pt = L(small ? "portrait_small" : "portrait"); // 가운데 x | 가운데 y | 그림 크기 | 받침 크기
float bx = At(bb, 0, 430f), bw = At(bb, 1, 620f), bh = At(bb, 2, 250f), by = At(bb, 3, 0f);
var brt = bubble.rectTransform;
brt.anchoredPosition = new Vector2(bx, by);
brt.sizeDelta = new Vector2(bw, bh);
float pc = At(pt, 2, 400f), pp = At(pt, 3, 340f);
var pos = new Vector2(At(pt, 0, 250f), At(pt, 1, 170f));
portrait.rectTransform.anchoredPosition = pos;
portrait.rectTransform.sizeDelta = new Vector2(pc, pc);
portrait.sprite = req.portrait;
portrait.enabled = req.portrait != null;
plate.rectTransform.anchoredPosition = pos;
plate.rectTransform.sizeDelta = new Vector2(pp, pp);
plate.color = req.plate;
plate.enabled = req.plate.a > 0.01f;
float top = Mathf.Max(by + bh + nameTag.rectTransform.sizeDelta.y * 0.5f, pos.y + Mathf.Max(pc, pp) * 0.5f);
block.sizeDelta = new Vector2(DesignW, top);
nameTag.gameObject.SetActive(req.name.Length > 0);
nameTag.color = req.tagTint;
nameText.text = req.name;
var nt = L("name_tag");
nameTag.rectTransform.sizeDelta = new Vector2(Mathf.Ceil(nameText.preferredWidth) + 2f * At(nt, 4, 26f), nameTag.rectTransform.sizeDelta.y);
body.text = "";
nextMark.gameObject.SetActive(false);
hasHole = false;
Refit(true);
}
public void Hide()
{
Shown = false;
req = null;
hasHole = false;
Taps = 0;
if (gameObject.activeSelf) gameObject.SetActive(false);
}
/// <summary>화면 누름(어두운 판 · 말풍선 · 테스트) — 대사가 나오는 중이면 전부 보여 주고, 다 나왔으면 누름 수를 더한다.</summary>
public void Tap()
{
if (!Shown || req == null) return;
if (Typing)
{
shownChars = req.text.Length;
body.text = req.text;
return;
}
Taps++;
}
// ---------- 매 프레임 ----------
void Update()
{
if (!Shown || req == null) return;
float dt = Time.unscaledDeltaTime;
clock += dt;
if (shownChars < req.text.Length)
{
shownChars = Mathf.Min(req.text.Length, shownChars + charsPerSec * dt);
string s = req.text.Substring(0, Mathf.FloorToInt(shownChars));
if (body.text != s) body.text = s;
}
// 다음 표시(▼) = 대사가 다 나온 뒤 · 누르게 하는 줄에는 없음
bool mark = !Typing && req.mode != FirstFlowData.Press;
if (nextMark.gameObject.activeSelf != mark) nextMark.gameObject.SetActive(mark);
if (mark)
{
var c = nextMark.color;
c.a = 0.35f + 0.65f * (0.5f + 0.5f * Mathf.Cos(clock / nextPeriod * Mathf.PI * 2f));
nextMark.color = c;
}
if (hasHole && req.mode == FirstFlowData.Press)
{
float a = Mathf.Lerp(frameMin, 1f, 0.5f + 0.5f * Mathf.Cos(clock / framePeriod * Mathf.PI * 2f));
var fc = new Color(frameColor.r, frameColor.g, frameColor.b, frameColor.a * a);
for (int i = 0; i < 4; i++) frame[i].color = fc;
float bob = fingerBob * (0.5f + 0.5f * Mathf.Sin(clock / fingerPeriod * Mathf.PI * 2f));
finger.rectTransform.anchoredPosition = fingerHome + new Vector2(bob, -bob); // 손가락 끝이 대상 쪽(왼쪽 위)을 까딱까딱 가리킴
}
}
void LateUpdate()
{
if (Shown && req != null) Refit(false);
}
/// <summary>대상 칸을 다시 재고(화면 전환 · 스크롤로 움직였을 때만) 어두운 판 · 테 · 손가락 · 대화 칸 자리를 맞춘다.</summary>
void Refit(bool force)
{
Rect h;
bool has = TargetRect(out h);
if (!force && has == hasHole && (!has || Near(h, hole))) return;
hasHole = has;
hole = h;
Layout();
}
static bool Near(Rect a, Rect b)
{
return Mathf.Abs(a.xMin - b.xMin) < 0.5f && Mathf.Abs(a.yMin - b.yMin) < 0.5f && Mathf.Abs(a.xMax - b.xMax) < 0.5f && Mathf.Abs(a.yMax - b.yMax) < 0.5f;
}
/// <summary>대상들을 합친 칸(루트 좌표 · 자식 그림까지 · 표 focus_frame 의 여백만큼 넓힘) — 대상이 없거나 꺼져 있으면 false.</summary>
bool TargetRect(out Rect r)
{
r = new Rect();
if (req == null || req.targets == null || req.mode == FirstFlowData.Talk) return false;
bool any = false;
var b = new Bounds();
foreach (var t in req.targets)
{
if (t == null || !t.gameObject.activeInHierarchy) continue;
var tb = RectTransformUtility.CalculateRelativeRectTransformBounds(root, t);
if (tb.size.x < 1f && tb.size.y < 1f) continue;
if (!any) b = tb;
else b.Encapsulate(tb);
any = true;
}
if (!any) return false;
float pad = At(L("focus_frame"), 0, 10f);
var full = root.rect;
r = Rect.MinMaxRect(Mathf.Max(full.xMin, b.min.x - pad), Mathf.Max(full.yMin, b.min.y - pad), Mathf.Min(full.xMax, b.max.x + pad), Mathf.Min(full.yMax, b.max.y + pad));
return r.width > 1f && r.height > 1f;
}
void Layout()
{
var full = root.rect;
if (!hasHole)
{
Place(dims[0], full);
for (int i = 1; i < 4; i++) dims[i].gameObject.SetActive(false);
dims[0].gameObject.SetActive(true);
}
else
{
Place(dims[0], Rect.MinMaxRect(full.xMin, hole.yMax, full.xMax, full.yMax)); // 위
Place(dims[1], Rect.MinMaxRect(full.xMin, full.yMin, full.xMax, hole.yMin)); // 아래
Place(dims[2], Rect.MinMaxRect(full.xMin, hole.yMin, hole.xMin, hole.yMax)); // 왼쪽
Place(dims[3], Rect.MinMaxRect(hole.xMax, hole.yMin, full.xMax, hole.yMax)); // 오른쪽
for (int i = 0; i < 4; i++) dims[i].gameObject.SetActive(true);
}
bool point = hasHole && req.mode == FirstFlowData.Point;
holeBlock.gameObject.SetActive(point);
if (point) Place(holeBlock, hole);
bool press = hasHole && req.mode == FirstFlowData.Press;
bool lit = hasHole && req.mode != FirstFlowData.Talk;
float w = At(L("focus_frame"), 1, 8f);
for (int i = 0; i < 4; i++) frame[i].gameObject.SetActive(lit);
if (lit)
{
Place(frame[0], Rect.MinMaxRect(hole.xMin - w, hole.yMax, hole.xMax + w, hole.yMax + w));
Place(frame[1], Rect.MinMaxRect(hole.xMin - w, hole.yMin - w, hole.xMax + w, hole.yMin));
Place(frame[2], Rect.MinMaxRect(hole.xMin - w, hole.yMin, hole.xMin, hole.yMax));
Place(frame[3], Rect.MinMaxRect(hole.xMax, hole.yMin, hole.xMax + w, hole.yMax));
for (int i = 0; i < 4; i++) frame[i].color = frameColor;
}
finger.gameObject.SetActive(press);
if (press)
{
var fg = L("finger");
fingerHome = hole.center + new Vector2(hole.width * At(fg, 1, 0.22f), hole.height * At(fg, 2, -0.18f));
// 손 그림(손가락 끝 = 피벗 · 그림은 오른쪽 아래로 뻗음)이 화면 밖으로 잘리지 않게 끝 자리를 안쪽으로
var frt = finger.rectTransform;
float right = frt.sizeDelta.x * (1f - frt.pivot.x) + fingerBob, down = frt.sizeDelta.y * frt.pivot.y + fingerBob;
fingerHome.x = Mathf.Min(fingerHome.x, full.xMax - right);
fingerHome.y = Mathf.Max(fingerHome.y, full.yMin + down);
frt.anchoredPosition = fingerHome;
}
// 대화 칸 = 화면 아래 · 대상과 겹치면 대상 위(자리가 없으면 대상 아래)
var tk = L("talk"); // 아래에서 y | 대상과의 간격 | 화면 위끝 여백
float bottom = At(tk, 0, 190f), gap = At(tk, 1, 40f), topPad = At(tk, 2, 150f);
float hgt = block.sizeDelta.y;
float y = bottom;
if (hasHole)
{
float h0 = hole.yMin - full.yMin, h1 = hole.yMax - full.yMin; // 화면 아래에서 잰 대상의 아래 · 위
if (h1 + gap > y && h0 - gap < y + hgt)
{
float above = h1 + gap + w;
if (above + hgt <= full.height - topPad) y = above;
else if (h0 - gap - w - hgt >= 0f) y = h0 - gap - w - hgt;
}
}
block.anchoredPosition = new Vector2(0f, y);
}
static void Place(Image img, Rect r)
{
var rt = img.rectTransform;
rt.anchoredPosition = r.center;
rt.sizeDelta = new Vector2(Mathf.Max(0f, r.width), Mathf.Max(0f, r.height));
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 26a4ed846dc5fad408213e4ca06cf4e5

View File

@ -0,0 +1,450 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TKS.OutGame
{
/// <summary>
/// 출정 첫 스테이지의 스킬 튜토리얼(첫 실행 흐름 · PD 2026-11-24 3차 「유비와 간옹만으로는 클리어가 어려운 편 → 튜토리얼을 제공해 적들을 섬멸」) —
/// 그 스테이지를 처음 깨기 전의 판에서: 적 셋을 유비 앞에 모아 놓고(표 sortie_cluster) 첫 아군 차례에
/// ① 적 하나 「오~ 손님이 오셨군…」 → 유비 「너희들의 악행을 끝내주겠다.」 → 안내 카드(유비의 「이도류 검법」) → 안내 띠: 유비 고르기 → 스킬 버튼 → 모여 있는 적 공격
/// ② 모여 있는 적 가운데 하나라도 맞으면 셋이 한 번에 쓰러짐 · 유비 체력을 표의 비율(50 %)로 낮춤(「반격 피해」)
/// ③ 그 행동이 끝나 다시 아군 차례가 되면 가신 「주공 무리하시면 안됩니다.」 → 안내 카드(간옹의 유세) → 안내 띠: 가신 고르기 → 스킬 버튼 → 유비 쪽으로 쏘기(회복)
/// ④ 그 뒤 = 자유 플레이 · 적을 모두 쓰러뜨리면 지금 규칙대로 승리 · 결과 화면 → (흐름) 가신의 진언 · 군영 안내.
/// 조건 = 출정(컨텐츠 모드 아님) · 일반 난이도 · 표의 스테이지(sortie_stage) · 그 스테이지 클리어 기록 없음 · 유비(서장 보상 영웅)와 가신이 판에 있음 — 아니면 아무것도 하지 않는다.
/// 값 = 표 first_flow_config sortie_* · 문구 = first_flow_text ff_sortie_*(C45). 그림 · 소리 = 다시 씀(연의 말풍선 ScenarioUi.Say · 학습 안내 UI TutorialGuideUI 의 카드 · 띠 · 테 · 손가락).
/// (같은 날 2차의 「복병 궁수 → 간옹 회복」 이벤트는 PD 지시로 뺌 = 시나리오 변경.)
/// </summary>
[DefaultExecutionOrder(1000)] // 학습 안내(TutorialDirector.Update 가 매 프레임 강조를 지우고 다시 그림) 뒤에 그리게
public class FirstFlowSortie : MonoBehaviour
{
static readonly Color EnemyTag = new Color(0.75f, 0.16f, 0.12f);
static readonly Color AllyTag = new Color(0.16f, 0.36f, 0.72f);
public enum Step
{
Off,
Intro, // 시작 대사 · 안내 카드(조작 잠금)
SkillGuide, // 유비 스킬 안내(띠 · 강조)
AfterAttack, // 모여 있던 적이 쓰러짐 → 그 행동이 끝나기를 기다림
RetainerTalk, // 가신 대사 · 안내 카드(조작 잠금)
HealGuide, // 가신 회복 스킬 안내(띠 · 강조)
Done,
}
OutGameRoot root;
FirstFlow flow;
BattleManager battle;
readonly List<Unit> cluster = new List<Unit>();
int hpAtHeal;
string lastBar;
float clock;
bool barPlaced;
GameObject ui;
RectTransform uiRoot;
RectTransform fx;
TalkState talk;
/// <summary>지금 단계 · 유비(서장 보상 영웅) · 가신 · 모아 놓은 적(테스트 · 확인).</summary>
public Step State { get; private set; }
public Unit Victim { get; private set; }
public Unit Retainer { get; private set; }
public IList<Unit> Cluster { get { return cluster; } }
/// <summary>지금 안내 띠 글자(테스트).</summary>
public string Bar { get { return lastBar ?? ""; } }
/// <summary>대사 · 안내 카드가 떠 있어 조작이 잠긴 때.</summary>
public bool Talking { get { return State == Step.Intro || State == Step.RetainerTalk; } }
public static FirstFlowSortie Create(OutGameRoot root, FirstFlow flow)
{
var a = flow.gameObject.AddComponent<FirstFlowSortie>();
a.root = root;
a.flow = flow;
a.battle = root.Battle;
a.battle.StageStarted += a.OnStageStarted;
a.battle.PhaseChanged += a.OnPhase;
return a;
}
void OnDestroy()
{
if (battle == null) return;
battle.StageStarted -= OnStageStarted;
battle.PhaseChanged -= OnPhase;
}
static float At(string[] a, int i, float def)
{
return ScreenTable.At(a, i, def);
}
Unit Ally(string heroId)
{
if (string.IsNullOrEmpty(heroId)) return null;
foreach (var u in battle.AliveUnits(Faction.Player))
if (!u.Npc && u.HeroId == heroId) return u;
return null;
}
/// <summary>판이 놓인 직후 — 조건이 맞으면 유비 앞에 적 셋을 모아 놓고 첫 아군 차례를 기다린다.</summary>
void OnStageStarted()
{
Abort();
if (flow == null || !flow.Available || Sim.Active || battle.Mode != null) return;
int ch, st;
if (!FirstFlowData.ParseStage(FirstFlowData.Str("sortie_stage"), out ch, out st)) return;
var s = battle.Stage;
if (s == null || s.chapter != ch || s.stage != st || root.Session.Hard) return;
var rec = root.Session.Save.Stage(ch, st, false);
if (rec != null && rec.clears > 0) return; // 그 스테이지를 처음 깨기 전에만
Victim = Ally(flow.VictimId);
Retainer = Ally(flow.RetainerId);
if (Victim == null || Retainer == null || Victim == Retainer)
{
Victim = Retainer = null;
return;
}
// 유비에게 가까운 적부터 표의 자리(유비 기준)로 모은다
var foes = battle.AliveUnits(Faction.Enemy);
foes.Sort((a, b) => (a.Position - Victim.Position).sqrMagnitude.CompareTo((b.Position - Victim.Position).sqrMagnitude));
var spots = FirstFlowData.List("sortie_cluster"); // x:y | x:y | x:y (유비에서 · 칸)
for (int i = 0; i < spots.Length && i < foes.Count; i++)
{
var xy = spots[i].Split(':');
if (xy.Length < 2) continue;
var p = Victim.Position + new Vector2(ScreenTable.F(xy[0]), ScreenTable.F(xy[1]));
foes[i].Position = battle.Board != null ? battle.Board.ClampInside(p, foes[i].Radius) : p;
Face(foes[i], Victim.Position);
cluster.Add(foes[i]);
}
if (cluster.Count == 0)
{
Victim = Retainer = null;
return;
}
Face(Victim, cluster[0].Position);
State = Step.Intro;
}
void OnPhase(BattlePhase p)
{
if (p == BattlePhase.StageClear || p == BattlePhase.Defeat) Abort();
}
/// <summary>판이 다시 놓이거나 끝남 — 연출 · 안내를 거둠.</summary>
void Abort()
{
StopAllCoroutines();
running = false;
var gui = GuideUi;
if (gui != null && Talking) gui.SetCard(null);
DestroyUi();
ClearBar();
State = Step.Off;
cluster.Clear();
Victim = Retainer = null;
}
bool running;
bool Ready
{
get { return battle.Phase == BattlePhase.PlayerTurn && !ScenarioEvent.Running && Victim != null && Retainer != null; }
}
void Update()
{
if (State == Step.Off || State == Step.Done) return;
if (Victim == null || Retainer == null || !Victim.IsAlive)
{
Finish();
return;
}
clock += Time.unscaledDeltaTime;
switch (State)
{
case Step.Intro:
if (!running && Ready) StartCoroutine(Intro());
break;
case Step.SkillGuide:
if (ClusterHit()) FellCluster();
else DrawSkillGuide();
break;
case Step.AfterAttack:
if (!running && Ready) StartCoroutine(RetainerTalk());
break;
case Step.HealGuide:
DrawHealGuide();
break;
}
}
// ---------- ① 시작 대사 · 유비 스킬 안내 ----------
IEnumerator Intro()
{
running = true;
battle.ForcePhase(BattlePhase.Resolving); // 대사 동안 조작 잠금(전투 화면 그대로)
var cam = FindFirstObjectByType<CameraController>();
BuildUi(cam);
var tm = FirstFlowData.List("sortie_timing"); // 시작 전 뜸 | 카메라가 옮겨 간 뒤 뜸
yield return Wait(At(tm, 0, 0.4f));
var speaker = cluster.Count > 1 ? cluster[1] : cluster[0]; // 가운데 적
if (cam != null && speaker != null) cam.FocusOn(speaker.Position);
yield return Wait(At(tm, 1, 0.4f));
yield return Say(cam, speaker, FirstFlowData.T("ff_sortie_enemy"), EnemyTag);
if (cam != null && Victim != null) cam.FocusOn(Victim.Position);
yield return Wait(At(tm, 1, 0.4f));
yield return Say(cam, Victim, FirstFlowData.T("ff_sortie_victim"), AllyTag);
yield return Card(FirstFlowData.T("ff_sortie_tip_skill"));
DestroyUi();
if (State != Step.Intro || Victim == null)
{
running = false;
yield break;
}
battle.ForcePhase(BattlePhase.PlayerTurn);
if (battle.Sling != null) battle.Sling.Select(Victim);
lastBar = null;
State = Step.SkillGuide;
running = false;
}
/// <summary>모아 놓은 적 가운데 하나라도 맞았는가(체력이 줄었거나 쓰러짐).</summary>
bool ClusterHit()
{
foreach (var e in cluster)
if (e == null || !e.IsAlive || e.Hp < e.MaxHp) return true;
return false;
}
/// <summary>② 하나가 맞으면 셋이 한 번에 쓰러짐 · 유비 체력을 표의 비율로 낮춤(「반격 피해」).</summary>
void FellCluster()
{
foreach (var e in cluster)
if (e != null && e.IsAlive) e.TakeDamage(e.MaxHp * 10);
int to = Mathf.Max(1, Mathf.RoundToInt(Victim.MaxHp * FirstFlowData.Num("sortie_hp_pct", 0.5f)));
if (Victim.Hp > to)
{
Fx.Popup(Victim.Position, "-" + (Victim.Hp - to), EnemyTag);
Victim.Hp = to;
if (Victim.View != null)
{
Victim.View.OnHit();
Victim.View.Refresh();
}
}
ClearBar();
State = Step.AfterAttack;
}
void DrawSkillGuide()
{
var gui = GuideUi;
if (gui == null) return;
float pulse = 1f + 0.06f * Mathf.Sin(clock * 6f), press = 0.5f + 0.5f * Mathf.Sin(clock * 6f);
var sk = battle.Skills.Of(Victim);
bool canAct = battle.Phase == BattlePhase.PlayerTurn && battle.CanAct(Victim);
bool skillReady = sk != null && !sk.Reserved && sk.ReadyTurn <= battle.TurnNumber;
string bar;
gui.BeginFrame();
if (!canAct) bar = "";
else if (battle.Sling != null && battle.Sling.Selected != Victim)
{
bar = FirstFlowData.T("ff_sortie_bar_select").Replace("{0}", Victim.DisplayName);
gui.Frame(gui.WorldRect(Victim.Position, Vector2.one * (Victim.Radius * 1.6f)), true, pulse);
gui.Finger(gui.ToCanvas(Victim.Position), press, 1f);
}
else if (skillReady)
{
bar = FirstFlowData.T("ff_sortie_bar_skill");
DrawSkillButton(gui, pulse, press);
}
else
{
bar = FirstFlowData.T("ff_sortie_bar_attack");
foreach (var e in cluster)
if (e != null && e.IsAlive) gui.Frame(gui.WorldRect(e.Position, Vector2.one * (e.Radius * 1.6f)), true, pulse);
}
gui.EndFrame();
SetBar(gui, bar);
}
void DrawSkillButton(TutorialGuideUI gui, float pulse, float press)
{
var rt = battle.Hud != null ? battle.Hud.transform.Find("Info/SkillButton") as RectTransform : null;
if (rt == null || !rt.gameObject.activeInHierarchy) return;
var r = gui.UiRect(rt);
gui.Frame(r, false, pulse);
gui.Finger(r.center, press, 1f);
}
// ---------- ③ 가신 대사 · 회복 스킬 안내 ----------
IEnumerator RetainerTalk()
{
running = true;
State = Step.RetainerTalk;
battle.ForcePhase(BattlePhase.Resolving);
var cam = FindFirstObjectByType<CameraController>();
BuildUi(cam);
if (cam != null && Retainer != null) cam.FocusOn(Retainer.Position);
yield return Wait(At(FirstFlowData.List("sortie_timing"), 1, 0.4f));
yield return Say(cam, Retainer, FirstFlowData.T("ff_sortie_retainer"), AllyTag);
yield return Card(FirstFlowData.T("ff_sortie_tip_heal"));
DestroyUi();
if (State != Step.RetainerTalk || Retainer == null || !Retainer.IsAlive)
{
running = false;
if (State == Step.RetainerTalk) Finish();
yield break;
}
// 가신이 이번 턴에 이미 움직였어도 회복 스킬을 써 볼 수 있게 — 다시 행동 가능 · 스킬 바로 사용 가능
if (!battle.CanAct(Retainer)) Retainer.ResetForNewTurn();
var sk = battle.Skills.Of(Retainer);
if (sk != null && !sk.Reserved) sk.ReadyTurn = battle.TurnNumber;
hpAtHeal = Victim != null ? Victim.Hp : 0;
battle.ForcePhase(BattlePhase.PlayerTurn);
if (battle.Sling != null) battle.Sling.Select(Retainer);
lastBar = null;
State = Step.HealGuide;
running = false;
}
void DrawHealGuide()
{
var sk = Retainer.IsAlive ? battle.Skills.Of(Retainer) : null;
bool healed = Victim.Hp > hpAtHeal;
bool canHeal = sk != null && !healed && battle.Phase == BattlePhase.PlayerTurn && battle.CanAct(Retainer);
if (healed || sk == null || (battle.Phase == BattlePhase.PlayerTurn && !battle.CanAct(Retainer)))
{
Finish(); // 회복했거나 가신이 다른 행동을 함 = 안내 끝(자유 플레이)
return;
}
var gui = GuideUi;
if (gui == null) return;
float pulse = 1f + 0.06f * Mathf.Sin(clock * 6f), press = 0.5f + 0.5f * Mathf.Sin(clock * 6f);
string bar;
gui.BeginFrame();
if (!canHeal) bar = "";
else if (sk.Reserved)
{
bar = FirstFlowData.T("ff_sortie_bar_aim").Replace("{0}", Victim.DisplayName);
gui.Frame(gui.WorldRect(Victim.Position, Vector2.one * (Victim.Radius * 1.6f)), true, pulse);
}
else if (battle.Sling != null && battle.Sling.Selected == Retainer)
{
bar = FirstFlowData.T("ff_sortie_bar_skill");
DrawSkillButton(gui, pulse, press);
}
else
{
bar = FirstFlowData.T("ff_sortie_bar_select").Replace("{0}", Retainer.DisplayName);
gui.Frame(gui.WorldRect(Retainer.Position, Vector2.one * (Retainer.Radius * 1.6f)), true, pulse);
gui.Finger(gui.ToCanvas(Retainer.Position), press, 1f);
}
gui.EndFrame();
SetBar(gui, bar);
}
/// <summary>④ 안내 끝 = 자유 플레이(적을 모두 쓰러뜨리면 지금 규칙대로 승리).</summary>
void Finish()
{
ClearBar();
State = Step.Done;
}
// ---------- 안내 띠 · 말풍선 · 카드 ----------
void SetBar(TutorialGuideUI gui, string bar)
{
if (bar == lastBar) return;
lastBar = bar;
if (!barPlaced)
{
gui.PlaceBar(true); // 띠 = 화면 위쪽(아래 유닛 정보 · 스킬 설명을 가리지 않게)
barPlaced = true;
}
gui.SetBar(bar.Length > 0 ? bar : null);
}
void ClearBar()
{
var gui = GuideUi;
if (gui != null && (lastBar != null || barPlaced))
{
gui.SetBar(null);
if (barPlaced) gui.PlaceBar(false);
}
lastBar = null;
barPlaced = false;
}
static TutorialGuideUI GuideUi
{
get { return TutorialDirector.Current != null ? TutorialDirector.Current.Ui : null; }
}
static void Face(Unit u, Vector2 at)
{
if (u != null && u.View != null) u.View.SetFacing(at - u.Position);
}
static IEnumerator Wait(float sec)
{
for (float t = 0f; t < sec; t += Time.unscaledDeltaTime) yield return null;
}
IEnumerator Say(CameraController cam, Unit who, string text, Color tag)
{
if (who == null || !who.IsAlive || cam == null || uiRoot == null) yield break;
talk.Taps = 0;
yield return ScenarioUi.Say(fx, uiRoot, cam.Cam, () => who != null ? ScenarioUi.Head(who) : Vector2.zero, who.DisplayName, tag, text, talk);
}
/// <summary>안내 카드(화면을 누르면 닫힘).</summary>
IEnumerator Card(string text)
{
var gui = GuideUi;
if (gui == null || talk == null) yield break;
gui.PlaceCard(0);
gui.SetCard(text);
talk.Taps = 0;
while (talk != null && talk.Taps == 0 && Talking) yield return null;
gui.SetCard(null);
}
/// <summary>말풍선 층 + 화면 누름 받기(보스 등장 연출 BossIntro 와 같은 구성 · 대사 동안만).</summary>
void BuildUi(CameraController cam)
{
DestroyUi();
talk = new TalkState();
if (cam == null) return;
ui = new GameObject("FirstFlowSortieUI");
UiLayer.Root(ui, cam.Cam, 460, 0.38f, UiLayer.Reference, UiRate.Event);
uiRoot = (RectTransform)ui.transform;
var catcher = UiKit.Fill("Tap", uiRoot).gameObject.AddComponent<Image>();
catcher.color = new Color(0f, 0f, 0f, 0f);
catcher.raycastTarget = true;
var b = catcher.gameObject.AddComponent<Button>();
b.transition = Selectable.Transition.None;
b.onClick.AddListener(() => { if (talk != null) talk.Taps++; });
fx = UiLayer.Group("Fx", uiRoot, UiRate.Frame);
}
void DestroyUi()
{
if (ui != null) Destroy(ui);
ui = null;
uiRoot = null;
fx = null;
}
/// <summary>테스트: 화면 누름 1회(말풍선 · 안내 카드 넘김).</summary>
public void TapForTest()
{
if (talk != null) talk.Taps++;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: daa2796927e702c42a69dacb118788e0

View File

@ -0,0 +1,339 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TKS.OutGame
{
/// <summary>
/// 인트로 화면(첫 실행 흐름 · PD 2026-11-24 · 요청서 §2-7) — 두루마리 그림 장(표 first_flow_intro) + 자막 · 장마다 f_sec 초 · 터치 = 다음 장 ·
/// 건너뛰기 = 시작 뒤 잠깐 있다가 나타남(연의 연출과 같은 값 scenario_event_config skip_show_after_sec) · 마지막 장 끝 = 확대(주점 간판 쪽) → 검정 → onDone(서장 1막).
/// 다시 쓰는 것 = 두루마리 틀(UI/Scenario/parts/part_scroll_big) · 연의 자막 띠 값 · 배경음악(sound_bgm screen_IntroScreen) · 그림이 없으면 색 판 + 글자(납품 전 임시).
/// 층(P41): 루트 = Static(바탕 · 두루마리 · 안내 글) → Pic(Frame · 그림이 매 프레임 움직임) → Ui(Event · 자막 · 장 점 · 건너뛰기 = 장이 바뀔 때만) → Fade(Frame · 검정 덮개).
/// 좌표 · 크기 · 색 · 시간 = 표 first_flow_config intro_* (설계 폭 1080 × 1920 · 화면 가운데 맞춤).
/// </summary>
public class IntroScreen : MonoBehaviour
{
public static IntroScreen Current { get; private set; }
/// <summary>인트로 표가 있는가(없으면 인트로 없이 바로 1막).</summary>
public static bool CanShow
{
get { return FirstFlowData.Cfg != null && FirstFlowData.Cuts.Count > 0; }
}
class View
{
public FirstFlowData.Cut cut;
public RectTransform rt;
public CanvasGroup group;
}
Action onDone;
readonly List<View> views = new List<View>();
readonly List<Image> dots = new List<Image>();
RectTransform stage;
Vector2 picSize;
Text caption;
GameObject skipBtn;
Image fade;
Color dotOn, dotOff;
int index;
float cutT;
float total;
float openSec, skipShow;
bool ending;
float endT, endSec, endZoom, endFromAlpha;
bool finished;
/// <summary>한 프레임에 흐르는 시간의 위끝(초) — 불러오기로 멈춘 프레임이 장을 넘겨 버리지 않게.</summary>
const float MaxFrameSec = 1f / 15f;
/// <summary>지금 보이는 장(0부터 · 테스트).</summary>
public int CutIndex { get { return index; } }
public int CutCount { get { return views.Count; } }
public bool Ending { get { return ending; } }
public bool SkipShown { get { return skipBtn != null && skipBtn.activeSelf; } }
public string Caption { get { return caption != null ? caption.text : ""; } }
/// <summary>그 장이 납품 그림으로 그려졌는가(false = 색 판 + 글자 임시).</summary>
public bool HasPicture(int i) { return i >= 0 && i < views.Count && views[i].rt.GetComponent<Image>().sprite != null; }
public static IntroScreen Show(Camera cam, Action onDone)
{
if (Current != null) Destroy(Current.gameObject);
var go = new GameObject("IntroScreen");
var s = go.AddComponent<IntroScreen>();
Current = s;
s.onDone = onDone;
s.Build(cam);
SoundHooks.ScreenBgm(s); // 소리: 인트로 배경음악(sound_bgm.csv screen_IntroScreen)
return s;
}
static string[] L(string key)
{
return FirstFlowData.List(key);
}
static float At(string[] a, int i, float def)
{
return ScreenTable.At(a, i, def);
}
/// <summary>설계 화면(1080×1920 · 왼쪽 위 기준)의 칸.</summary>
static RectTransform Box(string name, Transform parent, float x, float y, float w, float h)
{
return UiKit.Rect(name, parent, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(x, -y), new Vector2(w, h));
}
void Build(Camera cam)
{
var cv = L("intro_canvas"); // 정렬 순서 | 카메라에서 거리
UiLayer.Root(gameObject, cam, (int)At(cv, 0, 860f), At(cv, 1, 0.28f), UiLayer.Reference, UiRate.Static);
var root = (RectTransform)transform;
// 바탕(화면 전체) + 누름 받기(터치 = 다음 장)
var bg = UiKit.Fill("Bg", root).gameObject.AddComponent<Image>();
bg.color = FirstFlowData.Col("intro_bg", new Color(0.1f, 0.11f, 0.14f));
bg.raycastTarget = true;
var tap = bg.gameObject.AddComponent<Button>();
tap.transition = Selectable.Transition.None;
tap.onClick.AddListener(Tap);
// 설계 칸(1080×1920 · 화면 가운데)
var design = UiKit.Rect("Design", root, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, UiLayer.Reference);
var sc = L("intro_scroll"); // 그림 | 왼 x | 위 y | 폭 | 높이
var scroll = Box("Scroll", design, At(sc, 1, 10f), At(sc, 2, 150f), At(sc, 3, 1060f), At(sc, 4, 1560f)).gameObject.AddComponent<Image>();
scroll.sprite = Resources.Load<Sprite>(ScreenTable.Str(sc, 0));
scroll.type = scroll.sprite != null ? Image.Type.Sliced : Image.Type.Simple;
if (scroll.sprite == null) scroll.color = new Color(0.95f, 0.9f, 0.78f);
scroll.raycastTarget = false;
var hint = L("intro_hint"); // 위 y | 글자 | 색
var ht = UiKit.Title(UiKit.Label(design, FirstFlowData.T("ff_intro_hint"), (int)At(hint, 1, 34f), ScreenTable.Col(hint, 2, new Color(0.6f, 0.6f, 0.65f)), TextAnchor.MiddleCenter,
new Vector2(0.5f, 1f), new Vector2(0.5f, 0.5f), new Vector2(0f, -At(hint, 0, 1790f)), new Vector2(900f, 60f)));
ht.raycastTarget = false;
// 그림 칸(가림 · 매 프레임 움직임)
var pc = L("intro_picture"); // 왼 x | 위 y | 폭 | 높이
picSize = new Vector2(At(pc, 2, 780f), At(pc, 3, 930f));
var pic = Box("Pic", design, At(pc, 0, 150f), At(pc, 1, 372f), picSize.x, picSize.y);
UiLayer.Nest(pic.gameObject, UiRate.Frame, false);
pic.gameObject.AddComponent<RectMask2D>();
var en = L("intro_end"); // 확대 배율 | 확대 중심 x | y | 시간 | 건너뛰기 페이드 시간
endZoom = Mathf.Max(1f, At(en, 0, 2.2f));
endSec = Mathf.Max(0.05f, At(en, 3, 0.9f));
var ep = new Vector2(At(en, 1, 0.8f), At(en, 2, 0.85f));
stage = UiKit.Rect("Stage", pic, Vector2.zero, ep, new Vector2(picSize.x * ep.x, picSize.y * ep.y), picSize); // 끝 확대 = 이 칸을 확대 중심 기준으로 키움
foreach (var c in FirstFlowData.Cuts) views.Add(MakeView(c));
// 자막 · 장 점 · 건너뛰기(장이 바뀔 때만 갱신)
var ui = UiLayer.Group("Ui", design, UiRate.Event, true);
var cp = L("intro_caption"); // 왼 x | 위 y | 폭 | 높이 | 글자 | 최소 글자 | 띠 색 | 글자 색
var band = Box("Caption", ui, At(cp, 0, 150f), At(cp, 1, 1314f), At(cp, 2, 780f), At(cp, 3, 150f)).gameObject.AddComponent<Image>();
band.color = ScreenTable.Col(cp, 6, new Color(0.06f, 0.06f, 0.08f, 0.9f));
band.raycastTarget = false;
caption = UiKit.Title(UiKit.FillLabel(band.transform, "", (int)At(cp, 4, 44f), ScreenTable.Col(cp, 7, new Color(1f, 0.95f, 0.85f)), TextAnchor.MiddleCenter, false, 20f));
caption.horizontalOverflow = HorizontalWrapMode.Wrap;
caption.resizeTextForBestFit = true;
caption.resizeTextMinSize = (int)At(cp, 5, 30f);
caption.resizeTextMaxSize = (int)At(cp, 4, 44f);
caption.raycastTarget = false;
var dt = L("intro_dots"); // 위 y | 크기 | 사이 | 지금 색 | 나머지 색
dotOn = ScreenTable.Col(dt, 3, new Color(0.72f, 0.26f, 0.23f));
dotOff = ScreenTable.Col(dt, 4, new Color(0.79f, 0.71f, 0.56f));
float ds = At(dt, 1, 22f), dg = At(dt, 2, 26f);
for (int i = 0; i < views.Count; i++)
{
float x = (i - (views.Count - 1) * 0.5f) * (ds + dg);
var d = UiKit.Rect("Dot" + i, ui, new Vector2(0.5f, 1f), new Vector2(0.5f, 0.5f), new Vector2(x, -At(dt, 0, 1490f)), new Vector2(ds, ds)).gameObject.AddComponent<Image>();
d.sprite = UiKit.Circle;
d.raycastTarget = false;
dots.Add(d);
}
var sk = L("intro_skip"); // 오른쪽에서 x | 위 y | 폭 | 높이 | 글자 | 나타나는 시간(빈칸 = 연의 연출과 같음)
var sb = UiKit.Rect("Skip", ui, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-At(sk, 0, 40f), -At(sk, 1, 60f)), new Vector2(At(sk, 2, 190f), At(sk, 3, 80f))).gameObject.AddComponent<Image>();
sb.color = new Color(0f, 0f, 0f, 0.6f);
sb.raycastTarget = true;
sb.gameObject.AddComponent<Button>().onClick.AddListener(Skip);
var st = UiKit.Title(UiKit.FillLabel(sb.transform, FirstFlowData.T("ff_intro_skip"), (int)At(sk, 4, 34f), Color.white));
st.raycastTarget = false;
skipBtn = sb.gameObject;
skipBtn.SetActive(false);
skipShow = sk.Length > 5 && sk[5].Trim().Length > 0 ? At(sk, 5, 0.5f) : ScenarioData.EvCfg("skip_show_after_sec");
// 검정 덮개(첫 장 = 검정에서 밝아짐 · 끝 = 검정으로)
var fl = UiLayer.Group("Fade", root, UiRate.Frame, false);
fade = UiKit.Fill("Black", fl).gameObject.AddComponent<Image>();
fade.raycastTarget = false;
openSec = Mathf.Max(0f, FirstFlowData.Num("intro_open_sec", 0.6f));
fade.color = new Color(0f, 0f, 0f, openSec > 0f ? 1f : 0f);
index = 0;
cutT = 0f;
ShowCut();
Apply();
}
View MakeView(FirstFlowData.Cut c)
{
var rt = UiKit.Rect("Cut" + c.no, stage, Vector2.zero, c.pivot, new Vector2(picSize.x * c.pivot.x, picSize.y * c.pivot.y), picSize);
var img = rt.gameObject.AddComponent<Image>();
img.raycastTarget = false;
img.sprite = c.picture.Length > 0 ? Resources.Load<Sprite>(c.picture) : null;
if (img.sprite == null)
{
// 납품 전 임시 = 색 판 + 글자
img.color = c.dummyColor;
var t = UiKit.Title(UiKit.FillLabel(rt, FirstFlowData.T(c.dummyKey), 34, new Color(1f, 1f, 1f, 0.85f), TextAnchor.MiddleCenter, false, 60f));
t.horizontalOverflow = HorizontalWrapMode.Wrap;
t.raycastTarget = false;
}
var v = new View { cut = c, rt = rt, group = rt.gameObject.AddComponent<CanvasGroup>() };
v.group.alpha = 0f;
v.group.blocksRaycasts = false;
return v;
}
/// <summary>장이 바뀜 — 자막 · 장 점.</summary>
void ShowCut()
{
if (index < views.Count) caption.text = FirstFlowData.T(views[index].cut.captionKey);
for (int i = 0; i < dots.Count; i++) dots[i].color = i == index ? dotOn : dotOff;
}
// ---------- 입력 ----------
/// <summary>화면 누름 = 다음 장(마지막 장이면 끝 연출).</summary>
public void Tap()
{
if (ending || finished) return;
Advance();
}
/// <summary>건너뛰기 = 짧은 검정 페이드 뒤 끝.</summary>
public void Skip()
{
if (ending || finished) return;
BeginEnd(Mathf.Max(0.05f, At(L("intro_end"), 4, 0.3f)), false);
}
void Advance()
{
if (index + 1 < views.Count)
{
index++;
cutT = 0f;
ShowCut();
return;
}
BeginEnd(endSec, true);
}
void BeginEnd(float sec, bool zoom)
{
ending = true;
endT = 0f;
endSec = sec;
if (!zoom) endZoom = 1f;
endFromAlpha = fade.color.a;
}
// ---------- 매 프레임 ----------
void Update()
{
if (finished) return;
// 씬 바꿈 페이드(타이틀 → 게임)가 걷히기 전에는 시간을 세지 않는다 · 씬을 불러온 직후의 긴 프레임이 첫 장을 건너뛰지 않게 한 프레임 시간을 자른다
if (SceneSwitch.Current != null) return;
float dt = Mathf.Min(Time.unscaledDeltaTime, MaxFrameSec);
total += dt;
if (!skipBtn.activeSelf && !ending && total >= skipShow) skipBtn.SetActive(true);
if (ending)
{
endT += dt;
if (skipBtn.activeSelf) skipBtn.SetActive(false);
Apply();
if (endT >= endSec) Finish();
return;
}
cutT += dt;
if (index < views.Count && cutT >= views[index].cut.sec) Advance();
Apply();
}
static float Ease(float k)
{
k = Mathf.Clamp01(k);
return k * k * (3f - 2f * k);
}
void Apply()
{
for (int i = 0; i < views.Count; i++)
{
var v = views[i];
var c = v.cut;
if (i > index)
{
if (v.group.alpha != 0f) v.group.alpha = 0f;
continue;
}
if (i < index - 1)
{
if (v.group.alpha != 0f) v.group.alpha = 0f; // 두 장 앞 = 가려져 안 보임
continue;
}
float t = i == index ? cutT : c.sec; // 앞 장 = 끝 모습 그대로(지금 장이 그 위에 나타남)
float k = c.sec > 0f ? Mathf.Clamp01(t / c.sec) : 1f;
float e = c.enterSec > 0f ? Mathf.Clamp01(t / c.enterSec) : 1f;
var home = new Vector2(picSize.x * c.pivot.x, picSize.y * c.pivot.y);
float dx = 0f, dy = picSize.y * c.rise * (k - 0.5f);
float alpha = 1f;
if (c.enter == "slide") dx = picSize.x * (1f - Ease(e));
else alpha = e;
if (c.shake > 0f && c.enterSec > 0f && t > c.enterSec)
{
float s = (t - c.enterSec) / 0.35f; // 등장이 끝난 뒤 한 번 흔들림(0.35초 동안 잦아듦)
if (s < 1f) dx += c.shake * (1f - s) * Mathf.Sin(s * Mathf.PI * 6f);
}
v.rt.anchoredPosition = home + new Vector2(dx, dy);
float sc = Mathf.Lerp(c.scaleFrom, c.scaleTo, k);
v.rt.localScale = new Vector3(sc, sc, 1f);
if (v.group.alpha != alpha) v.group.alpha = alpha;
}
float a;
if (ending)
{
float k = Ease(endT / endSec);
float z = Mathf.Lerp(1f, endZoom, k);
stage.localScale = new Vector3(z, z, 1f);
a = Mathf.Lerp(endFromAlpha, 1f, Mathf.Clamp01(endT / endSec));
}
else a = openSec > 0f ? 1f - Mathf.Clamp01(total / openSec) : 0f;
if (!Mathf.Approximately(fade.color.a, a)) fade.color = new Color(0f, 0f, 0f, a);
}
void Finish()
{
if (finished) return;
finished = true;
fade.color = Color.black;
var cb = onDone;
onDone = null;
if (Current == this) Current = null;
// 검정인 채로 다음(서장 1막 시작 연출 = 검은 화면에서 시작)을 부르고 사라짐 — 이 프레임까지는 검정이 그려진다
if (cb != null) cb();
Destroy(gameObject);
}
void OnDestroy()
{
if (Current == this) Current = null;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4bd17ea5e4ade8641b90d69592add6ec

View File

@ -14,6 +14,8 @@ namespace TKS.OutGame
public bool isNew; public bool isNew;
public bool pickup; public bool pickup;
public bool pity; public bool pity;
/// <summary>확률이 아니라 표가 정한 장(첫 실행 흐름의 첫 등용 첫 장 = gacha.csv first_pull_hero) — 뽑기 연출의 문 안 실루엣이 이 장을 먼저 고른다.</summary>
public bool fixedPick;
public int shards; public int shards;
public int gold; public int gold;
} }
@ -27,6 +29,12 @@ namespace TKS.OutGame
/// </summary> /// </summary>
public static class GachaRules public static class GachaRules
{ {
/// <summary>이번 등용의 첫 장이 표의 영웅(first_pull_hero)으로 확정되는가 — 첫 실행 흐름에 들어온 세이브의 첫 등용(누적 0회)만.</summary>
public static bool FirstPullFixed(OutGameData db, SaveData d)
{
return d.firstFlow != null && d.firstFlow.started && d.gacha.total == 0 && db.Gacha.FirstPullHero.Length > 0 && db.Heroes.Get(db.Gacha.FirstPullHero) != null;
}
public static bool FirstTenFree(OutGameData db, SaveData d) public static bool FirstTenFree(OutGameData db, SaveData d)
{ {
return db.Gacha.FreeFirstTen && !d.gacha.firstTenUsed; return db.Gacha.FreeFirstTen && !d.gacha.firstTenUsed;
@ -191,29 +199,37 @@ namespace TKS.OutGame
var res = new List<GachaPull>(); var res = new List<GachaPull>();
if (CanDraw(db, d, b, count, nowUtc) != null) return res; if (CanDraw(db, d, b, count, nowUtc) != null) return res;
var g = db.Gacha; var g = db.Gacha;
if (count == g.TenCount && FirstTenFree(db, d)) d.gacha.firstTenUsed = true; bool firstTen = count == g.TenCount && FirstTenFree(db, d);
if (firstTen) d.gacha.firstTenUsed = true;
else if (UsesFree(db, d, b, count, nowUtc)) UseFree(d, nowUtc); else if (UsesFree(db, d, b, count, nowUtc)) UseFree(d, nowUtc);
else if (UsesTickets(db, d, count)) AwakenRules.AddGoods(d, GoodsRules.Ticket, -count); // 등용권 1장 = 1회 else if (UsesTickets(db, d, count)) AwakenRules.AddGoods(d, GoodsRules.Ticket, -count); // 등용권 1장 = 1회
else d.gem -= Cost(db, d, count); else d.gem -= Cost(db, d, count);
int gearSlots = HeroRules.GearSlotCount(db); int gearSlots = HeroRules.GearSlotCount(db);
// 첫 실행 흐름(세이브 firstFlow.started)의 첫 등용(누적 0회) = 첫 장이 표의 영웅(first_pull_hero · 가신) — 나머지 장은 확률 그대로 ·
// 그 밖의 등용(흐름이 아닌 세이브 · 두 번째부터 · 키가 비어 있음) = 예전과 같은 순서로 주사위를 굴림(PD 2026-11-24 「1회 뽑기로 얻은 간옹」)
var fixedHero = FirstPullFixed(db, d) ? db.Heroes.Get(g.FirstPullHero) : null;
int fixedTier = fixedHero == null ? 0 : fixedHero.isSoldier ? 1 : Mathf.Clamp(fixedHero.rarity, 1, 3);
int lastRolled = count - 1; // ★★ 이상 보장을 거는 자리(10회의 마지막 장)
bool guaranteed = false; bool guaranteed = false;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
int n = d.gacha.PityOf(b.pityGroup) + 1; int n = d.gacha.PityOf(b.pityGroup) + 1;
int tier; int tier;
bool pity = n >= g.Pity; bool fixedPick = fixedHero != null && i == 0;
if (pity) tier = 3; bool pity = !fixedPick && n >= g.Pity;
if (fixedPick) tier = fixedTier;
else if (pity) tier = 3;
else else
{ {
double r = rng.NextDouble(); double r = rng.NextDouble();
tier = r < g.P(3) ? 3 : r < g.P(3) + g.P(2) ? 2 : 1; tier = r < g.P(3) ? 3 : r < g.P(3) + g.P(2) ? 2 : 1;
} }
if (tier >= g.TenGuaranteeRarity) guaranteed = true; if (tier >= g.TenGuaranteeRarity) guaranteed = true;
if (count == g.TenCount && i == count - 1 && !guaranteed) tier = g.TenGuaranteeRarity; if (count == g.TenCount && i == lastRolled && !guaranteed) tier = g.TenGuaranteeRarity;
d.gacha.SetPity(b.pityGroup, tier == 3 ? 0 : n); d.gacha.SetPity(b.pityGroup, tier == 3 ? 0 : n);
d.gacha.total++; d.gacha.total++;
var pull = Pick(db, b, tier, rng, pity && g.PityPickupFeatured); var pull = fixedPick ? new GachaPull { heroId = fixedHero.id, tier = tier, fixedPick = true } : Pick(db, b, tier, rng, pity && g.PityPickupFeatured);
if (pull == null) continue; if (pull == null) continue;
pull.pity = pity; pull.pity = pity;
var h = db.Heroes.Get(pull.heroId); var h = db.Heroes.Get(pull.heroId);

View File

@ -1538,6 +1538,12 @@ namespace TKS.OutGame.Net
get { return true; } get { return true; }
} }
/// <summary>첫 실행 흐름 = 기기 세이브 모드만(2026-11-24 · 서버 모드는 범위 밖 — 뽑기를 서버가 굴리고 진행 기록 자리가 없음 · 요청서 §5 확인 사항).</summary>
public override bool FirstFlowAvailable
{
get { return false; }
}
/// <summary>이벤트 = 기기 세이브 모드만(PD 2026-11-19 결정 ① · 서버가 계정 값을 덮어 기기 지급이 사라짐 · 서버 이벤트 API = 따로) → 로비 이벤트 버튼 = 준비 중.</summary> /// <summary>이벤트 = 기기 세이브 모드만(PD 2026-11-19 결정 ① · 서버가 계정 값을 덮어 기기 지급이 사라짐 · 서버 이벤트 API = 따로) → 로비 이벤트 버튼 = 준비 중.</summary>
public override bool EventAvailable public override bool EventAvailable
{ {

View File

@ -771,6 +771,12 @@ namespace TKS.OutGame
get { return true; } get { return true; }
} }
/// <summary>첫 실행 흐름(인트로 → 서장 → 본영 안내 · PD 2026-11-24)을 쓰는가 — 기기 세이브 모드만(서버 모드 = 뽑기 · 진행 기록을 서버가 정함 · 범위 밖).</summary>
public virtual bool FirstFlowAvailable
{
get { return true; }
}
/// <summary>우편 · 쿠폰을 쓸 수 있는가(서버 모드만).</summary> /// <summary>우편 · 쿠폰을 쓸 수 있는가(서버 모드만).</summary>
public virtual bool MailAvailable public virtual bool MailAvailable
{ {

View File

@ -480,6 +480,8 @@ namespace TKS.OutGame
if (d.Heroes == null || d.Heroes.Get(p.heroId) == null) e.Add(f + " 행 " + Get(r, "#") + ": hero_id 「" + p.heroId + "」 가 heroes.csv 에 없음"); if (d.Heroes == null || d.Heroes.Get(p.heroId) == null) e.Add(f + " 행 " + Get(r, "#") + ": hero_id 「" + p.heroId + "」 가 heroes.csv 에 없음");
t.pool.Add(p); t.pool.Add(p);
} }
// 첫 실행 흐름의 첫 등용 확정 영웅(first_pull_hero · 선택 키 · 비어 있으면 확정 없음) = heroes.csv 에 있어야 한다
if (t.FirstPullHero.Length > 0 && (d.Heroes == null || d.Heroes.Get(t.FirstPullHero) == null)) e.Add("gacha.csv: first_pull_hero 「" + t.FirstPullHero + "」 가 heroes.csv 에 없음");
ParseBanners(t, bannerRows, d, e); ParseBanners(t, bannerRows, d, e);
return t; return t;
} }

View File

@ -166,6 +166,22 @@ namespace TKS.OutGame
} }
} }
/// <summary>
/// 첫 실행 흐름(인트로 → 서장 1 ~ 3막 → 본영 · 등용 · 출정 1-1 · 군영 소개 · PD 2026-11-24) 진행 기록 — 기기 세이브 모드.
/// started = 이 세이브가 첫 실행 흐름에 들어갔는가(서장을 이미 끝낸 예전 세이브 = false 그대로 = 흐름 없음) · line = 끝낸 마지막 대사 줄 번호(표 first_flow_lines n_step).
/// </summary>
[Serializable]
public class FirstFlowState
{
public bool started;
[Tooltip("인트로(그림 3장)를 끝까지 봤거나 건너뜀 = 다시 나오지 않음")]
public bool intro;
[Tooltip("끝낸 마지막 대사 줄(0 = 아직 없음)")]
public int line;
[Tooltip("첫 실행 흐름이 끝남(마지막 대사까지)")]
public bool done;
}
[Serializable] [Serializable]
public class ShopItem public class ShopItem
{ {
@ -238,6 +254,8 @@ namespace TKS.OutGame
public MineState mine = new MineState(); public MineState mine = new MineState();
[Tooltip("공방 제작 대기열(PD 2026-11-24)")] [Tooltip("공방 제작 대기열(PD 2026-11-24)")]
public CraftState craft = new CraftState(); public CraftState craft = new CraftState();
[Tooltip("첫 실행 흐름 진행(인트로 · 대사 줄 · 끝 · PD 2026-11-24)")]
public FirstFlowState firstFlow = new FirstFlowState();
[Tooltip("보유 꾸미기(2026-11-20 외형 · 계정 공용 · costume_items s_id)")] [Tooltip("보유 꾸미기(2026-11-20 외형 · 계정 공용 · costume_items s_id)")]
public List<string> costumes = new List<string>(); public List<string> costumes = new List<string>();
[Tooltip("새로 얻은 꾸미기 = 「외형」 버튼 빨간 점(창을 열면 끔)")] [Tooltip("새로 얻은 꾸미기 = 「외형」 버튼 빨간 점(창을 열면 끔)")]
@ -329,9 +347,19 @@ namespace TKS.OutGame
FileOverride = null; FileOverride = null;
} }
/// <summary>에디터 시험 메뉴 「첫 실행 흐름 — 시험 세이브로 Play」가 쓰는 파일(내 save.json 은 건드리지 않음 · 빌드에서는 쓰지 않음).</summary>
public const string FirstFlowTestFile = "save_firstflow_test.json";
public static string FilePath public static string FilePath
{ {
get { return Path.Combine(Application.persistentDataPath, string.IsNullOrEmpty(FileOverride) ? FileName : FileOverride); } get
{
string name = string.IsNullOrEmpty(FileOverride) ? FileName : FileOverride;
#if UNITY_EDITOR
if (string.IsNullOrEmpty(FileOverride) && TestOptions.FirstFlowSave) name = FirstFlowTestFile;
#endif
return Path.Combine(Application.persistentDataPath, name);
}
} }
public static bool MemoryOnly public static bool MemoryOnly

View File

@ -182,7 +182,9 @@ namespace TKS.OutGame
var e = d.scenario.Get(id, true); var e = d.scenario.Get(id, true);
var st = hard ? e.hard : e.normal; var st = hard ? e.hard : e.normal;
var got = new List<string>(); var got = new List<string>();
if (!st[0]) GiveParts(db, d, b, ContentTables.Str(M, hard ? "reward_hard" : "reward_normal"), rng, got); // 서장(n_no 0) 첫 승리 = reward_prologue 꾸러미(주역 영웅 획득 · PD 2026-11-24) · 줄이 없으면 다른 편과 같은 reward_normal
bool prologue = !hard && b != null && b.I("n_no") == 0 && ContentTables.Has(M, "reward_prologue");
if (!st[0]) GiveParts(db, d, b, ContentTables.Str(M, prologue ? "reward_prologue" : hard ? "reward_hard" : "reward_normal"), rng, got);
else if (ContentTables.Str(M, "reward_hero_shard") == "always") // 다시 이겨도 주역 조각(보유 여부 무관 · 양 = 첫 승리 꾸러미의 shard) else if (ContentTables.Str(M, "reward_hero_shard") == "always") // 다시 이겨도 주역 조각(보유 여부 무관 · 양 = 첫 승리 꾸러미의 shard)
foreach (var kv in ContentTables.ParseMap(ContentTables.Str(M, hard ? "reward_hard" : "reward_normal"))) foreach (var kv in ContentTables.ParseMap(ContentTables.Str(M, hard ? "reward_hard" : "reward_normal")))
if (kv.Key == "shard") GiveShard(d, b, Mathf.RoundToInt(kv.Value), db, got); if (kv.Key == "shard") GiveShard(d, b, Mathf.RoundToInt(kv.Value), db, got);
@ -223,6 +225,7 @@ namespace TKS.OutGame
got.Add("골드 +" + n); got.Add("골드 +" + n);
} }
else if (kv.Key == "shard") GiveShard(d, b, n, db, got); else if (kv.Key == "shard") GiveShard(d, b, n, db, got);
else if (kv.Key == "hero") GiveHero(d, b, n, db, got);
else if (kv.Key.EndsWith("_chest")) else if (kv.Key.EndsWith("_chest"))
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
@ -232,6 +235,20 @@ namespace TKS.OutGame
} }
} }
/// <summary>그 편 주역(s_reward_hero) 영웅을 얻는다(★ = 태생 희귀도 · Lv 1) — 이미 보유 = 조각 n 개(GiveShard).</summary>
static void GiveHero(SaveData d, ContentRow b, int n, OutGameData db, List<string> got)
{
var def = b != null ? db.Heroes.Get(b.S("s_reward_hero")) : null;
if (def == null) return;
if (!HeroRules.Grant(db, d, def, HeroRules.GearSlotCount(db)))
{
GiveShard(d, b, n, db, got);
return;
}
UiText.Use(TextTable);
got.Add(UiText.F("scn_reward_hero", new[] { def.nameKo, new string('★', Mathf.Clamp(def.rarity, 1, 5)) }));
}
static void GiveShard(SaveData d, ContentRow b, int n, OutGameData db, List<string> got) static void GiveShard(SaveData d, ContentRow b, int n, OutGameData db, List<string> got)
{ {
if (b == null || n <= 0) return; if (b == null || n <= 0) return;

View File

@ -91,7 +91,7 @@ namespace TKS.OutGame
body = UiKit.Fill("Body", pt); body = UiKit.Fill("Body", pt);
retry = UiKit.SkinBtn(pt, "Retry", "round08", UiKit.Col("menu_btn", UiKit.Dark), "다시", 34, UiKit.White, Side, BtnY, 260f, 110f, () => root.RetryStage()); retry = UiKit.SkinBtn(pt, "Retry", "round08", UiKit.Col("menu_btn", UiKit.Dark), "다시", 34, UiKit.White, Side, BtnY, 260f, 110f, () => root.RetryStage());
retryCost = UiKit.BtnCost(retry, "cur_stamina", "", 36f, 28); // 재도전 = 군량 소모 표시(검수 결함 2) retryCost = UiKit.BtnCost(retry, "cur_stamina", "", 36f, 28); // 재도전 = 군량 소모 표시(검수 결함 2)
ok = UiKit.SkinBtn(pt, "Ok", UISkin.Has("btn_l_yellow") ? "btn_l_yellow" : "button", UISkin.Has("btn_l_yellow") ? UiKit.White : UiKit.Coin, "확인", 46, UiKit.Col("text_on_yellow", UiKit.Ink), PW - Side - 520f, BtnY, 520f, 110f, null); ok = UiKit.SkinBtn(pt, "Ok", UISkin.Has("btn_l_yellow") ? "btn_l_yellow" : "button", UISkin.Has("btn_l_yellow") ? UiKit.White : UiKit.Coin, OkText, 46, UiKit.Col("text_on_yellow", UiKit.Ink), PW - Side - 520f, BtnY, 520f, 110f, null);
} }
else else
{ {
@ -324,9 +324,19 @@ namespace TKS.OutGame
UiKit.CondRow(body, "Line" + i, Side, y, RowW, RowH, null, true, r.lines[i], 30); UiKit.CondRow(body, "Line" + i, Side, y, RowW, RowH, null, true, r.lines[i], 30);
} }
/// <summary>「확인」 버튼 글자를 바꾼다(첫 실행 흐름의 서장 패배 = 「다시 도전」 · 다음 결과를 채울 때 「확인」으로 돌아감).</summary>
public void SetOkText(string s)
{
var t = ok != null ? UiKit.LabelOf(ok) : null;
if (t != null && !string.IsNullOrEmpty(s)) t.text = s;
}
const string OkText = "확인";
/// <summary>스테이지 = 「다시」 + 「확인」 · 연무장 = 「확인」 가운데.</summary> /// <summary>스테이지 = 「다시」 + 「확인」 · 연무장 = 「확인」 가운데.</summary>
void SetButtons(bool stage) void SetButtons(bool stage)
{ {
if (ok != null && UiKit.LabelOf(ok) != null) UiKit.LabelOf(ok).text = OkText;
if (retry == null) return; if (retry == null) return;
retry.gameObject.SetActive(stage); retry.gameObject.SetActive(stage);
((RectTransform)ok.transform).anchoredPosition = new Vector2(stage ? PW - Side - 520f : (PW - 520f) * 0.5f, -BtnY); ((RectTransform)ok.transform).anchoredPosition = new Vector2(stage ? PW - Side - 520f : (PW - 520f) * 0.5f, -BtnY);

View File

@ -309,7 +309,9 @@ namespace TKS.OutGame
foreach (var p in pulls) foreach (var p in pulls)
{ {
Tier = Mathf.Max(Tier, Mathf.Clamp(p.tier, 1, 3)); Tier = Mathf.Max(Tier, Mathf.Clamp(p.tier, 1, 3));
if (Featured == null || p.tier > Featured.tier || (p.tier == Featured.tier && p.isNew && !Featured.isNew)) Featured = p; // 문 안 실루엣 = 표가 정한 장(첫 10회 무료의 가신 · GachaPull.fixedPick)이 있으면 그 장 · 없으면 가장 높은 등급(새 영웅 먼저)
if (Featured != null && Featured.fixedPick) continue;
if (Featured == null || p.fixedPick || p.tier > Featured.tier || (p.tier == Featured.tier && p.isNew && !Featured.isNew)) Featured = p;
} }
tierRow = GachaScene.Tier(Tier); tierRow = GachaScene.Tier(Tier);
timeRow = GachaScene.Time(Tier); timeRow = GachaScene.Time(Tier);

View File

@ -117,6 +117,8 @@ namespace TKS.OutGame
public MissionScreen Missions { get; private set; } public MissionScreen Missions { get; private set; }
/// <summary>공방(채굴 · 제작 · 하단 탭 5번 · PD 2026-11-24).</summary> /// <summary>공방(채굴 · 제작 · 하단 탭 5번 · PD 2026-11-24).</summary>
public WorkshopScreen Workshop { get; private set; } public WorkshopScreen Workshop { get; private set; }
/// <summary>첫 실행 흐름(인트로 → 서장 1 ~ 3막 → 본영 · 등용 · 출정 1-1 · 군영 소개 · PD 2026-11-24) — 표가 없으면 아무 일도 하지 않는다.</summary>
public FirstFlow Flow { get; private set; }
readonly List<OutGameScreen> screens = new List<OutGameScreen>(); readonly List<OutGameScreen> screens = new List<OutGameScreen>();
OutGameScreen current; OutGameScreen current;
Image workshopDot; Image workshopDot;
@ -280,6 +282,7 @@ namespace TKS.OutGame
result = new BattleResultPanel(this, (RectTransform)resultCanvas.transform); result = new BattleResultPanel(this, (RectTransform)resultCanvas.transform);
if (s != null) s.HoldResultTap = p => result.PointerOnRetry(p); if (s != null) s.HoldResultTap = p => result.PointerOnRetry(p);
mainCanvas.gameObject.SetActive(false); mainCanvas.gameObject.SetActive(false);
Flow = FirstFlow.Create(this);
} }
T Add<T>(T scr) where T : OutGameScreen T Add<T>(T scr) where T : OutGameScreen
@ -310,6 +313,13 @@ namespace TKS.OutGame
Show(Lobby); Show(Lobby);
} }
/// <summary>전투 HUD · 조작을 끄거나 켠다(첫 실행 흐름의 막 사이 검정 페이드 동안 HUD 가 다시 보이지 않게).</summary>
internal void SetBattleHud(bool on)
{
if (hud != null) hud.gameObject.SetActive(on);
if (sling != null) sling.enabled = on;
}
public void Show(OutGameScreen scr) public void Show(OutGameScreen scr)
{ {
if (hud != null) hud.gameObject.SetActive(false); if (hud != null) hud.gameObject.SetActive(false);
@ -421,7 +431,7 @@ namespace TKS.OutGame
if (current != null && ScreensVisible && !inBattle) current.OnTick(); if (current != null && ScreensVisible && !inBattle) current.OnTick();
} }
if (toast != null && Time.unscaledTime > toastUntil) toast.SetActive(false); if (toast != null && Time.unscaledTime > toastUntil) toast.SetActive(false);
if (Input.GetKeyDown(KeyCode.Escape) && !inBattle) Back(); if (Input.GetKeyDown(KeyCode.Escape) && !inBattle && !(Flow != null && Flow.Busy)) Back(); // 첫 실행 흐름의 대사 · 화면 전환 중에는 뒤로 가기를 받지 않음
#if UNITY_EDITOR #if UNITY_EDITOR
if (Input.GetKeyDown(KeyCode.F5) && inBattle) RestartPrologueAct(); if (Input.GetKeyDown(KeyCode.F5) && inBattle) RestartPrologueAct();
#endif #endif
@ -1218,14 +1228,8 @@ namespace TKS.OutGame
bool win = p == BattlePhase.StageClear; bool win = p == BattlePhase.StageClear;
if (Battle.Mode != null) if (Battle.Mode != null)
{ {
// 임무 카운터용 = 결과 계산 전 문맥(종류 · 보급전 실패 환급 판정 = 그날 입장 수가 줄었는가) SettleMode(win);
var ctx = Session.Mode; if (Flow != null) Flow.OnModeResult(result, win); // 첫 실행 흐름의 서장 패배 = 버튼 글자 「다시 도전」
string kind = ctx != null ? ctx.kind : "";
int supplyBefore = ctx != null && kind == SupplyRules.Kind ? Session.Save.dailyC.Dungeon(SupplyRules.DailyPrefix + ctx.id) : 0;
result.FillMode(Session.OnModeEnd(Battle, win)); // 서버 모드 = null — 서버 응답이 오면 ModeReady 가 채운다
bool refunded = ctx != null && kind == SupplyRules.Kind && Session.Save.dailyC.Dungeon(SupplyRules.DailyPrefix + ctx.id) < supplyBefore;
MissionRules.BattleEnd(Session.Db, Session.Save, Battle, win, kind, refunded, Session.Now, Session.Rng);
Session.Commit();
return; return;
} }
var r = Session.OnBattleEnd(Battle, win); var r = Session.OnBattleEnd(Battle, win);
@ -1234,6 +1238,24 @@ namespace TKS.OutGame
Session.Commit(); Session.Commit();
} }
/// <summary>
/// 컨텐츠 모드 전투 끝 처리 — 결과 계산(세이브 기록 · 보상) · 결과 화면 채우기 · 임무 카운터 · 저장.
/// 결과 화면을 띄우지 않는 길(첫 실행 흐름의 서장 막 승리 · FirstFlow)도 같은 처리를 하도록 따로 뺐다(보상 · 기록 = 지금 규칙 그대로).
/// </summary>
internal ModeResult SettleMode(bool win)
{
// 임무 카운터용 = 결과 계산 전 문맥(종류 · 보급전 실패 환급 판정 = 그날 입장 수가 줄었는가)
var ctx = Session.Mode;
string kind = ctx != null ? ctx.kind : "";
int supplyBefore = ctx != null && kind == SupplyRules.Kind ? Session.Save.dailyC.Dungeon(SupplyRules.DailyPrefix + ctx.id) : 0;
var r = Session.OnModeEnd(Battle, win);
result.FillMode(r); // 서버 모드 = null — 서버 응답이 오면 ModeReady 가 채운다
bool refunded = ctx != null && kind == SupplyRules.Kind && Session.Save.dailyC.Dungeon(SupplyRules.DailyPrefix + ctx.id) < supplyBefore;
MissionRules.BattleEnd(Session.Db, Session.Save, Battle, win, kind, refunded, Session.Now, Session.Rng);
Session.Commit();
return r;
}
/// <summary>결과 「다시」(#1104) — 월드맵이 있으면 같은 노드 재출전(군량 확인) · 없으면 화면 탭과 같음.</summary> /// <summary>결과 「다시」(#1104) — 월드맵이 있으면 같은 노드 재출전(군량 확인) · 없으면 화면 탭과 같음.</summary>
public void RetryStage() public void RetryStage()
{ {
@ -1252,6 +1274,12 @@ namespace TKS.OutGame
/// <summary>컨텐츠 모드 전투(규칙 포함 · 보급전 · 연의 전기 · 맹장 토벌전 · 투기장 · 2026-11-17).</summary> /// <summary>컨텐츠 모드 전투(규칙 포함 · 보급전 · 연의 전기 · 맹장 토벌전 · 투기장 · 2026-11-17).</summary>
public void StartMode(string kind, string id, int index, BalanceConfig.StageDef stage, int maxTurns, int returnPage, ModeBattleRules rules) public void StartMode(string kind, string id, int index, BalanceConfig.StageDef stage, int maxTurns, int returnPage, ModeBattleRules rules)
{
StartMode(kind, id, index, stage, maxTurns, returnPage, rules, null);
}
/// <summary>onExit = 결과 화면을 닫은 뒤 갈 곳(null = 군영 returnPage 쪽 · 첫 실행 흐름의 서장 = 그 막을 처음부터 다시).</summary>
public void StartMode(string kind, string id, int index, BalanceConfig.StageDef stage, int maxTurns, int returnPage, ModeBattleRules rules, Action onExit)
{ {
if (stage == null) if (stage == null)
{ {
@ -1268,11 +1296,11 @@ namespace TKS.OutGame
Battle.StartMode(new BattleMode Battle.StartMode(new BattleMode
{ {
kind = kind, stage = stage, maxTurns = maxTurns, rules = rules, kind = kind, stage = stage, maxTurns = maxTurns, rules = rules,
onExit = () => onExit = onExit ?? (() =>
{ {
Show(Arena); Show(Arena);
Arena.SetPage(returnPage); Arena.SetPage(returnPage);
}, }),
}); });
} }
} }

View File

@ -451,6 +451,13 @@ namespace TKS
SetPhase(BattlePhase.Setup); SetPhase(BattlePhase.Setup);
} }
/// <summary>결과 화면 없이 모드 전투를 끝낸다(첫 실행 흐름의 서장 마지막 막 → 본영 · 판 · 연출을 치우고 Setup 단계).</summary>
public void LeaveMode()
{
Mode = null;
GoIdle();
}
public void ContinueAfterResult() public void ContinueAfterResult()
{ {
if (Mode != null && (Phase == BattlePhase.StageClear || Phase == BattlePhase.Defeat)) if (Mode != null && (Phase == BattlePhase.StageClear || Phase == BattlePhase.Defeat))

View File

@ -39,6 +39,17 @@ namespace TKS
get { return Act; } get { return Act; }
} }
/// <summary>
/// 승리 연출이 끝난 뒤 결과 화면 대신 부르는 것(첫 실행 흐름 = 막 기록 → 검정 페이드 → 다음 막 · 마지막 막 = 본영 · PD 2026-11-24 「결과 화면 없이 자연스럽게 2막이 시작」)
/// — true 를 돌려주면 결과 화면을 띄우지 않는다 · null = 연의 전기 화면에서 연 서장(막 승리 = 결과 화면 · 지금 그대로).
/// </summary>
public System.Func<bool> WinContinue;
public override bool NextActOnWin()
{
return WinContinue != null && WinContinue();
}
/// <summary>마지막 막인가(이기면 편 완료 · 보상).</summary> /// <summary>마지막 막인가(이기면 편 완료 · 보상).</summary>
public bool LastAct public bool LastAct
{ {

View File

@ -88,7 +88,11 @@ namespace TKS
if (!AutoStart) return; if (!AutoStart) return;
// 시작 흐름(PD 2026-11-16 「타이틀 화면은 별도의 씬」): 스플래시(회사 CI) → CDN 확인·받기 → 타이틀 = Splash·Title 씬(OutGame/Boot/SplashBoot · TitleSceneBoot) // 시작 흐름(PD 2026-11-16 「타이틀 화면은 별도의 씬」): 스플래시(회사 CI) → CDN 확인·받기 → 타이틀 = Splash·Title 씬(OutGame/Boot/SplashBoot · TitleSceneBoot)
// 이 Battle 씬은 타이틀 누름 뒤(또는 에디터에서 이 씬을 바로 Play) = 바로 본영 로비 // 이 Battle 씬은 타이틀 누름 뒤(또는 에디터에서 이 씬을 바로 Play) = 바로 본영 로비
if (StartOnLobby && WorldMap.HasData) OutGame.ShowLobby(); // 첫 실행(서장을 끝내지 않은 새 세이브 · 기기 세이브 모드 · PD 2026-11-24) = 로비 대신 인트로 → 서장 1막(연의 전기 화면을 거치지 않음 · OutGame/FirstFlow)
if (StartOnLobby && WorldMap.HasData)
{
if (OutGame.Flow == null || !OutGame.Flow.BootBegin()) OutGame.ShowLobby();
}
else Battle.StartStage(StartStageIndex); else Battle.StartStage(StartStageIndex);
} }

View File

@ -315,6 +315,9 @@ namespace TKS
public static string CurrentId = ""; public static string CurrentId = "";
public static int CurrentOrder; public static int CurrentOrder;
/// <summary>마지막으로 끝난 연출의 끝 화면이 검정이었는가(끝 줄이 fade out) — 첫 실행 흐름이 막 사이 검정 페이드를 끊김 없이 이어 받는다.</summary>
public static bool EndedBlack { get; private set; }
/// <summary>테스트·캡처: 화면 누름 1회.</summary> /// <summary>테스트·캡처: 화면 누름 1회.</summary>
public static void TapForTest() public static void TapForTest()
{ {
@ -407,6 +410,7 @@ namespace TKS
} }
CurrentOrder = int.MaxValue; CurrentOrder = int.MaxValue;
yield return Return(); yield return Return();
EndedBlack = fade != null && fade.color.a > 0.5f;
Cleanup(true); Cleanup(true);
var done = onDone; var done = onDone;
onDone = null; onDone = null;

View File

@ -15,6 +15,7 @@ namespace TKS
public const string KeyStandardSpec = "TKS_TEST_STD_SPEC"; public const string KeyStandardSpec = "TKS_TEST_STD_SPEC";
public const string KeyLineup = "TKS_TEST_LINEUP"; public const string KeyLineup = "TKS_TEST_LINEUP";
public const string KeyAimMode = "TKS_TEST_AIM_MODE"; public const string KeyAimMode = "TKS_TEST_AIM_MODE";
public const string KeyFirstFlowSave = "TKS_TEST_FIRSTFLOW_SAVE";
public static bool UnlockAllStages public static bool UnlockAllStages
{ {
@ -28,6 +29,16 @@ namespace TKS
set { PlayerPrefs.SetInt(KeyStandardSpec, value ? 1 : 0); PlayerPrefs.Save(); } set { PlayerPrefs.SetInt(KeyStandardSpec, value ? 1 : 0); PlayerPrefs.Save(); }
} }
/// <summary>
/// 첫 실행 흐름 시험 세이브(2026-11-24) — 켜면 에디터 Play 가 내 세이브(save.json) 대신 따로 둔 시험 세이브 파일(SaveStore.FirstFlowTestFile)을 쓴다
/// = 새 유저의 첫 실행 흐름(인트로 → 서장 → 본영 안내)을 내 세이브를 지우지 않고 본다 · 끄면 다시 내 세이브.
/// </summary>
public static bool FirstFlowSave
{
get { return PlayerPrefs.GetInt(KeyFirstFlowSave, 0) == 1; }
set { PlayerPrefs.SetInt(KeyFirstFlowSave, value ? 1 : 0); PlayerPrefs.Save(); }
}
/// <summary>기준 편성 영웅 id(; 로 · 비면 내 편성).</summary> /// <summary>기준 편성 영웅 id(; 로 · 비면 내 편성).</summary>
public static string LineupIds public static string LineupIds
{ {

View File

@ -0,0 +1,725 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using TKS.OutGame;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
namespace TKS.Tests
{
/// <summary>
/// 첫 실행 흐름(PD 2026-11-24 「최초 게임 실행 시 게임 Flow」 · 요청서 §4 + 2차 지시) — 새 세이브(영웅 없음): 인트로 → 서장 1 → 2막(결과 화면 없음) → 3막 = 결과 화면(유비 획득) →
/// 본영(유비만 편성) + 대사 → 「등용」 → 「1회 등용」(무료 · 첫 장 = 가신) → 편성 안내(가신을 세움) → 「출정」 → 1-1: 스킬 튜토리얼(적 대사 → 유비 스킬 → 모인 적 일격 → 가신 회복) → 자유 플레이 → 승리 → 군영 소개(장소 포커스) → 끝 기록.
/// 서장을 끝낸 세이브 = 로비 · 메모리 세이브 = 건너뜀 · 도중 종료 뒤 이어서 · 첫 등용을 이미 한 세이브 · 튜토리얼 조건이 안 맞는 판.
/// 흐름은 메모리 세이브에서 꺼져 있다 → 여기서만 FirstFlow.ForceOn(연출 · 학습 판도 ForceOn). 값(영웅 · 배너 · 줄 · 문구)은 표에서 읽는다(C45).
/// </summary>
public class FirstFlowTests
{
static readonly DateTime T0 = new DateTime(2026, 11, 24, 3, 0, 0, DateTimeKind.Utc);
OutGameRoot og;
BattleManager bm;
static OutGameData Db { get { return OutGameData.Default; } }
static BalanceConfig Cfg { get { return Resources.Load<BalanceConfig>("BalanceConfig"); } }
static string PrologueId { get { return FirstFlowData.Str("prologue_battle"); } }
static int PrologueActs { get { return ContentTables.Find("scenario_battles", "s_id", PrologueId).I("n_acts"); } }
static string Retainer { get { return Db.Gacha.FirstPullHero; } }
static string Victim { get { return ContentTables.Find("scenario_battles", "s_id", PrologueId).S("s_reward_hero"); } }
[SetUp]
public void SetUp()
{
WorldProgress.Reset();
FirstFlowData.Reload();
}
[UnityTearDown]
public IEnumerator TearDown()
{
ScenarioEvent.Abort();
FirstFlow.ForceOn = false;
TutorialRules.Mode = TutorialMode.Auto;
ScenarioEvent.Mode = TutorialMode.Auto;
Time.timeScale = 1f;
if (IntroScreen.Current != null) UnityEngine.Object.Destroy(IntroScreen.Current.gameObject);
yield return null;
}
/// <summary>Battle 씬을 연다 — fresh = 새 메모리 세이브 · false = 앞에서 쓴 메모리 세이브 그대로(앱을 껐다 켠 것) · flow = 첫 실행 흐름을 켬.</summary>
IEnumerator Boot(bool fresh, bool flow)
{
SaveStore.UseMemory(fresh);
FirstFlow.ForceOn = flow;
TutorialRules.Mode = TutorialMode.ForceOn;
ScenarioEvent.Mode = TutorialMode.ForceOn;
SceneManager.LoadScene("Battle");
yield return null;
yield return null;
og = OutGameRoot.Instance;
bm = BattleManager.Instance;
Assert.IsNotNull(og);
Assert.IsNotNull(bm);
Time.timeScale = 1f;
}
SaveData Save { get { return og.Session.Save; } }
PrologueRules Rules { get { return bm.Mode != null ? bm.Mode.rules as PrologueRules : null; } }
static IEnumerator Until(Func<bool> cond, float timeout, string what)
{
float t0 = Time.realtimeSinceStartup;
while (!cond() && Time.realtimeSinceStartup - t0 < timeout) yield return null;
Assert.IsTrue(cond(), what + " — " + timeout + "초 안에 되지 않음");
}
/// <summary>서장을 모두 이긴 세이브로(연의 규칙 그대로 · 보상 포함).</summary>
void ClearPrologue()
{
var s = og.Session;
for (int a = 1; a <= PrologueActs; a++) ScenarioModeRules.ActResult(s.Db, s.Save, PrologueId, a, PrologueActs, true, new List<string>(), s.Now, new System.Random(1));
}
/// <summary>서장을 끝낸 흐름 세이브(line 줄까지 끝남)로 다시 켠다.</summary>
IEnumerator BootAtLine(int line, Action<SaveData> more = null)
{
yield return Boot(true, false);
ClearPrologue();
Save.firstFlow.started = true;
Save.firstFlow.intro = true;
Save.firstFlow.line = line;
if (more != null) more(Save);
og.Session.Commit();
yield return Boot(false, true);
}
IEnumerator UntilLine(int step, float timeout = 6f)
{
Func<bool> on = () => og.Flow.Current != null && og.Flow.Current.step == step && og.Flow.Guide != null && og.Flow.Guide.Shown;
float t0 = Time.realtimeSinceStartup;
while (!on() && Time.realtimeSinceStartup - t0 < timeout) yield return null;
Assert.IsTrue(on(), "대사 줄 " + step + " — " + timeout + "초 안에 뜨지 않음 · " + og.Flow.DebugState());
}
/// <summary>대사 넘김 = 누름 2번(한 글자씩 나오는 중이면 전부 표시 → 다음).</summary>
IEnumerator TapLine()
{
og.Flow.TapForTest();
og.Flow.TapForTest();
yield return null;
yield return null;
}
IEnumerator UntilPlayerTurn(float timeout = 12f)
{
float t0 = Time.realtimeSinceStartup;
while ((bm.Phase != BattlePhase.PlayerTurn || ScenarioEvent.Running) && Time.realtimeSinceStartup - t0 < timeout)
{
if (ScenarioEvent.Running) ScenarioEvent.SkipForTest();
yield return null;
}
Assert.AreEqual(BattlePhase.PlayerTurn, bm.Phase, "아군 차례");
}
void KillEnemies()
{
foreach (var e in bm.AliveUnits(Faction.Enemy)) e.TakeDamage(e.MaxHp * 10);
bm.CheckBattleEnd();
}
/// <summary>지금 막: 시작 연출을 건너뛰고 적을 모두 쓰러뜨린 뒤 승리 연출을 건너뜀 — 마지막 막이 아니면 결과 화면 없이 다음 막 · 마지막 막 = 결과 화면.</summary>
IEnumerator WinAct(int act)
{
yield return Until(() => Rules != null && Rules.Act == act, 6f, act + "막 시작");
Assert.IsNotNull(Rules.WinContinue, "첫 실행 흐름이 연 막");
yield return UntilPlayerTurn();
Assert.IsFalse(og.ScreensVisible, "연의 전기 화면을 거치지 않음");
KillEnemies();
yield return null;
var was = Rules;
bool last = was.LastAct;
float t0 = Time.realtimeSinceStartup;
while (Time.realtimeSinceStartup - t0 < 12f)
{
if (ScenarioEvent.Running) ScenarioEvent.SkipForTest();
if (!last)
{
Assert.IsFalse(og.ResultVisible, act + "막 승리 뒤 결과 화면이 뜸");
Assert.AreNotEqual(BattlePhase.StageClear, bm.Phase, act + "막 승리 = 결과 단계로 가지 않음");
if (Rules != was) break; // 다음 막이 놓임
}
else if (bm.Phase == BattlePhase.StageClear && og.ResultVisible) break; // 마지막 막 = 결과 화면(서장 보상 알림)
yield return null;
}
}
// ---------- 표 · 규칙 ----------
[Test]
public void Tables_NoErrors_RetainerIsFirstPullHero()
{
var errors = FirstFlowData.Check(Db, Cfg);
Assert.AreEqual(0, errors.Count, string.Join("\n", errors.ToArray()));
Assert.Greater(Retainer.Length, 0, "gacha.csv first_pull_hero");
Assert.IsNotNull(Db.Heroes.Get(Retainer), "가신이 heroes.csv 에 있음");
Assert.IsNotNull(Db.Heroes.Get(Victim), "서장 보상 영웅이 heroes.csv 에 있음");
Assert.AreEqual(FirstFlowData.LastStep, FirstFlowData.Lines.Count, "줄 번호 = 1부터 차례");
Assert.IsFalse(Db.Gacha.FreeFirstTen, "첫 10회 무료 없음(PD 2026-11-24 「뽑기는 1회만 무료」)");
}
/// <summary>첫 실행 흐름 세이브의 첫 등용 = 첫 장이 표의 영웅(무료 = 상시 배너의 오늘 무료 1회) · 두 번째부터 · 흐름이 아닌 세이브 = 확률 그대로(같은 씨앗이면 같은 결과).</summary>
[Test]
public void FirstPull_FixedHero_OnlyInFlowSave()
{
var g = Db.Gacha;
var b = g.Get(FirstFlowData.Arg(FirstFlowData.LineOf(5).onShow, FirstFlowData.OnShowBanner));
Assert.IsNotNull(b, "줄 5 가 고르는 등용 배너");
const int Seed = 1147;
var d = HeroRules.NewSave(Db, Cfg.playerSpawnPoints.Length, T0);
d.heroes.Clear();
d.firstFlow.started = true;
int gem = d.gem;
Assert.IsTrue(GachaRules.UsesFree(Db, d, b, 1, T0), "첫 1회 = 무료(상시 배너 오늘 무료)");
var one = GachaRules.Draw(Db, d, b, 1, new System.Random(Seed), T0);
Assert.AreEqual(1, one.Count);
Assert.AreEqual(Retainer, one[0].heroId, "첫 장 = 가신");
Assert.IsTrue(one[0].fixedPick);
Assert.IsTrue(one[0].isNew);
Assert.AreEqual(gem, d.gem, "무료");
Assert.IsFalse(GachaRules.UsesFree(Db, d, b, 1, T0), "무료는 1회만");
d.gem = g.CostSingle;
Assert.IsFalse(GachaRules.Draw(Db, d, b, 1, new System.Random(Seed), T0)[0].fixedPick, "두 번째 등용 = 확정 없음");
// 흐름이 아닌 세이브 = 확정 없음 · 키를 지운 표와 같은 결과(예전 규칙 그대로)
var plain = HeroRules.NewSave(Db, Cfg.playerSpawnPoints.Length, T0);
var a = GachaRules.Draw(Db, plain, b, 1, new System.Random(Seed), T0);
Assert.IsFalse(a[0].fixedPick);
var entries = g.values.entries;
var entry = entries.Find(x => x.key == "first_pull_hero");
Assert.IsNotNull(entry);
entries.Remove(entry);
try
{
var flow = HeroRules.NewSave(Db, Cfg.playerSpawnPoints.Length, T0);
flow.firstFlow.started = true;
var c = GachaRules.Draw(Db, flow, b, 1, new System.Random(Seed), T0);
Assert.AreEqual(a[0].heroId, c[0].heroId, "키 없음 = 확률 그대로");
Assert.IsFalse(c[0].fixedPick);
}
finally
{
entries.Add(entry);
}
}
// ---------- 새 세이브 = 전체 흐름 ----------
[UnityTest]
public IEnumerator NewSave_FullFlow()
{
yield return Boot(true, true);
var flow = og.Flow;
Assert.IsTrue(flow.Active, "새 세이브 = 첫 실행 흐름");
Assert.AreEqual(0, Save.heroes.Count, "새 유저 = 영웅 없음(서장 보상 · 등용으로 얻음)");
Assert.IsNotNull(IntroScreen.Current, "타이틀 뒤 = 인트로");
Assert.IsFalse(og.LobbyVisible, "로비를 띄우지 않음");
IntroScreen.Current.Tap();
Assert.AreEqual(1, IntroScreen.Current.CutIndex, "터치 = 다음 장");
IntroScreen.Current.Skip();
yield return Until(() => IntroScreen.Current == null, 3f, "인트로 끝");
Assert.IsTrue(Save.firstFlow.intro);
// 서장: 1 → 2막 = 결과 화면 없이 이어짐 · 3막 = 결과 화면(유비 획득) → 닫으면 본영(유비만 편성)
for (int act = 1; act <= PrologueActs; act++) yield return WinAct(act);
Assert.AreEqual(BattlePhase.StageClear, bm.Phase, "마지막 막 = 결과 화면");
Assert.IsTrue(og.ResultVisible);
Assert.IsTrue(Save.Owns(Victim), "서장 보상 = 영웅 획득");
Assert.AreEqual(Db.Heroes.Get(Victim).rarity, Save.Hero(Victim).star, "별 = 태생 희귀도");
Assert.AreEqual(1, Save.heroes.Count);
Assert.IsTrue(og.Session.LastMode.lines.Exists(x => x.Contains(Db.Heroes.Get(Victim).nameKo)), "결과 화면에 획득 알림");
bm.ContinueAfterResult();
yield return Until(() => og.LobbyVisible, 3f, "결과 화면을 닫으면 본영 로비");
var slots = Save.ActivePreset.slots;
Assert.AreEqual(Victim, slots[0], "로비 = 유비만 배치");
Assert.AreEqual(1, slots.FindAll(x => !string.IsNullOrEmpty(x)).Count);
// 줄 1 ~ 3 = 여인의 인사 · 줄 4 = 「등용」 · 줄 5 = 「1회 등용」(무료 · 가신)
yield return UntilLine(1);
Assert.AreEqual(FirstFlowData.Talk, flow.Guide.Mode);
Assert.AreEqual(FirstFlowData.T("ff_name_helper"), flow.Guide.SpeakerName);
Assert.IsTrue(flow.Guide.PortraitShown);
for (int n = 1; n <= 3; n++)
{
yield return UntilLine(n);
yield return TapLine();
}
yield return UntilLine(4);
Assert.AreEqual(FirstFlowData.Press, flow.Guide.Mode);
Assert.IsTrue(flow.Guide.FingerShown);
yield return TapLine();
Assert.AreEqual(4, flow.Current.step, "누르기 줄 = 화면을 눌러도 넘어가지 않음");
Assert.IsTrue(flow.PressTargetForTest());
Assert.AreEqual(og.Trade, og.Current, "명장 등용 화면");
yield return UntilLine(5);
Assert.AreEqual(FirstFlowData.Arg(FirstFlowData.LineOf(5).onShow, FirstFlowData.OnShowBanner), og.Trade.Banner.id, "표가 정한 등용 쪽");
int gem = Save.gem;
Assert.IsTrue(flow.PressTargetForTest());
Assert.AreEqual(1, og.Trade.LastPulls.Count, "1회 등용");
Assert.AreEqual(Retainer, og.Trade.LastPulls[0].heroId, "가신 확정");
Assert.AreEqual(gem, Save.gem, "무료");
Assert.IsTrue(Save.Owns(Retainer));
Assert.AreEqual(2, Save.heroes.Count, "보유 = 유비 + 가신");
Assert.AreEqual(5, Save.firstFlow.line);
yield return null;
yield return null;
Assert.IsNull(flow.Current, "뽑기 연출 동안 대사 없음");
og.Trade.RevealAll();
og.Trade.CloseResult();
// 줄 6 = 가신의 한마디 · 줄 7 = 편성 안내 → 본영 · 줄 8 = 「편성」 · 줄 9 = 가신 카드(세우고 저장) · 줄 10 = 여인(PD 원문) → 본영 · 줄 11 = 「출정」
yield return UntilLine(6);
Assert.AreEqual(Db.Heroes.Get(Retainer).nameKo, flow.Guide.SpeakerName);
yield return TapLine();
yield return UntilLine(7);
yield return TapLine();
yield return UntilLine(8);
Assert.IsTrue(og.LobbyVisible);
Assert.IsTrue(flow.PressTargetForTest());
Assert.AreEqual(og.Formation, og.Current, "편성 화면");
yield return UntilLine(9);
Assert.IsFalse(Save.ActivePreset.slots.Contains(Retainer));
Assert.IsTrue(flow.PressTargetForTest());
Assert.IsTrue(Save.ActivePreset.slots.Contains(Retainer), "가신을 세운 편성이 저장됨");
Assert.IsTrue(Save.ActivePreset.slots.Contains(Victim));
yield return UntilLine(10);
yield return TapLine();
yield return UntilLine(11);
Assert.IsTrue(og.LobbyVisible, "대사 뒤 스스로 본영 로비");
Assert.IsTrue(flow.PressTargetForTest());
Assert.IsTrue(og.Map.IsVisible, "월드맵");
// 출정 1-1(유비 + 가신) — 스킬 튜토리얼: 적 대사 → 유비 스킬 안내 → 모인 적 일격(유비 체력 50 %) → 가신 대사 · 회복 안내 → 자유 플레이 → 승리
int ch, st;
Assert.IsTrue(FirstFlowData.ParseStage(FirstFlowData.Str("sortie_stage"), out ch, out st));
og.Map.Show(ch - 1);
og.Map.OpenPopup(st - 1);
og.Map.ConfirmPopup();
yield return null;
var so = flow.Sortie;
Assert.AreEqual(FirstFlowSortie.Step.Intro, so.State, "그 스테이지 첫 진입 = 튜토리얼");
Assert.AreEqual(FirstFlowData.List("sortie_cluster").Length, so.Cluster.Count, "적 셋을 유비 앞에 모아 놓음");
Assert.AreEqual(2, bm.AliveUnits(Faction.Player).Count, "출전 = 유비 + 가신");
float t0 = Time.realtimeSinceStartup;
while (so.State != FirstFlowSortie.Step.SkillGuide && Time.realtimeSinceStartup - t0 < 20f)
{
so.TapForTest(); // 말풍선 · 안내 카드 넘김
yield return null;
}
Assert.AreEqual(FirstFlowSortie.Step.SkillGuide, so.State, "대사 뒤 유비 스킬 안내");
Assert.AreEqual(BattlePhase.PlayerTurn, bm.Phase);
var victim = so.Victim;
var retainer = so.Retainer;
Assert.AreEqual(Victim, victim.HeroId);
Assert.AreEqual(Retainer, retainer.HeroId);
yield return null;
Assert.AreEqual(FirstFlowData.T("ff_sortie_bar_skill"), so.Bar, "유비가 골라진 채 = 스킬 버튼 안내");
bm.Skills.TapActive(victim);
Assert.IsTrue(bm.Skills.Of(victim).Reserved, "유비 스킬");
yield return null;
Assert.AreEqual(FirstFlowData.T("ff_sortie_bar_attack"), so.Bar);
int foes = bm.AliveUnits(Faction.Enemy).Count, group = so.Cluster.Count;
yield return bm.ResolveForTest(victim, so.Cluster[1].Position, false, new ActionOutcome());
yield return new WaitForSeconds(0.3f);
Assert.AreEqual(foes - group, bm.AliveUnits(Faction.Enemy).Count, "모여 있던 적 = 한 번에 쓰러짐");
Assert.AreEqual(Mathf.Max(1, Mathf.RoundToInt(victim.MaxHp * FirstFlowData.Num("sortie_hp_pct"))), victim.Hp, "유비 체력 = 표의 비율");
t0 = Time.realtimeSinceStartup;
while (so.State != FirstFlowSortie.Step.HealGuide && Time.realtimeSinceStartup - t0 < 20f)
{
so.TapForTest(); // 가신 대사 · 안내 카드 넘김
yield return null;
}
Assert.AreEqual(FirstFlowSortie.Step.HealGuide, so.State, "가신 대사 뒤 회복 안내");
Assert.AreEqual(BattlePhase.PlayerTurn, bm.Phase);
Assert.IsTrue(bm.CanAct(retainer), "가신 행동 가능");
int half = victim.Hp;
yield return null;
Assert.AreEqual(FirstFlowData.T("ff_sortie_bar_skill"), so.Bar, "가신이 골라진 채 = 스킬 버튼 안내");
bm.Skills.TapActive(retainer);
Assert.IsTrue(bm.Skills.Of(retainer).Reserved, "가신 스킬");
yield return null;
Assert.AreEqual(FirstFlowData.T("ff_sortie_bar_aim").Replace("{0}", victim.DisplayName), so.Bar);
yield return bm.ResolveForTest(retainer, victim.Position, false, new ActionOutcome());
yield return new WaitForSeconds(0.3f);
Assert.Greater(victim.Hp, half, "가신의 스킬 = 아군 회복");
Assert.AreEqual(FirstFlowSortie.Step.Done, so.State, "안내 끝 = 자유 플레이");
Assert.AreEqual("", so.Bar);
Assert.Greater(bm.AliveUnits(Faction.Enemy).Count, 0, "남은 적 = 유저가 섬멸");
KillEnemies();
yield return Until(() => bm.Phase == BattlePhase.StageClear && og.ResultVisible, 8f, "섬멸 = 승리 · 결과 화면");
Assert.AreEqual(1, Save.Stage(ch, st, false).clears);
bm.ContinueAfterResult();
// 줄 12 = 가신의 진언 → 본영 · 줄 13 = 「군영」 · 줄 14 ~ 20 = 군영 소개(장소로 화면을 옮겨 가리킴)
yield return UntilLine(12);
Assert.AreEqual(Db.Heroes.Get(Retainer).nameKo, flow.Guide.SpeakerName);
yield return TapLine();
yield return UntilLine(13);
Assert.IsTrue(og.LobbyVisible);
Assert.IsTrue(flow.PressTargetForTest());
Assert.AreEqual(og.Arena, og.Current, "군영 화면");
for (int n = 14; n <= FirstFlowData.LastStep; n++)
{
yield return UntilLine(n);
var l = FirstFlowData.LineOf(n);
Assert.AreEqual(l.mode, flow.Guide.Mode, "줄 " + n + " 방식");
if (l.mode == FirstFlowData.Point)
{
Assert.IsNotNull(flow.Guide.Hole, "줄 " + n + " 장소만 밝게");
Assert.IsFalse(flow.PressTargetForTest(), "가리키기 = 누르게 하지 않음");
Assert.IsFalse(og.Arena.Hub.Fitter.Focusing, "화면이 옮겨 간 뒤 가리킴");
// 밝게 남긴 칸 = 화면을 옮긴 뒤의 그 장소 자리(장소 가운데가 화면 안 · 칸 안)
yield return null;
string spot = FirstFlowData.Arg(l.onShow, FirstFlowData.OnShowFocus);
Assert.IsNotNull(spot, "줄 " + n + " 장소 포커스");
RectTransform press = null;
foreach (var rt in og.Arena.Rt.GetComponentsInChildren<RectTransform>(false))
if (rt.name == "Press_" + spot) press = rt;
Assert.IsNotNull(press);
var groot = (RectTransform)flow.Guide.transform;
var c = RectTransformUtility.CalculateRelativeRectTransformBounds(groot, press).center;
Assert.IsTrue(flow.Guide.Hole.Value.Contains(new Vector2(c.x, c.y)), "줄 " + n + " 밝은 칸이 그 장소 위");
Assert.IsTrue(groot.rect.Contains(new Vector2(c.x, c.y)), "줄 " + n + " 장소가 화면 안");
}
yield return TapLine();
}
yield return Until(() => Save.firstFlow.done, 3f, "끝 기록");
Assert.IsFalse(flow.Active);
Assert.IsFalse(flow.Guide.Shown);
}
// ---------- 흐름에 들어가지 않는 세이브 ----------
[UnityTest]
public IEnumerator MemorySave_SkipsFlow_LobbyInTwoFrames_KeepsStartHeroes()
{
yield return Boot(true, false);
Assert.IsTrue(og.LobbyVisible, "메모리 세이브 = 지금처럼 로비");
Assert.IsNull(IntroScreen.Current);
Assert.IsFalse(og.Flow.Available);
Assert.IsFalse(Save.firstFlow.started);
Assert.AreEqual(og.Session.Db.Economy.StartHeroes.Length, Save.heroes.Count, "흐름이 아닌 새 세이브 = 시작 영웅 그대로");
}
[UnityTest]
public IEnumerator PrologueDoneSave_GoesLobby_NoFlow()
{
yield return Boot(true, false);
ClearPrologue();
og.Session.Commit();
yield return Boot(false, true);
Assert.IsTrue(og.LobbyVisible, "서장을 끝낸 세이브 = 로비");
Assert.IsNull(IntroScreen.Current);
Assert.IsFalse(og.Flow.Active, "흐름에 들어가지 않음");
Assert.IsFalse(Save.firstFlow.started);
yield return new WaitForSecondsRealtime(1.2f);
Assert.IsTrue(og.Flow.Guide == null || !og.Flow.Guide.Shown, "대사 없음");
}
// ---------- 도중 종료 뒤 이어서 ----------
[UnityTest]
public IEnumerator Resume_MidPrologue_NextUnwonAct_NoIntroAgain()
{
yield return Boot(true, true);
IntroScreen.Current.Skip();
yield return Until(() => IntroScreen.Current == null && Rules != null, 3f, "1막 시작");
Assert.AreEqual(1, Rules.Act);
yield return Boot(false, true); // 1막 도중에 끔 → 다시 켬
Assert.IsNull(IntroScreen.Current, "인트로는 다시 나오지 않음");
Assert.AreEqual(1, Rules.Act, "아직 이기지 못한 첫 막");
Assert.AreEqual(0, Save.heroes.Count, "영웅 없음 그대로");
yield return WinAct(1);
yield return Until(() => Rules != null && Rules.Act == 2 && !og.Flow.Switching, 6f, "2막");
yield return Boot(false, true); // 2막 도중에 끔 → 다시 켬
Assert.IsNull(IntroScreen.Current);
Assert.AreEqual(2, Rules.Act);
}
[UnityTest]
public IEnumerator Resume_Lines_NextLine_GateLine_WaitForStage()
{
yield return BootAtLine(2);
Assert.IsTrue(og.LobbyVisible);
yield return UntilLine(3);
// 줄 5(명장 등용 화면)가 남은 채 본영 로비 = 그 화면으로 이끄는 줄(n_gate)을 다시 보여 줌 · 기록은 그대로
var l5 = FirstFlowData.LineOf(5);
Save.firstFlow.line = 4;
og.Session.Commit();
yield return Boot(false, true);
yield return UntilLine(l5.gate);
Assert.AreEqual(4, Save.firstFlow.line);
Assert.IsTrue(og.Flow.PressTargetForTest());
yield return UntilLine(5);
Assert.AreEqual(4, Save.firstFlow.line, "다시 보여 준 줄은 기록을 바꾸지 않음");
// 1-1 을 이긴 뒤에만 나오는 줄(s_wait)
var waitLine = FirstFlowData.Lines.Find(x => x.wait.Length > 0);
int ch, st;
FirstFlowData.ParseStage(FirstFlowData.Arg(waitLine.wait, FirstFlowData.WaitStageClear), out ch, out st);
Save.firstFlow.line = waitLine.step - 1;
og.Session.Commit();
yield return Boot(false, true);
yield return new WaitForSecondsRealtime(1.2f);
Assert.IsNull(og.Flow.Current, "1-1 을 이기기 전 = 대사 없음(여인의 배웅을 다시 하지 않음)");
Save.Stage(ch, st, true).clears = 1;
yield return UntilLine(waitLine.step);
}
/// <summary>첫 등용을 이미 한 세이브 = 등용 줄을 건너뜀 · 가신이 이미 편성에 있는 세이브 = 편성 안내 줄을 건너뜀.</summary>
[UnityTest]
public IEnumerator Skips_FirstPullDone_RetainerPlaced()
{
var l4 = FirstFlowData.LineOf(4);
yield return BootAtLine(3, d => d.gacha.total = 1);
yield return UntilLine(l4.skipTo);
Assert.IsTrue(og.LobbyVisible, "등용 화면으로 보내지 않음");
var l7 = FirstFlowData.Lines.Find(x => x.skipIf == FirstFlowData.SkipRetainerPlaced);
yield return BootAtLine(l7.step - 1, d =>
{
d.gacha.total = 1;
HeroRules.Grant(Db, d, Db.Heroes.Get(Retainer), HeroRules.GearSlotCount(Db));
d.ActivePreset.slots[d.ActivePreset.slots.Count - 1] = Retainer;
});
yield return UntilLine(l7.skipTo);
Assert.IsTrue(og.LobbyVisible, "편성 화면으로 보내지 않음");
}
// ---------- 복병 조건 · 군영 스크롤 ----------
/// <summary>출정 1-1 스킬 튜토리얼 = 가신이 판에 없으면 나오지 않음(지금 그대로) · 그 스테이지를 이미 깬 세이브도 나오지 않음(적 자리도 그대로).</summary>
[UnityTest]
public IEnumerator SortieTutorial_NotWithoutRetainer_NotAfterFirstClear()
{
int ch, st;
FirstFlowData.ParseStage(FirstFlowData.Str("sortie_stage"), out ch, out st);
yield return Boot(true, false);
FirstFlow.ForceOn = true; // 흐름은 켜되 시작 영웅 편성(가신 없음)
og.OpenWorldMap();
og.Map.Show(ch - 1);
og.Map.OpenPopup(st - 1);
og.Map.ConfirmPopup();
yield return null;
Assert.AreEqual(FirstFlowSortie.Step.Off, og.Flow.Sortie.State, "가신이 없으면 튜토리얼 없음");
yield return UntilPlayerTurn();
KillEnemies();
Assert.AreEqual(BattlePhase.StageClear, bm.Phase);
yield return null;
bm.ContinueAfterResult();
yield return null;
// 가신을 편성해도 이미 깬 스테이지 = 튜토리얼 없음
HeroRules.Grant(Db, Save, Db.Heroes.Get(Retainer), HeroRules.GearSlotCount(Db));
Save.ActivePreset.slots[Save.ActivePreset.slots.Count - 1] = Retainer;
og.Map.Show(ch - 1);
og.Map.OpenPopup(st - 1);
og.Map.ConfirmPopup();
yield return null;
Assert.AreEqual(FirstFlowSortie.Step.Off, og.Flow.Sortie.State, "처음 깨기 전에만");
Assert.AreEqual(0, og.Flow.Sortie.Cluster.Count);
}
/// <summary>군영 화면 = 그림이 화면보다 큰 쪽(가로 · 세로)만 끌어서 볼 수 있음 · 장소 포커스 = 그 장소가 화면 가운데 쪽으로(그림 밖이 비지 않게).</summary>
[UnityTest]
public IEnumerator CampHub_ScrollsBothAxesWhenLarger_FocusMovesToSpot()
{
yield return Boot(true, false);
og.Arena.SetPage(0);
og.Show(og.Arena);
yield return null;
var hub = og.Arena.Hub;
Assert.IsTrue(og.Arena.HubVisible);
var fit = hub.Fitter;
var view = ((RectTransform)fit.transform).rect;
var size = hub.Content.sizeDelta * fit.Zoom;
Assert.AreEqual(size.x > view.width + 1f, hub.Scroll.horizontal, "가로 = 그림이 더 넓을 때만");
Assert.AreEqual(size.y > view.height + 1f, hub.Scroll.vertical, "세로 = 그림이 더 높을 때만");
float mx = Mathf.Max(0f, (size.x - view.width) * 0.5f), my = Mathf.Max(0f, (size.y - view.height) * 0.5f);
// 끝까지 끌기 = 그림 여백 끝까지
hub.Scroll.normalizedPosition = new Vector2(0f, 0f);
yield return null;
Assert.AreEqual(mx, hub.Content.anchoredPosition.x, 1f, "왼쪽 끝");
Assert.AreEqual(my, hub.Content.anchoredPosition.y, 1f, "아래 끝");
hub.Scroll.normalizedPosition = new Vector2(1f, 1f);
yield return null;
Assert.AreEqual(-mx, hub.Content.anchoredPosition.x, 1f, "오른쪽 끝");
Assert.AreEqual(-my, hub.Content.anchoredPosition.y, 1f, "위 끝");
foreach (var s in hub.Spots)
{
if (s.pressSize.x <= 0f) continue;
Assert.IsTrue(hub.Focus(s.id, 0f));
var p = hub.Content.anchoredPosition;
Assert.AreEqual(fit.PositionFor(s.press), p);
Assert.LessOrEqual(Mathf.Abs(p.x), mx + 0.5f, s.id + " 그림 밖이 비지 않음");
Assert.LessOrEqual(Mathf.Abs(p.y), my + 0.5f);
}
}
// ---------- 패배 · 연의 전기 화면의 서장 ----------
[UnityTest]
public IEnumerator Defeat_RestartsSameAct_NotScenarioScreen()
{
yield return Boot(true, true);
IntroScreen.Current.Skip();
yield return Until(() => IntroScreen.Current == null && Rules != null, 3f, "1막 시작");
yield return UntilPlayerTurn();
var hud = UnityEngine.Object.FindFirstObjectByType<BattleHUD>(FindObjectsInactive.Include);
hud.OpenGiveUp();
hud.ConfirmGiveUp();
Assert.AreEqual(BattlePhase.Defeat, bm.Phase, "포기 = 패배(지금 그대로)");
yield return null;
Assert.IsTrue(og.ResultVisible, "패배 결과 창");
var first = Rules;
bm.ContinueAfterResult();
yield return null;
Assert.IsNotNull(Rules, "그 막을 처음부터 다시");
Assert.AreNotSame(first, Rules);
Assert.AreEqual(1, Rules.Act);
Assert.IsFalse(og.ScreensVisible, "연의 전기 화면으로 나가지 않음");
}
/// <summary>연의 전기 화면에서 여는 서장(막 버튼) = 막 승리 → 결과 화면(지금 그대로 · 흐름이 켜져 있어도) · 이미 유비를 가진 세이브의 서장 보상 = 조각(지금 그대로).</summary>
[UnityTest]
public IEnumerator ScenarioScreenPrologue_ActWin_StillShowsResult_OwnedHeroGetsShards()
{
yield return Boot(true, false);
int shards = Save.Hero(Victim).shards;
ClearPrologue();
Assert.Greater(Save.Hero(Victim).shards, shards, "이미 보유 = 조각");
og.Session.Commit();
yield return Boot(false, true);
og.Show(og.Arena);
og.Arena.SetPage(ArenaScreen.ScenarioPage);
yield return null;
og.Arena.Scenario.SetTab("p1_a");
og.Arena.Scenario.Open(PrologueId, true);
yield return null;
og.Arena.Scenario.GoAct(PrologueId, 1); // 막 버튼 ①
yield return null;
Assert.IsNotNull(Rules, "연의 전기 화면에서 연 서장 1막");
Assert.IsNull(Rules.WinContinue, "연의 전기 화면의 막 = 흐름 아님");
yield return UntilPlayerTurn();
KillEnemies();
yield return null;
float t0 = Time.realtimeSinceStartup;
while (bm.Phase != BattlePhase.StageClear && Time.realtimeSinceStartup - t0 < 12f)
{
if (ScenarioEvent.Running) ScenarioEvent.SkipForTest();
yield return null;
}
Assert.AreEqual(BattlePhase.StageClear, bm.Phase, "막 승리 = 결과 단계");
yield return null;
Assert.IsTrue(og.ResultVisible, "결과 화면");
Assert.AreEqual(1, Rules.Act, "다음 막으로 자동으로 넘어가지 않음");
}
/// <summary>화면 확인용 캡처(Explicit) → Logs/firstflow/sortie_*.png — 출정 1-1 스킬 튜토리얼(말풍선 · 안내 카드 · 안내 띠와 강조).</summary>
[UnityTest, Explicit]
public IEnumerator Capture_Sortie()
{
string dir = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Application.dataPath), "Logs", "firstflow");
Func<string, IEnumerator> shot = name => CaptureUtil.Capture(Camera.main, 540, 960, System.IO.Path.Combine(dir, name + ".png"));
int ch, st;
FirstFlowData.ParseStage(FirstFlowData.Str("sortie_stage"), out ch, out st);
yield return BootAtLine(11, d =>
{
d.gacha.total = 1;
d.heroes.RemoveAll(h => h.id != Victim);
HeroRules.Grant(Db, d, Db.Heroes.Get(Retainer), HeroRules.GearSlotCount(Db));
HeroRules.Sanitize(Db, d, Cfg.playerSpawnPoints.Length);
d.ActivePreset.slots[1] = Retainer;
});
og.OpenWorldMap();
og.Map.Show(ch - 1);
og.Map.OpenPopup(st - 1);
og.Map.ConfirmPopup();
yield return null;
var so = og.Flow.Sortie;
for (int i = 1; i <= 5 && so.State == FirstFlowSortie.Step.Intro; i++)
{
yield return new WaitForSecondsRealtime(1.6f);
if (so.State != FirstFlowSortie.Step.Intro) break;
yield return shot("sortie_intro_" + i);
so.TapForTest();
yield return null;
so.TapForTest();
}
yield return Until(() => so.State == FirstFlowSortie.Step.SkillGuide, 10f, "유비 스킬 안내");
yield return new WaitForSecondsRealtime(0.5f);
yield return shot("sortie_guide_1_skill");
bm.Skills.TapActive(so.Victim);
yield return new WaitForSecondsRealtime(0.3f);
yield return shot("sortie_guide_2_attack");
yield return bm.ResolveForTest(so.Victim, so.Cluster[1].Position, false, new ActionOutcome());
for (int i = 1; i <= 4 && so.State != FirstFlowSortie.Step.HealGuide; i++)
{
yield return new WaitForSecondsRealtime(1.6f);
if (so.State == FirstFlowSortie.Step.HealGuide) break;
yield return shot("sortie_retainer_" + i);
so.TapForTest();
yield return null;
so.TapForTest();
}
yield return Until(() => so.State == FirstFlowSortie.Step.HealGuide, 10f, "가신 회복 안내");
yield return new WaitForSecondsRealtime(0.5f);
yield return shot("sortie_guide_3_heal_skill");
bm.Skills.TapActive(so.Retainer);
yield return new WaitForSecondsRealtime(0.3f);
yield return shot("sortie_guide_4_heal_aim");
}
/// <summary>화면 확인용 캡처(Explicit) → Logs/firstflow/*.png — 대사 줄(말하기 · 누르기 · 가리키기) 배치를 눈으로 본다.</summary>
[UnityTest, Explicit]
public IEnumerator Capture_Screens()
{
string dir = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Application.dataPath), "Logs", "firstflow");
Func<string, IEnumerator> shot = name => CaptureUtil.Capture(Camera.main, 540, 960, System.IO.Path.Combine(dir, name + ".png"));
yield return BootAtLine(0, d =>
{
d.heroes.RemoveAll(h => h.id != Victim);
HeroRules.Sanitize(Db, d, Cfg.playerSpawnPoints.Length);
});
var flow = og.Flow;
for (int n = 1; n <= FirstFlowData.LastStep; n++)
{
var l = FirstFlowData.LineOf(n);
if (l.wait.Length > 0)
{
int ch, st;
FirstFlowData.ParseStage(FirstFlowData.Arg(l.wait, FirstFlowData.WaitStageClear), out ch, out st);
Save.Stage(ch, st, true).clears = 1;
og.ShowLobby();
}
yield return UntilLine(n);
flow.TapForTest(); // 대사 전부 표시
yield return new WaitForSecondsRealtime(0.25f);
yield return shot("line_" + n.ToString("00") + "_" + l.mode);
if (flow.Guide.Mode == FirstFlowData.Press)
{
Assert.IsTrue(flow.PressTargetForTest());
if (og.Trade.ResultVisible)
{
og.Trade.RevealAll();
og.Trade.CloseResult();
}
}
else flow.TapForTest();
yield return null;
}
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 11da4a1973162114d8a34e12a9bc240b

View File

@ -311,11 +311,14 @@ namespace TKS.Tests
var rng = new System.Random(1093); var rng = new System.Random(1093);
var d = NewSave(); var d = NewSave();
int gem = d.gem; int gem = d.gem;
Assert.IsTrue(GachaRules.FirstTenFree(Db, d)); // 첫 10연 무료 = 표 free_first_ten(2026-11-24 PD 「뽑기는 1회만 무료」 = 0 · 켜면 첫 10연이 무료) — 꺼져 있으면 보옥으로 뽑는다
bool freeTen = g.FreeFirstTen;
Assert.AreEqual(freeTen, GachaRules.FirstTenFree(Db, d));
if (!freeTen) d.gem = gem = d.gem + g.CostTen;
var ten = GachaRules.Draw(Db, d, b, g.TenCount, rng, at); var ten = GachaRules.Draw(Db, d, b, g.TenCount, rng, at);
Assert.AreEqual(g.TenCount, ten.Count); Assert.AreEqual(g.TenCount, ten.Count);
Assert.AreEqual(gem, d.gem, "첫 10연 무료"); Assert.AreEqual(freeTen ? gem : gem - g.CostTen, d.gem, freeTen ? "첫 10연 무료" : "10연 = 보옥");
Assert.IsTrue(d.gacha.firstTenUsed); Assert.AreEqual(freeTen, d.gacha.firstTenUsed);
Assert.AreEqual(g.CostTen, GachaRules.Cost(Db, d, g.TenCount)); Assert.AreEqual(g.CostTen, GachaRules.Cost(Db, d, g.TenCount));
d.gem = 100000000; d.gem = 100000000;

File diff suppressed because one or more lines are too long