ThreeKingdomsSlingshot/Assets/Scripts/OutGame/SaveDataC.cs

141 lines
4.1 KiB
C#
Raw Permalink Normal View History

아웃게임 2차(PD #1093 세션 C) — 내정(훈련·순찰·개발) · 보물(수집품·세트·상자) · 연무장(탑·일일 던전·투기장·적장 토벌) · 거래 상자 탭 + 영웅 56명 확장(PD #1096 · 신규 effect_key 4) - 데이터: C 표 10장(training · training_ranks · patrol · dev_tree · treasures · treasure_sets · chests(+iron/buy 열) · tower · dungeons(+reward_amount) · arena(+상점 키)) + economy.csv C 키 24 → 임포트 18 자산(OutGameTables.C.cs 검증: 행·연속 Lv/랭크/층·참조·확률 합 1·선행 노드·효과 키 처리기·카운터 키 · 오류 시 자산 불변) - 영웅 56명: heroes 71 · skills 112 · hero_gear 1344 · gacha_pool 71 재복사 · 신규 키 4(team_dmg_pct_turn · cooldown_add · charm · heal_self_pct) + 기존 키 조건 열(받는 피해 p2 HP 임계/보스/근접 · p3 출전 인원 아군 전원 · 최대 HP·반격 아군 전원 · 피해 % 발동 턴) · 대장군 키는 표 미사용(처리기 유지) - 내정: 훈련(병종 5 · 3항목 Lv · cost_mult · 랭크 승급 · train_bonus → §3-2 항목별) · 순찰(챕터 행 × 시간 · 오프라인 · 상한 12h + 농업 · 소수점 이월 · 광고 2배 스텁 · 즉시 수확 보옥) · 개발(갈래 3 · 선행 · 골드·도면 비용 · 효과 키 → 군량·보상·상점·순찰·상자 적용 지점 · 초기화 보옥 + 도면 환급) - 보물: 보유 중(4열 · 등급 색 · 상세·강화) · 세트(단계 효과) · 상자(포인트 → 명장 · 확률 · 중복 조각) · 효과 hp/atk/def → HeroRules · crit/range/splash → BattleManager.SideEffectsProvider → SkillMods · 조건 카운터 8종 = Runtime/BattleEvents(전투 코드 Raise 1줄씩 · 아군만) · 스테이지 청동 상자 10 % - 연무장: BattleManager.StartMode(BattleMode = 적 편성·제한 턴·onExit) · 탑 100층(입장권·층 배율·보상·10층 상자) · 던전 3(요일·2/일·보상) · 투기장(샘플 10 · EnemyAI 방어 · 메달·주간 순위·조각 상점) · 적장 토벌(주간 순환·hp ×20·5턴·누적 피해·명장 상자·천기) · 결과 패널 → 탭 = 연무장 - 거래: 상자 탭(구매 = 골드/보옥/포인트 · 거래 할인) · 패스·월정액·챕터 팩·첫 결제 팩 = 준비 중 스텁 · 스킬서 임시 판매 제거(사당 던전) - 테스트 87/87(기존 73 유지 · 갱신 3 = 로비 탭 · 표 키 목록 · 상점 스킬서 칸 / 신규 14 = OutGameCTests 12 + 확장 키 2) · console error 0 · 캡처 = DataImporter.CaptureC Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:22:54 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
namespace TKS.OutGame
{
// 세이브 C 단계(PD #1093 C · 기획서 §11 "training" · "patrol" · "dev" · "counters" · inv "chests" · "treasures" + 연무장) — SaveData 의 필드.
[Serializable]
public class TrainState
{
[Tooltip("unit_type 키(infantry …)")]
public string type;
public int rank = 1;
[Tooltip("hp · atk · def 항목 Lv(0 = 훈련 안 함)")]
public int[] lv = { 0, 0, 0 };
}
[Serializable]
public class PatrolState
{
[Tooltip("누적 시작 시각(UTC ISO · 마지막 수확)")]
public string startAt = "";
[Tooltip("수확 소수점 이월(장비 · 상자 · 결정적 누적)")]
public float carryGear;
public float carryChest;
}
[Serializable]
public class DevState
{
public List<CountEntry> nodes = new List<CountEntry>();
[Tooltip("지금 트리에 쓴 도면(초기화 환급)")]
public int blueprintSpent;
}
[Serializable]
public class TreasureState
{
public string id;
[Tooltip("강화 ★(획득 = 0)")]
public int star;
public int shards;
}
[Serializable]
public class ArenaSample
{
public string name = "";
public List<string> heroes = new List<string>();
public int lv = 1;
public int score;
}
[Serializable]
public class ArenaState
{
[Tooltip("천하제일 탑 = 클리어한 최고 층")]
public int towerFloor;
public int towerTickets;
public int medals;
public int seasonScore;
[Tooltip("시즌 시작(UTC ISO) · season_days 지나면 순위 보상 후 새 시즌")]
public string seasonStart = "";
public int wins;
public int losses;
public List<ArenaSample> samples = new List<ArenaSample>();
[Tooltip("지난 시즌 순위·보상(표시)")]
public string lastSeason = "";
[Tooltip("적장 토벌 주(yyyy-ww) · 바뀌면 누적 피해 초기화")]
public string raidWeek = "";
public int raidDamage;
public string raidBoss = "";
}
/// <summary>C 단계 일일 횟수(날짜가 바뀌면 통째로 새로) — 던전 · 투기장 · 적장 · 순찰 즉시 수확 · 탑 광고 · 상점 무료 새로고침 · 투기장 상점.</summary>
[Serializable]
public class DailyC
{
public string day = "";
public List<CountEntry> dungeons = new List<CountEntry>();
public int arena;
public int raid;
public int towerAd;
public int freeRefresh;
public int arenaShop;
public int Dungeon(string id)
{
foreach (var c in dungeons)
if (c.id == id) return c.n;
return 0;
}
public void AddDungeon(string id)
{
foreach (var c in dungeons)
if (c.id == id)
{
c.n++;
return;
}
dungeons.Add(new CountEntry { id = id, n = 1 });
}
}
/// <summary>CountEntry 목록 도우미(카운터 · 상자 · 개발 노드).</summary>
public static class Counts
{
public static int Get(List<CountEntry> l, string id)
{
if (l == null) return 0;
foreach (var c in l)
if (c.id == id) return c.n;
return 0;
}
public static void Add(List<CountEntry> l, string id, int n)
{
foreach (var c in l)
if (c.id == id)
{
c.n = Mathf.Max(0, c.n + n);
return;
}
if (n > 0) l.Add(new CountEntry { id = id, n = n });
}
public static void Set(List<CountEntry> l, string id, int n)
{
foreach (var c in l)
if (c.id == id)
{
c.n = n;
return;
}
l.Add(new CountEntry { id = id, n = n });
}
}
}