예제 #1
0
        public BotAction GetNextAction()
        {
            BotAction        act            = CurrentAction;
            List <BotAction> KnownBotAcions = GetPossibleActions(MaxThinkAboutDistance, MaxSupportedZChange);

            lock (KnownBotAcions)
            {
                if (KnownBotAcions.Count > 0)
                {
                    act = KnownBotAcions[0];// (BotAction)FindBestUsage(KnownBotAcions);
                }
                if (act == null)
                {
                    SimRegion R = Actor.GetSimRegion();
                    if (R == null)
                    {
                        return(new CommandAction(Actor, "anim shrug"));
                    }
                    Vector3d v3d =
                        R.LocalToGlobal(new Vector3(MyRandom.Next(250) + 5, MyRandom.Next(250) + 5,
                                                    Actor.SimPosition.Z));
                    Actor.Debug("MoveToLocation: " + Actor.DistanceVectorString(v3d));
                    SimPosition WP = SimWaypointImpl.CreateGlobal(v3d);
                    act = new MoveToLocation(Actor, WP);
                }
                return(act);
            }
        }