feat(balance): 스킬 버프 모디파이어 3종 전투 적용
Some checks failed
CI / analyze-and-test (push) Has been cancelled
Some checks failed
CI / analyze-and-test (push) Has been cancelled
- defModifier: 몬스터 반격 시 방어력 배율 적용 (DEF × (1+defMod)) - criRateModifier: 플레이어 공격 시 크리티컬 확률 추가 - evasionModifier: 몬스터 반격 시 회피율 추가 - 기존 atkModifier 패턴과 동일하게 임시 적용 + HP/MP만 반영
This commit is contained in:
@@ -125,12 +125,22 @@ class CombatTickService {
|
|||||||
newEvents.addAll(potionResult.events);
|
newEvents.addAll(potionResult.events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 스킬 버프 모디파이어 조회 (전투 계산에 적용)
|
||||||
|
final buffMods = updatedSkillSystem.totalBuffModifiers;
|
||||||
|
|
||||||
// 플레이어 공격 체크
|
// 플레이어 공격 체크
|
||||||
if (playerAccumulator >= playerStats.attackDelayMs) {
|
if (playerAccumulator >= playerStats.attackDelayMs) {
|
||||||
|
// 크리티컬 확률 버프 적용
|
||||||
|
final buffedPlayerForAttack = buffMods.criMod != 0
|
||||||
|
? playerStats.copyWith(
|
||||||
|
criRate: (playerStats.criRate + buffMods.criMod).clamp(0.0, 1.0),
|
||||||
|
)
|
||||||
|
: playerStats;
|
||||||
|
|
||||||
final attackProcessor = PlayerAttackProcessor(rng: rng);
|
final attackProcessor = PlayerAttackProcessor(rng: rng);
|
||||||
final attackResult = attackProcessor.processAttack(
|
final attackResult = attackProcessor.processAttack(
|
||||||
state: state,
|
state: state,
|
||||||
playerStats: playerStats,
|
playerStats: buffedPlayerForAttack,
|
||||||
monsterStats: monsterStats,
|
monsterStats: monsterStats,
|
||||||
updatedSkillSystem: updatedSkillSystem,
|
updatedSkillSystem: updatedSkillSystem,
|
||||||
activeDoTs: activeDoTs,
|
activeDoTs: activeDoTs,
|
||||||
@@ -145,7 +155,14 @@ class CombatTickService {
|
|||||||
healingMultiplier: healingMultiplier,
|
healingMultiplier: healingMultiplier,
|
||||||
);
|
);
|
||||||
|
|
||||||
playerStats = attackResult.playerStats;
|
// 크리티컬 버프가 적용된 스탯에서 HP/MP만 원본에 반영
|
||||||
|
final attackedPlayer = attackResult.playerStats;
|
||||||
|
playerStats = buffMods.criMod != 0
|
||||||
|
? playerStats.copyWith(
|
||||||
|
hpCurrent: attackedPlayer.hpCurrent,
|
||||||
|
mpCurrent: attackedPlayer.mpCurrent,
|
||||||
|
)
|
||||||
|
: attackedPlayer;
|
||||||
monsterStats = attackResult.monsterStats;
|
monsterStats = attackResult.monsterStats;
|
||||||
updatedSkillSystem = attackResult.skillSystem;
|
updatedSkillSystem = attackResult.skillSystem;
|
||||||
activeDoTs = attackResult.activeDoTs;
|
activeDoTs = attackResult.activeDoTs;
|
||||||
@@ -161,8 +178,18 @@ class CombatTickService {
|
|||||||
// 몬스터가 살아있으면 반격
|
// 몬스터가 살아있으면 반격
|
||||||
if (monsterStats.isAlive &&
|
if (monsterStats.isAlive &&
|
||||||
monsterAccumulator >= monsterStats.attackDelayMs) {
|
monsterAccumulator >= monsterStats.attackDelayMs) {
|
||||||
|
// 방어력/회피율 버프 적용
|
||||||
|
final buffedPlayerForDefense = (buffMods.defMod != 0 ||
|
||||||
|
buffMods.evasionMod != 0)
|
||||||
|
? playerStats.copyWith(
|
||||||
|
def: (playerStats.def * (1.0 + buffMods.defMod)).round(),
|
||||||
|
evasion: (playerStats.evasion + buffMods.evasionMod)
|
||||||
|
.clamp(0.0, 1.0),
|
||||||
|
)
|
||||||
|
: playerStats;
|
||||||
|
|
||||||
final monsterAttackResult = _processMonsterAttack(
|
final monsterAttackResult = _processMonsterAttack(
|
||||||
playerStats: playerStats,
|
playerStats: buffedPlayerForDefense,
|
||||||
monsterStats: monsterStats,
|
monsterStats: monsterStats,
|
||||||
activeDebuffs: activeDebuffs,
|
activeDebuffs: activeDebuffs,
|
||||||
totalDamageTaken: totalDamageTaken,
|
totalDamageTaken: totalDamageTaken,
|
||||||
@@ -170,7 +197,12 @@ class CombatTickService {
|
|||||||
calculator: calculator,
|
calculator: calculator,
|
||||||
);
|
);
|
||||||
|
|
||||||
playerStats = monsterAttackResult.playerStats;
|
// 버프 적용된 스탯에서 HP/MP만 원본에 반영
|
||||||
|
final defendedPlayer = monsterAttackResult.playerStats;
|
||||||
|
playerStats = playerStats.copyWith(
|
||||||
|
hpCurrent: defendedPlayer.hpCurrent,
|
||||||
|
mpCurrent: defendedPlayer.mpCurrent,
|
||||||
|
);
|
||||||
totalDamageTaken = monsterAttackResult.totalDamageTaken;
|
totalDamageTaken = monsterAttackResult.totalDamageTaken;
|
||||||
newEvents.addAll(monsterAttackResult.events);
|
newEvents.addAll(monsterAttackResult.events);
|
||||||
monsterAccumulator -= monsterStats.attackDelayMs;
|
monsterAccumulator -= monsterStats.attackDelayMs;
|
||||||
|
|||||||
Reference in New Issue
Block a user