| | |
| | | } |
| | | } |
| | | |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isSubSkill, Action onComplete) |
| | | { |
| | | return motionBase.PlaySkillAnimation(skillConfig, skillBase, isCounter, onComplete); |
| | | return motionBase.PlaySkillAnimation(skillConfig, skillSkinConfig, skillBase, isSubSkill, onComplete); |
| | | } |
| | | |
| | | public override bool CanStartDeath() |
| | |
| | | return motionBase.CanStartDeath(); |
| | | } |
| | | |
| | | public override bool CanCastSkillAnimation(SkillConfig skillConfig) |
| | | public override bool CanCastSkillAnimation(SkillSkinConfig skillSkinConfig) |
| | | { |
| | | return motionBase.CanCastSkill(skillConfig); |
| | | // 除了等 Spine 技能动画锁(playingSkillWithAnim),还必须等 caster 自身由 SkillBase.MoveToTarget |
| | | // 发起的前冲 / 回位 tween 跑完。否则上一个技能的回位 tween 还在半路,下一个技能(尤其是被动 |
| | | // BattleType=5)会在当前位置再发起前冲,旧回位 tween 和新前冲 tween 同时写 anchoredPosition, |
| | | // 视觉表现是"没回位又突然冲出去攻击"。这里只判定 SkillBase 自己记录的移动 tween 句柄,不误伤 |
| | | // 挂在 heroRectTrans 上的其它业务 tween。 |
| | | if (activeMoveTween != null && activeMoveTween.IsActive() && !activeMoveTween.IsComplete()) |
| | | { |
| | | return false; |
| | | } |
| | | return motionBase.CanCastSkill(skillSkinConfig); |
| | | } |
| | | |
| | | public override SkeletonAnimation GetSkeletonAnimation() |
| | |
| | | public override DeathRecordAction Hurt(BattleHurtParam battleHurtParam, SkillRecordAction _parentSkillAction = null) |
| | | { |
| | | DeathRecordAction recordAction = null; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | bool firstHit = battleHurtParam.hitIndex == 0; |
| | | |
| | | // 添加调试日志 |
| | |
| | | |
| | | // ============ 应用目标的血量和护盾变化 ============ |
| | | ApplyHurtToTarget(battleHurtParam, isLastHit); |
| | | |
| | | |
| | | // 这里 |
| | | if (dmgInfo.IsType(DamageType.Dodge) /*&& !buffMgr.isControled[BattleConst.HardControlGroup]*/)//如果被控制了还闪避了 要看看服务器怎么处理了 |
| | | if (dmgInfo.IsType(DamageType.Dodge) || dmgInfo.IsType(DamageType.CompletelyDodge))//如果被控制了还闪避了 要看看服务器怎么处理了 |
| | | { |
| | | if (isLastHit) |
| | | { |
| | |
| | | |
| | | if (firstHit) |
| | | { |
| | | OnDodgeBegin(); |
| | | OnDodgeBegin(dmgInfo.IsType(DamageType.Dodge) ? DamageType.Dodge : DamageType.CompletelyDodge); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | const float pingpongTime = 0.4f; |
| | | // 闪避开始 |
| | | public override void OnDodgeBegin() |
| | | public override void OnDodgeBegin(DamageType damageType) |
| | | { |
| | | RectTransform rectTrans = heroRectTrans; |
| | | var tween = rectTrans.DOAnchorPos(new Vector3(-30, 0, 0), pingpongTime) |
| | |
| | | |
| | | motionBase.ShowIllusionShadow(true); |
| | | |
| | | DamageNumConfig damageNumConfig = DamageNumConfig.Get((int)DamageType.Dodge); |
| | | int damageTypeInt = damageType == DamageType.Dodge ? (int)damageType : BattleConst.CompletelyDodge; |
| | | |
| | | DamageNumConfig damageNumConfig = DamageNumConfig.Get(damageTypeInt); |
| | | |
| | | string dodgeStr = ((char)damageNumConfig.prefix).ToString(); |
| | | |
| | |
| | | |
| | | protected override void ApplyCasterHpChange(long newHp) |
| | | { |
| | | if (teamHero == null) return; |
| | | teamHero.curHp = newHp; |
| | | } |
| | | |
| | | public override long GetCurHp() => teamHero.curHp; |
| | | public override long GetMaxHp() => teamHero.maxHp; |
| | | public override void SetCurHp(long value) { teamHero.curHp = value; } |
| | | public override void SetIsDead(bool value) { teamHero.isDead = value; } |
| | | public override long GetCurHp() => teamHero == null ? 0 : teamHero.curHp; |
| | | public override long GetMaxHp() => teamHero == null ? 0 : teamHero.maxHp; |
| | | public override void SetCurHp(long value) { if (teamHero == null) return; teamHero.curHp = value; } |
| | | public override void SetIsDead(bool value) { if (teamHero == null) return; teamHero.isDead = value; } |
| | | |
| | | public override int GetNPCID() => teamHero.NPCID; |
| | | public override long GetFightPower() => teamHero.fightPower; |
| | | public override int GetNPCID() => teamHero == null ? 0 : teamHero.NPCID; |
| | | public override long GetFightPower() => teamHero == null ? 0 : teamHero.fightPower; |
| | | |
| | | // 伤害还要看 是否闪避 暴击 and so on 需要有一个DamageType 服务器应该会给 |
| | | protected override BattleDmgInfo PopDamage(BattleHurtParam battleHurtParam) |
| | |
| | | } |
| | | |
| | | // ============ 应用施法者的血量和护盾变化 ============ |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | ApplyHurtToCaster(battleHurtParam, isLastHit); |
| | | |
| | | // 和Hurt一样,调用PopDamage处理吸血/反伤的显示 |