ThreeKingdomsSlingshot/Assets/Scripts/Runtime/BattleEvents.cs

46 lines
1.9 KiB
C#
Raw 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 UnityEngine;
namespace TKS
{
/// <summary>
/// 전투 이벤트 카운터(보물 조건 효과 cond_key · 시스템 기획 §8 · PD #1093 C) — 전투 코드는 Raise 1줄만 부르고 아웃게임(OutGameSession)이 구독해 세이브에 누적한다.
/// 아군 행동만 센다(by = 행동 유닛 · 적군이면 무시). battles · boss_kills · gold_spent · patrols 는 아웃게임 쪽에서 직접 센다.
/// </summary>
public static class BattleEvents
{
public const string Battles = "battles";
public const string BossKills = "boss_kills";
public const string GoldSpent = "gold_spent";
public const string Patrols = "patrols";
public const string StrategistShots = "strategist_shots";
public const string ActiveUses = "active_uses";
public const string ArcherCrits = "archer_crits";
public const string Pushes = "pushes";
/// <summary>treasures.csv cond_key 로 쓸 수 있는 키(임포터 검증).</summary>
public static readonly string[] Keys = { Battles, BossKills, GoldSpent, Patrols, StrategistShots, ActiveUses, ArcherCrits, Pushes };
public static event Action<string, int> Raised;
/// <summary>Play 진입마다 구독 해제(도메인 리로드를 끈 설정에서 이전 세션 구독이 남지 않게).</summary>
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void ResetStatics()
{
Raised = null;
}
public static void Raise(string key, Unit by, int n = 1)
{
if (by != null && by.Faction != Faction.Player) return;
Raise(key, n);
}
public static void Raise(string key, int n = 1)
{
if (n <= 0 || Raised == null) return;
Raised(key, n);
}
}
}