feat(hall-of-fame): 명예의 전당 상세 UI 및 전투 스탯 저장 추가
- CombatStats에 toJson/fromJson 직렬화 메서드 추가 - HallOfFameEntry에 finalStats(CombatStats) 필드 추가 - 명예의 전당 상세 다이얼로그에서 전투 스탯, 장비, 스펠 표시 - GameState에 combatStats 접근자 추가 - game_text_l10n에 명예의 전당 관련 텍스트 추가
This commit is contained in:
@@ -391,6 +391,60 @@ class CombatStats {
|
||||
);
|
||||
}
|
||||
|
||||
/// JSON으로 직렬화
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'str': str,
|
||||
'con': con,
|
||||
'dex': dex,
|
||||
'intelligence': intelligence,
|
||||
'wis': wis,
|
||||
'cha': cha,
|
||||
'atk': atk,
|
||||
'def': def,
|
||||
'magAtk': magAtk,
|
||||
'magDef': magDef,
|
||||
'criRate': criRate,
|
||||
'criDamage': criDamage,
|
||||
'evasion': evasion,
|
||||
'accuracy': accuracy,
|
||||
'blockRate': blockRate,
|
||||
'parryRate': parryRate,
|
||||
'attackDelayMs': attackDelayMs,
|
||||
'hpMax': hpMax,
|
||||
'hpCurrent': hpCurrent,
|
||||
'mpMax': mpMax,
|
||||
'mpCurrent': mpCurrent,
|
||||
};
|
||||
}
|
||||
|
||||
/// JSON에서 역직렬화
|
||||
factory CombatStats.fromJson(Map<String, dynamic> json) {
|
||||
return CombatStats(
|
||||
str: json['str'] as int,
|
||||
con: json['con'] as int,
|
||||
dex: json['dex'] as int,
|
||||
intelligence: json['intelligence'] as int,
|
||||
wis: json['wis'] as int,
|
||||
cha: json['cha'] as int,
|
||||
atk: json['atk'] as int,
|
||||
def: json['def'] as int,
|
||||
magAtk: json['magAtk'] as int,
|
||||
magDef: json['magDef'] as int,
|
||||
criRate: (json['criRate'] as num).toDouble(),
|
||||
criDamage: (json['criDamage'] as num).toDouble(),
|
||||
evasion: (json['evasion'] as num).toDouble(),
|
||||
accuracy: (json['accuracy'] as num).toDouble(),
|
||||
blockRate: (json['blockRate'] as num).toDouble(),
|
||||
parryRate: (json['parryRate'] as num).toDouble(),
|
||||
attackDelayMs: json['attackDelayMs'] as int,
|
||||
hpMax: json['hpMax'] as int,
|
||||
hpCurrent: json['hpCurrent'] as int,
|
||||
mpMax: json['mpMax'] as int,
|
||||
mpCurrent: json['mpCurrent'] as int,
|
||||
);
|
||||
}
|
||||
|
||||
/// 테스트/디버그용 기본값
|
||||
factory CombatStats.empty() => const CombatStats(
|
||||
str: 10,
|
||||
|
||||
Reference in New Issue
Block a user