Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 7
0
 void Controller_ControlledEntityChanged(Entities.IMyControllableEntity oldEntity, Entities.IMyControllableEntity newEntity)
 {
     m_navigation.ChangeEntity(newEntity);
 }
Ejemplo n.º 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);
        }