| | |
| | | {
|
| | | _dungeon.AddHeroHurt(hurtValue);
|
| | | }
|
| | | var _cnpc = target as GA_NpcClientFightNorm;
|
| | | if (_cnpc != null)
|
| | | {
|
| | | _cnpc.StartCantAtkedRotate();
|
| | | }
|
| | | }
|
| | | else if (_clientHazyDemonStage != null)
|
| | | {
|
| | |
| | | else if (target is GA_NpcClientFightNorm)
|
| | | {
|
| | | var _cnpc = target as GA_NpcClientFightNorm;
|
| | | _cnpc.StartCantAtkedRotate();
|
| | | if (_cnpc.NpcConfig.AIType == 198)
|
| | | {
|
| | | _doReduceHp = false;
|
| | |
| | | int _suppressValueRealmRate = 1;
|
| | | float _suppressFightPower = 0;
|
| | | float _suppressValueFP_0 = 0;
|
| | | float _superHitAdd = 0;
|
| | |
|
| | | #region 伤害替换
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | #region 4094,4507 增加暴击概率
|
| | | if (skill.skillInfo.effectValue.TryGetValue(4094, out _effectValue))
|
| | | {
|
| | | bool _vaild = true;
|
| | | if (_effectValue.value2 != 0)
|
| | | {
|
| | | if (!target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2))
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_vaild)
|
| | | {
|
| | | _aSuperHitRate += _effectValue.value1;
|
| | | }
|
| | | }
|
| | |
|
| | | if (skill.skillInfo.effectValue.TryGetValue(4507, out _effectValue))
|
| | | {
|
| | | bool _vaild = true;
|
| | | if (_effectValue.value2 == 1)
|
| | | {
|
| | | if (attacker.SelectTarget == null
|
| | | || attacker.SelectTarget.ServerInstID != target.ServerInstID)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_effectValue.value3 == 0)
|
| | | {
|
| | | if (skill.skillInfo.config.FuncType != (int)E_SkillFuncType.NormalAttack)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_vaild)
|
| | | {
|
| | | if (_vaild)
|
| | | {
|
| | | _aSuperHitRate += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | _isMiss = IsMiss(_hitRate, _missRate);
|
| | | _isCrit = IsCrit(_aSuperHitRate);
|
| | | _isLucky = IsLucky(_aLuckyHitRate);
|
| | |
| | | #if UNITY_EDITOR
|
| | | Debug.LogFormat("技能: {0} 计算伤害的时候发生重击, 暴击伤害翻倍: {1}", skill.id, _aSuperHit);
|
| | | #endif
|
| | |
|
| | | #region 4528,4083 增加重击伤害
|
| | | if (skill.skillInfo.effectValue.TryGetValue(4528, out _effectValue))
|
| | | {
|
| | | bool _vaild = true;
|
| | | if (_effectValue.value2 == 1)
|
| | | {
|
| | | if (attacker.SelectTarget == null
|
| | | || attacker.SelectTarget.ServerInstID != target.ServerInstID)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_effectValue.value3 == 1)
|
| | | {
|
| | | if (skill.skillInfo.config.FuncType != (int)E_SkillFuncType.NormalAttack
|
| | | && skill.skillInfo.config.FuncType != (int)E_SkillFuncType.FaBaoActiveSkill)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_vaild)
|
| | | {
|
| | | if (_vaild)
|
| | | {
|
| | | _superHitAdd += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4083, out _effectValue))
|
| | | {
|
| | | bool _vaild = true;
|
| | | if (_effectValue.value2 == 1)
|
| | | {
|
| | | if (attacker.SelectTarget == null
|
| | | || attacker.SelectTarget.ServerInstID != target.ServerInstID)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | if (_vaild)
|
| | | {
|
| | | _superHitAdd += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
|
| | |
|
| | | // 4051 当发生会心伤害时, 增加会心一击伤害
|
| | | if (_isLucky
|
| | |
| | | || skill.skillInfo.config.HurtType == 0)
|
| | | {
|
| | | // 处理本身的技能
|
| | | CalculateSkillEffect(attacker, target, skill.skillInfo, ref _aDamagePer, ref _aAtkSkillPer, ref _atkSkillValue, ref _aIceAtk, ref _aFinalHurt, ref _aSuperHit, _isCrit);
|
| | | CalculateSkillEffect(attacker, target, skill.skillInfo, ref _aDamagePer, ref _aAtkSkillPer, ref _atkSkillValue, ref _aIceAtk, ref _aFinalHurt, ref _superHitAdd, _isCrit);
|
| | |
|
| | | // 处理sp技能
|
| | | List<SkillHelper.SkillInfo> _spSkillList = SkillHelper.Instance.GetSpSkill(skill.id);
|
| | |
| | | {
|
| | | for (int i = 0; i < _spSkillList.Count; ++i)
|
| | | {
|
| | | CalculateSkillEffect(attacker, target, _spSkillList[i], ref _aDamagePer, ref _aAtkSkillPer, ref _atkSkillValue, ref _aIceAtk, ref _aFinalHurt, ref _aSuperHit, _isCrit);
|
| | | CalculateSkillEffect(attacker, target, _spSkillList[i], ref _aDamagePer, ref _aAtkSkillPer, ref _atkSkillValue, ref _aIceAtk, ref _aFinalHurt, ref _superHitAdd, _isCrit);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | _aAtkSkillPer += (_per * Constants.F_DELTA);
|
| | | }
|
| | | }
|
| | |
|
| | | _aSuperHit *= (1 + _superHitAdd * Constants.F_DELTA);
|
| | |
|
| | | // -------------- 公式计算 --------------
|
| | | // PVE
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | SkillHelper.EffectValue _effectValue;
|
| | | if (_hero.SkillMgr.TryGetPassiveEffectValue(4081, out _effectValue))
|
| | | {
|
| | | if (_effectValue.value2 == 1)
|
| | | {
|
| | | if (_hero.SelectTarget.ServerInstID == target.ServerInstID)
|
| | | {
|
| | | _rate += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _rate += _effectValue.value1;
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | var _random = Random.Range(0, 10000);
|
| | | var _result = _random < _rate;
|
| | |
| | | ref int _atkSkillValue,
|
| | | ref int _aIceAtk,
|
| | | ref int _aFinalHurt,
|
| | | ref float _aSuperHit,
|
| | | ref float _aSuperHitAdd,
|
| | | bool _isCrit)
|
| | | {
|
| | | SkillHelper.EffectValue _effectValue;
|
| | | #region 伤害增加
|
| | | // 4002 目标血量低于XX百分比提高伤害xx
|
| | | if (skillInfo.effectValue.TryGetValue(4002, out _effectValue))
|
| | | {
|
| | | if (HpPer(target) < _effectValue.value2 * Constants.F_DELTA)
|
| | | {
|
| | | _aDamagePer += _effectValue.value1;
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_SkillEffectLog)
|
| | | {
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , aDamagePer 增加了 {2}", skillInfo.config.SkillID, 4002, _effectValue.value1);
|
| | | }
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | if (skillInfo.effectValue.TryGetValue(1062, out _effectValue))
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 4003 目标处于XX状态提高伤害 _aDamagePer ???
|
| | | if (skillInfo.effectValue.TryGetValue(4003, out _effectValue))
|
| | | if (attacker is GA_Hero)
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2)
|
| | | && target.ActorInfo.status4012[(byte)_effectValue.value2] > 0)
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4086, out _effectValue))
|
| | | {
|
| | | _aDamagePer += _effectValue.value1;
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_SkillEffectLog)
|
| | | bool _vaild = true;
|
| | | if (_effectValue.value3 == 1)
|
| | | {
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , aDamagePer 增加了 {2}", skillInfo.config.SkillID, 4003, _effectValue.value1);
|
| | | if (attacker.SelectTarget == null
|
| | | || attacker.SelectTarget.ServerInstID != target.ServerInstID)
|
| | | {
|
| | | _vaild = false;
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | if (_vaild)
|
| | | {
|
| | | int _limit = PlayerDatas.Instance.baseData.yinjiCount > _effectValue.value2 ?
|
| | | _effectValue.value2 : PlayerDatas.Instance.baseData.yinjiCount;
|
| | | _aAtkSkillPer += _limit * _effectValue.value1;
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4087, out _effectValue))
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.yinjiCount > _effectValue.value2)
|
| | | {
|
| | | _aAtkSkillPer += _effectValue.value1;
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4088, out _effectValue))
|
| | | {
|
| | | int _per = _effectValue.value1;
|
| | | int _needCount = _effectValue.value2;
|
| | | bool _valid = true;
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4092, out _effectValue))
|
| | | {
|
| | | if (_effectValue.value2 == 0)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.yinjiCount != _needCount)
|
| | | {
|
| | | _valid = false;
|
| | | }
|
| | | }
|
| | | else if (_effectValue.value2 == 1)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.yinjiCount == 0
|
| | | || PlayerDatas.Instance.baseData.yinjiCount < _effectValue.value1)
|
| | | {
|
| | | _valid = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (_valid)
|
| | | {
|
| | | _needCount = PlayerDatas.Instance.baseData.yinjiCount > _needCount ?
|
| | | _needCount : PlayerDatas.Instance.baseData.yinjiCount;
|
| | | _aAtkSkillPer += _per * _needCount;
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4015, out _effectValue))
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2))
|
| | | {
|
| | | uint _selfSID = _effectValue.value3 == 1 ? attacker.ServerInstID : 0;
|
| | | if (StatusMgr.Instance.IsBurning(target.ServerInstID, _selfSID))
|
| | | {
|
| | | _aAtkSkillPer += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (StatusMgr.Instance.TryGetSkillEffectValue(attacker.ServerInstID, 4505, out _effectValue))
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2))
|
| | | {
|
| | | uint _selfSID = _effectValue.value3 == 1 ? attacker.ServerInstID : 0;
|
| | | if (StatusMgr.Instance.IsBurning(target.ServerInstID, _selfSID))
|
| | | {
|
| | | _aAtkSkillPer += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4098, out _effectValue))
|
| | | {
|
| | | var _skillInfo = SkillHelper.Instance.Get(_effectValue.value2);
|
| | | if (_skillInfo != null)
|
| | | {
|
| | | SkillHelper.EffectValue _tmpEffectValue;
|
| | | if (_skillInfo.effectValue.TryGetValue(4012, out _tmpEffectValue))
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_tmpEffectValue.value1))
|
| | | {
|
| | | if (target.ActorInfo.GetStatusCount((byte)_tmpEffectValue.value1, attacker.ServerInstID) >= _effectValue.value3)
|
| | | {
|
| | | _aAtkSkillPer += _effectValue.value1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (attacker.SkillMgr.TryGetPassiveEffectValue(4096, out _effectValue))
|
| | | {
|
| | | if (StatusMgr.Instance.IsExist(target.ServerInstID, _effectValue.value3))
|
| | | {
|
| | | int _count = target.ActorInfo.GetStatusCount((byte)_effectValue.value2, attacker.ServerInstID);
|
| | | _aAtkSkillPer += _effectValue.value1 * _count;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | // 4005 概率增加攻击(技能)伤害万分率
|
| | | if (skillInfo.effectValue.TryGetValue(4005, out _effectValue))
|
| | |
| | | // 4015 目标处于XX状态提高技能伤害
|
| | | if (skillInfo.effectValue.TryGetValue(4015, out _effectValue))
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2)
|
| | | && target.ActorInfo.status4012[(byte)_effectValue.value2] > 0)
|
| | | if (target.ActorInfo.GetStatusCount((byte)_effectValue.value2, attacker.ServerInstID) > 0)
|
| | | {
|
| | | _aAtkSkillPer += _effectValue.value1;
|
| | |
|
| | |
| | | }
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | // 4024 攻击附加真实伤害百分比
|
| | | if (skillInfo.effectValue.TryGetValue(4024, out _effectValue))
|
| | | {
|
| | | _aIceAtk *= (int)((10000 + _effectValue.value1) * Constants.F_DELTA);
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_SkillEffectLog)
|
| | | {
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , _aIceAtk 增加了 {2}", skillInfo.config.SkillID, 4024, _aIceAtk * _effectValue.value1 * Constants.F_DELTA);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | // 4025 攻击附加真实伤害
|
| | |
| | | if (StatusMgr.Instance.TryGetSkillEffectValue(attacker.ServerInstID, 4501, out _effectValue))
|
| | | {
|
| | | int _rate = _effectValue.value2;
|
| | | SkillHelper.EffectValue _rateEffectValue;
|
| | | // 判断是否存在4030 有的话提高概率
|
| | | if (StatusMgr.Instance.TryGetSkillEffectValue(attacker.ServerInstID, 4030, out _rateEffectValue))
|
| | |
|
| | | // 基于目标状态
|
| | | if (_effectValue.value3 != 0)
|
| | | {
|
| | | _rate += _rateEffectValue.value1;
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_SkillEffectLog)
|
| | | if (!target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value3))
|
| | | {
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , 增加了 4501 的概率", skillInfo.config.SkillID, 4030, _rateEffectValue.value1);
|
| | | _rate = 0;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | if (Random.Range(0, 10000) < _rate)
|
| | |
| | | // 4503 buff中攻击提高增加伤害,可附加目标处于XX状态
|
| | | if (StatusMgr.Instance.TryGetSkillEffectValue(attacker.ServerInstID, 4503, out _effectValue))
|
| | | {
|
| | | if (target.ActorInfo.status4012.ContainsKey((byte)_effectValue.value2)
|
| | | && target.ActorInfo.status4012[(byte)_effectValue.value2] > 0)
|
| | | if (target.ActorInfo.GetStatusCount((byte)_effectValue.value2, attacker.ServerInstID) > 0)
|
| | | {
|
| | | _aDamagePer += _effectValue.value1;
|
| | |
|
| | |
| | | // 是否可以执行
|
| | | if (_condition && _isCrit)
|
| | | {
|
| | | _aSuperHit += (_aSuperHit * _effectValue.value1 * Constants.F_DELTA);
|
| | | _aSuperHitAdd += _effectValue.value1;
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_SkillEffectLog)
|
| | | {
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , _aSuperHit 增加了 {2}", skillInfo.config.SkillID, 4007, (_aSuperHit * _effectValue.value1 * Constants.F_DELTA));
|
| | | Debug.LogFormat("技能 {0} 触发了效果 {1} , _aSuperHitAdd 增加了 {2}", skillInfo.config.SkillID, 4007, _effectValue.value1 * Constants.F_DELTA);
|
| | | }
|
| | | #endif
|
| | | }
|