| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public override void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | public override void OnMiddleFrameStart(int times) |
| | | { |
| | | base.Play(_onHit); |
| | | // 弹射 另外的做法了 |
| | | if (skillConfig.effectType == SkillEffectType.Bullet && skillConfig.BulletPath == 4) |
| | | { |
| | |
| | | BattleObject targetObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObject == null) |
| | | { |
| | | Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | BattleDebug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | return; |
| | | } |
| | | ShotToTarget(targetObject); |
| | |
| | | { |
| | | case SkillCastMode.Self: |
| | | onHitFormation?.Invoke(0, tagUseSkillAttack.HurtList.ToList()); |
| | | Debug.LogError("子弹的目标是自己,暂时不支持 协商程序完成"); |
| | | BattleDebug.LogError("子弹的目标是自己,暂时不支持 协商程序完成"); |
| | | break; |
| | | case SkillCastMode.Enemy: |
| | | var targetNode = caster.battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig); |
| | |
| | | BattleObject target = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (target == null) |
| | | { |
| | | Debug.LogError("特效目标为空 target == null ObjId : " + hurt.ObjID); |
| | | BattleDebug.LogError("特效目标为空 target == null ObjId : " + hurt.ObjID); |
| | | continue; |
| | | } |
| | | |
| | |
| | | ShotToFormation(healNode, onHitFormation); |
| | | break; |
| | | default: |
| | | Debug.LogError("暂时不支持其他的方式释放 有需求请联系程序 " + skillConfig.SkillID); |
| | | BattleDebug.LogError("暂时不支持其他的方式释放 有需求请联系程序 " + skillConfig.SkillID); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public override void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | base.Play(_onHit); |
| | | |
| | | } |
| | | |
| | | protected void ShotToFormation(RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | |
| | | BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObj == null) |
| | | { |
| | | Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | BattleDebug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | continue; |
| | | } |
| | | |
| | | caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffectId, targetObj.heroGo.transform); |
| | | caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffect2, targetObj.heroGo.transform); |
| | | var effect1 = caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffectId, targetObj.heroGo.transform); |
| | | var effect2 = caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffect2, targetObj.heroGo.transform); |
| | | if (effect1 != null) |
| | | { |
| | | effect1.transform.localRotation = effectTrans.localRotation; |
| | | } |
| | | if (effect2 != null) |
| | | { |
| | | effect2.transform.localRotation = effectTrans.localRotation; |
| | | } |
| | | } |
| | | |
| | | }); |
| | |
| | | |
| | | protected void ShotToTarget(BattleObject target) |
| | | { |
| | | BattleDebug.LogError("发射子弹 " + skillConfig.BulletEffectId); |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster.ObjID, skillConfig.BulletEffectId, caster.heroRectTrans); |
| | | RectTransform effectTrans = effectPlayer.transform as RectTransform; |
| | | |
| | | |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, target.heroRectTrans, tagUseSkillAttack, (index, hitList) => |
| | | { |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, hitList); |
| | | |
| | | // 击中就销毁子弹 |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | |
| | | BattleDebug.LogError("回收子弹 " + skillConfig.BulletEffectId); |
| | | // 播放子弹爆炸特效 |
| | | |
| | | |
| | | foreach (var hurt in hitList) |
| | | { |
| | | BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObj == null) |
| | | { |
| | | Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | BattleDebug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | continue; |
| | | } |
| | | |
| | | caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffectId, targetObj.heroGo.transform); |
| | | caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffect2, targetObj.heroGo.transform); |
| | | if (skillConfig.ExplosionEffectId > 0) |
| | | { |
| | | var eft = caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffectId, targetObj.heroGo.transform); |
| | | eft.transform.localRotation = effectPlayer.transform.localRotation; |
| | | } |
| | | |
| | | if (skillConfig.ExplosionEffect2 > 0) |
| | | { |
| | | var eft = caster.battleField.battleEffectMgr.PlayEffect(targetObj.ObjID, skillConfig.ExplosionEffect2, targetObj.heroGo.transform); |
| | | eft.transform.localRotation = effectPlayer.transform.localRotation; |
| | | } |
| | | } |
| | | |
| | | // 击中就销毁子弹 |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | isFinish = true; |
| | | }); |
| | | |
| | | bulletCurves.Add(bulletCurve); |
| | |
| | | bulletCurve.Run(); |
| | | } |
| | | } |
| | | |
| | | public override bool IsFinished() |
| | | { |
| | | bool isCurveFinish = false; |
| | | |
| | | foreach (var bulletCurve in bulletCurves) |
| | | { |
| | | isCurveFinish |= bulletCurve.IsFinished; |
| | | } |
| | | |
| | | return isCurveFinish && isFinish; |
| | | } |
| | | } |