protected bool ContainWeaponHitType(FCWeapon.WEAPON_HIT_TYPE wht) { bool ret = false; if (wht == FCWeapon.WEAPON_HIT_TYPE.ALL) { ret = true; } else if (wht == FCWeapon.WEAPON_HIT_TYPE.NONE) { ret = false; } else { foreach (FCWeapon.WEAPON_HIT_TYPE tmp in _weaponHitType) { if (tmp == wht) { ret = true; break; } } } return(ret); }
public void TryEvent(RageEvent ret, FCWeapon.WEAPON_HIT_TYPE weaponHitType, bool beForce = false) { bool canTry = false; if (ret == RageEvent.HIT_TARGET || ret == RageEvent.ATTACK_OVER_WITH_NOHIT || beForce) { canTry = true; } foreach (AIAgent.STATE ass in _statesCanGetRage) { if (_owner.AIStateAgent.CurrentStateID == ass && _owner.AIStateAgent.NextStateID != AIAgent.STATE.DEAD && _owner.TargetAC != null && _owner.TargetAC.IsAlived) { canTry = true; break; } } if (canTry) { foreach (RageCell rc in _rageEventAll) { if (rc.TryActive(ret, weaponHitType)) { break; } } } }
public void Init(FCObject owner) { _owner = owner as AIAgent; _currentHitType = AttackHitType.None; _attackerType = FCWeapon.WEAPON_HIT_TYPE.NONE; _hurtInfoForClient = Quaternion.identity; _hurtInfoForClient2 = Quaternion.identity; }
public bool TryActive(RageAgent.RageEvent rr, FCWeapon.WEAPON_HIT_TYPE wht) { if (rr == _rageEvent && ContainWeaponHitType(wht)) { ModifyRage(_rageValue); return(true); } return(false); }
public AttackHitType GetHitType(AttackUnit aut, int realDamage, int currentHP) { AttackInfo aif = aut.GetAttackInfo(); AttackHitType eht = aif._hitType; #if xingtianbo //if(eht > AttackHitType.BLEND_HURT) //{ // eht = eht - AttackHitType.BLEND_HURT + AttackHitType.Normal; //} //else if(eht > AttackHitType.NORMAL_HURT) //{ // eht = eht - AttackHitType.NORMAL_HURT + AttackHitType.Normal; //} #endif if (!_canBeHitDown) { eht = AttackHitType.KnockBack; } if (_owner.IsOnParry == FC_PARRY_EFFECT.FAIL) { eht = AttackHitType.ParryFail; _owner.IsOnParry = FC_PARRY_EFFECT.NONE; } #if xingtianbo //if(eht == AttackHitType.Normal) //{ // eht = AttackHitType.HURT_NORMAL; //} #endif AttackHitType expectHitType = _currentHitType; if (_nextHitType != AttackHitType.None) { expectHitType = _nextHitType; } if (eht >= AttackHitType.HurtNormal && realDamage >= currentHP) { if (currentHP > 0 && expectHitType != AttackHitType.Dizzy && expectHitType != AttackHitType.KnockDown && !_owner.ACOwner.IsPlayer) { if (eht != AttackHitType.HitFly) { eht = AttackHitType.KnockDown; } } else { eht = AttackHitType.None; } } else if (expectHitType == AttackHitType.HitFly) { } else { if (((eht == AttackHitType.None) || _owner.HasActionSwitchFlag(FC_ACTION_SWITCH_FLAG.IN_RIGIDBODY) && eht == AttackHitType.HurtNormal) || _owner.HasActionSwitchFlag(FC_ACTION_SWITCH_FLAG.IN_RIGIDBODY2) || (eht < expectHitType && eht != AttackHitType.ParrySuccess && expectHitType != AttackHitType.ForceBack) || (eht == AttackHitType.Dizzy && expectHitType == AttackHitType.Dizzy) || (eht == AttackHitType.KnockDown && expectHitType == AttackHitType.KnockDown) || (eht != AttackHitType.KnockDown && eht != AttackHitType.HitFly && expectHitType == AttackHitType.KnockDown) || _owner.HasActionSwitchFlag(FC_ACTION_SWITCH_FLAG.IN_DEEP_FREEZE) || (_owner.AIStateAgent.CurrentStateID == AIAgent.STATE.STAND && eht == AttackHitType.HitFly) || _owner.HasActionSwitchFlag(FC_ACTION_SWITCH_FLAG.IN_EOT_GODDOWN)) { eht = AttackHitType.None; } if (eht == AttackHitType.ParrySuccess && (expectHitType == AttackHitType.HitFly || expectHitType == AttackHitType.KnockDown || expectHitType == AttackHitType.Dizzy)) { eht = AttackHitType.None; } } if (eht != AttackHitType.None) { _nextHitType = eht; _attackerType = aut.GetAttackerType(); _effectTime = aif._effectTime; _hitStrength = aut.GetOwner().CharacterStrength; //base value is 100 } if (eht == AttackHitType.BlackHole) { _target = aut.GetOwner(); } return(eht); }