feat(core): i18n 및 핵심 로직 개선
- 수익화 관련 텍스트 추가 - item_service 수정 - progress_service 수정
This commit is contained in:
@@ -141,14 +141,56 @@ String get deathNoSacrificeNeeded =>
|
||||
_l('No sacrifice needed', '희생 없이 부활', '犠牲なしで復活');
|
||||
String get deathCoinRemaining => _l('Coin Remaining', '남은 코인', '残りコイン');
|
||||
String get deathResurrect => _l('Resurrect', '부활', '復活');
|
||||
String get deathAutoResurrect => _l('Auto Resurrect', '자동 부활', '自動復活');
|
||||
String get deathCombatLog => _l('Combat Log', '전투 기록', '戦闘ログ');
|
||||
|
||||
// 광고 부활 (통합)
|
||||
String get deathAdRevive => _l('Watch Ad & Revive', '광고보고 부활', '広告視聴で復活');
|
||||
String get deathAdReviveHp => _l('HP 100% Recovery', 'HP 100% 회복', 'HP 100%回復');
|
||||
String get deathAdReviveItem => _l('Item Recovery', '아이템 복구', 'アイテム回収');
|
||||
String get deathAdReviveAuto =>
|
||||
_l('10min Auto-Revive Buff', '10분간 자동부활 버프', '10分間自動復活バフ');
|
||||
String get deathAdRevivePaidDesc =>
|
||||
_l('Premium: No ads required', '프리미엄: 광고 없이 이용', 'プレミアム: 広告不要');
|
||||
|
||||
String deathKilledBy(String killerName) =>
|
||||
_l('Killed by $killerName', '$killerName에게 사망', '$killerNameに倒された');
|
||||
String get deathEnvironmentalHazard =>
|
||||
_l('Environmental hazard', '환경 피해로 사망', '環境ダメージで死亡');
|
||||
|
||||
// ============================================================================
|
||||
// 속도 부스트 (Phase 6)
|
||||
// ============================================================================
|
||||
|
||||
String get speedBoostTitle =>
|
||||
_l('Speed Boost', '속도 부스트', 'スピードブースト');
|
||||
String get speedBoostActivate =>
|
||||
_l('Activate 10x Speed', '10배속 활성화', '10倍速を有効化');
|
||||
String speedBoostRemaining(int seconds) =>
|
||||
_l('${seconds}s remaining', '${seconds}초 남음', '残り${seconds}秒');
|
||||
String get speedBoostActive =>
|
||||
_l('BOOST ACTIVE', '부스트 활성화', 'ブースト中');
|
||||
|
||||
// ============================================================================
|
||||
// 복귀 보상 (Phase 7)
|
||||
// ============================================================================
|
||||
|
||||
String get returnRewardTitle =>
|
||||
_l('Welcome Back!', '돌아오셨군요!', 'おかえりなさい!');
|
||||
String returnRewardHoursAway(String time) =>
|
||||
_l('You were away for $time', '$time 동안 떠나있었습니다', '$time 離れていました');
|
||||
String get returnRewardBasic =>
|
||||
_l('Basic Reward', '기본 보상', '基本報酬');
|
||||
String get returnRewardBonus =>
|
||||
_l('Bonus Reward', '보너스 보상', 'ボーナス報酬');
|
||||
String returnRewardGold(int gold) =>
|
||||
_l('+$gold Gold', '+$gold 골드', '+$gold ゴールド');
|
||||
String get returnRewardClaim =>
|
||||
_l('Claim', '받기', '受け取る');
|
||||
String get returnRewardClaimBonus =>
|
||||
_l('Claim Bonus', '보너스 받기', 'ボーナス受取');
|
||||
String get returnRewardSkip =>
|
||||
_l('Skip', '건너뛰기', 'スキップ');
|
||||
|
||||
// ============================================================================
|
||||
// UI 일반 메시지
|
||||
// ============================================================================
|
||||
|
||||
@@ -60,23 +60,26 @@ class ItemService {
|
||||
// 희귀도 결정
|
||||
// ============================================================================
|
||||
|
||||
/// 희귀도 결정 (레벨 기반 확률)
|
||||
/// 희귀도 결정 (고정 확률)
|
||||
///
|
||||
/// 레벨이 높을수록 희귀한 아이템 확률 증가
|
||||
/// 확률 분포:
|
||||
/// - Common: 34%
|
||||
/// - Uncommon: 40%
|
||||
/// - Rare: 20%
|
||||
/// - Epic: 5%
|
||||
/// - Legendary: 1%
|
||||
ItemRarity determineRarity(int level) {
|
||||
final roll = rng.nextInt(100);
|
||||
final legendaryChance = (level * 0.5).clamp(0, 5).toInt(); // 최대 5%
|
||||
final epicChance = (level * 1.0).clamp(0, 10).toInt(); // 최대 10%
|
||||
final rareChance = (level * 2.0).clamp(0, 20).toInt(); // 최대 20%
|
||||
final uncommonChance = (level * 3.0).clamp(0, 30).toInt(); // 최대 30%
|
||||
|
||||
if (roll < legendaryChance) return ItemRarity.legendary;
|
||||
if (roll < legendaryChance + epicChance) return ItemRarity.epic;
|
||||
if (roll < legendaryChance + epicChance + rareChance)
|
||||
return ItemRarity.rare;
|
||||
if (roll < legendaryChance + epicChance + rareChance + uncommonChance) {
|
||||
return ItemRarity.uncommon;
|
||||
}
|
||||
// Legendary: 0-0 (1%)
|
||||
if (roll < 1) return ItemRarity.legendary;
|
||||
// Epic: 1-5 (5%)
|
||||
if (roll < 6) return ItemRarity.epic;
|
||||
// Rare: 6-25 (20%)
|
||||
if (roll < 26) return ItemRarity.rare;
|
||||
// Uncommon: 26-65 (40%)
|
||||
if (roll < 66) return ItemRarity.uncommon;
|
||||
// Common: 66-99 (34%)
|
||||
return ItemRarity.common;
|
||||
}
|
||||
|
||||
|
||||
@@ -972,12 +972,16 @@ class ProgressService {
|
||||
String? lostItemName;
|
||||
EquipmentSlot? lostItemSlot;
|
||||
ItemRarity? lostItemRarity;
|
||||
EquipmentItem? lostEquipmentItem; // 광고 부활 시 복구용
|
||||
|
||||
if (!isBossDeath) {
|
||||
// 레벨 기반 장비 손실 확률 계산
|
||||
// Lv 1~5: 0%, Lv 6: 10%, Lv 10: 50%, Lv 15+: 100%
|
||||
// Lv 1: 20%, Lv 5: ~56%, Lv 10+: 100%
|
||||
// 공식: 20 + (level - 1) * 80 / 9
|
||||
final level = state.traits.level;
|
||||
final lossChancePercent = ((level - 5) * 10).clamp(0, 100);
|
||||
final lossChancePercent = level >= 10
|
||||
? 100
|
||||
: (20 + ((level - 1) * 80 ~/ 9)).clamp(0, 100);
|
||||
final roll = state.rng.nextInt(100); // 0~99
|
||||
final shouldLoseEquipment = roll < lossChancePercent;
|
||||
|
||||
@@ -1004,10 +1008,10 @@ class ProgressService {
|
||||
)];
|
||||
|
||||
// 제물로 바칠 아이템 정보 저장
|
||||
final lostItem = state.equipment.getItemByIndex(sacrificeIndex);
|
||||
lostItemName = lostItem.name;
|
||||
lostEquipmentItem = state.equipment.getItemByIndex(sacrificeIndex);
|
||||
lostItemName = lostEquipmentItem.name;
|
||||
lostItemSlot = EquipmentSlot.values[sacrificeIndex];
|
||||
lostItemRarity = lostItem.rarity;
|
||||
lostItemRarity = lostEquipmentItem.rarity;
|
||||
|
||||
// 해당 슬롯을 빈 장비로 교체
|
||||
newEquipment = newEquipment.setItemByIndex(
|
||||
@@ -1029,6 +1033,7 @@ class ProgressService {
|
||||
lostItemName: lostItemName,
|
||||
lostItemSlot: lostItemSlot,
|
||||
lostItemRarity: lostItemRarity,
|
||||
lostItem: lostEquipmentItem, // 광고 부활 시 복구용
|
||||
goldAtDeath: state.inventory.gold,
|
||||
levelAtDeath: state.traits.level,
|
||||
timestamp: state.skillSystem.elapsedMs,
|
||||
|
||||
Reference in New Issue
Block a user