| | |
| | | return true; |
| | | } |
| | | |
| | | public virtual void Hurt(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig) |
| | | public virtual void Hurt(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig, bool playAnimation = true) |
| | | { |
| | | BattleDmgInfo dmgInfo = PopDamage(damageValues, _totalDamage, hurt, skillConfig); |
| | | |
| | | if (dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()) |
| | | if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()) && playAnimation) |
| | | { |
| | | motionBase.PlayAnimation(MotionName.hit, false); |
| | | } |
| | |
| | | |
| | | public void SuckHp(uint suckHP, SkillConfig skillConfig) |
| | | { |
| | | |
| | | teamHero.curHp = Math.Min(teamHero.maxHp, teamHero.curHp + (int)suckHP); |
| | | } |
| | | |
| | | public void HurtByReflect(uint bounceHP, SkillConfig skillConfig) |
| | | { |
| | | |
| | | teamHero.curHp = Math.Max(0, teamHero.curHp - (int)bounceHP); |
| | | } |
| | | |
| | | // 闪避开始 |
| | |
| | | currentHurtHp += (int)damageValues[i]; |
| | | } |
| | | |
| | | heroInfoBar.UpdateHP(teamHero.curHp, Math.Max(0, teamHero.curHp - currentHurtHp), teamHero.maxHp); |
| | | teamHero.curHp = Math.Max(0, teamHero.curHp - currentHurtHp); |
| | | bool isRecovery = battleDmgInfo.IsType(DamageType.Recovery); |
| | | |
| | | long toHp = Math.Max(0, teamHero.curHp + (isRecovery ? currentHurtHp : -currentHurtHp)); |
| | | |
| | | heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp); |
| | | teamHero.curHp = toHp; |
| | | |
| | | // YYL TODO 是否需要挂在在自身的follow点上 |
| | | EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo); |
| | |
| | | { |
| | | // 伤害分布 (万分比) |
| | | // Debug.LogError("skillConfig.DamageDivide.Count " + skillConfig.DamageDivide.Length + " _hitIndex " + _hitIndex); |
| | | bool isLastHit = _hitIndex >= skillConfig.DamageDivide.Length - 1; |
| | | int[] damageDivide = skillConfig.DamageDivide[_hitIndex]; |
| | | |
| | | long totalDamage = GeneralDefine.GetFactValue(hurt.HurtHP, hurt.HurtHPEx); |
| | |
| | | |
| | | |
| | | // TODO YYL AttackTypes 要表现成什么样呢? 支持多种类型并存,如无视防御且暴击同时被格挡,二进制或运算最终值;0-失败;1-普通;2-回血;5-格挡;6-无视防御;7-暴击;9-闪避 |
| | | target.Hurt(damageList, totalDamage, hurt, skillConfig); |
| | | |
| | | List<HB422_tagMCTurnFightObjDead> deadPacks = BattleUtility.FindDeadPack(packList); |
| | | bool isTargetDead = deadPacks.Exists(p => p.ObjID == target.ObjID); |
| | | |
| | | bool playAnimation = !(isLastHit && isTargetDead); |
| | | target.Hurt(damageList, totalDamage, hurt, skillConfig, playAnimation); |
| | | |
| | | // TODO YYL 这里是要做统一计算后再hurt跟suckhp还是怎样 |
| | | caster.SuckHp(hurt.SuckHP, skillConfig);// 吸血 |