[Skill Parity] 火球 (Fire Ball) 命中后缺失范围爆炸视觉与轰炸效果 (爆炸素材误配为火弹微弱火星 & 爆炸半径偏小) #440

Closed
opened 2026-09-24 08:43:16 +00:00 by troytt · 0 comments
Owner

问题描述 (Bug Description)

在当前游戏中,法师技能 火球 (Fire Ball, 技能 ID 47) 命中敌人或障碍物后,完全没有原版标志性的大型球形烈焰轰炸爆炸效果:

  1. 视觉效果严重降级/缺失:火球命中后仅播放了与 1 级小技能“火弹 (Fire Bolt)”完全相同的微弱小火花,毫无火球术震慑性的火海爆轰视觉质感;
  2. 爆炸范围偏小且判定不完善:1.13c 原版火球拥有 4 个子格 (80px) 的范围爆炸伤害与冲击波,当前代码硬编码为 48px,且在撞墙或射程终点时未正确引爆。

原版 1.13c 地面真理 (Diablo II 1.13c Ground Truth Invariants)

在 1.13c Missiles.txt 中,火弹与火球的爆炸投射物存在明确的分级与本质区别:

  1. 火弹 (Fire Bolt, ID 58):

    • ExplosionMissile: fireexplode (ID 29)
    • CelFile: FireArrowExplode2,尺寸仅 78×70 像素,共 12 帧,仅为单体命中后的火星消散。
  2. 火球 (Fire Ball, ID 62):

    • ExplosionMissile: explodingarrowexp (ID 42)
    • CelFile: ExpArrowExplode,尺寸高达 208×174 像素,共 16 帧,带声效 explosion_medium_1。
    • 这是暗黑2中最具代表性的大型球形烈焰爆轰动画(与陨石 meteorexplode 采用同一套 ExpArrowExplode 高清爆炸素材!)。
    • sHitPar1: 4 (服务器端爆炸伤害半径 = 4 个子瓦片 = 80 像素 / 2 码)。
    • cHitPar1: 3 (客户端视觉爆炸半径 = 3 个子瓦片)。
    • pCltHitFunc: 1 / pSrvHitFunc: 1:在命中目标、撞击障碍物或到达终点时均产生范围轰炸。

缺陷代码定位与根因分析 (Root Cause Analysis)

  1. 爆炸投射物配置错误导致视觉严重缩水:

    • 在 src/game/skills.ts (第 565-585 行):
      fireball: {
        name: 'fireball',
        id: 62,
        ...
        celFile: 'Fireball',
        animLen: 5,
        explosionMissile: 'fireexplode', // <-- 错误!配成了火弹的小火花 fireexplode
      }
      
      此处错误地将火球的爆炸投射物指定成了 fireexplode(FireArrowExplode2,78×70),而非原版的 explodingarrowexp / ExpArrowExplode(208×174)。
    • 在 src/scene/act-scene.ts (第 6404-6410 行) 中:
      for (const exp of engine.explosions) {
        pushEntity(exp.x, exp.y, () => {
          const art =
            missileArtMap.get(exp.missileType) ??
            (exp.missileType === 'blizzardexplode3' ? missileArtMap.get('blizzardexplode2') : missileArtMap.get('fireexplode'))
          drawExplosion(renderer, exp, art)
        })
      }
      
      未将 explodingarrowexp 别名映射到现有的 meteorexplode(即已打包好的 16 帧 ExpArrowExplode 图集),导致即使改名也会 fallback 到火弹的 fireexplode。
  2. 爆炸范围与伤害硬编码:

    • 在 src/scene/act-scene.ts (第 2140-2147 行):
      } else if (skillId === 47) {
        const missile = getMissileTxtData('fireball')
        speed = missile.speedPxPerSec || 500
        range = missile.distancePx || 1000
        damage = 35       // <-- 硬编码固定值,未关联 slvl 与加成
        delay = 0
        aoeRadius = 48    // <-- 仅 48px,原版 4 个子格应为 80px
        missileType = 'fireball'
        skillName = '火球'
      }
      
    • 撞墙时在 src/game/engine.ts 中硬编码造成 10 点伤害,未产生完整的火球爆炸。

修复建议 (Proposed Fix)

  1. 修正爆炸投射物素材与别名映射:
    • 在 src/game/skills.ts 中将 fireball.explosionMissile 修正为 explodingarrowexp;
    • 在 src/render/missiles-meta.ts 和 act-scene.ts 中,将 explodingarrowexp 作为别名直接映射至现有的 ExpArrowExplode (meteorexplode) 素材:
      if (map.has('meteorexplode')) {
        map.set('explodingarrowexp', map.get('meteorexplode')!)
      }
      
  2. 校正爆炸范围 (AoE Radius):
    • 依据 1.13c sHitPar1: 4,将火球爆炸范围从 48 像素调整为 80 像素 (4 个 Sub-tile)。
  3. 动态伤害计算:
    • 接入 calculateSkillDamage(47, slvl) 动态计算火球基础伤害与火弹/陨石协同加成。
### 问题描述 (Bug Description) 在当前游戏中,法师技能 **火球 (Fire Ball, 技能 ID 47)** 命中敌人或障碍物后,**完全没有原版标志性的大型球形烈焰轰炸爆炸效果**: 1. **视觉效果严重降级/缺失**:火球命中后仅播放了与 1 级小技能“火弹 (Fire Bolt)”完全相同的微弱小火花,毫无火球术震慑性的火海爆轰视觉质感; 2. **爆炸范围偏小且判定不完善**:1.13c 原版火球拥有 4 个子格 (80px) 的范围爆炸伤害与冲击波,当前代码硬编码为 48px,且在撞墙或射程终点时未正确引爆。 --- ### 原版 1.13c 地面真理 (Diablo II 1.13c Ground Truth Invariants) 在 1.13c `Missiles.txt` 中,火弹与火球的爆炸投射物存在明确的分级与本质区别: 1. **火弹 (Fire Bolt, ID 58)**: - `ExplosionMissile: fireexplode` (ID 29) - `CelFile: FireArrowExplode2`,尺寸仅 78×70 像素,共 12 帧,仅为单体命中后的火星消散。 2. **火球 (Fire Ball, ID 62)**: - `ExplosionMissile: explodingarrowexp` (ID 42) - `CelFile: ExpArrowExplode`,尺寸高达 208×174 像素,共 16 帧,带声效 `explosion_medium_1`。 - 这是暗黑2中最具代表性的大型球形烈焰爆轰动画(与陨石 `meteorexplode` 采用同一套 `ExpArrowExplode` 高清爆炸素材!)。 - `sHitPar1: 4` (服务器端爆炸伤害半径 = 4 个子瓦片 = 80 像素 / 2 码)。 - `cHitPar1: 3` (客户端视觉爆炸半径 = 3 个子瓦片)。 - `pCltHitFunc: 1` / `pSrvHitFunc: 1`:在命中目标、撞击障碍物或到达终点时均产生范围轰炸。 --- ### 缺陷代码定位与根因分析 (Root Cause Analysis) 1. **爆炸投射物配置错误导致视觉严重缩水**: - 在 `src/game/skills.ts` (第 565-585 行): ```typescript fireball: { name: 'fireball', id: 62, ... celFile: 'Fireball', animLen: 5, explosionMissile: 'fireexplode', // <-- 错误!配成了火弹的小火花 fireexplode } ``` 此处错误地将火球的爆炸投射物指定成了 `fireexplode`(`FireArrowExplode2`,78×70),而非原版的 `explodingarrowexp` / `ExpArrowExplode`(208×174)。 - 在 `src/scene/act-scene.ts` (第 6404-6410 行) 中: ```typescript for (const exp of engine.explosions) { pushEntity(exp.x, exp.y, () => { const art = missileArtMap.get(exp.missileType) ?? (exp.missileType === 'blizzardexplode3' ? missileArtMap.get('blizzardexplode2') : missileArtMap.get('fireexplode')) drawExplosion(renderer, exp, art) }) } ``` 未将 `explodingarrowexp` 别名映射到现有的 `meteorexplode`(即已打包好的 16 帧 `ExpArrowExplode` 图集),导致即使改名也会 fallback 到火弹的 `fireexplode`。 2. **爆炸范围与伤害硬编码**: - 在 `src/scene/act-scene.ts` (第 2140-2147 行): ```typescript } else if (skillId === 47) { const missile = getMissileTxtData('fireball') speed = missile.speedPxPerSec || 500 range = missile.distancePx || 1000 damage = 35 // <-- 硬编码固定值,未关联 slvl 与加成 delay = 0 aoeRadius = 48 // <-- 仅 48px,原版 4 个子格应为 80px missileType = 'fireball' skillName = '火球' } ``` - 撞墙时在 `src/game/engine.ts` 中硬编码造成 10 点伤害,未产生完整的火球爆炸。 --- ### 修复建议 (Proposed Fix) 1. **修正爆炸投射物素材与别名映射**: - 在 `src/game/skills.ts` 中将 `fireball.explosionMissile` 修正为 `explodingarrowexp`; - 在 `src/render/missiles-meta.ts` 和 `act-scene.ts` 中,将 `explodingarrowexp` 作为别名直接映射至现有的 `ExpArrowExplode` (`meteorexplode`) 素材: ```typescript if (map.has('meteorexplode')) { map.set('explodingarrowexp', map.get('meteorexplode')!) } ``` 2. **校正爆炸范围 (AoE Radius)**: - 依据 1.13c `sHitPar1: 4`,将火球爆炸范围从 48 像素调整为 **80 像素** (4 个 Sub-tile)。 3. **动态伤害计算**: - 接入 `calculateSkillDamage(47, slvl)` 动态计算火球基础伤害与火弹/陨石协同加成。
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#440
No description provided.