| | |
| | | // 高亮所有相关目标:设置施法者和目标的显示层级 |
| | | protected void HighLightAllTargets() |
| | | { |
| | | caster.layerMgr.SetSortingOrder(BattleConst.ActiveHeroActionSortingOrder); |
| | | caster.layerMgr.SetSortingOrder(BattleConst.SkillMaskOrder + BattleConst.BattleActiveHeroOffset); |
| | | |
| | | if (skillConfig.FuncType != 2) |
| | | return; |
| | |
| | | battleField.battleRootNode.skillMaskNode.SetActive(true); |
| | | } |
| | | |
| | | protected long suckHp = 0; |
| | | |
| | | // 命中目标回调:处理所有被命中的目标(包括主目标、弹射目标、溅射目标) |
| | | protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | |
| | | // 造成伤害前先处理血量刷新包 |
| | | HandleRefreshHP(); |
| | | |
| | | suckHp = 0; |
| | | |
| | | // 统计吸血总量(主目标) |
| | | foreach (var hurt in hitList) |
| | | { |
| | | suckHp += hurt.SuckHP; |
| | | } |
| | | bool suckHp = true; |
| | | |
| | | // 处理主目标列表 |
| | | foreach (var hurt in hitList) |
| | |
| | | continue; |
| | | } |
| | | |
| | | OnHitEachTarget(_hitIndex, target, hurt); |
| | | OnHitEachTarget(_hitIndex, target, hurt, suckHp); |
| | | |
| | | suckHp = false; |
| | | |
| | | // 处理该目标的额外目标列表(如弹射伤害的平摊目标) |
| | | if (hurt.HurtListEx != null && hurt.HurtListEx.Length > 0) |
| | |
| | | } |
| | | |
| | | // 处理单个目标被命中:应用伤害和施法者效果 |
| | | protected virtual void OnHitEachTarget(int _hitIndex, BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | protected virtual void OnHitEachTarget(int _hitIndex, BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, bool suckHp) |
| | | { |
| | | // ============ 获取临时数据(掉落、死亡等) ============ |
| | | int objID = (int)target.ObjID; |
| | |
| | | deadPack = null; |
| | | } |
| | | |
| | | bool clearSuckHp = tagUseSkillAttack.HurtList.ToList().IndexOf(hurt) != 0; |
| | | |
| | | // ============ 参数打包 ============ |
| | | BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack); |
| | | if (clearSuckHp) |
| | | { |
| | | hurtParam.caster.suckHpList.Clear(); |
| | | } |
| | | BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack, suckHp); |
| | | #if UNITY_EDITOR |
| | | PrintHurtParamDebugInfo(hurtParam); |
| | | #endif |
| | |
| | | HurtHPEx = hurtEx.HurtHPEx, |
| | | CurHP = hurtEx.CurHP, |
| | | CurHPEx = hurtEx.CurHPEx, |
| | | SuckHP = hurtEx.SuckHP, |
| | | SuckHP = 0,//hurtEx.SuckHP, 获取全部吸血时已经计算过 这里就不再计算 |
| | | BounceHP = 0, // HurtEx 没有反伤字段 |
| | | HurtCountEx = 0, |
| | | HurtListEx = null |
| | | }; |
| | | |
| | | BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack); |
| | | |
| | | #if UNITY_EDITOR |
| | | PrintHurtParamDebugInfo(hurtParam); |
| | | #endif |
| | | |
| | | // 先调用目标受伤 |
| | | target.Hurt(hurtParam); |
| | | |
| | | // 再调用施法者吸血/反伤 |
| | | caster.OnHurtTarget(hurtParam); |
| | | OnHitEachTarget(_hitIndex, target, hurt, false);//获取全部吸血时已经计算过 这里就不再计算 |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | battleField.RemoveCastingSkill(caster.ObjID, this); |
| | | } |
| | | |
| | | battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values)); |
| | | |
| | | // 1. 强制结束技能效果 |
| | | skillEffect?.ForceFinished(); |
| | | skillEffect = null; |
| | | |
| | | foreach (var subSkillPack in tagUseSkillAttack.subSkillList) |
| | | { |
| | | SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic>() { subSkillPack }); |
| | | recordAction.fromSkill = this; |
| | | otherSkillActionList.Add(recordAction); |
| | | battleField.recordPlayer.ImmediatelyPlay(recordAction); |
| | | } |
| | | tagUseSkillAttack.subSkillList.Clear(); |
| | | foreach (var subCombinePack in tagUseSkillAttack.subSkillCombinePackList) |
| | | { |
| | | SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, subCombinePack.packList); |
| | | recordAction.fromSkill = this; |
| | | otherSkillActionList.Add(recordAction); |
| | | battleField.recordPlayer.ImmediatelyPlay(recordAction); |
| | | } |
| | | tagUseSkillAttack.subSkillCombinePackList.Clear(); |
| | | |
| | | // 2. 强制结束所有子技能动作 |
| | | otherSkillActionList.ForEach(action => action.ForceFinish()); |
| | |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffDel.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RemoveBuff(buffDel); |
| | | battleObj.buffMgr.RemoveBuff(buffDel, false); |
| | | } |
| | | } |
| | | } |