yyl
17 小时以前 2668ee0c8bb360ce8909d88796e3f87abc393773
125 战斗 弹射支持
2个文件已修改
66 ■■■■ 已修改文件
Main/System/Battle/SkillEffect/BulletCurve/BounceBulletCurve.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/SkillEffect/BulletSkillEffect.cs 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/SkillEffect/BulletCurve/BounceBulletCurve.cs
@@ -62,13 +62,13 @@
            // 下一段弹射
            start = end;
            var nextTargetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurtList[curIndex].ObjID);
            if (nextTargetObj != null)
            if (nextTargetObj != null && !nextTargetObj.IsDead())
            {
                end = WorldToLocalAnchoredPosition(nextTargetObj.heroGo.transform.position);
                end = WorldToLocalAnchoredPosition(nextTargetObj.heroRectTrans.position);
            }
            else
            {
                Debug.LogError("弹射找不到下一个目标");
                BattleDebug.LogError("弹射找不到下一个目标 或者只有一个目标");
                // 如果目标丢失,直接用上一个end
                end = start;
            }
Main/System/Battle/SkillEffect/BulletSkillEffect.cs
@@ -380,27 +380,61 @@
        effectPlayer.Alpha = shotToSelf ? 0f : 1f;
        int bounceHitIndex = 0;
        var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, target.heroRectTrans, tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) =>
        {
            foreach (var hurt in hitList)
            if (skillConfig.BulletPath == 4)
            {
                if (bounceHitIndex >= hitList.Count)
                {
                    return;
                }
                var hurt = hitList[bounceHitIndex++];
                BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
                if (targetObj == null)
                if (targetObj != null)
                {
                    PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp);
                }
                else
                {
                    Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID);
                    continue;
                }
                PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp);
                PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp);
                PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp);
                PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp);
            }
                // 表现子弹飞行到目标位置
                onHit?.Invoke(index, new List<HB427_tagSCUseSkill.tagSCUseSkillHurt> { hurt });
            // 表现子弹飞行到目标位置
            onHit?.Invoke(index, hitList);
            // 击中就销毁子弹
            caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer);
                if (bulletIndex == tagUseSkillAttack.HurtList.Length - 1)
                {
                    caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer);
                }
            }
            else
            {
                foreach (var hurt in hitList)
                {
                    BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
                    if (targetObj == null)
                    {
                        Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID);
                        continue;
                    }
                    PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp);
                    PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp);
                }
                // 表现子弹飞行到目标位置
                onHit?.Invoke(index, hitList);
                // 击中就销毁子弹
                caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer);
            }
            if (isFinish)
                return;
@@ -414,6 +448,8 @@
        bulletCurves.Add(bulletCurve);
    }
    protected void PlayExplosionEffect(int effectId, Transform parent, BattleCamp camp)
    {
        if (effectId <= 0)