protected AIAction CreateAction(Type type) { AIAction aiaction = Activator.CreateInstance(type) as AIAction; aiaction.Initialize(this.m_AI, this); return(aiaction); }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanMoveTo) || action.GetType() == typeof(HumanRotateTo)) { float num = Vector3.Angle(this.m_HumanAI.m_StartForward.GetNormalized2D(), this.m_AI.transform.forward.GetNormalized2D()); if (num >= 5f) { this.m_HumanRotateTo.SetupParams(this.m_HumanAI.transform.position + this.m_HumanAI.m_StartForward.GetNormalized2D(), 5f); base.StartAction(this.m_HumanRotateTo); } else { base.StartAction(this.m_Idle); } } else if (action.GetType() == typeof(Idle)) { base.StartAction(this.m_StartCrouch); } else if (action.GetType() == typeof(StartCrouch)) { base.StartAction(this.m_CrouchIdle); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (this.m_Active && this.SetupPath()) { base.StartAction(this.m_HumanMoveTo); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(StopCrouch) || action.GetType() == typeof(HumanRotateTo)) { this.SetupAction(); } }
protected AIAction StartAction(AIAction action) { this.m_Plan.Clear(); this.m_CurrentAction = action; this.m_CurrentAction.Start(); this.m_Plan.Add(this.m_CurrentAction); return(this.m_CurrentAction); }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanRotateTo)) { base.StartAction(this.m_ThrowStone); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(RotateTo)) { this.StartIdle(); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(StartPlay)) { base.StartAction(this.m_PlayIdle); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(StopCrouch)) { base.StartAction(this.m_LookAround); } else if (action.GetType() == typeof(LookAround)) { this.m_HumanAI.SetState(HumanAI.State.Rest); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanRotateTo) && this.m_HumanAI.m_WeaponType != HumanAI.WeaponType.Primary) { base.StartAction(this.m_SwitchWeapon); } else if (action.GetType() == typeof(SwitchWeapon) || action.GetType() == typeof(HumanRotateTo)) { base.StartAction(this.m_BowAttack); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanRotateTo)) { base.StartAction(this.m_SwitchWeapon); } else if (action.GetType() == typeof(SwitchWeapon)) { this.m_AI.m_GoalsModule.ActivateGoal(AIGoalType.HumanMoveToEnemy); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(StartMove)) { base.Prepare(); this.m_AI.m_AnimationModule.m_TransitionDuration = 0f; } else if (action.GetType() == typeof(MoveTo)) { this.Prepare(); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanMoveTo)) { if (this.m_MoveBack) { if (this.m_Range > this.m_AI.m_Params.m_JumpAttackRange) { if (!this.m_MovingBack) { this.m_Range += this.ADD_RANGE; if (this.m_Range >= this.MAX_RANGE) { this.m_MovingBack = true; } } else { this.m_Range -= this.ADD_RANGE; } if (this.SetupPath()) { this.SetupAction(); } } } else if (base.GetDuration() < this.m_Lenght) { this.m_Range += this.ADD_RANGE; if (this.SetupPath()) { this.SetupAction(); } } else { Vector3 normalized2D = (Player.Get().transform.position - this.m_AI.transform.position).GetNormalized2D(); float num = Vector3.Angle(normalized2D, this.m_AI.transform.forward.GetNormalized2D()); if (num >= 10f) { this.m_HumanRotateTo.SetupParams(Player.Get().transform.position, 10f); base.StartAction(this.m_HumanRotateTo); } } } else if (action.GetType() == typeof(HumanRotateTo) && UnityEngine.Random.Range(0f, 1f) < 0.5f) { base.StartAction(this.m_Taunt); } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanStartMove)) { base.StartAction(this.m_HumanMove); } else if (action.GetType() == typeof(HumanMove)) { if (Vector3.Distance(this.m_HumanAI.transform.position, this.m_AI.m_EnemyModule.m_Enemy.transform.position) > this.m_MinDistToEnemy) { base.StartAction(this.m_HumanStopMove); } else if (this.SetupPath()) { base.StartAction(this.m_HumanMove); } else { base.StartAction(this.m_HumanStopMove); } } }
public override void OnStopAction(AIAction action) { base.OnStopAction(action); if (action.GetType() == typeof(HumanStartMove)) { base.StartAction(this.m_HumanMove); return; } if (action.GetType() == typeof(HumanMove)) { if (this.m_HunterAI.IsProperPosToBowAttack()) { base.StartAction(this.m_HumanStopMove); return; } if (this.SetupPath()) { base.StartAction(this.m_HumanMove); return; } base.StartAction(this.m_HumanStopMove); } }
protected void AddToPlan(AIAction action) { action.Reset(); this.m_Plan.Add(action); }
public virtual void OnStopAction(AIAction action) { }