示例#1
0
        protected virtual void Controller_ControlledEntityChanged(IMyControllableEntity oldEntity, IMyControllableEntity newEntity)
        {
            if (oldEntity == null && newEntity is MyCharacter)
            {
                EraseRespawn();
            }

            m_navigation.ChangeEntity(newEntity);
            m_navigation.AimWithMovement();

            var newCharacter = newEntity as MyCharacter;

            if (newCharacter != null)
            {
                var character = m_player.Controller.ControlledEntity as MyCharacter;
                var jetpack   = newCharacter.JetpackComp;
                if (jetpack != null)
                {
                    jetpack.TurnOnJetpack(false);
                }
            }

            if (HasLogic)
            {
                m_botLogic.OnControlledEntityChanged(newEntity);
            }
        }
示例#2
0
        public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition)
        {
            m_player           = player;
            m_navigation       = new MyBotNavigation();
            m_actionCollection = null;
            m_botMemory        = new MyBotMemory(this);
            m_botDefinition    = botDefinition as MyAgentDefinition;

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;
            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);
        }
示例#3
0
        public MySandboxBot(MyPlayer botPlayer, MyBotDefinition botDefinition)
        {
            m_definition = botDefinition as MyAgentDefinition;

            m_player             = botPlayer;
            m_navigation         = new MyBotNavigation();
            m_respawnRequestSent = false;
            m_actionCollection   = null;
            m_botMemory          = new MyBotMemory(this);

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;

            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);
        }
        public MySandboxBot(MyPlayer botPlayer, MyBotDefinition botDefinition)
        {
            m_definition = botDefinition as MyAgentDefinition;

            m_player = botPlayer;
            m_navigation = new MyBotNavigation();
            m_respawnRequestSent = false;
            m_actionCollection = null;
            m_botMemory = new MyBotMemory(this);

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;

            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);
        }
示例#5
0
        protected virtual void Controller_ControlledEntityChanged(IMyControllableEntity oldEntity, IMyControllableEntity newEntity)
        {
            if (oldEntity == null && newEntity is MyCharacter)
            {
                m_deathTimestamp     = 0;
                m_respawnRequestSent = false;
            }

            m_navigation.ChangeEntity(newEntity);
            m_navigation.ResetAiming(true);
            if (HasLogic)
            {
                m_botLogic.OnControlledEntityChanged(newEntity);
            }
        }
示例#6
0
        public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition)
        {
            m_player           = player;
            m_navigation       = new MyBotNavigation();
            m_actionCollection = null;
            m_botMemory        = new MyBotMemory(this);
            m_botDefinition    = botDefinition as MyAgentDefinition;

            m_removeAfterDeath   = m_botDefinition.RemoveAfterDeath;
            m_respawnRequestSent = false;
            m_botRemoved         = false;

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;
            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);

            Sandbox.Game.Gui.MyCestmirDebugInputComponent.PlacedAction += DebugGoto;
        }
示例#7
0
 void Controller_ControlledEntityChanged(Entities.IMyControllableEntity oldEntity, Entities.IMyControllableEntity newEntity)
 {
     m_navigation.ChangeEntity(newEntity);
 }
示例#8
0
        public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition)
        {
            m_player = player;
            m_navigation = new MyBotNavigation(); 
            m_actionCollection = null;
            m_botMemory = new MyBotMemory(this);
            m_botDefinition = botDefinition as MyAgentDefinition;

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;
            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);
        }