refactor(core): 밸런스 상수 분리 및 진행 서비스 개선
- balance_constants.dart에 게임 밸런스 상수 정의 - ProgressService 로직 개선 및 상수 참조
This commit is contained in:
@@ -17,6 +17,7 @@ import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/potion.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/balance_constants.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
class ProgressTickResult {
|
||||
@@ -549,10 +550,13 @@ class ProgressService {
|
||||
);
|
||||
|
||||
// 전투용 몬스터 레벨 조정 (밸런스)
|
||||
// config의 raw 레벨이 플레이어보다 너무 높으면 전투가 불가능
|
||||
// 플레이어 레벨 ±3 범위로 제한 (최소 1)
|
||||
// Act별 최소 레벨과 플레이어 레벨 중 큰 값을 기준으로 ±3 범위 제한
|
||||
final actMinLevel = ActMonsterLevel.forPlotStage(
|
||||
state.progress.plotStageCount,
|
||||
);
|
||||
final baseLevel = math.max(level, actMinLevel);
|
||||
final effectiveMonsterLevel = monsterResult.level
|
||||
.clamp(math.max(1, level - 3), level + 3)
|
||||
.clamp(math.max(1, baseLevel - 3), baseLevel + 3)
|
||||
.toInt();
|
||||
|
||||
final monsterCombatStats = MonsterCombatStats.fromLevel(
|
||||
@@ -849,11 +853,25 @@ class ProgressService {
|
||||
}
|
||||
|
||||
GameState forcePlotComplete(GameState state) {
|
||||
final progress = state.progress.copyWith(
|
||||
task: state.progress.task.copyWith(position: state.progress.task.max),
|
||||
plot: state.progress.plot.copyWith(position: state.progress.plot.max),
|
||||
// 다음 Act의 최소 몬스터 레벨까지 레벨업
|
||||
final nextPlotStage = state.progress.plotStageCount + 1;
|
||||
final targetLevel = ActMonsterLevel.forPlotStage(nextPlotStage);
|
||||
var nextState = state;
|
||||
|
||||
// 현재 레벨이 목표 레벨보다 낮으면 레벨업
|
||||
while (nextState.traits.level < targetLevel) {
|
||||
nextState = _levelUp(nextState);
|
||||
}
|
||||
|
||||
final progress = nextState.progress.copyWith(
|
||||
task: nextState.progress.task.copyWith(
|
||||
position: nextState.progress.task.max,
|
||||
),
|
||||
plot: nextState.progress.plot.copyWith(
|
||||
position: nextState.progress.plot.max,
|
||||
),
|
||||
);
|
||||
return state.copyWith(progress: progress);
|
||||
return nextState.copyWith(progress: progress);
|
||||
}
|
||||
|
||||
GameState _applyReward(GameState state, pq_logic.RewardKind reward) {
|
||||
|
||||
Reference in New Issue
Block a user