feat: 优化游戏体验和系统平衡性

- 修复商店物品名称显示问题,添加堆叠物品出售数量选择
- 自动战斗状态持久化,战斗结束显示"寻找中"状态
- 战斗日志显示经验获取详情(战斗经验、武器经验)
- 技能进度条显示当前/最大经验值
- 阅读自动解锁技能并持续获得阅读经验,背包可直接阅读
- 优化训练平衡:时长60秒,经验5点/秒,耐力消耗降低
- 实现自然回复系统:基于体质回复HP/耐力,休息提供3倍加成
- 战斗和训练时不进行自然回复

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-01-23 19:40:55 +08:00
parent 16223c89a5
commit cef974d94f
9 changed files with 447 additions and 29 deletions

View File

@@ -55,6 +55,12 @@
type="warning"
@click="unequipItem"
/>
<TextButton
v-if="canRead"
text="阅读"
type="primary"
@click="readItem"
/>
<TextButton
v-if="canUse"
text="使用"
@@ -75,6 +81,7 @@ import { ref, computed } from 'vue'
import { usePlayerStore } from '@/store/player'
import { useGameStore } from '@/store/game'
import { equipItem as equipItemUtil, unequipItemBySlot, useItem as useItemUtil } from '@/utils/itemSystem.js'
import { startTask } from '@/utils/taskSystem.js'
import FilterTabs from '@/components/common/FilterTabs.vue'
import TextButton from '@/components/common/TextButton.vue'
@@ -112,6 +119,11 @@ const canUse = computed(() => {
return selectedItem.value.type === 'consumable'
})
const canRead = computed(() => {
if (!selectedItem.value) return false
return selectedItem.value.type === 'book'
})
// 装备槽位映射
const slotMap = {
weapon: 'weapon',
@@ -163,11 +175,34 @@ function useItem() {
if (!selectedItem.value) return
const result = useItemUtil(player, game, selectedItem.value.id, 1)
if (result.success) {
// 如果阅读任务,可以在这里处理
selectedItem.value = null
}
}
function readItem() {
if (!selectedItem.value) return
// 检查是否已经在阅读中
const existingTask = game.activeTasks?.find(t => t.type === 'reading')
if (existingTask) {
game.addLog('已经在阅读其他书籍了', 'error')
return
}
const result = startTask(game, player, 'reading', {
itemId: selectedItem.value.id,
duration: selectedItem.value.readingTime || 60
})
if (result.success) {
game.addLog(`开始阅读《${selectedItem.value.name}`, 'info')
selectedItem.value = null
emit('close') // 关闭背包以便看到阅读进度
} else {
game.addLog(result.message, 'error')
}
}
function sellItem() {
if (!selectedItem.value) return
// 已装备的物品不能出售
@@ -256,13 +291,6 @@ function sellItem() {
font-size: 22rpx;
margin-top: 4rpx;
}
}
.quality-badge {
font-size: 18rpx;
opacity: 0.8;
margin-left: 8rpx;
}
&__equipped-badge {
width: 32rpx;
@@ -278,6 +306,12 @@ function sellItem() {
}
}
.quality-badge {
font-size: 18rpx;
opacity: 0.8;
margin-left: 8rpx;
}
.inventory-empty {
padding: 80rpx;
text-align: center;