Compare commits

...

4 Commits

Author SHA1 Message Date
JiWoong Sul
7e1936b34f fix(ui): 사망 화면 장비 슬롯명 표시 및 기타 수정
- 사망 시 잃은 아이템에 슬롯명 표시 추가
- progress_service 마이너 수정
- 관련 테스트 업데이트
2026-01-15 23:23:38 +09:00
JiWoong Sul
9599a33a8f style(ui): HP/MP 바 숫자 오버레이 표시
- 웹: hp_mp_bar.dart 숫자를 바 중앙에 오버레이
- 모바일: enhanced_animation_panel.dart 동일 적용
- 텍스트 그림자 추가로 가독성 향상
2026-01-15 23:23:02 +09:00
JiWoong Sul
c41d15405f feat(balance): 버프 스킬 하이브리드 밸런스 조정
- 22개 버프 스킬 효과 감소 + MP 비용 증가
- Tier 1-5 전체 스킬 효율 하향 조정
- 예: Breakpoint CRI 35%→20%, MP 70→120
2026-01-15 23:22:49 +09:00
JiWoong Sul
b0913a24ff feat(skill): DamageType 및 magAtk/magDef 스킬 시스템 추가
- DamageType enum 추가 (physical/magical)
- 스킬별 데미지 타입 지정 기능 구현
- 마법 스킬 데미지에 magAtk/magDef 적용
- 장비 아이템에서 magAtk/magDef 스탯 추출
- 관련 테스트 업데이트
2026-01-15 23:22:36 +09:00
16 changed files with 556 additions and 247 deletions

View File

@@ -17,31 +17,34 @@ class SkillData {
name: 'Stack Trace',
type: SkillType.attack,
tier: 1,
mpCost: 50,
damageType: DamageType.physical,
mpCost: 30, // T1 기본
cooldownMs: 3000,
power: 15,
damageMultiplier: 2.0,
);
/// Core Dump - 중급 공격
/// Core Dump - 중급 마법 공격 (메모리 덤프)
static const coreDump = Skill(
id: 'core_dump',
name: 'Core Dump',
type: SkillType.attack,
tier: 3,
mpCost: 180,
damageType: DamageType.magical,
mpCost: 135, // T3 × 1.5 (mult 3.0)
cooldownMs: 12000,
power: 30,
damageMultiplier: 3.0,
);
/// Memory Dump - DOT 공격
/// Memory Dump - DOT 마법 공격
static const memoryDump = Skill(
id: 'memory_dump',
name: 'Memory Dump',
type: SkillType.attack,
tier: 3,
mpCost: 130,
damageType: DamageType.magical,
mpCost: 110, // T3 DOT (6틱 × 10dmg)
cooldownMs: 15000,
power: 0,
element: SkillElement.memory,
@@ -51,63 +54,68 @@ class SkillData {
baseDotTickMs: 1000,
);
/// Kernel Panic - 최강 공격 (자해 데미지)
/// Kernel Panic - 최강 마법 공격 (자해 데미지)
static const kernelPanic = Skill(
id: 'kernel_panic',
name: 'Kernel Panic',
type: SkillType.attack,
tier: 5,
mpCost: 400,
damageType: DamageType.magical,
mpCost: 300, // T5 × 2.0 (mult 4.0, 자해 보상)
cooldownMs: 45000,
power: 60,
damageMultiplier: 4.0,
selfDamagePercent: 0.1,
);
/// Blue Screen - 강력 공격 (긴 쿨타임)
/// Blue Screen - 강력 마법 공격 (긴 쿨타임)
static const blueScreen = Skill(
id: 'blue_screen',
name: 'Blue Screen',
type: SkillType.attack,
tier: 4,
mpCost: 300,
damageType: DamageType.magical,
mpCost: 210, // T4 × 1.75 (mult 3.5)
cooldownMs: 30000,
power: 50,
damageMultiplier: 3.5,
);
/// Inject Code - 방어 무시 공격
/// Inject Code - 방어 무시 마법 공격
static const injectCode = Skill(
id: 'inject_code',
name: 'Inject Code',
type: SkillType.attack,
tier: 4,
mpCost: 200,
damageType: DamageType.magical,
mpCost: 190, // T4 × 1.25 × 방감 1.25
cooldownMs: 18000,
power: 35,
damageMultiplier: 2.5,
targetDefReduction: 0.5,
);
/// Spawn Shell - 3연타 공격
/// Spawn Shell - 3연타 물리 공격
static const spawnShell = Skill(
id: 'spawn_shell',
name: 'Spawn Shell',
type: SkillType.attack,
tier: 3,
mpCost: 150,
damageType: DamageType.physical,
mpCost: 120, // T3 × 3타 보정 1.3
cooldownMs: 10000,
power: 12,
damageMultiplier: 2.0,
hitCount: 3,
);
/// Thread Pool - 5연타 공격
/// Thread Pool - 5연타 물리 공격
static const threadPool = Skill(
id: 'thread_pool',
name: 'Thread Pool',
type: SkillType.attack,
tier: 4,
damageType: DamageType.physical,
mpCost: 230,
cooldownMs: 15000,
power: 10,
@@ -115,12 +123,13 @@ class SkillData {
hitCount: 5,
);
/// Exfiltrate Data - HP 흡수 공격
/// Exfiltrate Data - HP 흡수 하이브리드 공격
static const exfiltrateData = Skill(
id: 'exfiltrate_data',
name: 'Exfiltrate Data',
type: SkillType.attack,
tier: 4,
damageType: DamageType.hybrid,
mpCost: 180,
cooldownMs: 12000,
power: 25,
@@ -128,12 +137,13 @@ class SkillData {
lifestealPercent: 0.3,
);
/// Fuzzing - 랜덤 데미지 공격
/// Fuzzing - 랜덤 데미지 하이브리드 공격
static const fuzzing = Skill(
id: 'fuzzing',
name: 'Fuzzing',
type: SkillType.attack,
tier: 2,
damageType: DamageType.hybrid,
mpCost: 100,
cooldownMs: 8000,
power: 20,
@@ -141,12 +151,13 @@ class SkillData {
element: SkillElement.chaos,
);
/// Chaos Monkey - 랜덤 효과 공격
/// Chaos Monkey - 랜덤 효과 하이브리드 공격
static const chaosMonkey = Skill(
id: 'chaos_monkey',
name: 'Chaos Monkey',
type: SkillType.attack,
tier: 5,
damageType: DamageType.hybrid,
mpCost: 250,
cooldownMs: 25000,
power: 40,
@@ -154,12 +165,13 @@ class SkillData {
element: SkillElement.chaos,
);
/// Saga Pattern - 3회 연속 공격
/// Saga Pattern - 3회 연속 물리 공격
static const sagaPattern = Skill(
id: 'saga_pattern',
name: 'Saga Pattern',
type: SkillType.attack,
tier: 4,
damageType: DamageType.physical,
mpCost: 280,
cooldownMs: 20000,
power: 18,
@@ -167,12 +179,13 @@ class SkillData {
hitCount: 3,
);
/// Event Store - 차지 공격 (DOT로 표현)
/// Event Store - 차지 마법 공격 (DOT로 표현)
static const eventStore = Skill(
id: 'event_store',
name: 'Event Store',
type: SkillType.attack,
tier: 4,
damageType: DamageType.magical,
mpCost: 200,
cooldownMs: 18000,
power: 0,
@@ -183,24 +196,26 @@ class SkillData {
baseDotTickMs: 3000,
);
/// Auto Scale - HP비례 공격
/// Auto Scale - HP비례 하이브리드 공격
static const autoScale = Skill(
id: 'auto_scale',
name: 'Auto Scale',
type: SkillType.attack,
tier: 4,
damageType: DamageType.hybrid,
mpCost: 230,
cooldownMs: 20000,
power: 30,
damageMultiplier: 2.5,
);
/// Disassemble - 방어감소+공격
/// Disassemble - 방어감소 + 물리 공격
static const disassemble = Skill(
id: 'disassemble',
name: 'Disassemble',
type: SkillType.attack,
tier: 3,
damageType: DamageType.physical,
mpCost: 150,
cooldownMs: 12000,
power: 22,
@@ -208,36 +223,39 @@ class SkillData {
targetDefReduction: 0.3,
);
/// Decompile - 약점 공격 (높은 크리)
/// Decompile - 약점 물리 공격 (높은 크리)
static const decompile = Skill(
id: 'decompile',
name: 'Decompile',
type: SkillType.attack,
tier: 2,
damageType: DamageType.physical,
mpCost: 130,
cooldownMs: 10000,
power: 20,
damageMultiplier: 2.2,
);
/// Canary Release - 테스트 공격
/// Canary Release - 테스트 물리 공격
static const canaryRelease = Skill(
id: 'canary_release',
name: 'Canary Release',
type: SkillType.attack,
tier: 1,
mpCost: 80,
damageType: DamageType.physical,
mpCost: 35, // T1 기본
cooldownMs: 6000,
power: 12,
damageMultiplier: 2.0,
);
/// A/B Test - 이중 공격
/// A/B Test - 이중 물리 공격
static const abTest = Skill(
id: 'ab_test',
name: 'A/B Test',
type: SkillType.attack,
tier: 2,
damageType: DamageType.physical,
mpCost: 180,
cooldownMs: 12000,
power: 15,
@@ -245,12 +263,13 @@ class SkillData {
hitCount: 2,
);
/// Pivot Network - 네트워크 공격
/// Pivot Network - 네트워크 마법 공격
static const pivotNetwork = Skill(
id: 'pivot_network',
name: 'Pivot Network',
type: SkillType.attack,
tier: 3,
damageType: DamageType.magical,
mpCost: 150,
cooldownMs: 10000,
power: 25,
@@ -258,24 +277,26 @@ class SkillData {
element: SkillElement.network,
);
/// Async Await - 딜레이 공격
/// Async Await - 딜레이 마법 공격
static const asyncAwait = Skill(
id: 'async_await',
name: 'Async Await',
type: SkillType.attack,
tier: 4,
damageType: DamageType.magical,
mpCost: 180,
cooldownMs: 14000,
power: 35,
damageMultiplier: 3.0,
);
/// Event Source - DOT 공격
/// Event Source - DOT 마법 공격
static const eventSource = Skill(
id: 'event_source',
name: 'Event Source',
type: SkillType.attack,
tier: 3,
damageType: DamageType.magical,
mpCost: 150,
cooldownMs: 12000,
power: 0,
@@ -286,12 +307,13 @@ class SkillData {
baseDotTickMs: 800,
);
/// CQRS Split - 분리 공격
/// CQRS Split - 분리 물리 공격
static const cqrsSplit = Skill(
id: 'cqrs_split',
name: 'CQRS Split',
type: SkillType.attack,
tier: 4,
damageType: DamageType.physical,
mpCost: 200,
cooldownMs: 15000,
power: 20,
@@ -464,190 +486,190 @@ class SkillData {
name: 'Debug Mode',
type: SkillType.buff,
tier: 3,
mpCost: 100,
mpCost: 140, // 100 → 140
cooldownMs: 20000,
power: 0,
buff: BuffEffect(
id: 'debug_mode_buff',
name: 'Debug Mode',
durationMs: 10000,
atkModifier: 0.25,
durationMs: 8000, // 10초 → 8초
atkModifier: 0.15, // 25% → 15%
),
);
/// Safe Mode - DEF +30%
/// Safe Mode - DEF 증가
static const safeMode = Skill(
id: 'safe_mode',
name: 'Safe Mode',
type: SkillType.buff,
tier: 3,
mpCost: 130,
mpCost: 160, // 130 → 160
cooldownMs: 25000,
power: 0,
buff: BuffEffect(
id: 'safe_mode_buff',
name: 'Safe Mode',
durationMs: 10000,
defModifier: 0.3,
durationMs: 8000, // 10초 → 8초
defModifier: 0.18, // 30% → 18%
),
);
/// Memory Optimization - 전스탯 +10%
/// Memory Optimization - 전스탯 증가
static const memoryOptimization = Skill(
id: 'memory_optimization',
name: 'Memory Optimization',
type: SkillType.buff,
tier: 3,
mpCost: 150,
mpCost: 180, // 150 → 180
cooldownMs: 30000,
power: 0,
buff: BuffEffect(
id: 'memory_optimization_buff',
name: 'Optimized',
durationMs: 15000,
atkModifier: 0.1,
defModifier: 0.1,
criRateModifier: 0.05,
evasionModifier: 0.05,
durationMs: 12000, // 15초 → 12초
atkModifier: 0.07, // 10% → 7%
defModifier: 0.07, // 10% → 7%
criRateModifier: 0.03, // 5% → 3%
evasionModifier: 0.03, // 5% → 3%
),
);
/// Breakpoint - 다음 공격 크리티컬
/// Breakpoint - 크리율 증가 (하이브리드 밸런스)
static const breakpoint = Skill(
id: 'breakpoint',
name: 'Breakpoint',
type: SkillType.buff,
tier: 2,
mpCost: 80,
mpCost: 120, // 70 → 120
cooldownMs: 12000,
power: 0,
buff: BuffEffect(
id: 'breakpoint_buff',
name: 'Breakpoint',
durationMs: 5000,
criRateModifier: 0.5,
criRateModifier: 0.20, // 35% → 20%
),
);
/// Watch Variable - 회피율 +20%
/// Watch Variable - 회피율 증가
static const watchVariable = Skill(
id: 'watch_variable',
name: 'Watch Variable',
type: SkillType.buff,
tier: 2,
mpCost: 90,
mpCost: 120, // 90 → 120
cooldownMs: 15000,
power: 0,
buff: BuffEffect(
id: 'watch_variable_buff',
name: 'Watching',
durationMs: 8000,
evasionModifier: 0.2,
durationMs: 6000, // 8초 → 6초
evasionModifier: 0.12, // 20% → 12%
),
);
/// Step Into - 공격속도 +30% (ATK 버프로 표현)
/// Step Into - 공격속도 증가 (ATK 버프로 표현)
static const stepInto = Skill(
id: 'step_into',
name: 'Step Into',
type: SkillType.buff,
tier: 1,
mpCost: 80,
mpCost: 100, // 80 → 100
cooldownMs: 12000,
power: 0,
buff: BuffEffect(
id: 'step_into_buff',
name: 'Step Into',
durationMs: 6000,
atkModifier: 0.2,
atkModifier: 0.12, // 20% → 12%
),
);
/// Profile Run - 크리율 +30%
/// Profile Run - 크리율 증가
static const profileRun = Skill(
id: 'profile_run',
name: 'Profile Run',
type: SkillType.buff,
tier: 3,
mpCost: 100,
mpCost: 150, // 100 → 150
cooldownMs: 18000,
power: 0,
buff: BuffEffect(
id: 'profile_run_buff',
name: 'Profiling',
durationMs: 8000,
criRateModifier: 0.3,
durationMs: 6000, // 8초 → 6초
criRateModifier: 0.18, // 30% → 18%
),
);
/// Benchmark - 데미지 +40%
/// Benchmark - 데미지 증가
static const benchmark = Skill(
id: 'benchmark',
name: 'Benchmark',
type: SkillType.buff,
tier: 4,
mpCost: 130,
mpCost: 180, // 130 → 180
cooldownMs: 20000,
power: 0,
buff: BuffEffect(
id: 'benchmark_buff',
name: 'Benchmarking',
durationMs: 5000,
atkModifier: 0.4,
atkModifier: 0.25, // 40% → 25%
),
);
/// Elevate Privilege - 전스탯 +20%
/// Elevate Privilege - 전스탯 증가 (하이브리드 밸런스)
static const elevatePrivilege = Skill(
id: 'elevate_privilege',
name: 'Elevate Privilege',
type: SkillType.buff,
tier: 5,
mpCost: 200,
mpCost: 280, // 220 → 280
cooldownMs: 35000,
power: 0,
buff: BuffEffect(
id: 'elevate_privilege_buff',
name: 'Elevated',
durationMs: 8000,
atkModifier: 0.2,
defModifier: 0.2,
criRateModifier: 0.1,
evasionModifier: 0.1,
durationMs: 6000, // 8초 → 6초
atkModifier: 0.08, // 12% → 8%
defModifier: 0.08, // 12% → 8%
criRateModifier: 0.04, // 6% → 4%
evasionModifier: 0.04, // 6% → 4%
),
);
/// Scale Up - ATK +50%
/// Scale Up - ATK 증가 (하이브리드 밸런스)
static const scaleUp = Skill(
id: 'scale_up',
name: 'Scale Up',
type: SkillType.buff,
tier: 5,
mpCost: 180,
mpCost: 280, // 220 → 280
cooldownMs: 30000,
power: 0,
buff: BuffEffect(
id: 'scale_up_buff',
name: 'Scaled Up',
durationMs: 6000,
atkModifier: 0.5,
durationMs: 5000, // 6초 → 5초
atkModifier: 0.20, // 30% → 20%
),
);
/// Failover - 치명타 방지 (DEF 증가로 표현)
/// Failover - DEF 증가 (하이브리드 밸런스)
static const failover = Skill(
id: 'failover',
name: 'Failover',
type: SkillType.buff,
tier: 5,
mpCost: 150,
mpCost: 350, // 300 → 350
cooldownMs: 45000,
power: 0,
buff: BuffEffect(
id: 'failover_buff',
name: 'Failover Ready',
durationMs: 30000,
defModifier: 0.4,
durationMs: 15000, // 20초 → 15초
defModifier: 0.18, // 25% → 18%
),
);
@@ -657,14 +679,14 @@ class SkillData {
name: 'Containerize',
type: SkillType.buff,
tier: 3,
mpCost: 130,
mpCost: 170, // 130 → 170
cooldownMs: 20000,
power: 0,
buff: BuffEffect(
id: 'containerize_buff',
name: 'Containerized',
durationMs: 12000,
defModifier: 0.35,
durationMs: 10000, // 12초 → 10초
defModifier: 0.20, // 35% → 20%
),
);
@@ -674,16 +696,16 @@ class SkillData {
name: 'Orchestrate',
type: SkillType.buff,
tier: 4,
mpCost: 230,
mpCost: 260, // 230 → 260
cooldownMs: 40000,
power: 0,
buff: BuffEffect(
id: 'orchestrate_buff',
name: 'Orchestrated',
durationMs: 10000,
atkModifier: 0.15,
defModifier: 0.15,
criRateModifier: 0.1,
durationMs: 8000, // 10초 → 8초
atkModifier: 0.10, // 15% → 10%
defModifier: 0.10, // 15% → 10%
criRateModifier: 0.06, // 10% → 6%
),
);
@@ -693,14 +715,14 @@ class SkillData {
name: 'Promise Resolve',
type: SkillType.buff,
tier: 2,
mpCost: 100,
mpCost: 130, // 100 → 130
cooldownMs: 15000,
power: 0,
buff: BuffEffect(
id: 'promise_resolve_buff',
name: 'Resolved',
durationMs: 8000,
atkModifier: 0.25,
durationMs: 6000, // 8초 → 6초
atkModifier: 0.15, // 25% → 15%
),
);
@@ -710,32 +732,32 @@ class SkillData {
name: 'Feature Toggle',
type: SkillType.buff,
tier: 1,
mpCost: 80,
mpCost: 110, // 80 → 110
cooldownMs: 10000,
power: 0,
buff: BuffEffect(
id: 'feature_toggle_buff',
name: 'Toggled',
durationMs: 12000,
atkModifier: 0.15,
defModifier: 0.15,
durationMs: 10000, // 12초 → 10초
atkModifier: 0.10, // 15% → 10%
defModifier: 0.10, // 15% → 10%
),
);
/// Dark Launch - 은신 (회피+100% → 50%로 조정)
/// Dark Launch - 은신 (하이브리드 밸런스)
static const darkLaunch = Skill(
id: 'dark_launch',
name: 'Dark Launch',
type: SkillType.buff,
tier: 4,
mpCost: 180,
mpCost: 180, // 150 → 180
cooldownMs: 30000,
power: 0,
buff: BuffEffect(
id: 'dark_launch_buff',
name: 'Hidden',
durationMs: 3000,
evasionModifier: 0.5,
evasionModifier: 0.20, // 30% → 20%
),
);
@@ -745,14 +767,14 @@ class SkillData {
name: 'Static Analysis',
type: SkillType.buff,
tier: 1,
mpCost: 80,
mpCost: 100, // 80 → 100
cooldownMs: 12000,
power: 0,
buff: BuffEffect(
id: 'static_analysis_buff',
name: 'Analyzed',
durationMs: 10000,
criRateModifier: 0.15,
durationMs: 8000, // 10초 → 8초
criRateModifier: 0.10, // 15% → 10%
),
);
@@ -762,15 +784,15 @@ class SkillData {
name: 'Dynamic Analysis',
type: SkillType.buff,
tier: 4,
mpCost: 130,
mpCost: 170, // 130 → 170
cooldownMs: 18000,
power: 0,
buff: BuffEffect(
id: 'dynamic_analysis_buff',
name: 'Dynamic',
durationMs: 8000,
criRateModifier: 0.15,
evasionModifier: 0.15,
durationMs: 6000, // 8초 → 6초
criRateModifier: 0.10, // 15% → 10%
evasionModifier: 0.10, // 15% → 10%
),
);
@@ -780,14 +802,14 @@ class SkillData {
name: 'Reverse Engineer',
type: SkillType.buff,
tier: 4,
mpCost: 150,
mpCost: 190, // 150 → 190
cooldownMs: 25000,
power: 0,
buff: BuffEffect(
id: 'reverse_engineer_buff',
name: 'Reversed',
durationMs: 10000,
atkModifier: 0.3,
durationMs: 8000, // 10초 → 8초
atkModifier: 0.18, // 30% → 18%
),
);
@@ -797,14 +819,14 @@ class SkillData {
name: 'Cover Tracks',
type: SkillType.buff,
tier: 2,
mpCost: 100,
mpCost: 130, // 100 → 130
cooldownMs: 15000,
power: 0,
buff: BuffEffect(
id: 'cover_tracks_buff',
name: 'Covered',
durationMs: 5000,
evasionModifier: 0.25,
evasionModifier: 0.15, // 25% → 15%
),
);
@@ -814,14 +836,14 @@ class SkillData {
name: 'Deploy',
type: SkillType.buff,
tier: 4,
mpCost: 180,
mpCost: 220, // 180 → 220
cooldownMs: 30000,
power: 0,
buff: BuffEffect(
id: 'deploy_buff',
name: 'Deployed',
durationMs: 12000,
atkModifier: 0.35,
durationMs: 10000, // 12초 → 10초
atkModifier: 0.22, // 35% → 22%
),
);
@@ -831,14 +853,14 @@ class SkillData {
name: 'Retry Logic',
type: SkillType.buff,
tier: 2,
mpCost: 100,
mpCost: 130, // 100 → 130
cooldownMs: 15000,
power: 0,
buff: BuffEffect(
id: 'retry_logic_buff',
name: 'Retrying',
durationMs: 10000,
criRateModifier: 0.2,
durationMs: 8000, // 10초 → 8초
criRateModifier: 0.12, // 20% → 12%
),
);
@@ -848,15 +870,15 @@ class SkillData {
name: 'State Machine',
type: SkillType.buff,
tier: 2,
mpCost: 150,
mpCost: 170, // 150 → 170
cooldownMs: 25000,
power: 0,
buff: BuffEffect(
id: 'state_machine_buff',
name: 'State Active',
durationMs: 15000,
atkModifier: 0.1,
defModifier: 0.1,
durationMs: 12000, // 15초 → 12초
atkModifier: 0.08, // 10% → 8%
defModifier: 0.08, // 10% → 8%
),
);

View File

@@ -187,6 +187,7 @@ class ActProgressionService {
level: bossLevel,
atk: (bossStats.atk * 1.5).round(), // Boss 보정 (1.5배)
def: (bossStats.def * 1.5).round(),
magDef: (bossStats.def * 1.8).round(), // 보스 마법 방어 (물리 대비 1.2배)
hpMax: (bossStats.hp * 2.0).round(), // HP는 2.0배 (보스다운 전투 시간)
hpCurrent: (bossStats.hp * 2.0).round(),
criRate: 0.05,

View File

@@ -106,6 +106,8 @@ class ItemService {
/// - 느린 무기 (1500ms): atk × 1.4
/// - 기본 무기 (1000ms): atk × 1.0
/// - 빠른 무기 (600ms): atk × 0.7
///
/// 마법 무기 확률: 30% (magAtk 부여)
ItemStats _generateWeaponStats(int baseValue, ItemRarity rarity) {
final criBonus = rarity.index >= ItemRarity.rare.index
? 0.02 + rarity.index * 0.01
@@ -115,39 +117,76 @@ class ItemService {
: 0.0;
// 공속 결정 (600ms ~ 1500ms 범위)
// 희귀도가 높을수록 공속 변동 폭 증가
final speedVariance =
300 + rarity.index * 100; // Common: 300, Legendary: 700
final speedVariance = 300 + rarity.index * 100;
final speedOffset = rng.nextInt(speedVariance * 2) - speedVariance;
final attackSpeed = (1000 + speedOffset).clamp(600, 1500);
// 공속-데미지 역비례 계산
// 기준: 1000ms = 1.0x, 600ms = 0.7x, 1500ms = 1.4x
final speedMultiplier = 0.3 + (attackSpeed / 1000) * 0.7;
final adjustedAtk = (baseValue * speedMultiplier).round();
// 마법 무기 여부 (30% 확률)
final isMagicWeapon = rng.nextInt(100) < 30;
final magAtk = isMagicWeapon ? (adjustedAtk * 0.8).round() : 0;
// 능력치 보너스 (Rare 이상)
final strBonus = rarity.index >= ItemRarity.rare.index && !isMagicWeapon
? rarity.index
: 0;
final intBonus = rarity.index >= ItemRarity.rare.index && isMagicWeapon
? rarity.index
: 0;
return ItemStats(
atk: adjustedAtk,
magAtk: magAtk,
criRate: criBonus,
parryRate: parryBonus,
attackSpeed: attackSpeed,
strBonus: strBonus,
intBonus: intBonus,
);
}
/// 방패 스탯 생성
///
/// DEF 배율 조정 (v2): 방패 DEF를 0.15배로 축소
/// 마법 방어(magDef), CON 보너스 추가
ItemStats _generateShieldStats(int baseValue, ItemRarity rarity) {
final blockBonus = 0.05 + rarity.index * 0.02;
final def = (baseValue * 0.15).round();
return ItemStats(def: def, blockRate: blockBonus);
// 마법 방어 (50% 확률)
final hasMagDef = rng.nextInt(100) < 50;
final magDef = hasMagDef ? (def * 0.7).round() : 0;
// HP 보너스 (Uncommon 이상)
final hpBonus =
rarity.index >= ItemRarity.uncommon.index ? baseValue ~/ 3 : 0;
// CON 보너스 (Rare 이상)
final conBonus = rarity.index >= ItemRarity.rare.index ? rarity.index : 0;
return ItemStats(
def: def,
magDef: magDef,
blockRate: blockBonus,
hpBonus: hpBonus,
conBonus: conBonus,
);
}
/// 방어구 스탯 생성
///
/// DEF 배율 조정 (v2): 9개 방어구 합산 DEF ≈ 무기 ATK × 1.6
/// 기존 배율(합계 8.0)에서 대폭 축소하여 일반 공격 데미지 정상화
/// 슬롯별 특화 보너스 추가:
/// - 투구(helm): INT, WIS 보너스
/// - 갑옷(hauberk): HP, CON 보너스
/// - 상완갑/전완갑(brassairts, vambraces): STR, DEX 보너스
/// - 건틀릿(gauntlets): STR, 크리티컬 보너스
/// - 갬비슨(gambeson): HP, MP 보너스
/// - 허벅지갑/정강이갑(cuisses, greaves): CON, 회피 보너스
/// - 철제부츠(sollerets): DEX, 회피 보너스
ItemStats _generateArmorStats(
int baseValue,
ItemRarity rarity,
@@ -155,7 +194,7 @@ class ItemService {
) {
// 슬롯별 방어력 가중치 (총합 ~1.6으로 축소)
final defMultiplier = switch (slot) {
EquipmentSlot.hauberk => 0.30, // 갑옷류 최고
EquipmentSlot.hauberk => 0.30,
EquipmentSlot.helm => 0.25,
EquipmentSlot.gambeson => 0.20,
EquipmentSlot.cuisses => 0.18,
@@ -169,11 +208,88 @@ class ItemService {
final def = (baseValue * defMultiplier).round();
// 희귀도에 따른 추가 보너스
final hpBonus = rarity.index >= ItemRarity.rare.index ? baseValue ~/ 2 : 0;
final evasionBonus = rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0;
// 슬롯별 특화 보너스 계산
return switch (slot) {
// 투구: 지능/지혜 보너스, 마법 방어
EquipmentSlot.helm => ItemStats(
def: def,
magDef: rarity.index >= ItemRarity.uncommon.index ? def ~/ 2 : 0,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
intBonus: rarity.index >= ItemRarity.epic.index ? rarity.index : 0,
wisBonus: rarity.index >= ItemRarity.rare.index ? rarity.index - 1 : 0,
),
return ItemStats(def: def, hpBonus: hpBonus, evasion: evasionBonus);
// 갑옷: HP, CON 보너스 (주력 방어구)
EquipmentSlot.hauberk => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue : 0,
conBonus: rarity.index >= ItemRarity.rare.index ? rarity.index : 0,
strBonus: rarity.index >= ItemRarity.epic.index ? rarity.index - 1 : 0,
),
// 상완갑: STR 보너스
EquipmentSlot.brassairts => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 4 : 0,
strBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
),
// 전완갑: DEX 보너스
EquipmentSlot.vambraces => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 4 : 0,
dexBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
),
// 건틀릿: STR, 크리티컬 보너스
EquipmentSlot.gauntlets => ItemStats(
def: def,
criRate: rarity.index >= ItemRarity.rare.index
? 0.01 + rarity.index * 0.005
: 0.0,
strBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
),
// 갬비슨: HP, MP 보너스
EquipmentSlot.gambeson => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue ~/ 2 : 0,
mpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue ~/ 3 : 0,
wisBonus: rarity.index >= ItemRarity.epic.index ? rarity.index - 1 : 0,
),
// 허벅지갑: CON, 회피 보너스
EquipmentSlot.cuisses => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
conBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
evasion: rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0,
),
// 정강이갑: CON, 회피 보너스
EquipmentSlot.greaves => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
conBonus:
rarity.index >= ItemRarity.rare.index ? rarity.index - 1 : 0,
evasion: rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0,
),
// 철제부츠: DEX, 회피 보너스
EquipmentSlot.sollerets => ItemStats(
def: def,
dexBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
evasion: rarity.index >= ItemRarity.rare.index
? 0.01 + rarity.index * 0.005
: 0.0,
),
// 기본 (무기, 방패는 여기 안옴)
_ => ItemStats(
def: def,
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 2 : 0,
),
};
}
// ============================================================================

View File

@@ -970,6 +970,8 @@ class ProgressService {
// 보스전 사망이 아닐 경우에만 장비 손실
var newEquipment = state.equipment;
var lostCount = 0;
String? lostItemName;
EquipmentSlot? lostItemSlot;
if (!isBossDeath) {
// 무기(슬롯 0)를 제외한 장착된 장비 중 1개를 제물로 삭제
@@ -987,12 +989,16 @@ class ProgressService {
equippedNonWeaponSlots[state.rng.nextInt(
equippedNonWeaponSlots.length,
)];
final slot = EquipmentSlot.values[sacrificeIndex];
// 제물로 바칠 아이템 정보 저장
final lostItem = state.equipment.getItemByIndex(sacrificeIndex);
lostItemName = lostItem.name;
lostItemSlot = EquipmentSlot.values[sacrificeIndex];
// 해당 슬롯을 빈 장비로 교체
newEquipment = newEquipment.setItemByIndex(
sacrificeIndex,
EquipmentItem.empty(slot),
EquipmentItem.empty(lostItemSlot),
);
}
}
@@ -1002,6 +1008,8 @@ class ProgressService {
cause: cause,
killerName: killerName,
lostEquipmentCount: lostCount,
lostItemName: lostItemName,
lostItemSlot: lostItemSlot,
goldAtDeath: state.inventory.gold,
levelAtDeath: state.traits.level,
timestamp: state.skillSystem.elapsedMs,

View File

@@ -63,15 +63,22 @@ class SkillService {
required MonsterCombatStats monster,
required SkillSystemState skillSystem,
}) {
// 데미지 타입에 따른 공격력/방어력 선택
final (attackStat, defenseStat) = _getStatsByDamageType(
skill.damageType,
player,
monster,
);
// 기본 데미지 계산
final baseDamage = player.atk * skill.damageMultiplier;
final baseDamage = attackStat * skill.damageMultiplier;
// 버프 효과 적용
final buffMods = skillSystem.totalBuffModifiers;
final buffedDamage = baseDamage * (1 + buffMods.atkMod);
// 적 방어력 감소 적용
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
final effectiveMonsterDef = defenseStat * (1 - skill.targetDefReduction);
// 최종 데미지 계산 (방어력 감산 0.3)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
@@ -636,15 +643,22 @@ class SkillService {
// 실제 MP 비용 계산
final actualMpCost = (skill.mpCost * mpMult).round();
// 데미지 타입에 따른 공격력/방어력 선택
final (attackStat, defenseStat) = _getStatsByDamageType(
skill.damageType,
player,
monster,
);
// 기본 데미지 계산 (랭크 배율 적용)
final baseDamage = player.atk * skill.damageMultiplier * rankMult;
final baseDamage = attackStat * skill.damageMultiplier * rankMult;
// 버프 효과 적용
final buffMods = skillSystem.totalBuffModifiers;
final buffedDamage = baseDamage * (1 + buffMods.atkMod);
// 적 방어력 감소 적용
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
final effectiveMonsterDef = defenseStat * (1 - skill.targetDefReduction);
// 최종 데미지 계산 (방어력 감산 0.3)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
@@ -708,4 +722,32 @@ class SkillService {
return state.copyWith(skillStates: skillStates);
}
// ============================================================================
// 데미지 타입 헬퍼
// ============================================================================
/// 데미지 타입에 따른 공격력/방어력 스탯 반환
///
/// [damageType] 스킬의 데미지 타입
/// [player] 플레이어 전투 스탯
/// [monster] 몬스터 전투 스탯
/// Returns: (공격력, 방어력) 튜플
(double, double) _getStatsByDamageType(
DamageType damageType,
CombatStats player,
MonsterCombatStats monster,
) {
return switch (damageType) {
DamageType.physical => (player.atk.toDouble(), monster.def.toDouble()),
DamageType.magical => (
player.magAtk.toDouble(),
monster.magDef.toDouble(),
),
DamageType.hybrid => (
(player.atk + player.magAtk) / 2,
(monster.def + monster.magDef) / 2,
),
};
}
}

View File

@@ -131,6 +131,7 @@ class DeathInfo {
required this.levelAtDeath,
required this.timestamp,
this.lostItemName,
this.lostItemSlot,
this.lastCombatEvents = const [],
});
@@ -146,6 +147,9 @@ class DeathInfo {
/// 제물로 바친 아이템 이름 (null이면 없음)
final String? lostItemName;
/// 제물로 바친 아이템 슬롯 (null이면 없음)
final EquipmentSlot? lostItemSlot;
/// 사망 시점 골드
final int goldAtDeath;
@@ -163,6 +167,7 @@ class DeathInfo {
String? killerName,
int? lostEquipmentCount,
String? lostItemName,
EquipmentSlot? lostItemSlot,
int? goldAtDeath,
int? levelAtDeath,
int? timestamp,
@@ -173,6 +178,7 @@ class DeathInfo {
killerName: killerName ?? this.killerName,
lostEquipmentCount: lostEquipmentCount ?? this.lostEquipmentCount,
lostItemName: lostItemName ?? this.lostItemName,
lostItemSlot: lostItemSlot ?? this.lostItemSlot,
goldAtDeath: goldAtDeath ?? this.goldAtDeath,
levelAtDeath: levelAtDeath ?? this.levelAtDeath,
timestamp: timestamp ?? this.timestamp,

View File

@@ -22,6 +22,7 @@ class MonsterCombatStats {
required this.level,
required this.atk,
required this.def,
required this.magDef,
required this.hpMax,
required this.hpCurrent,
required this.criRate,
@@ -41,9 +42,12 @@ class MonsterCombatStats {
/// 공격력
final int atk;
/// 방어력
/// 물리 방어력
final int def;
/// 마법 방어력
final int magDef;
/// 최대 HP
final int hpMax;
@@ -96,6 +100,7 @@ class MonsterCombatStats {
int? level,
int? atk,
int? def,
int? magDef,
int? hpMax,
int? hpCurrent,
double? criRate,
@@ -110,6 +115,7 @@ class MonsterCombatStats {
level: level ?? this.level,
atk: atk ?? this.atk,
def: def ?? this.def,
magDef: magDef ?? this.magDef,
hpMax: hpMax ?? this.hpMax,
hpCurrent: hpCurrent ?? this.hpCurrent,
criRate: criRate ?? this.criRate,
@@ -173,11 +179,16 @@ class MonsterCombatStats {
MonsterSpeedType.slow => 1400,
};
// 마법 방어력: 물리 방어력의 70~130% (레벨에 따라 변동)
final magDefRatio = 0.7 + (level % 60) * 0.01; // 0.7 ~ 1.3
final magDef = (baseStats.def * magDefRatio).round();
return MonsterCombatStats(
name: name,
level: level,
atk: baseStats.atk,
def: baseStats.def,
magDef: magDef,
hpMax: adjustedHp,
hpCurrent: adjustedHp,
criRate: criRate,
@@ -202,6 +213,7 @@ class MonsterCombatStats {
level: bossLevel,
atk: bossStats.atk,
def: bossStats.def,
magDef: (bossStats.def * 1.2).round(), // 보스는 마법 방어력 20% 증가
hpMax: bossStats.hp,
hpCurrent: bossStats.hp,
criRate: 0.25, // 보스 크리티컬 확률 25%
@@ -244,6 +256,7 @@ class MonsterCombatStats {
level: 1,
atk: 8,
def: 3,
magDef: 3,
hpMax: 35,
hpCurrent: 35,
criRate: 0.02,
@@ -264,6 +277,7 @@ class MonsterCombatStats {
level: 0, // PvP에서는 레벨 페널티 없음
atk: stats.atk,
def: stats.def,
magDef: stats.magDef,
hpMax: stats.hpMax,
hpCurrent: stats.hpMax, // 풀 HP로 시작
criRate: stats.criRate,

View File

@@ -4,8 +4,9 @@
/// 스펠 랭크에 따른 스킬 배율 계산
///
/// 랭크 1: 1.0x, 랭크 2: 1.15x, 랭크 3: 1.30x, ...
double getRankMultiplier(int rank) => 1.0 + (rank - 1) * 0.15;
/// 랭크 1: 1.0x, 랭크 2: 1.08x, 랭크 3: 1.16x, ... 최대 1.72x (rank 10)
/// Phase 3 밸런스: 0.15 → 0.08로 하향
double getRankMultiplier(int rank) => 1.0 + (rank - 1) * 0.08;
/// 랭크에 따른 쿨타임 감소율 계산
///
@@ -38,6 +39,18 @@ enum SkillType {
debuff,
}
/// 데미지 타입 (물리/마법 구분)
enum DamageType {
/// 물리 공격 - STR + atk 기반, 적 def로 방어
physical,
/// 마법 공격 - INT + magAtk 기반, 적 magDef로 방어
magical,
/// 하이브리드 - (atk + magAtk) / 2, (def + magDef) / 2
hybrid,
}
/// 스킬 속성 (하이브리드: 코드 + 시스템)
enum SkillElement {
/// 논리 (Logic) - 순수 데미지
@@ -118,6 +131,7 @@ class Skill {
required this.cooldownMs,
required this.power,
this.tier = 1,
this.damageType = DamageType.physical,
this.damageMultiplier = 1.0,
this.healAmount = 0,
this.healPercent = 0.0,
@@ -137,6 +151,9 @@ class Skill {
/// 스킬 티어 (1~5, 높을수록 강함)
final int tier;
/// 데미지 타입 (물리/마법/하이브리드)
final DamageType damageType;
/// 스킬 ID
final String id;

View File

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:asciineverdie/data/game_text_l10n.dart' as l10n;
import 'package:asciineverdie/src/core/l10n/game_data_l10n.dart';
import 'package:asciineverdie/src/core/model/combat_event.dart';
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
import 'package:asciineverdie/src/core/model/game_state.dart';
import 'package:asciineverdie/src/shared/retro_colors.dart';
@@ -293,6 +294,11 @@ class DeathOverlay extends StatelessWidget {
final expColor = RetroColors.expOf(context);
final gold = RetroColors.goldOf(context);
// 슬롯명 + 아이템명 조합
final lostItemDisplay = hasLostItem
? '[${_getSlotName(deathInfo.lostItemSlot)}] ${deathInfo.lostItemName}'
: null;
return Column(
children: [
// 제물로 바친 아이템 표시
@@ -321,10 +327,10 @@ class DeathOverlay extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
deathInfo.lostItemName!,
lostItemDisplay!,
style: TextStyle(
fontFamily: 'PressStart2P',
fontSize: 14,
fontSize: 13,
color: hpColor,
),
),
@@ -671,4 +677,22 @@ class DeathOverlay extends StatelessWidget {
),
};
}
/// 장비 슬롯 이름 반환
String _getSlotName(EquipmentSlot? slot) {
if (slot == null) return '';
return switch (slot) {
EquipmentSlot.weapon => l10n.slotWeapon,
EquipmentSlot.shield => l10n.slotShield,
EquipmentSlot.helm => l10n.slotHelm,
EquipmentSlot.hauberk => l10n.slotHauberk,
EquipmentSlot.brassairts => l10n.slotBrassairts,
EquipmentSlot.vambraces => l10n.slotVambraces,
EquipmentSlot.gauntlets => l10n.slotGauntlets,
EquipmentSlot.gambeson => l10n.slotGambeson,
EquipmentSlot.cuisses => l10n.slotCuisses,
EquipmentSlot.greaves => l10n.slotGreaves,
EquipmentSlot.sollerets => l10n.slotSollerets,
};
}
}

View File

@@ -285,7 +285,7 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
);
}
/// 컴팩트 HP 바
/// 컴팩트 HP 바 (숫자 오버레이)
Widget _buildCompactHpBar() {
final ratio = _currentHpMax > 0 ? _currentHp / _currentHpMax : 0.0;
final isLow = ratio < 0.2 && ratio > 0;
@@ -320,29 +320,42 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
),
),
),
// 프로그레스
// 프로그레스 바 + 숫자 오버레이
Expanded(
child: ClipRRect(
borderRadius: const BorderRadius.horizontal(
right: Radius.circular(3),
),
child: LinearProgressIndicator(
value: ratio.clamp(0.0, 1.0),
backgroundColor: Colors.red.withValues(alpha: 0.2),
valueColor: AlwaysStoppedAnimation(
isLow ? Colors.red : Colors.red.shade600,
child: Stack(
alignment: Alignment.center,
children: [
// 프로그레스 바
ClipRRect(
borderRadius: const BorderRadius.horizontal(
right: Radius.circular(3),
),
child: LinearProgressIndicator(
value: ratio.clamp(0.0, 1.0),
backgroundColor: Colors.red.withValues(alpha: 0.2),
valueColor: AlwaysStoppedAnimation(
isLow ? Colors.red : Colors.red.shade600,
),
minHeight: 20,
),
),
minHeight: 20,
),
),
),
// 수치
Container(
width: 56,
alignment: Alignment.center,
child: Text(
'$_currentHp/$_currentHpMax',
style: const TextStyle(fontSize: 11, color: Colors.white),
// 숫자 오버레이 (바 중앙)
Text(
'$_currentHp/$_currentHpMax',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: Colors.white,
shadows: [
Shadow(
color: Colors.black.withValues(alpha: 0.9),
blurRadius: 2,
),
const Shadow(color: Colors.black, blurRadius: 4),
],
),
),
],
),
),
],
@@ -352,7 +365,7 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
// 플로팅 변화량
if (_hpChange != 0 && _hpFlashAnimation.value > 0.05)
Positioned(
right: 50,
right: 20,
top: -8,
child: Transform.translate(
offset: Offset(0, -10 * (1 - _hpFlashAnimation.value)),
@@ -378,7 +391,7 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
);
}
/// 컴팩트 MP 바
/// 컴팩트 MP 바 (숫자 오버레이)
Widget _buildCompactMpBar() {
final ratio = _currentMpMax > 0 ? _currentMp / _currentMpMax : 0.0;
@@ -408,27 +421,42 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
),
),
),
// 프로그레스 바 + 숫자 오버레이
Expanded(
child: ClipRRect(
borderRadius: const BorderRadius.horizontal(
right: Radius.circular(3),
),
child: LinearProgressIndicator(
value: ratio.clamp(0.0, 1.0),
backgroundColor: Colors.blue.withValues(alpha: 0.2),
valueColor: AlwaysStoppedAnimation(
Colors.blue.shade600,
child: Stack(
alignment: Alignment.center,
children: [
// 프로그레스 바
ClipRRect(
borderRadius: const BorderRadius.horizontal(
right: Radius.circular(3),
),
child: LinearProgressIndicator(
value: ratio.clamp(0.0, 1.0),
backgroundColor: Colors.blue.withValues(alpha: 0.2),
valueColor: AlwaysStoppedAnimation(
Colors.blue.shade600,
),
minHeight: 20,
),
),
minHeight: 20,
),
),
),
Container(
width: 56,
alignment: Alignment.center,
child: Text(
'$_currentMp/$_currentMpMax',
style: const TextStyle(fontSize: 11, color: Colors.white),
// 숫자 오버레이 (바 중앙)
Text(
'$_currentMp/$_currentMpMax',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: Colors.white,
shadows: [
Shadow(
color: Colors.black.withValues(alpha: 0.9),
blurRadius: 2,
),
const Shadow(color: Colors.black, blurRadius: 4),
],
),
),
],
),
),
],
@@ -437,7 +465,7 @@ class _EnhancedAnimationPanelState extends State<EnhancedAnimationPanel>
if (_mpChange != 0 && _mpFlashAnimation.value > 0.05)
Positioned(
right: 50,
right: 20,
top: -8,
child: Transform.translate(
offset: Offset(0, -10 * (1 - _mpFlashAnimation.value)),

View File

@@ -288,7 +288,7 @@ class _HpMpBarState extends State<HpMpBar> with TickerProviderStateMixin {
);
}
/// 레트로 스타일 세그먼트 바
/// 레트로 스타일 세그먼트 바 (숫자 바 위 오버레이)
Widget _buildRetroBar({
required String label,
required int current,
@@ -316,53 +316,62 @@ class _HpMpBarState extends State<HpMpBar> with TickerProviderStateMixin {
),
),
),
// 세그먼트 바
// 세그먼트 바 (숫자 오버레이)
Expanded(
child: Container(
height: 12,
decoration: BoxDecoration(
color: emptyColor.withValues(alpha: 0.3),
border: Border.all(color: RetroColors.panelBorderOuter, width: 1),
),
child: Row(
children: List.generate(segmentCount, (index) {
final isFilled = index < filledSegments;
return Expanded(
child: Container(
decoration: BoxDecoration(
color: isFilled
? fillColor.withValues(alpha: blinkOpacity)
: emptyColor.withValues(alpha: 0.2),
border: Border(
right: index < segmentCount - 1
? BorderSide(
color: RetroColors.panelBorderOuter.withValues(
alpha: 0.3,
),
width: 1,
)
: BorderSide.none,
child: Stack(
alignment: Alignment.center,
children: [
// 세그먼트 바
Container(
height: 14,
decoration: BoxDecoration(
color: emptyColor.withValues(alpha: 0.3),
border:
Border.all(color: RetroColors.panelBorderOuter, width: 1),
),
child: Row(
children: List.generate(segmentCount, (index) {
final isFilled = index < filledSegments;
return Expanded(
child: Container(
decoration: BoxDecoration(
color: isFilled
? fillColor.withValues(alpha: blinkOpacity)
: emptyColor.withValues(alpha: 0.2),
border: Border(
right: index < segmentCount - 1
? BorderSide(
color:
RetroColors.panelBorderOuter.withValues(
alpha: 0.3,
),
width: 1,
)
: BorderSide.none,
),
),
),
);
}),
),
),
// 숫자 오버레이 (바 중앙)
Text(
'$current/$max',
style: TextStyle(
fontFamily: 'PressStart2P',
fontSize: 12,
color: RetroColors.textLight.withValues(alpha: blinkOpacity),
shadows: [
Shadow(
color: Colors.black.withValues(alpha: 0.9),
blurRadius: 2,
),
),
);
}),
),
),
),
const SizedBox(width: 6),
// 수치 표시
SizedBox(
width: 60,
child: Text(
'$current/$max',
style: const TextStyle(
fontFamily: 'PressStart2P',
fontSize: 13,
color: RetroColors.textLight,
),
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
const Shadow(color: Colors.black, blurRadius: 4),
],
),
),
],
),
),
],

View File

@@ -24,6 +24,7 @@ void main() {
level: 1,
atk: 10,
def: 50, // DEF 50 → 50 * 0.4 = 20 감소
magDef: 50,
hpMax: 100,
hpCurrent: 100,
criRate: 0.05,
@@ -63,6 +64,7 @@ void main() {
level: 1,
atk: 10,
def: 0, // DEF 0
magDef: 0,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -100,6 +102,7 @@ void main() {
level: 1,
atk: 10,
def: 0,
magDef: 0,
hpMax: 100,
hpCurrent: 100,
criRate: 0.05,
@@ -135,6 +138,7 @@ void main() {
level: 1,
atk: 100,
def: 0,
magDef: 0,
hpMax: 100,
hpCurrent: 100,
criRate: 0.0, // 크리티컬 없음
@@ -174,6 +178,7 @@ void main() {
level: 1,
atk: 100,
def: 0,
magDef: 0,
hpMax: 100,
hpCurrent: 100,
criRate: 0.0,
@@ -221,6 +226,7 @@ void main() {
level: 1,
atk: 10,
def: 10,
magDef: 10,
hpMax: 100,
hpCurrent: 100,
criRate: 0.05,
@@ -255,6 +261,7 @@ void main() {
level: 1,
atk: 10,
def: 5,
magDef: 5,
hpMax: 50,
hpCurrent: 50,
criRate: 0.05,
@@ -270,6 +277,7 @@ void main() {
level: 10,
atk: 50,
def: 20,
magDef: 20,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -314,6 +322,7 @@ void main() {
level: 1,
atk: 30,
def: 10,
magDef: 10,
hpMax: 80,
hpCurrent: 80,
criRate: 0.05,

View File

@@ -23,6 +23,7 @@ void main() {
level: 1,
atk: 10,
def: 5,
magDef: 5,
hpMax: 50,
hpCurrent: 0, // 몬스터 사망
criRate: 0.05,

View File

@@ -74,6 +74,7 @@ void main() {
level: 10,
atk: 10,
def: 5,
magDef: 5,
hpMax: 100,
hpCurrent: 0, // 몬스터 사망 상태
criRate: 0.05,

View File

@@ -103,6 +103,7 @@ void main() {
level: 1,
atk: 10,
def: 50, // DEF 50 → 50 * 0.3 = 15 감소
magDef: 50,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -124,7 +125,7 @@ void main() {
// ATK 100 * 2.0 - DEF 50 * 0.3 = 200 - 15 = 185
expect(result.result.success, isTrue);
expect(result.result.damage, equals(185));
expect(result.updatedPlayer.mpCurrent, equals(40)); // 50 - 10
expect(result.updatedPlayer.mpCurrent, equals(20)); // 50 - 30 (mpCost 30)
expect(result.updatedMonster.hpCurrent, equals(315)); // 500 - 185
});
@@ -143,6 +144,7 @@ void main() {
level: 1,
atk: 10,
def: 0,
magDef: 0,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -196,6 +198,7 @@ void main() {
level: 1,
atk: 10,
def: 0,
magDef: 0,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -217,7 +220,7 @@ void main() {
// 랭크 1: 1.0x → ATK 100 * 2.0 * 1.0 = 200
expect(result.result.damage, equals(200));
expect(result.updatedPlayer.mpCurrent, equals(40)); // MP 10 소모
expect(result.updatedPlayer.mpCurrent, equals(20)); // MP 30 소모
});
test('랭크 5 데미지 스케일링', () {
@@ -235,6 +238,7 @@ void main() {
level: 1,
atk: 10,
def: 0,
magDef: 0,
hpMax: 500,
hpCurrent: 500,
criRate: 0.05,
@@ -254,12 +258,12 @@ void main() {
rank: 5,
);
// 랭크 5: 1.6x (1.0 + 4 * 0.15)
// ATK 100 * 2.0 * 1.6 = 320
expect(result.result.damage, equals(320));
// 랭크 5: 1.32x (1.0 + 4 * 0.08) - 랭크 배율 하향
// ATK 100 * 2.0 * 1.32 = 264
expect(result.result.damage, equals(264));
// MP 비용: 10 * (1.0 - 4 * 0.03) = 10 * 0.88 = 9 (반올림)
expect(result.updatedPlayer.mpCurrent, equals(41)); // 50 - 9
// MP 비용: 30 * (1.0 - 4 * 0.03) = 30 * 0.88 = 26 (반올림)
expect(result.updatedPlayer.mpCurrent, equals(24)); // 50 - 26
});
});
@@ -268,12 +272,12 @@ void main() {
final rng = DeterministicRandom(42);
final service = SkillService(rng: rng);
const skill = SkillData.hotReload; // healAmount: 30
const skill = SkillData.hotReload; // healAmount: 30, mpCost: 80
final player = CombatStats.empty().copyWith(
hpMax: 200,
hpCurrent: 100,
mpMax: 100,
mpCurrent: 50,
mpMax: 200,
mpCurrent: 150,
);
final skillSystem = SkillSystemState.empty().copyWith(elapsedMs: 5000);
@@ -286,7 +290,7 @@ void main() {
expect(result.result.success, isTrue);
expect(result.result.healedAmount, equals(30));
expect(result.updatedPlayer.hpCurrent, equals(130)); // 100 + 30
expect(result.updatedPlayer.mpCurrent, equals(35)); // 50 - 15
expect(result.updatedPlayer.mpCurrent, equals(70)); // 150 - 80
});
test('퍼센트 회복량', () {
@@ -483,6 +487,7 @@ void main() {
level: 1,
atk: 10,
def: 10,
magDef: 10,
hpMax: 100,
hpCurrent: 100,
criRate: 0.05,
@@ -512,14 +517,15 @@ void main() {
final player = CombatStats.empty().copyWith(
hpMax: 100,
hpCurrent: 20, // 20% HP
mpMax: 100,
mpCurrent: 80,
mpMax: 200,
mpCurrent: 150, // 힐 스킬 사용 가능한 MP (garbageCollection: 130)
);
final monster = MonsterCombatStats(
name: 'Test Monster',
level: 1,
atk: 10,
def: 10,
magDef: 10,
hpMax: 100,
hpCurrent: 100,
criRate: 0.05,
@@ -548,10 +554,10 @@ void main() {
final rng = DeterministicRandom(42);
final service = SkillService(rng: rng);
const skill = SkillData.debugMode; // ATK +25% 버프
const skill = SkillData.debugMode; // ATK +25% 버프, mpCost: 100
final player = CombatStats.empty().copyWith(
mpMax: 100,
mpCurrent: 50,
mpMax: 200,
mpCurrent: 150,
);
final skillSystem = SkillSystemState.empty().copyWith(elapsedMs: 5000);
@@ -568,7 +574,7 @@ void main() {
equals(0.25),
);
expect(result.updatedSkillSystem.activeBuffs.length, equals(1));
expect(result.updatedPlayer.mpCurrent, equals(30)); // 50 - 20
expect(result.updatedPlayer.mpCurrent, equals(50)); // 150 - 100
});
test('중복 버프 제거 후 새 버프 적용', () {
@@ -648,11 +654,12 @@ void main() {
group('getRankMultiplier', () {
test('랭크별 배율 계산', () {
// 랭크 배율 하향: 0.15 → 0.08 per rank
expect(getRankMultiplier(1), equals(1.0));
expect(getRankMultiplier(2), closeTo(1.15, 0.001));
expect(getRankMultiplier(3), closeTo(1.30, 0.001));
expect(getRankMultiplier(5), closeTo(1.60, 0.001));
expect(getRankMultiplier(10), closeTo(2.35, 0.001));
expect(getRankMultiplier(2), closeTo(1.08, 0.001));
expect(getRankMultiplier(3), closeTo(1.16, 0.001));
expect(getRankMultiplier(5), closeTo(1.32, 0.001));
expect(getRankMultiplier(10), closeTo(1.72, 0.001));
});
});

View File

@@ -118,6 +118,7 @@ class MockFactories {
level: monsterLevel,
atk: 10,
def: 5,
magDef: 5,
hpMax: monsterHpMax,
hpCurrent: monsterHpCurrent,
criRate: 0.05,
@@ -146,6 +147,7 @@ class MockFactories {
int level = 1,
int atk = 10,
int def = 5,
int magDef = 5,
int hpMax = 100,
int? hpCurrent,
double criRate = 0.05,
@@ -160,6 +162,7 @@ class MockFactories {
level: level,
atk: atk,
def: def,
magDef: magDef,
hpMax: hpMax,
hpCurrent: hpCurrent ?? hpMax,
criRate: criRate,
@@ -182,6 +185,7 @@ class MockFactories {
level: level,
atk: base.atk,
def: base.def,
magDef: base.def, // 물리 방어와 동일
hpMax: base.hp,
hpCurrent: base.hp,
criRate: 0.05,