diff --git a/docs/tasks/task_detail_2026_04_11.md b/docs/tasks/task_detail_2026_04_11.md index 9146d85..08a4738 100644 --- a/docs/tasks/task_detail_2026_04_11.md +++ b/docs/tasks/task_detail_2026_04_11.md @@ -86,3 +86,14 @@ 3. 在探索场景添加 NPC 模型与互动提示,接入 E 键对话,并更新状态面板展示任务进度。 - **执行结果**: 已形成第一条任务链闭环(接任务 -> 打怪累积 -> 回 NPC 交付),并通过构建验证。 +# 任务执行摘要 + +## 会话 ID: 1775865869 +- [2026-04-11 08:04:29] +- **执行原因**: 用户要求将战斗系统改为俯视角 RPG 回合战斗场景风格。 +- **执行过程**: + 1. 重构 BattlePanel,接入 Three.js 俯视战场(相机、地形、单位、回合高亮、受击反馈)。 + 2. 保留并整合原有回合指令 HUD(攻击/技能/防御/道具)与日志结算区。 + 3. 增加战斗场景资源生命周期管理(进入初始化、退出释放),并完成构建验证。 +- **执行结果**: 战斗已从纯 UI 面板升级为俯视角战斗场景,形成“3D 战场 + 回合指令 HUD”的可玩表现。 + diff --git a/src/data/gameConfig.ts b/src/data/gameConfig.ts index f7d5b59..a3a1f5f 100644 --- a/src/data/gameConfig.ts +++ b/src/data/gameConfig.ts @@ -1,4 +1,4 @@ export const gameConfig = { title: 'Breath of Fire-like RPG Demo', - tagline: '里程碑 4: NPC 任务链(接取/击败/交付)', + tagline: '里程碑 5: 俯视角回合战斗场景', } diff --git a/src/ui/BattlePanel.vue b/src/ui/BattlePanel.vue index 184c511..814c1ef 100644 --- a/src/ui/BattlePanel.vue +++ b/src/ui/BattlePanel.vue @@ -1,47 +1,247 @@ @@ -50,19 +250,33 @@ const runAction = (action: 'attack' | 'skill' | 'defend' | 'item') => { .battle-overlay { position: fixed; inset: 0; - background: rgba(6, 10, 14, 0.78); - display: grid; - place-items: center; z-index: 50; + background: radial-gradient(circle at center, rgba(14, 21, 28, 0.86), rgba(5, 9, 12, 0.95)); padding: 14px; } -.battle-card { - width: min(760px, 100%); +.battle-stage { + width: min(1060px, 100%); + height: 100%; + margin: 0 auto; + display: grid; + grid-template-rows: minmax(260px, 58vh) auto; + gap: 10px; +} + +.battle-viewport { + border: 1px solid #3b556a; border-radius: 12px; - border: 1px solid #365064; - background: linear-gradient(180deg, #12202a, #0f1921); - padding: 14px; + overflow: hidden; + box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35); + background: #101a22; +} + +.battle-hud { + border: 1px solid #304758; + border-radius: 12px; + background: linear-gradient(180deg, #13212c, #0f1a23); + padding: 12px; } .battle-head h2 { @@ -71,22 +285,23 @@ const runAction = (action: 'attack' | 'skill' | 'defend' | 'item') => { } .battle-head p { - margin: 6px 0 0; - color: #9cc0d6; + margin: 4px 0 0; + color: #9ec1d8; + font-size: 13px; } .bars { - margin-top: 12px; + margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .bars > div { - border: 1px solid #2f4555; + border: 1px solid #304758; border-radius: 8px; - padding: 10px; - background: #172632; + padding: 8px 10px; + background: #162734; } .bars p { @@ -95,18 +310,18 @@ const runAction = (action: 'attack' | 'skill' | 'defend' | 'item') => { } .actions { - margin-top: 12px; + margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } button { - border: 1px solid #42627a; + border: 1px solid #44657e; border-radius: 8px; - background: #203646; + background: #1e3546; color: #d7e0e6; - padding: 10px; + padding: 9px 10px; cursor: pointer; } @@ -116,7 +331,7 @@ button:disabled { } .result { - margin-top: 12px; + margin-top: 10px; display: flex; align-items: center; justify-content: space-between; @@ -127,20 +342,24 @@ button:disabled { } .log { - margin: 12px 0 0; - border: 1px solid #2f4555; + margin: 10px 0 0; + border: 1px solid #304758; border-radius: 8px; - background: #111d27; + background: #0f1b24; padding: 10px 12px; list-style: none; display: grid; - gap: 6px; - max-height: 150px; + gap: 5px; + max-height: 140px; overflow: auto; - font-size: 13px; + font-size: 12px; } -@media (max-width: 720px) { +@media (max-width: 900px) { + .battle-stage { + grid-template-rows: minmax(230px, 48vh) auto; + } + .bars { grid-template-columns: 1fr; }