public override void DoExecute(BaseContext c) { NPCHumanContext nPCHumanContext = c as NPCHumanContext; if (c.GetFact(NPCPlayerApex.Facts.CanNotMove) == 1 || nPCHumanContext != null && nPCHumanContext.Human.NeverMove) { c.AIAgent.StopMoving(); if (nPCHumanContext != null) { nPCHumanContext.Human.SetFact(NPCPlayerApex.Facts.PathToTargetStatus, 2, true, true); } return; } c.AIAgent.SetFact(NPCPlayerApex.Facts.IsRetreatingToCover, 0, true, true); c.AIAgent.SetFact(NPCPlayerApex.Facts.SidesteppedOutOfCover, 0, true, true); if (UnityEngine.Time.time - nPCHumanContext.LastNavigationTime < 1f) { return; } nPCHumanContext.LastNavigationTime = UnityEngine.Time.time; if (nPCHumanContext.Human.NavAgent.pathPending) { return; } switch (this.Operator) { case HumanNavigateToOperator.OperatorType.EnemyLoc: { HumanNavigateToOperator.NavigateToEnemy(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.RandomLoc: { HumanNavigateToOperator.NavigateToRandomLoc(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.SpawnLoc: { HumanNavigateToOperator.NavigateToSpawnLoc(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.FleeEnemy: { HumanNavigateToOperator.FleeEnemy(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.FleeHurtDir: { HumanNavigateToOperator.FleeHurtDir(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.RetreatCover: { HumanNavigateToOperator.NavigateToCover(nPCHumanContext, HumanNavigateToOperator.TakeCoverIntention.Retreat); return; } case HumanNavigateToOperator.OperatorType.FlankCover: { HumanNavigateToOperator.NavigateToCover(nPCHumanContext, HumanNavigateToOperator.TakeCoverIntention.Flank); return; } case HumanNavigateToOperator.OperatorType.AdvanceCover: { HumanNavigateToOperator.NavigateToCover(nPCHumanContext, HumanNavigateToOperator.TakeCoverIntention.Advance); return; } case HumanNavigateToOperator.OperatorType.FleeExplosive: { HumanNavigateToOperator.FleeExplosive(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.Sidestep: { HumanNavigateToOperator.Sidestep(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.ClosestCover: { HumanNavigateToOperator.NavigateToCover(nPCHumanContext, HumanNavigateToOperator.TakeCoverIntention.Closest); return; } case HumanNavigateToOperator.OperatorType.PatrolLoc: { HumanNavigateToOperator.NavigateToPatrolLoc(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.MountableChair: { HumanNavigateToOperator.NavigateToMountableLoc(nPCHumanContext, this.Operator); return; } case HumanNavigateToOperator.OperatorType.WaypointLoc: { HumanNavigateToOperator.NavigateToWaypointLoc(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.LastEnemyLoc: { HumanNavigateToOperator.NavigateToLastEnemy(nPCHumanContext); return; } case HumanNavigateToOperator.OperatorType.HideoutLoc: { HumanNavigateToOperator.NavigateToHideout(nPCHumanContext); return; } default: { return; } } }
public override float GetScore(BaseContext ctx) { NPCHumanContext c = ctx as NPCHumanContext; return(c != null && IsAtLocation.Test(c, this.Location) ? 1f : 0.0f); }
public override void DoExecute(BaseContext c) { c.AIAgent.Eat(); }
public override float GetScore(BaseContext c, BaseEntity target) { return(Object.op_Equality((Object)c.AIAgent.FoodTarget, (Object)target) ? 1f : 0.0f); }
public override float GetScore(BaseContext c) { return((int)c.GetFact(this.fact) != (int)this.value ? 0.0f : 1f); }
public override float GetScore(BaseContext c) { return(IsAtLastKnownEnemyLocation.Evaluate(c as NPCHumanContext) ? 1f : 0.0f); }
public override float GetScore(BaseContext c) { return(IsPathDistanceToTargetValid.Evaluate(c as NPCHumanContext) ? 1f : 0.0f); }
public override float GetScore(BaseContext c) { return(c.Entity.healthFraction); }
public override void DoExecute(BaseContext c) { SetHumanSpeed.Set(c, this.value); }
public override float GetScore(BaseContext c) { return((double)c.AIAgent.TimeAtDestination < (double)Random.Range(this.MinDuration, this.MaxDuration) ? 0.0f : 1f); }
public override float GetScore(BaseContext c) { return((double)c.AIAgent.GetStuckDuration < (double)this.StuckSeconds ? 0.0f : 1f); }
public override float GetScore(BaseContext c) { return((NPCPlayerApex.WeaponTypeEnum)c.GetFact(NPCPlayerApex.Facts.CurrentWeaponType) != this.value ? 0.0f : 1f); }
public override float GetScore(BaseContext c) { return(Object.op_Equality((Object)c.AIAgent.AttackTarget, (Object)null) ? 0.0f : 1f); }
public override float GetScore(BaseContext ctx) { NPCHumanContext c = ctx as NPCHumanContext; return(c != null && IsTargetAlive.Test(c) ? 1f : 0.0f); }
public override float GetScore(BaseContext c) { return(HasPatrolPointsInRoamRange.Evaluate(c as NPCHumanContext) ? 1f : 0.0f); }
public static void Set(BaseContext c, NPCPlayerApex.SpeedEnum speed) { c.AIAgent.TargetSpeed = c.AIAgent.ToSpeed(speed); c.SetFact(NPCPlayerApex.Facts.Speed, (byte)speed, true, true); }
public override float GetScore(BaseContext c, Vector3 position) { return(WaterLevel.GetWaterDepth(position) / this.MaxDepth); }
public override float GetScore(BaseContext c) { return(GetHumanPathToTargetStatus.Evaluate(c as NPCHumanContext, this.Status) ? 1f : 0.0f); }
protected virtual float Test(Memory.SeenInfo memory, BaseContext c) { return(Object.op_Equality((Object)memory.Entity, (Object)null) || Object.op_Equality((Object)(memory.Entity as BaseNpc), (Object)null) ? 0.0f : 1f); }
public abstract void DoExecute(BaseContext context);
public override void DoExecute(BaseContext c) { c.SetFact(NPCPlayerApex.Facts.BodyState, (byte)this.@value, true, false); }
public override float GetScore(BaseContext c) { return((double)c.AIAgent.AttackTargetMemory.Timestamp > 0.0 && (double)Time.get_realtimeSinceStartup() - (double)c.AIAgent.AttackTargetMemory.Timestamp <= (double)this.WithinSeconds ? 1f : 0.0f); }
public override float GetScore(BaseContext context) { return(IsMountedToType.Test(context as NPCHumanContext, this.MountableType)); }
public override float GetScore(BaseContext c) { return(c.AIAgent.CurrentBehaviour != this.Behaviour || (double)c.AIAgent.currentBehaviorDuration >= (double)this.duration ? 0.0f : 1f); }
public override float GetScore(BaseContext c) { return(Object.op_Equality((Object)c.AIAgent.AttackTarget, (Object)null) || (double)Vector3.Distance(c.AIAgent.AttackPosition, c.AIAgent.AttackTarget.ClosestPoint(c.AIAgent.AttackPosition)) > (double)c.AIAgent.GetAttackRange ? 0.0f : 1f); }
public abstract float GetScore(BaseContext context);
public override float GetScore(BaseContext c) { return(c.AIAgent.IsNavRunning() && c.AIAgent.GetNavAgent.get_pathStatus() == this.Status ? 1f : 0.0f); }
public override float GetScore(BaseContext context) { return(HasChairTarget.Test(context as NPCHumanContext)); }
public override float GetScore(BaseContext ctx) { NPCHumanContext c = ctx as NPCHumanContext; return(c != null && IsClosestPlayerWithinDistance.Test(c, this.distance) ? 1f : 0.0f); }
public override void DoExecute(BaseContext c) { Debug.Log(this.debugMessage); }