fix(ui): 사망 화면 장비 슬롯명 표시 및 기타 수정
- 사망 시 잃은 아이템에 슬롯명 표시 추가 - progress_service 마이너 수정 - 관련 테스트 업데이트
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user