Add equipment growth system
This commit is contained in:
203
src/game/data/battleItems.ts
Normal file
203
src/game/data/battleItems.ts
Normal file
@@ -0,0 +1,203 @@
|
||||
export type EquipmentSlot = 'weapon' | 'armor' | 'accessory';
|
||||
|
||||
export type EquipmentRank = 'common' | 'treasure';
|
||||
|
||||
export type EquipmentState = {
|
||||
itemId: string;
|
||||
level: number;
|
||||
exp: number;
|
||||
};
|
||||
|
||||
export type EquipmentSet = Record<EquipmentSlot, EquipmentState>;
|
||||
|
||||
export type ItemDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
slot: EquipmentSlot;
|
||||
rank: EquipmentRank;
|
||||
description: string;
|
||||
attackBonus?: number;
|
||||
defenseBonus?: number;
|
||||
strategyBonus?: number;
|
||||
effects: string[];
|
||||
};
|
||||
|
||||
export const equipmentSlotLabels: Record<EquipmentSlot, string> = {
|
||||
weapon: '무기',
|
||||
armor: '방어구',
|
||||
accessory: '보조구'
|
||||
};
|
||||
|
||||
export const equipmentSlots: EquipmentSlot[] = ['weapon', 'armor', 'accessory'];
|
||||
|
||||
export const itemCatalog: Record<string, ItemDefinition> = {
|
||||
'training-sword': {
|
||||
id: 'training-sword',
|
||||
name: '연습검',
|
||||
slot: 'weapon',
|
||||
rank: 'common',
|
||||
description: '의용군이 가장 쉽게 다룰 수 있는 기본 검.',
|
||||
attackBonus: 1,
|
||||
effects: ['공격 경험치를 안정적으로 쌓는다']
|
||||
},
|
||||
'twin-oath-blades': {
|
||||
id: 'twin-oath-blades',
|
||||
name: '쌍의검',
|
||||
slot: 'weapon',
|
||||
rank: 'treasure',
|
||||
description: '도원에서 맹세한 뜻을 담아 벼린 쌍검.',
|
||||
attackBonus: 3,
|
||||
effects: ['공명 관계가 70 이상이면 공격 경험치 +2']
|
||||
},
|
||||
'green-dragon-glaive': {
|
||||
id: 'green-dragon-glaive',
|
||||
name: '청룡월도',
|
||||
slot: 'weapon',
|
||||
rank: 'treasure',
|
||||
description: '묵직한 월도로 전열을 갈라내는 관우의 보물 무기.',
|
||||
attackBonus: 5,
|
||||
effects: ['적보다 무력이 높으면 피해 보너스']
|
||||
},
|
||||
'serpent-spear': {
|
||||
id: 'serpent-spear',
|
||||
name: '장팔장창',
|
||||
slot: 'weapon',
|
||||
rank: 'treasure',
|
||||
description: '한 번 내지르면 기세까지 꿰뚫는 장비의 긴 창.',
|
||||
attackBonus: 5,
|
||||
effects: ['연속 공격 판정 보정']
|
||||
},
|
||||
'yellow-turban-saber': {
|
||||
id: 'yellow-turban-saber',
|
||||
name: '황건도',
|
||||
slot: 'weapon',
|
||||
rank: 'common',
|
||||
description: '황건 무리가 들고 다니는 거친 도검.',
|
||||
attackBonus: 1,
|
||||
effects: ['평지 전투에 무난하다']
|
||||
},
|
||||
'short-bow': {
|
||||
id: 'short-bow',
|
||||
name: '단궁',
|
||||
slot: 'weapon',
|
||||
rank: 'common',
|
||||
description: '가볍게 쏘기 좋은 짧은 활.',
|
||||
attackBonus: 2,
|
||||
effects: ['궁병 기본 사거리 장비']
|
||||
},
|
||||
'leader-axe': {
|
||||
id: 'leader-axe',
|
||||
name: '두령부',
|
||||
slot: 'weapon',
|
||||
rank: 'common',
|
||||
description: '두령이 위압을 보이기 위해 쓰는 큼직한 도끼.',
|
||||
attackBonus: 3,
|
||||
effects: ['HP가 낮은 적을 압박한다']
|
||||
},
|
||||
'cloth-armor': {
|
||||
id: 'cloth-armor',
|
||||
name: '포의',
|
||||
slot: 'armor',
|
||||
rank: 'common',
|
||||
description: '가벼운 천옷. 민첩함은 해치지 않지만 방어는 낮다.',
|
||||
defenseBonus: 1,
|
||||
effects: ['방어 경험치를 빠르게 시작한다']
|
||||
},
|
||||
'lamellar-armor': {
|
||||
id: 'lamellar-armor',
|
||||
name: '찰갑',
|
||||
slot: 'armor',
|
||||
rank: 'common',
|
||||
description: '작은 철편을 엮어 만든 실전용 갑옷.',
|
||||
defenseBonus: 3,
|
||||
effects: ['근접 견제에 강하다']
|
||||
},
|
||||
'oath-robe': {
|
||||
id: 'oath-robe',
|
||||
name: '도원포',
|
||||
slot: 'armor',
|
||||
rank: 'treasure',
|
||||
description: '맹세의 문양을 수놓은 전투복.',
|
||||
defenseBonus: 2,
|
||||
strategyBonus: 1,
|
||||
effects: ['공명 경험치 획득 시 방어 경험치 +1']
|
||||
},
|
||||
'reinforced-lamellar': {
|
||||
id: 'reinforced-lamellar',
|
||||
name: '철린갑',
|
||||
slot: 'armor',
|
||||
rank: 'treasure',
|
||||
description: '비늘처럼 맞물린 철편으로 급소를 덮은 보물 갑옷.',
|
||||
defenseBonus: 5,
|
||||
effects: ['방어 시 받는 피해 감소']
|
||||
},
|
||||
'rebel-vest': {
|
||||
id: 'rebel-vest',
|
||||
name: '황건 조끼',
|
||||
slot: 'armor',
|
||||
rank: 'common',
|
||||
description: '두꺼운 천과 가죽을 덧댄 조끼.',
|
||||
defenseBonus: 1,
|
||||
effects: ['숲 지형에서 버티기 좋다']
|
||||
},
|
||||
'peach-charm': {
|
||||
id: 'peach-charm',
|
||||
name: '복숭아 부적',
|
||||
slot: 'accessory',
|
||||
rank: 'treasure',
|
||||
description: '도원결의의 상징을 새긴 작은 부적.',
|
||||
strategyBonus: 2,
|
||||
effects: ['턴 시작 시 낮은 병력을 조금 회복할 예정']
|
||||
},
|
||||
'war-manual': {
|
||||
id: 'war-manual',
|
||||
name: '병법서',
|
||||
slot: 'accessory',
|
||||
rank: 'treasure',
|
||||
description: '진형과 공격 타이밍을 적은 병법서.',
|
||||
strategyBonus: 2,
|
||||
effects: ['공명 연계 판정 보정']
|
||||
},
|
||||
'bravery-token': {
|
||||
id: 'bravery-token',
|
||||
name: '호담패',
|
||||
slot: 'accessory',
|
||||
rank: 'treasure',
|
||||
description: '물러서지 않는 기개를 새긴 패.',
|
||||
attackBonus: 1,
|
||||
effects: ['HP가 낮을수록 공격 의지가 오른다']
|
||||
},
|
||||
'grain-pouch': {
|
||||
id: 'grain-pouch',
|
||||
name: '군량 주머니',
|
||||
slot: 'accessory',
|
||||
rank: 'common',
|
||||
description: '전투 중 병사들의 허기를 달래는 보조 도구.',
|
||||
effects: ['장기전 회복 아이템과 연동 예정']
|
||||
},
|
||||
'yellow-scarf-charm': {
|
||||
id: 'yellow-scarf-charm',
|
||||
name: '황건 부적',
|
||||
slot: 'accessory',
|
||||
rank: 'common',
|
||||
description: '황건 무리가 신념의 증표로 지닌 부적.',
|
||||
effects: ['사기 유지에 도움을 준다']
|
||||
},
|
||||
'wind-quiver': {
|
||||
id: 'wind-quiver',
|
||||
name: '바람 화살통',
|
||||
slot: 'accessory',
|
||||
rank: 'treasure',
|
||||
description: '가벼운 화살깃과 균형추가 달린 보물 화살통.',
|
||||
attackBonus: 1,
|
||||
effects: ['궁병의 명중 보정']
|
||||
}
|
||||
};
|
||||
|
||||
export function getItem(itemId: string) {
|
||||
return itemCatalog[itemId] ?? itemCatalog['training-sword'];
|
||||
}
|
||||
|
||||
export function equipmentExpToNext(level: number) {
|
||||
return 50 + Math.min(level, 9) * 20;
|
||||
}
|
||||
Reference in New Issue
Block a user