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;
            }
            }
        }
예제 #2
0
        public override float GetScore(BaseContext ctx)
        {
            NPCHumanContext c = ctx as NPCHumanContext;

            return(c != null && IsAtLocation.Test(c, this.Location) ? 1f : 0.0f);
        }
예제 #3
0
 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);
 }
예제 #5
0
 public override float GetScore(BaseContext c)
 {
     return((int)c.GetFact(this.fact) != (int)this.value ? 0.0f : 1f);
 }
예제 #6
0
 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);
 }
예제 #8
0
 public override float GetScore(BaseContext c)
 {
     return(c.Entity.healthFraction);
 }
예제 #9
0
 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);
 }
예제 #11
0
 public override float GetScore(BaseContext c)
 {
     return((double)c.AIAgent.GetStuckDuration < (double)this.StuckSeconds ? 0.0f : 1f);
 }
예제 #12
0
 public override float GetScore(BaseContext c)
 {
     return((NPCPlayerApex.WeaponTypeEnum)c.GetFact(NPCPlayerApex.Facts.CurrentWeaponType) != this.value ? 0.0f : 1f);
 }
예제 #13
0
 public override float GetScore(BaseContext c)
 {
     return(Object.op_Equality((Object)c.AIAgent.AttackTarget, (Object)null) ? 0.0f : 1f);
 }
예제 #14
0
        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);
 }
예제 #16
0
 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);
 }
예제 #17
0
 public override float GetScore(BaseContext c, Vector3 position)
 {
     return(WaterLevel.GetWaterDepth(position) / this.MaxDepth);
 }
예제 #18
0
 public override float GetScore(BaseContext c)
 {
     return(GetHumanPathToTargetStatus.Evaluate(c as NPCHumanContext, this.Status) ? 1f : 0.0f);
 }
예제 #19
0
 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);
 }
예제 #20
0
 public abstract void DoExecute(BaseContext context);
예제 #21
0
 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);
 }
예제 #23
0
 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);
 }
예제 #25
0
 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);
 }
예제 #26
0
 public abstract float GetScore(BaseContext context);
예제 #27
0
 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));
 }
예제 #29
0
        public override float GetScore(BaseContext ctx)
        {
            NPCHumanContext c = ctx as NPCHumanContext;

            return(c != null && IsClosestPlayerWithinDistance.Test(c, this.distance) ? 1f : 0.0f);
        }
예제 #30
0
 public override void DoExecute(BaseContext c)
 {
     Debug.Log(this.debugMessage);
 }