feat: update weapon refinement cost formula and add durability and destruction mechanics
This commit is contained in:
parent
f504024bd5
commit
0c7a562b00
|
|
@ -8,9 +8,13 @@ The Refinement mini-game allows users to strengthen their virtual weapons, parti
|
||||||
## Core Features
|
## Core Features
|
||||||
|
|
||||||
### 1. Weapon Refinement
|
### 1. Weapon Refinement
|
||||||
- **Progression**: Level 0 to Level 20.
|
- **Progression**: Level- **재련 비용**: `floor(10 × 1.6^level)G` (레벨별 기하급수적 증가)
|
||||||
- **Cost**: Increases exponentially with level (`level^2 * 100 G`).
|
- **판매 가격**: `floor(현재_단계_비용 × 2)G`
|
||||||
- **Success Rate**: Decreases as the level increases.
|
- **내구도**: 전투 참여 시(공격/방어 모두) 내구도 -1.
|
||||||
|
- **파괴 조건**:
|
||||||
|
- 재련 실패 시 낮은 확률로 파괴 (0단계 회귀).
|
||||||
|
- 내구도가 0인 상태에서 전투 시도(공격) 시 전투 후 무기 파괴.
|
||||||
|
as the level increases.
|
||||||
- **Risk**: Failure at higher levels can lead to weapon destruction (reset to level 0).
|
- **Risk**: Failure at higher levels can lead to weapon destruction (reset to level 0).
|
||||||
- **Durability**: Each battle reduces durability. **Success and Level Up fully restores durability.**
|
- **Durability**: Each battle reduces durability. **Success and Level Up fully restores durability.**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ export class RefinementService {
|
||||||
throw new Error(`이미 최대 단계(${this.MAX_LEVEL}강)에 도달했습니다. 무기를 판매하고 다시 시작하세요!`);
|
throw new Error(`이미 최대 단계(${this.MAX_LEVEL}강)에 도달했습니다. 무기를 판매하고 다시 시작하세요!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비용 계산: level^2 * 100G
|
// 비용 계산: floor(10 * 1.6^level)
|
||||||
const cost = Math.pow(profile.weaponLevel, 2) * 100 || 100;
|
const cost = Math.floor(10 * Math.pow(1.6, profile.weaponLevel));
|
||||||
|
|
||||||
if (profile.gold < cost) {
|
if (profile.gold < cost) {
|
||||||
throw new Error('골드가 부족합니다.');
|
throw new Error('골드가 부족합니다.');
|
||||||
|
|
@ -206,7 +206,8 @@ export class RefinementService {
|
||||||
const profile = await this.getOrCreateProfile(userId, guildId);
|
const profile = await this.getOrCreateProfile(userId, guildId);
|
||||||
if (profile.weaponLevel === 0) throw new Error('0단계 무기는 판매할 수 없습니다.');
|
if (profile.weaponLevel === 0) throw new Error('0단계 무기는 판매할 수 없습니다.');
|
||||||
|
|
||||||
const price = Math.pow(profile.weaponLevel, 2) * 150;
|
const currentCost = Math.floor(10 * Math.pow(1.6, profile.weaponLevel));
|
||||||
|
const price = Math.floor(currentCost * 2);
|
||||||
|
|
||||||
const updated = await prisma.refinementProfile.update({
|
const updated = await prisma.refinementProfile.update({
|
||||||
where: { userId_guildId: { userId, guildId } },
|
where: { userId_guildId: { userId, guildId } },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue