feat(balance): 레벨 기반 장비 손실 확률 시스템
- 저레벨 사망 스파이럴 방지 - 장비 손실 확률 = (레벨 - 5) * 10% - Lv 1~5: 0% (절대 안전) - Lv 6: 10% - Lv 10: 50% - Lv 15+: 100% - 디버그 로그 추가
This commit is contained in:
@@ -974,20 +974,26 @@ class ProgressService {
|
||||
ItemRarity? lostItemRarity;
|
||||
|
||||
if (!isBossDeath) {
|
||||
// 레벨 기반 장비 손실 확률 계산
|
||||
// Lv 1~5: 0%, Lv 6: 10%, Lv 10: 50%, Lv 15+: 100%
|
||||
final level = state.traits.level;
|
||||
final lossChancePercent = ((level - 5) * 10).clamp(0, 100);
|
||||
final roll = state.rng.nextInt(100); // 0~99
|
||||
final shouldLoseEquipment = roll < lossChancePercent;
|
||||
|
||||
// ignore: avoid_print
|
||||
print('[Death] Lv$level lossChance=$lossChancePercent% roll=$roll '
|
||||
'shouldLose=$shouldLoseEquipment');
|
||||
|
||||
if (shouldLoseEquipment) {
|
||||
// 무기(슬롯 0)를 제외한 장착된 장비 중 1개를 제물로 삭제
|
||||
final equippedNonWeaponSlots = <int>[];
|
||||
for (var i = 1; i < Equipment.slotCount; i++) {
|
||||
final item = state.equipment.getItemByIndex(i);
|
||||
// 디버그: 장비 슬롯 상태 확인
|
||||
// ignore: avoid_print
|
||||
print('[Death] Slot $i: "${item.name}" isEmpty=${item.isEmpty}');
|
||||
if (item.isNotEmpty) {
|
||||
equippedNonWeaponSlots.add(i);
|
||||
}
|
||||
}
|
||||
// 디버그: 장착된 슬롯 목록
|
||||
// ignore: avoid_print
|
||||
print('[Death] equippedNonWeaponSlots: $equippedNonWeaponSlots');
|
||||
|
||||
if (equippedNonWeaponSlots.isNotEmpty) {
|
||||
lostCount = 1;
|
||||
@@ -1008,6 +1014,10 @@ class ProgressService {
|
||||
sacrificeIndex,
|
||||
EquipmentItem.empty(lostItemSlot),
|
||||
);
|
||||
|
||||
// ignore: avoid_print
|
||||
print('[Death] Lost item: $lostItemName (slot: $lostItemSlot)');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user