fix(model): copyWith currentCombat null 초기화 버그 수정 및 테스트 추가

- ProgressState.copyWith에 clearCurrentCombat 파라미터 추가
- death_handler, resurrection_service에서 clearCurrentCombat 사용
- death_handler 테스트 14개 추가
- item_service 테스트 33개 추가
- skill_data 주석 스킬 개수 70→68 수정
This commit is contained in:
JiWoong Sul
2026-03-19 14:53:04 +09:00
parent c4280c929d
commit 2e66562ea2
6 changed files with 979 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ import 'package:asciineverdie/src/core/model/skill.dart';
/// 게임 내 스킬 정의
///
/// PQ 스펠 70개를 전투 스킬로 매핑
/// PQ 스펠을 기반으로 68개 전투 스킬로 재구성
/// 스펠 이름(영문)으로 스킬 조회 가능
class SkillData {
SkillData._();

View File

@@ -72,7 +72,7 @@ class DeathHandler {
// 전투 상태 초기화 및 사망 횟수 증가
final progress = state.progress.copyWith(
currentCombat: null,
clearCurrentCombat: true,
deathCount: state.progress.deathCount + 1,
bossLevelingEndTime: bossLevelingEndTime,
);

View File

@@ -78,7 +78,7 @@ class ResurrectionService {
);
// 전투 상태 초기화
final progress = state.progress.copyWith(currentCombat: null);
final progress = state.progress.copyWith(clearCurrentCombat: true);
return state.copyWith(
equipment: newEquipment,

View File

@@ -160,6 +160,7 @@ class ProgressState {
bool? pendingActCompletion,
int? bossLevelingEndTime,
bool clearBossLevelingEndTime = false,
bool clearCurrentCombat = false,
}) {
return ProgressState(
task: task ?? this.task,
@@ -173,7 +174,9 @@ class ProgressState {
plotHistory: plotHistory ?? this.plotHistory,
questHistory: questHistory ?? this.questHistory,
currentQuestMonster: currentQuestMonster ?? this.currentQuestMonster,
currentCombat: currentCombat ?? this.currentCombat,
currentCombat: clearCurrentCombat
? null
: (currentCombat ?? this.currentCombat),
monstersKilled: monstersKilled ?? this.monstersKilled,
deathCount: deathCount ?? this.deathCount,
finalBossState: finalBossState ?? this.finalBossState,