| | |
| | | protected RectTransform targetNode = null; // 目标节点 |
| | | public BattleObject caster = null; // 施法者 |
| | | protected List<GameNetPackBasic> packList; |
| | | protected List<SkillRecordAction> otherSkillActionList = new List<SkillRecordAction>(); |
| | | |
| | | protected List<RecordAction> currentWaitingSkill = new List<RecordAction>(); |
| | | |
| | | protected List<H0704_tagRolePackRefresh> dropPackList = new List<H0704_tagRolePackRefresh>(); |
| | | protected List<HB405_tagMCAddExp> expPackList = new List<HB405_tagMCAddExp>(); |
| | | |
| | | protected bool moveFinished = false; |
| | | public SkillBase fromSkill; |
| | | public bool isPlay = false; |
| | | |
| | | // 父RecordAction(SkillRecordAction),用于子技能建立父子关系 |
| | | protected SkillRecordAction ownRecordAction; |
| | | |
| | | // 技能动画是否播放完成(针对有动画的技能) |
| | | protected bool isMotionCompleted = false; |
| | | |
| | | private float MoveSpeed = 750f; |
| | | |
| | | private Dictionary<int, BattleDrops> tempDropList = new Dictionary<int, BattleDrops>(); |
| | | private Dictionary<int, HB422_tagMCTurnFightObjDead> tempDeadPackList = new Dictionary<int, HB422_tagMCTurnFightObjDead>(); |
| | | private Dictionary<int, BattleDeadPack> tempDeadPackList = new Dictionary<int, BattleDeadPack>(); |
| | | |
| | | protected List<HB428_tagSCBuffRefresh> buffCollections = new List<HB428_tagSCBuffRefresh>(); |
| | | // Buff相关包集合,支持 HB428(刷新) 和 HB429(删除) |
| | | protected List<GameNetPackBasic> buffPackCollections = new List<GameNetPackBasic>(); |
| | | |
| | | |
| | | // 构造函数:初始化技能基础数据 |
| | | public SkillBase(BattleObject _caster, SkillConfig _skillCfg, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> _packList, BattleField _battleField = null) |
| | | { |
| | | caster = _caster; |
| | | if (null == caster) |
| | | { |
| | | throw new Exception("SkillBase caster is null "); |
| | | } |
| | | skillConfig = _skillCfg; |
| | | tagUseSkillAttack = vNetData; |
| | | battleField = _battleField; |
| | | packList = _packList; |
| | | |
| | | SafetyCheck(); |
| | | #if UNITY_EDITOR |
| | | if (Launch.Instance.isOpenSkillLogFile) |
| | | // 注册正在释放的技能 |
| | | if (battleField != null && caster != null) |
| | | { |
| | | PinrtHB427Hp(); |
| | | battleField.AddCastingSkill(caster.ObjID, this); |
| | | } |
| | | #endif |
| | | |
| | | SafetyCheck(); |
| | | } |
| | | |
| | | public virtual void AfterAddToQueue() |
| | | { |
| | | |
| | | } |
| | | |
| | | // 设置父RecordAction |
| | | public void SetOwnRecordAction(SkillRecordAction recordAction) |
| | | { |
| | | ownRecordAction = recordAction; |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | var Hurt = tagUseSkillAttack.HurtList[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)Hurt.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(Hurt.HurtHP, Hurt.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(Hurt.CurHP, Hurt.CurHPEx); |
| | | |
| | |
| | | var HurtEx = tagUseSkillAttack.HurtListEx[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)HurtEx.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(HurtEx.HurtHP, HurtEx.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(HurtEx.CurHP, HurtEx.CurHPEx); |
| | | |
| | |
| | | |
| | | private void SafetyCheck() |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (Launch.Instance.isOpenSkillLogFile) |
| | | { |
| | | PinrtHB427Hp(); |
| | | } |
| | | #endif |
| | | |
| | | bool safety = caster != null |
| | | && skillConfig != null |
| | | && tagUseSkillAttack != null |
| | |
| | | return; |
| | | } |
| | | |
| | | if (otherSkillActionList.Count > 0) |
| | | { |
| | | for (int i = otherSkillActionList.Count - 1; i >= 0; i--) |
| | | { |
| | | var action = otherSkillActionList[i]; |
| | | if (action.IsFinished()) |
| | | { |
| | | otherSkillActionList.RemoveAt(i); |
| | | OnSkillFinished(); |
| | | } |
| | | else if (moveFinished) |
| | | { |
| | | action.Run(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | protected void ShadowIllutionCreate(bool create) |
| | |
| | | if (change) |
| | | { |
| | | MoveSpeed = 1125f; |
| | | caster.motionBase.ShowIllusionShadow(true, color); |
| | | caster.ShowIllusionShadow(true, color); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MoveSpeed = 750f; |
| | | caster.motionBase.ShowIllusionShadow(false); |
| | | caster.ShowIllusionShadow(false); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | // 广播技能释放事件 |
| | | string guid = battleField.guid; |
| | | TeamHero teamHero = caster.teamHero; |
| | | // 获取释放者数据:Hero 传递 teamHero,Mingge 传递 null(因为事件监听器只处理 Hero 数据) |
| | | TeamHero teamHero = null; |
| | | if (caster is HeroBattleObject heroBattleObject) |
| | | { |
| | | teamHero = heroBattleObject.teamHero; |
| | | } |
| | | // 命格释放技能时 teamHero 为 null,监听器会正确处理(已有 null 检查) |
| | | EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero); |
| | | |
| | | if (skillConfig.SkinllSFX1 != 0) |
| | |
| | | { |
| | | if (hintConfig != null) |
| | | { |
| | | battleObject.heroInfoBar.ShowTips(((char)hintConfig.prefix).ToString(), true, false, 1.25f); |
| | | battleObject.ShowTips(((char)hintConfig.prefix).ToString(), true, false, 1.25f); |
| | | } |
| | | } |
| | | |
| | |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | | }, MoveSpeed); |
| | | } |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | | }, MoveSpeed); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | ExecuteMoveAndCastSequence(targetTrans, () => |
| | | { |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum); |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()); |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(rectTransform, Vector2.zero, () => |
| | | { |
| | |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | | }, MoveSpeed); |
| | | } |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | | }, MoveSpeed); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | caster.motionBase.PlayAnimation(MotionName.run, true); |
| | | var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, () => |
| | | caster.PlayAnimation(MotionName.run, true); |
| | | var tweener = BattleUtility.MoveToTarget(caster.GetRectTransform(), target, offset, () => |
| | | { |
| | | caster.motionBase.PlayAnimation(MotionName.idle, true); |
| | | caster.PlayAnimation(MotionName.idle, true); |
| | | _onComplete?.Invoke(); |
| | | }, speed); |
| | | battleField.battleTweenMgr.OnPlayTween(tweener); |
| | |
| | | { |
| | | if (skillConfig.CastDistance < 0) |
| | | { |
| | | Vector3 scale = caster.heroGo.transform.localScale; |
| | | scale.x = Mathf.Abs(scale.x) * forward; |
| | | caster.heroGo.transform.localScale = scale; |
| | | caster.SetFacing(forward); |
| | | } |
| | | _onComplete?.Invoke(); |
| | | } |
| | |
| | | { |
| | | TurnBack(null, 1f); |
| | | OnAllAttackMoveFinished(); |
| | | caster.motionBase.PlayAnimation(MotionName.idle, true); |
| | | caster.PlayAnimation(MotionName.idle, true); |
| | | } |
| | | |
| | | // 所有攻击移动完成后的处理:恢复UI显示状态 |
| | |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | | bo.layerMgr.SetFront(); |
| | | bo.heroInfoBar.SetActive(true); |
| | | bo.GetHeroInfoBar()?.SetActive(true); |
| | | } |
| | | battleField.battleRootNode.skillMaskNode.SetActive(false); |
| | | } |
| | |
| | | // 执行技能释放动画和逻辑:播放施法动作并提供回调 |
| | | protected TrackEntry CastImpl(Action onComplete = null) |
| | | { |
| | | return caster.motionBase.PlaySkillAnimation(skillConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | return caster.PlaySkillAnimation(skillConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | } |
| | | |
| | | // 技能开始回调:处理死亡、子技能、技能效果初始化 |
| | |
| | | return; |
| | | } |
| | | |
| | | // 先把死亡包收集了 |
| | | HandleDead(); |
| | | |
| | | // 再处理 内嵌技能 |
| | | ProcessSubSkill(); |
| | | |
| | | skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, tagUseSkillAttack); |
| | | skillEffect.Play(OnHitTargets); |
| | | 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(); |
| | | |
| | | |
| | | isPlay = true; |
| | | } |
| | | |
| | | protected void ProcessSubSkill() |
| | | { |
| | | // 按packUID排序所有子技能 |
| | | var allSubSkills = new List<(ulong packUID, SkillRecordAction action)>(); |
| | | |
| | | List<GameNetPackBasic> removePackList = new List<GameNetPackBasic>(); |
| | | |
| | | foreach (var pack in packList) |
| | | { |
| | | if (pack is HB427_tagSCUseSkill skillPack) |
| | | { |
| | | SkillConfig ssc = SkillConfig.Get((int)skillPack.SkillID); |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | { |
| | | break; |
| | | } |
| | | if (ssc.SkillType == 8) |
| | | { |
| | | break; |
| | | } |
| | | SkillRecordAction skillRecordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic> { skillPack }); |
| | | allSubSkills.Add((skillPack.packUID, skillRecordAction)); |
| | | removePackList.Add(pack); |
| | | } |
| | | else if (pack is HB422_tagMCTurnFightObjDead dead) |
| | | { |
| | | break; |
| | | } |
| | | else if (pack is CustomHB426CombinePack combinePack) |
| | | { |
| | | HB427_tagSCUseSkill sp = combinePack.GetMainHB427SkillPack(); |
| | | SkillConfig ssc = SkillConfig.Get((int)sp.SkillID); |
| | | |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | { |
| | | break; |
| | | } |
| | | |
| | | if (ssc.SkillType == 8) |
| | | { |
| | | break; |
| | | } |
| | | |
| | | SkillRecordAction skillRecordAction = combinePack.CreateSkillAction(); |
| | | allSubSkills.Add((sp.packUID, skillRecordAction)); |
| | | removePackList.Add(pack); |
| | | |
| | | if (skillRecordAction.useParentRecordPlayer) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < removePackList.Count; i++) |
| | | { |
| | | packList.Remove(removePackList[i]); |
| | | } |
| | | |
| | | // 按packUID排序 |
| | | allSubSkills.Sort((a, b) => a.packUID.CompareTo(b.packUID)); |
| | | |
| | | foreach (var (packUID, recordAction) in allSubSkills) |
| | | { |
| | | if (recordAction.useParentRecordPlayer) |
| | | { |
| | | ownRecordAction.GetInnerRecordPlayer().PlayRecord(recordAction, ownRecordAction); |
| | | } |
| | | else |
| | | { |
| | | ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 技能前摇结束回调 |
| | |
| | | // 技能后摇结束回调:通知技能效果处理后摇结束 |
| | | public virtual void OnFinalFrameEnd() |
| | | { |
| | | // 标记动画播放完成 |
| | | isMotionCompleted = true; |
| | | BattleDebug.LogError($"SkillBase.OnFinalFrameEnd: 技能 {skillConfig?.SkillID} 动画播放完成"); |
| | | |
| | | skillEffect?.OnFinalFrameEnd(); // 修复:添加空值检查 |
| | | } |
| | |
| | | // 高亮所有相关目标:设置施法者和目标的显示层级 |
| | | protected void HighLightAllTargets() |
| | | { |
| | | caster.layerMgr.SetSortingOrder(BattleConst.ActiveHeroActionSortingOrder); |
| | | caster.layerMgr.SetSortingOrder(BattleConst.SkillMaskOrder + BattleConst.BattleActiveHeroOffset); |
| | | |
| | | if (skillConfig.FuncType != 2) |
| | | return; |
| | |
| | | var highlightSet = new HashSet<BattleObject>(highlightList); |
| | | |
| | | // 先把施法者的 InfoBar 隐藏(原逻辑保留) |
| | | caster.heroInfoBar.SetActive(false); |
| | | caster.GetHeroInfoBar()?.SetActive(false); |
| | | |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | |
| | | } |
| | | |
| | | // 目标(含 HurtListEx)都应显示 InfoBar |
| | | bo.heroInfoBar.SetActive(isTarget); |
| | | bo.GetHeroInfoBar()?.SetActive(isTarget); |
| | | } |
| | | |
| | | battleField.battleRootNode.skillMaskNode.SetActive(true); |
| | | } |
| | | |
| | | protected long suckHp = 0; |
| | | |
| | | // 命中目标回调:处理所有被命中的目标(包括主目标、弹射目标、溅射目标) |
| | | protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | // Debug.LogError($"Skill {skillConfig.SkillID} hit targets _hitIndex: {_hitIndex} hit {string.Join(", ", hitList.Select(h => h.ObjID + ":" + battleField.battleObjMgr.GetBattleObject((int)h.ObjID)?.GetName()))}"); |
| | | |
| | | // 造成伤害前先处理血量刷新包 |
| | | 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) |
| | |
| | | } |
| | | } |
| | | |
| | | HandleHint(_hitIndex, hitList); |
| | | } |
| | | |
| | | protected void HandleHint(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | if (0 == _hitIndex) |
| | | { |
| | | bool needhint = false; |
| | |
| | | DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BattleStun); |
| | | Hint(caster, hintConfig); |
| | | } |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < hitList.Count; i++) |
| | | { |
| | | var hurt = hitList[i]; |
| | | |
| | | if ((hurt.AttackTypes & (int)DamageType.BreakArmor) == (int)DamageType.BreakArmor) |
| | | { |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (battleObject != null) |
| | | { |
| | | DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BreakArmor); |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.BreakArmorEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | else if ((hurt.AttackTypes & (int)DamageType.Parry) == (int)DamageType.Parry) |
| | | { |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (battleObject != null) |
| | | { |
| | | DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.Parry); |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.ParryEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 处理单个目标被命中:应用伤害和施法者效果 |
| | | 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; |
| | | tempDropList.TryGetValue(objID, out BattleDrops battleDrops); |
| | | tempDeadPackList.TryGetValue(objID, out HB422_tagMCTurnFightObjDead deadPack); |
| | | tempDeadPackList.TryGetValue(objID, out BattleDeadPack deadPack); |
| | | |
| | | // 如果目标正在释放技能,跳过死亡处理(延迟到技能结束) |
| | | if (battleField != null && battleField.IsCastingSkill(target.ObjID)) |
| | | { |
| | | deadPack = null; |
| | | } |
| | | |
| | | // ============ 参数打包 ============ |
| | | BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack); |
| | | |
| | | BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack, suckHp); |
| | | #if UNITY_EDITOR |
| | | PrintHurtParamDebugInfo(hurtParam); |
| | | #endif |
| | | |
| | | // 先调用目标受伤 |
| | | target.Hurt(hurtParam); |
| | | DeathRecordAction recordAc = target.Hurt(hurtParam, ownRecordAction); |
| | | |
| | | if (null != recordAc) |
| | | { |
| | | tempDeadPackList.Remove(hurtParam.hurter.hurtObj.ObjID); |
| | | ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAc, ownRecordAction, true); |
| | | currentWaitingSkill.Add(recordAc); |
| | | } |
| | | |
| | | // 再调用施法者吸血/反伤 |
| | | caster.OnHurtTarget(hurtParam); |
| | |
| | | // ============ 获取临时数据(掉落、死亡等) ============ |
| | | int objID = (int)target.ObjID; |
| | | tempDropList.TryGetValue(objID, out BattleDrops battleDrops); |
| | | tempDeadPackList.TryGetValue(objID, out HB422_tagMCTurnFightObjDead deadPack); |
| | | |
| | | tempDeadPackList.TryGetValue(objID, out BattleDeadPack deadPack); |
| | | |
| | | // 如果目标正在释放技能,跳过死亡处理(延迟到技能结束) |
| | | if (battleField != null && battleField.IsCastingSkill(target.ObjID)) |
| | | { |
| | | deadPack = null; |
| | | } |
| | | // ============ 参数打包(将 tagSCUseSkillHurtEx 转换为 tagSCUseSkillHurt)============ |
| | | HB427_tagSCUseSkill.tagSCUseSkillHurt hurt = new HB427_tagSCUseSkill.tagSCUseSkillHurt |
| | | { |
| | |
| | | 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 |
| | |
| | | |
| | | BattleDebug.LogError( |
| | | (hurtParam.caster.casterObj.Camp == BattleCamp.Red ? "【红方行动】" : "【蓝方行动】 ") + |
| | | $"攻击者: {hurtParam.caster.casterObj.teamHero.name} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.teamHero.name} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"攻击者: {hurtParam.caster.casterObj.GetName()} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.GetName()} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"技能: {hurtParam.skillConfig.SkillName} (ID:{hurtParam.skillConfig.SkillID})\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"\n" + |
| | |
| | | if (refreshPack != null) |
| | | { |
| | | // 分发HP刷新包 |
| | | PackageRegedit.Distribute(refreshPack); |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:HP刷新包是技能内部产生的,应该由当前SkillRecordAction的innerRecordPlayer管理 |
| | | // 这样可以确保HP刷新与技能的生命周期绑定,ForceFinish时一并处理 |
| | | PackageRegeditEx.DistributeToRecordAction(refreshPack, ownRecordAction); |
| | | packList.Remove(refreshPack); |
| | | } |
| | | } |
| | |
| | | // 处理死亡相关逻辑:分配掉落和经验 |
| | | protected void HandleDead() |
| | | { |
| | | var deadPackList = BattleUtility.FindDeadPack(packList); |
| | | List<BattleDeadPack> deadPackList = BattleUtility.FindDeadPack(packList); |
| | | if (deadPackList.Count <= 0) return; |
| | | |
| | | foreach (var deadPack in deadPackList) |
| | | { |
| | | packList.Remove(deadPack.deadPack); |
| | | packList.Remove(deadPack.deadTriggerSkill); |
| | | } |
| | | |
| | | // 找到最大的死亡包 packUID |
| | | BattleDeadPack lastBattleDeadPack = null; |
| | | ulong maxDeathPackUID = 0; |
| | | foreach (var deadPack in deadPackList) |
| | | { |
| | | if (deadPack.deadPack != null && deadPack.deadPack.packUID > maxDeathPackUID) |
| | | { |
| | | maxDeathPackUID = deadPack.deadPack.packUID; |
| | | lastBattleDeadPack = deadPack; |
| | | } |
| | | } |
| | | |
| | | // 如果找到了死亡包,收集所有 packUID > maxDeathPackUID 的包 |
| | | if (maxDeathPackUID > 0 && lastBattleDeadPack != null) |
| | | { |
| | | BattleDebug.LogError($"SkillBase.HandleDead: 找到死亡包,maxDeathPackUID = {maxDeathPackUID},开始收集死亡后的包"); |
| | | |
| | | // 1. 收集 packList 中 packUID 大于死亡包的包(排除经验包和掉落包,它们需要在当前技能中处理) |
| | | List<GameNetPackBasic> packsToRemove = new List<GameNetPackBasic>(); |
| | | foreach (var pack in packList) |
| | | { |
| | | ulong packUID = GetPackUID(pack); |
| | | if (packUID > maxDeathPackUID) |
| | | { |
| | | // 排除经验包和掉落包,它们属于当前死亡事件的一部分,不是"死亡后"的包 |
| | | if (pack is HB405_tagMCAddExp expPack && expPack.Source == 2 || |
| | | (pack is H0704_tagRolePackRefresh h0704 && h0704.PackType == (byte)PackType.DropItem && h0704.IsBind == 1)) |
| | | { |
| | | continue; // 跳过经验包和掉落包,让 CheckAfterDeadhPack() 处理它们 |
| | | } |
| | | |
| | | BattleDebug.LogError($"SkillBase.HandleDead: 从packList收集死亡后的包 - Type: {pack.GetType().Name}, UID: {packUID}"); |
| | | lastBattleDeadPack.packListAfterDeath.Add(pack); |
| | | packsToRemove.Add(pack); |
| | | } |
| | | } |
| | | |
| | | packList.RemoveAll(p => packsToRemove.Contains(p)); |
| | | } |
| | | |
| | | CheckAfterDeadhPack(); |
| | | |
| | |
| | | var dropPacksToRemove = new List<H0704_tagRolePackRefresh>(dropPackList); |
| | | foreach (var _dropPack in dropPacksToRemove) |
| | | { |
| | | PackageRegedit.Distribute(_dropPack); |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:掉落包是技能效果的一部分,应该由当前SkillRecordAction管理 |
| | | // 掉落包的分发与技能完成绑定,确保在技能ForceFinish时正确处理 |
| | | PackageRegeditEx.DistributeToRecordAction(_dropPack, ownRecordAction); |
| | | packList.Remove(_dropPack); |
| | | } |
| | | |
| | |
| | | // 构造BattleDrops并缓存 |
| | | for (int i = 0; i < deadPackList.Count; i++) |
| | | { |
| | | int objID = (int)deadPackList[i].ObjID; |
| | | BattleDeadPack bdp = deadPackList[i]; |
| | | int objID = (int)bdp.deadPack.ObjID; |
| | | BattleObject deadTarget = battleField.battleObjMgr.GetBattleObject(objID); |
| | | |
| | | // 修复:添加空值检查 |
| | |
| | | |
| | | BattleDrops battleDrops = new BattleDrops() |
| | | { |
| | | rectTransform = deadTarget.heroRectTrans, |
| | | rectTransform = deadTarget.GetRectTransform(), |
| | | dropItemPackIndex = itemIndexList, |
| | | expDrops = expAssign[i] |
| | | }; |
| | |
| | | } |
| | | |
| | | // 修复:避免在遍历时修改集合,先收集后删除 |
| | | var deadPacksToRemove = new List<GameNetPackBasic>(deadPackList.Cast<GameNetPackBasic>()); |
| | | var deadPacksToRemove = new List<GameNetPackBasic>(deadPackList.Select(d => d.deadPack)); |
| | | deadPacksToRemove.AddRange(deadPackList.Where(d => d.deadTriggerSkill != null).Select(d => d.deadTriggerSkill)); |
| | | foreach (var deadPack in deadPacksToRemove) |
| | | { |
| | | packList.Remove(deadPack); |
| | |
| | | for (int i = 0; i < itemList.Count; i++) |
| | | dropAssign[i % deadCount].Add(itemList[i]); |
| | | return dropAssign; |
| | | } |
| | | |
| | | // 获取包的 packUID |
| | | protected ulong GetPackUID(GameNetPackBasic pack) |
| | | { |
| | | if (pack == null) return 0; |
| | | |
| | | if (pack is HB422_tagMCTurnFightObjDead deadPack) |
| | | return deadPack.packUID; |
| | | |
| | | if (pack is CustomHB426CombinePack combinePack) |
| | | { |
| | | var mainSkillPack = combinePack.GetMainHB427SkillPack(); |
| | | return mainSkillPack?.packUID ?? 0; |
| | | } |
| | | |
| | | if (pack is HB427_tagSCUseSkill skillPack) |
| | | return skillPack.packUID; |
| | | |
| | | if (pack is HB428_tagSCBuffRefresh buffRefresh) |
| | | return buffRefresh.packUID; |
| | | |
| | | if (pack is HB429_tagSCBuffDel buffDel) |
| | | return buffDel.packUID; |
| | | |
| | | if (pack is HB419_tagSCObjHPRefresh hpRefresh) |
| | | return hpRefresh.packUID; |
| | | |
| | | if (pack is HB405_tagMCAddExp expPack) |
| | | return expPack.packUID; |
| | | |
| | | if (pack is H0704_tagRolePackRefresh dropPack) |
| | | return dropPack.packUID; |
| | | |
| | | // 尝试通过反射获取 packUID |
| | | var packUIDField = pack.GetType().GetField("packUID"); |
| | | if (packUIDField != null) |
| | | { |
| | | return (ulong)packUIDField.GetValue(pack); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | // 分配经验值:将经验包平均分配给每个死亡对象 |
| | |
| | | packList.RemoveAt(removeIndexList[i]); |
| | | } |
| | | |
| | | |
| | | public virtual bool IsActionCompleted() |
| | | { |
| | | if (!isPlay) return false; |
| | | |
| | | if (skillEffect != null) |
| | | { |
| | | if (!skillEffect.IsFinished()) return false; |
| | | } |
| | | |
| | | if (moveFinished) |
| | | { |
| | | // 如果技能有动画(SkillMotionName不为空),需要等待动画播放完成 |
| | | if (skillConfig != null && !string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | { |
| | | if (!isMotionCompleted) |
| | | { |
| | | BattleDebug.LogError($"SkillBase.IsActionCompleted: 技能 {skillConfig.SkillID} 等待动画播放完成"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // 检查技能是否完成:综合检查所有完成条件 |
| | | public virtual bool IsFinished() |
| | | { |
| | |
| | | } |
| | | |
| | | // 检查其他技能动作是否完成 |
| | | if (otherSkillActionList.Count > 0) |
| | | if (currentWaitingSkill.Count > 0) |
| | | { |
| | | for (int i = otherSkillActionList.Count - 1; i >= 0; i--) |
| | | if (currentWaitingSkill.Any(s => s.IsFinished())) |
| | | { |
| | | var action = otherSkillActionList[i]; |
| | | if (action.IsFinished()) |
| | | { |
| | | otherSkillActionList.RemoveAt(i); |
| | | OnSkillFinished(); |
| | | } |
| | | currentWaitingSkill.RemoveAll(s => s.IsFinished()); |
| | | OnSkillFinished(); |
| | | } |
| | | if (otherSkillActionList.Count > 0) |
| | | else |
| | | { |
| | | tempRetValue = false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 检查最终完成状态 |
| | | if (isFinished && moveFinished) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | // 如果自己内部的recora action的 inner record player还有没执行完的包 也是返回false |
| | | if (ownRecordAction != null && ownRecordAction.GetInnerRecordPlayer().IsPlaying()) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 技能完全结束,移除技能注册并触发延迟的死亡判定 |
| | | if (battleField != null && caster != null) |
| | | { |
| | | battleField.RemoveCastingSkill(caster.ObjID, this); |
| | | |
| | | // 传递parentRecordAction,让死亡技能等待当前技能完成 |
| | | DeathRecordAction recordAction = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values), null, ownRecordAction); |
| | | if (null != recordAction) |
| | | { |
| | | ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction); |
| | | tempDeadPackList.Clear(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return !ownRecordAction.GetInnerRecordPlayer().IsPlaying(); |
| | | } |
| | | |
| | | return false; |
| | |
| | | // 强制结束技能:立即结束所有技能相关的处理 |
| | | public virtual void ForceFinished() |
| | | { |
| | | if (isFinished) |
| | | return; |
| | | |
| | | // 移除技能注册 |
| | | if (battleField != null && caster != null) |
| | | { |
| | | battleField.RemoveCastingSkill(caster.ObjID, this); |
| | | } |
| | | |
| | | // 传递parentRecordAction,让死亡技能等待当前技能完成 |
| | | RecordAction rc = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values)); |
| | | if (null != rc) |
| | | { |
| | | ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc); |
| | | } |
| | | tempDeadPackList.Clear(); |
| | | |
| | | // 1. 强制结束技能效果 |
| | | skillEffect?.ForceFinished(); |
| | | skillEffect = null; |
| | | |
| | | otherSkillActionList.ForEach(action => action.ForceFinish()); |
| | | otherSkillActionList.Clear(); |
| | | // 2. 强制结束所有子技能动作 |
| | | if (currentWaitingSkill.Count > 0) |
| | | { |
| | | foreach (var skill in currentWaitingSkill) |
| | | { |
| | | skill.ForceFinish(); |
| | | } |
| | | currentWaitingSkill.Clear(); |
| | | } |
| | | |
| | | // 3. 清理 DOTween 动画(防止移动回调在战斗结束后执行) |
| | | if (caster != null) |
| | | { |
| | | caster.StopMoveAnimation(); |
| | | } |
| | | |
| | | // 4. 重置施法者状态 |
| | | if (caster != null) |
| | | { |
| | | // 重置位置到原点 |
| | | caster.ResetPosition(); |
| | | |
| | | // 重置朝向 |
| | | caster.ResetFacing(); |
| | | |
| | | // 取消幻影效果 |
| | | caster.ShowIllusionShadow(false); |
| | | } |
| | | |
| | | // 5. 恢复 UI 状态 |
| | | if (battleField != null) |
| | | { |
| | | // 恢复所有角色的显示层级和血条 |
| | | var allList = battleField.battleObjMgr?.allBattleObjDict?.Values; |
| | | if (allList != null) |
| | | { |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | | bo.layerMgr?.SetFront(); |
| | | bo.GetHeroInfoBar()?.SetActive(true); |
| | | } |
| | | } |
| | | |
| | | // 关闭技能遮罩 |
| | | if (battleField.battleRootNode != null && battleField.battleRootNode.skillMaskNode != null) |
| | | { |
| | | battleField.battleRootNode.skillMaskNode.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | isFinished = true; |
| | | moveFinished = true; |
| | | isPlay = true; |
| | | |
| | | // 强制结束时,无论是否有动画,都标记动画完成 |
| | | isMotionCompleted = true; |
| | | |
| | | // 处理所有剩余包 |
| | | // 6. 处理所有剩余包(包括 buff 包) |
| | | // 先处理 buffPackCollections |
| | | DistributeBuffPacks(buffPackCollections); |
| | | buffPackCollections.Clear(); |
| | | |
| | | // 处理剩余的 packList |
| | | while (packList.Count > 0) |
| | | { |
| | | var pack = packList[0]; |
| | |
| | | } |
| | | else |
| | | { |
| | | if (pack is CustomB421ActionPack actionPack) |
| | | actionPack.Distribute(); |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:ForceFinished时剩余的包也是技能内部产生的,应该由innerRecordPlayer管理 |
| | | // 这样可以确保即使强制结束,包的处理也在正确的上下文中 |
| | | PackageRegedit.Distribute(pack); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 验证其他技能动作是否完成 |
| | | if (otherSkillActionList.Count > 0) |
| | | if (currentWaitingSkill.Count > 0) |
| | | { |
| | | bool hasFinishedAction = false; |
| | | for (int i = otherSkillActionList.Count - 1; i >= 0; i--) |
| | | { |
| | | var action = otherSkillActionList[i]; |
| | | if (action.IsFinished()) |
| | | { |
| | | otherSkillActionList.RemoveAt(i); |
| | | hasFinishedAction = true; |
| | | } |
| | | } |
| | | bool hasFinishedAction = currentWaitingSkill.All(s => s.IsFinished()); |
| | | |
| | | if (hasFinishedAction) |
| | | { |
| | | // 修复死循环:完成后需要清空 currentWaitingSkill |
| | | currentWaitingSkill.Clear(); |
| | | continue; // 使用continue代替递归调用 |
| | | } |
| | | return; |
| | |
| | | |
| | | protected virtual bool ResolvePackList() |
| | | { |
| | | if (currentWaitingSkill.Count > 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | while (packList.Count > 0) |
| | | { |
| | | var pack = packList[0]; |
| | | packList.RemoveAt(0); |
| | | |
| | | |
| | | if (pack is CustomHB426CombinePack combinePack && combinePack.startTag.Tag.StartsWith("Skill_")) |
| | | { |
| | | BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag); |
| | | var otherSkillAction = combinePack.CreateSkillAction(); |
| | | otherSkillAction.fromSkill = this; |
| | | otherSkillActionList.Add(otherSkillAction); |
| | | var skillRecordAction = combinePack.CreateSkillAction(); |
| | | skillRecordAction.fromSkill = this; |
| | | currentWaitingSkill.Add(skillRecordAction); |
| | | |
| | | // 需要给真正parent播的 |
| | | if (skillRecordAction.useParentRecordPlayer && skillRecordAction.parentSkillAction != null) |
| | | { |
| | | skillRecordAction.parentSkillAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction); |
| | | } |
| | | else |
| | | { |
| | | ownRecordAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | else if (pack is HB428_tagSCBuffRefresh buffRefresh) |
| | | else if (IsBuffPack(pack)) |
| | | { |
| | | // 从找到第一个HB428开始 找出连续的HB428_tagSCBuffRefresh包 如果找到一个B428后 之后碰到非HB428包就停止 |
| | | buffCollections.Add(buffRefresh); |
| | | // 从找到第一个 Buff 包开始,收集连续的 HB428/HB429 包 |
| | | buffPackCollections.Add(pack); |
| | | while (packList.Count > 0) |
| | | { |
| | | var nextPack = packList[0]; |
| | | if (nextPack is HB428_tagSCBuffRefresh nextBuffRefresh) |
| | | if (IsBuffPack(nextPack)) |
| | | { |
| | | buffCollections.Add(nextBuffRefresh); |
| | | buffPackCollections.Add(nextPack); |
| | | packList.RemoveAt(0); |
| | | } |
| | | else |
| | |
| | | } |
| | | } |
| | | |
| | | // 同时刷新所有对象的buff,不分组 |
| | | foreach (var buff in buffCollections) |
| | | { |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buff.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RefreshBuff(buff, true); |
| | | } |
| | | } |
| | | // 处理所有收集到的 buff 包 |
| | | ProcessBuffPacks(buffPackCollections); |
| | | |
| | | // 清空已处理的buff集合 |
| | | buffCollections.Clear(); |
| | | // 清空已处理的 buff 集合 |
| | | buffPackCollections.Clear(); |
| | | continue; |
| | | } |
| | | |
| | | if (pack is CustomB421ActionPack actionPack) |
| | | { |
| | | actionPack.Distribute(); |
| | | } |
| | | else |
| | | { |
| | | PackageRegedit.Distribute(pack); |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:技能执行过程中的包(Buff、属性刷新等)是技能效果的一部分 |
| | | // 应该由SkillRecordAction的innerRecordPlayer管理,确保与技能生命周期一致 |
| | | PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | tempDropList?.Clear(); |
| | | tempDeadPackList?.Clear(); |
| | | otherSkillActionList?.Clear(); |
| | | currentWaitingSkill?.Clear(); |
| | | dropPackList?.Clear(); |
| | | expPackList?.Clear(); |
| | | buffPackCollections?.Clear(); |
| | | |
| | | skillEffect = null; |
| | | packList = null; |
| | | } |
| | | |
| | | #region Buff包处理 |
| | | |
| | | /// <summary> |
| | | /// 判断是否为 Buff 相关的包(HB428 或 HB429) |
| | | /// </summary> |
| | | protected bool IsBuffPack(GameNetPackBasic pack) |
| | | { |
| | | return pack is HB428_tagSCBuffRefresh || pack is HB429_tagSCBuffDel; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 处理收集到的 Buff 包列表(HB428 刷新 和 HB429 删除) |
| | | /// </summary> |
| | | protected void ProcessBuffPacks(List<GameNetPackBasic> buffPacks) |
| | | { |
| | | if (buffPacks == null || buffPacks.Count == 0) return; |
| | | |
| | | foreach (var pack in buffPacks) |
| | | { |
| | | if (pack is HB428_tagSCBuffRefresh buffRefresh) |
| | | { |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffRefresh.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RefreshBuff(buffRefresh, true); |
| | | } |
| | | } |
| | | } |
| | | else if (pack is HB429_tagSCBuffDel buffDel) |
| | | { |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffDel.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RemoveBuff(buffDel, false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 强制分发 Buff 包(用于 ForceFinished 场景) |
| | | /// </summary> |
| | | protected void DistributeBuffPacks(List<GameNetPackBasic> buffPacks) |
| | | { |
| | | if (buffPacks == null || buffPacks.Count == 0) return; |
| | | |
| | | foreach (var pack in buffPacks) |
| | | { |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:Buff包是技能效果的核心组成部分,应该由SkillRecordAction管理 |
| | | // 即使是强制分发的情况,也要保持在正确的RecordAction上下文中 |
| | | PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction); |
| | | } |
| | | } |
| | | |
| | | public virtual bool CanStartExecution() |
| | | { |
| | | if (null == caster) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (null == skillConfig) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return !battleField.IsCastingSkill(caster.ObjID); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |