refactor(engine): 스킬 및 전투 시스템 개선

- SkillData 조정
- CombatCalculator 개선
- ItemService 업데이트
- ProgressService 개선
- SkillService 정리
This commit is contained in:
JiWoong Sul
2026-01-09 00:21:14 +09:00
parent 21d8febeb0
commit 2bf7387a08
5 changed files with 23 additions and 15 deletions

View File

@@ -98,8 +98,9 @@ class CombatCalculator {
final isParried = parryRoll < defenderParryRate;
// 3. 기본 데미지 계산 (0.8 ~ 1.2 변동)
// DEF 감산 비율: 0.3 (기존 0.5에서 축소하여 의미있는 피해 보장)
final damageVariation = 0.8 + rng.nextDouble() * 0.4;
var baseDamage = (attackerAtk * damageVariation - defenderDef * 0.5);
var baseDamage = (attackerAtk * damageVariation - defenderDef * 0.3);
// 4. 크리티컬 판정
final criRoll = rng.nextDouble();

View File

@@ -85,12 +85,13 @@ class ItemService {
// ============================================================================
/// 아이템 스탯 생성 (레벨/희귀도/슬롯 기반)
/// baseValue 공식: level * 1.2 * rarity (DEF 스케일링 축소)
ItemStats generateItemStats({
required int level,
required ItemRarity rarity,
required EquipmentSlot slot,
}) {
final baseValue = (level * 2 * rarity.multiplier).round();
final baseValue = (level * 1.2 * rarity.multiplier).round();
return switch (slot) {
EquipmentSlot.weapon => _generateWeaponStats(baseValue, rarity),

View File

@@ -882,6 +882,12 @@ class ProgressService {
nextState = _levelUp(nextState);
}
// 모든 장비 슬롯을 목표 레벨에 맞는 장비로 교체 (전투 보상 드랍 공식 사용)
final equipLevel = nextState.traits.level;
for (var slotIndex = 0; slotIndex < Equipment.slotCount; slotIndex++) {
nextState = mutations.winEquipByIndex(nextState, equipLevel, slotIndex);
}
// 태스크 바 완료 처리
var progress = nextState.progress.copyWith(
task: nextState.progress.task.copyWith(

View File

@@ -68,8 +68,8 @@ class SkillService {
// 적 방어력 감소 적용
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
// 최종 데미지 계산 (방어력 감산)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.5)
// 최종 데미지 계산 (방어력 감산 0.3)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
.round()
.clamp(1, 9999);
@@ -626,8 +626,8 @@ class SkillService {
// 적 방어력 감소 적용
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
// 최종 데미지 계산 (방어력 감산)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.5)
// 최종 데미지 계산 (방어력 감산 0.3)
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
.round()
.clamp(1, 9999);