Files
text-adventure-game/config/items.js
Claude 16223c89a5 feat: 实现游戏核心系统和UI组件
核心系统:
- combatSystem: 战斗逻辑、伤害计算、战斗状态管理
- skillSystem: 技能系统、技能解锁、经验值、里程碑
- taskSystem: 任务系统、任务类型、任务执行和完成
- eventSystem: 事件系统、随机事件处理
- environmentSystem: 环境系统、时间流逝、区域效果
- levelingSystem: 升级系统、属性成长
- soundSystem: 音效系统

配置文件:
- enemies: 敌人配置、掉落表
- events: 事件配置、事件效果
- items: 物品配置、装备属性
- locations: 地点配置、探索事件
- skills: 技能配置、技能树

UI组件:
- CraftingDrawer: 制造界面
- InventoryDrawer: 背包界面
- 其他UI优化和动画

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:20:10 +08:00

515 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 物品配置
// Phase 5 内容扩展 - 更多物品
export const ITEM_CONFIG = {
// ===== 武器 =====
wooden_stick: {
id: 'wooden_stick',
name: '木棍',
type: 'weapon',
subtype: 'one_handed',
icon: '🪵',
baseValue: 10,
baseDamage: 5,
attackSpeed: 1.0,
quality: 100,
unlockSkill: 'stick_mastery',
description: '一根粗糙的木棍,至少比空手强。'
},
rusty_sword: {
id: 'rusty_sword',
name: '生锈铁剑',
type: 'weapon',
subtype: 'sword',
icon: '🗡️',
baseValue: 100,
baseDamage: 12,
attackSpeed: 1.1,
quality: 50,
unlockSkill: 'sword_mastery',
stats: { critRate: 2 },
description: '一把生锈的铁剑,虽然旧了但依然锋利。'
},
iron_sword: {
id: 'iron_sword',
name: '铁剑',
type: 'weapon',
subtype: 'sword',
icon: '⚔️',
baseValue: 500,
baseDamage: 25,
attackSpeed: 1.2,
quality: 100,
unlockSkill: 'sword_mastery',
stats: { critRate: 5 },
description: '一把精工打造的铁剑。'
},
wooden_club: {
id: 'wooden_club',
name: '木棒',
type: 'weapon',
subtype: 'blunt',
icon: '🏏',
baseValue: 30,
baseDamage: 8,
attackSpeed: 0.9,
quality: 80,
unlockSkill: 'blunt_mastery',
description: '一根粗大的木棒,攻击力强但速度慢。'
},
stone_axe: {
id: 'stone_axe',
name: '石斧',
type: 'weapon',
subtype: 'axe',
icon: '🪓',
baseValue: 80,
baseDamage: 18,
attackSpeed: 0.8,
quality: 60,
unlockSkill: 'axe_mastery',
stats: { critRate: 3 },
description: '用石头打磨成的斧头,笨重但有效。'
},
hunter_bow: {
id: 'hunter_bow',
name: '猎弓',
type: 'weapon',
subtype: 'ranged',
icon: '🏹',
baseValue: 200,
baseDamage: 15,
attackSpeed: 1.3,
quality: 90,
unlockSkill: 'archery',
stats: { accuracy: 10 },
description: '猎人使用的弓,可以远程攻击。'
},
// ===== 防具 =====
rag_armor: {
id: 'rag_armor',
name: '破布护甲',
type: 'armor',
subtype: 'light',
icon: '👕',
baseValue: 20,
defense: 3,
quality: 50,
description: '用破布拼凑成的简易护甲。'
},
leather_armor: {
id: 'leather_armor',
name: '皮甲',
type: 'armor',
subtype: 'light',
icon: '🦺',
baseValue: 150,
defense: 8,
quality: 100,
stats: { evasion: 5 },
description: '用兽皮制成的轻甲,提供基础保护。'
},
iron_armor: {
id: 'iron_armor',
name: '铁甲',
type: 'armor',
subtype: 'heavy',
icon: '🛡️',
baseValue: 800,
defense: 20,
quality: 100,
stats: { maxStamina: -10 }, // 重量影响耐力
description: '铁制重甲,防御力强但会影响行动。'
},
// ===== 盾牌 =====
wooden_shield: {
id: 'wooden_shield',
name: '木盾',
type: 'shield',
icon: '🛡️',
baseValue: 50,
defense: 5,
blockRate: 10,
quality: 80,
description: '简单的木制盾牌。'
},
iron_shield: {
id: 'iron_shield',
name: '铁盾',
type: 'shield',
icon: '🛡️',
baseValue: 300,
defense: 12,
blockRate: 20,
quality: 100,
description: '坚固的铁制盾牌。'
},
// ===== 饰品 =====
lucky_ring: {
id: 'lucky_ring',
name: '幸运戒指',
type: 'accessory',
icon: '💍',
baseValue: 200,
quality: 100,
stats: { critRate: 5, fleeRate: 5 },
description: '一枚带来幸运的戒指。'
},
// ===== 消耗品 - 食物 =====
bread: {
id: 'bread',
name: '面包',
type: 'consumable',
subtype: 'food',
icon: '🍞',
baseValue: 10,
effect: {
stamina: 20,
health: 5
},
description: '普通的面包,可以恢复耐力和少量生命。',
stackable: true,
maxStack: 99
},
meat: {
id: 'meat',
name: '肉干',
type: 'consumable',
subtype: 'food',
icon: '🥩',
baseValue: 15,
effect: {
stamina: 35,
health: 10
},
description: '风干的肉,营养丰富。',
stackable: true,
maxStack: 50
},
cooked_meat: {
id: 'cooked_meat',
name: '烤肉',
type: 'consumable',
subtype: 'food',
icon: '🍖',
baseValue: 25,
effect: {
stamina: 50,
health: 20
},
description: '烤制的肉,美味又营养。',
stackable: true,
maxStack: 50
},
fresh_water: {
id: 'fresh_water',
name: '清水',
type: 'consumable',
subtype: 'drink',
icon: '💧',
baseValue: 5,
effect: {
stamina: 10,
sanity: 5
},
description: '干净的清水,解渴提神。',
stackable: true,
maxStack: 99
},
// ===== 消耗品 - 药品 =====
healing_herb: {
id: 'healing_herb',
name: '草药',
type: 'consumable',
subtype: 'medicine',
icon: '🌿',
baseValue: 15,
effect: {
health: 20
},
description: '常见的治疗草药,可以恢复生命值。',
stackable: true,
maxStack: 99
},
bandage: {
id: 'bandage',
name: '绷带',
type: 'consumable',
subtype: 'medicine',
icon: '🩹',
baseValue: 20,
effect: {
health: 30,
stamina: 5
},
description: '急救用的绷带,可以止血。',
stackable: true,
maxStack: 50
},
health_potion_small: {
id: 'health_potion_small',
name: '小治疗药水',
type: 'consumable',
subtype: 'medicine',
icon: '🧪',
baseValue: 50,
effect: {
health: 50
},
description: '小瓶治疗药水,快速恢复生命值。',
stackable: true,
maxStack: 20
},
health_potion: {
id: 'health_potion',
name: '治疗药水',
type: 'consumable',
subtype: 'medicine',
icon: '🧪',
baseValue: 150,
effect: {
health: 100
},
description: '治疗药水,大幅恢复生命值。',
stackable: true,
maxStack: 10
},
// ===== 书籍 =====
old_book: {
id: 'old_book',
name: '破旧书籍',
type: 'book',
icon: '📖',
baseValue: 50,
readingTime: 60,
expReward: {
reading: 10
},
completionBonus: null,
description: '一本破旧的书籍,记录着一些基础知识。',
consumable: false
},
survival_guide: {
id: 'survival_guide',
name: '生存指南',
type: 'book',
icon: '📕',
baseValue: 100,
readingTime: 120,
expReward: {
reading: 25,
survival_instinct: 5
},
completionBonus: { maxStamina: 10 },
description: '荒野生存技巧指南。',
consumable: false
},
combat_manual: {
id: 'combat_manual',
name: '战斗手册',
type: 'book',
icon: '📗',
baseValue: 150,
readingTime: 180,
expReward: {
reading: 30
},
completionBonus: { critRate: 3 },
description: '记录战斗技巧的手册。',
consumable: false
},
herbalism_book: {
id: 'herbalism_book',
name: '草药图鉴',
type: 'book',
icon: '📙',
baseValue: 120,
readingTime: 150,
expReward: {
reading: 20,
herbalism: 10
},
completionBonus: null,
description: '识别和采集草药的图鉴。',
consumable: false
},
// ===== 素材 =====
dog_skin: {
id: 'dog_skin',
name: '狗皮',
type: 'material',
icon: '🐕',
baseValue: 5,
description: '野狗的皮毛,可以用来制作简单装备。',
stackable: true,
maxStack: 99
},
wolf_fang: {
id: 'wolf_fang',
name: '狼牙',
type: 'material',
icon: '🦷',
baseValue: 20,
description: '锋利的狼牙,可用于制作武器。',
stackable: true,
maxStack: 99
},
bat_wing: {
id: 'bat_wing',
name: '蝙蝠翼',
type: 'material',
icon: '🦇',
baseValue: 15,
description: '蝙蝠的翅膀,有特殊用途。',
stackable: true,
maxStack: 99
},
leather: {
id: 'leather',
name: '皮革',
type: 'material',
icon: '🟤',
baseValue: 30,
description: '加工过的兽皮,可用于制作装备。',
stackable: true,
maxStack: 99
},
iron_ore: {
id: 'iron_ore',
name: '铁矿石',
type: 'material',
icon: '⛰️',
baseValue: 50,
description: '含铁的矿石,可以提炼金属。',
stackable: true,
maxStack: 99
},
rare_gem: {
id: 'rare_gem',
name: '稀有宝石',
type: 'material',
icon: '💎',
baseValue: 500,
description: '闪闪发光的宝石,价值不菲。',
stackable: true,
maxStack: 10
},
// ===== 货币 =====
copper_coin: {
id: 'copper_coin',
name: '铜币',
type: 'currency',
icon: '🪙',
baseValue: 1,
description: '通用的货币单位。',
stackable: true,
maxStack: 9999
},
// ===== 关键道具 =====
basement_key: {
id: 'basement_key',
name: '地下室钥匙',
type: 'key',
icon: '🔑',
baseValue: 0,
description: '一把生锈的钥匙上面刻着「B」字母。',
stackable: false
},
cave_key: {
id: 'cave_key',
name: '洞穴钥匙',
type: 'key',
icon: '🗝️',
baseValue: 0,
description: '开启深处洞穴的钥匙。',
stackable: false
},
mystic_key: {
id: 'mystic_key',
name: '神秘钥匙',
type: 'key',
icon: '🔮',
baseValue: 1000,
description: '一把散发着神秘光芒的钥匙,似乎能打开某扇重要的门。',
stackable: false,
keyItem: true
},
// ===== 特殊物品 =====
bomb: {
id: 'bomb',
name: '炸弹',
type: 'special',
subtype: 'explosive',
icon: '💣',
baseValue: 100,
description: '可以造成范围伤害的爆炸物,在战斗中特别有效。',
stackable: true,
maxStack: 10,
effect: {
damage: 50,
radius: 1
},
consumable: true
},
bible: {
id: 'bible',
name: '圣经',
type: 'special',
icon: '📿',
baseValue: 0,
description: '一本神圣的书籍,可以用来祈祷。',
stackable: false,
effect: { sanity: 10 }
}
}
/**
* 获取物品商店分类
* @returns {Object} 分类列表
*/
export const ITEM_CATEGORIES = {
weapon: { id: 'weapon', name: '武器', icon: '⚔️' },
armor: { id: 'armor', name: '防具', icon: '🛡️' },
shield: { id: 'shield', name: '盾牌', icon: '🛡️' },
accessory: { id: 'accessory', name: '饰品', icon: '💍' },
consumable: { id: 'consumable', name: '消耗品', icon: '🧪' },
book: { id: 'book', name: '书籍', icon: '📖' },
material: { id: 'material', name: '素材', icon: '📦' },
key: { id: 'key', name: '钥匙', icon: '🔑' },
special: { id: 'special', name: '特殊', icon: '✨' }
}