fix: 修复武器经验获取并完善义体系统

- 修复战斗胜利后未获得武器技能经验的问题 (initCombat未传递skillExpReward)
- 每级武器技能提供5%武器伤害加成(已实现,无需修改)
- 实现义体安装/卸载功能,支持NPC对话交互
- StatusPanel添加义体装备槽显示
- MapPanel修复NPC对话import问题
- 新增成就系统框架
- 添加项目文档CLAUDE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-02-02 15:52:32 +08:00
parent 27e1c8d440
commit ccfd6a5e75
8 changed files with 672 additions and 35 deletions

View File

@@ -124,7 +124,7 @@ import { NPC_CONFIG } from '@/config/npcs.js'
import { ENEMY_CONFIG, getRandomEnemyForLocation } from '@/config/enemies.js'
import { getShopConfig } from '@/config/shop.js'
import { initCombat, getEnvironmentType } from '@/utils/combatSystem.js'
import { triggerExploreEvent, tryFlee } from '@/utils/eventSystem.js'
import { triggerExploreEvent, tryFlee, startNPCDialogue } from '@/utils/eventSystem.js'
import TextButton from '@/components/common/TextButton.vue'
import ProgressBar from '@/components/common/ProgressBar.vue'
import FilterTabs from '@/components/common/FilterTabs.vue'
@@ -252,16 +252,8 @@ const availableNPCs = computed(() => {
function talkToNPC(npc) {
game.addLog(`${npc.name} 开始对话...`, 'info')
// 打开 NPC 对话
if (npc.dialogue && npc.dialogue.first) {
game.drawerState.event = true
game.currentEvent = {
type: 'npc_dialogue',
npcId: npc.id,
dialogue: npc.dialogue.first,
choices: npc.dialogue.first.choices || []
}
}
// 使用 eventSystem 的 startNPCDialogue 来处理对话
startNPCDialogue(game, npc.id, 'first', player)
}
function openInventory() {
@@ -360,14 +352,15 @@ function startCombat() {
// 获取环境类型
const environment = getEnvironmentType(player.currentLocation)
// 使用 initCombat 初始化战斗
game.combatState = initCombat(enemyConfig.id, enemyConfig, environment)
// 使用 initCombat 初始化战斗,传入偏好的战斗姿态
game.combatState = initCombat(enemyConfig.id, enemyConfig, environment, game.preferredStance)
game.inCombat = true
}
function changeStance(stance) {
if (game.combatState) {
game.combatState.stance = stance
game.preferredStance = stance // 记住玩家选择的姿态
game.addLog(`切换到${stanceTabs.find(t => t.id === stance)?.label}姿态`, 'combat')
}
}