Exemplo n.º 1
0
        void TrySwitchToExplore(MySmallShipBot bot)
        {
            Vector3?result = null;

            if (bot.TryGetTestPositionResult(ref result))
            {
                if (result.HasValue)
                {
                    m_exploreTarget      = result.Value;
                    m_exploreTargetTimer = MyMwcUtils.GetRandomFloat(2, 3);
                    m_state = CuriousState.EXPLORE;
                }
                else
                {
                    bool success = TrySwitchExploreSearch(bot);
                    Debug.Assert(success);
                }
            }
        }
        void TrySwitchToFlyAround(MySmallShipBot bot)
        {
            Vector3?result = null;

            if (bot.TryGetTestPositionResult(ref result))
            {
                if (result.HasValue)
                {
                    m_flyToTarget    = result.Value;
                    m_flyAroundTimer = MyMwcUtils.GetRandomFloat(2, 3);
                    m_strafe         = MyMwcUtils.GetRandomBool(4); //Vector3.DistanceSquared(flyToTarget, bot.GetPosition()) < STRAFE_DISTANCE_SQR;
                    m_state          = StateEnum.FLYING_AROUND;
                }
                else
                {
                    // Position failed, try again
                    bool success = TrySwitchToAttackSearch(bot);
                    Debug.Assert(success);
                }
            }
        }
Exemplo n.º 3
0
 void TrySwitchToExplore(MySmallShipBot bot)
 {
     Vector3? result = null;
     if (bot.TryGetTestPositionResult(ref result))
     {
         if (result.HasValue)
         {
             m_exploreTarget = result.Value;
             m_exploreTargetTimer = MyMwcUtils.GetRandomFloat(2, 3);
             m_state = CuriousState.EXPLORE;
         }
         else
         {
             bool success = TrySwitchExploreSearch(bot);
             Debug.Assert(success);
         }
     }
 }
Exemplo n.º 4
0
 void TrySwitchToFlyAround(MySmallShipBot bot)
 {
     Vector3? result = null;
     if (bot.TryGetTestPositionResult(ref result))
     {
         if (result.HasValue)
         {
             m_flyToTarget = result.Value;
             m_flyAroundTimer = MyMwcUtils.GetRandomFloat(2, 3);
             m_strafe = MyMwcUtils.GetRandomBool(4); //Vector3.DistanceSquared(flyToTarget, bot.GetPosition()) < STRAFE_DISTANCE_SQR;
             m_state = StateEnum.FLYING_AROUND;
         }
         else
         {
             // Position failed, try again
             bool success = TrySwitchToAttackSearch(bot);
             Debug.Assert(success);
         }
     }
 }