Пример #1
0
        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableShipSoundSystem && (MyFakes.ENABLE_NEW_SMALL_SHIP_SOUNDS || MyFakes.ENABLE_NEW_LARGE_SHIP_SOUNDS) && MySandboxGame.IsDedicated == false)
            {
                ShipSoundComponent = new MyShipSoundComponent();
            }

            m_blocksRegistered = true;
        }
Пример #2
0
        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            ThrustSystem = new MyGridThrustSystem(m_cubeGrid);
            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                OxygenSystem = new MyGridOxygenSystem(m_cubeGrid);
            }
            JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);

            m_cubeGrid.SyncObject.PowerProducerStateChanged += SyncObject_PowerProducerStateChanged;

            m_blocksRegistered = true;
        }
        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }

            m_blocksRegistered = true;
        }
 void WeaponSystem_WeaponUnregistered(MyGridWeaponSystem sender, MyGridWeaponSystem.EventArgs args)
 {
     if (m_shipController.Pilot != null && args.Weapon.DefinitionId == m_gunId)
     {
         if (m_currentGuns.Contains(args.Weapon))
         {
             args.Weapon.OnControlReleased();
             m_currentGuns.Remove(args.Weapon);
         }
     }
 }
 void WeaponSystem_WeaponUnregistered(MyGridWeaponSystem sender, MyGridWeaponSystem.EventArgs args)
 {
     if (m_shipController.Pilot != null && args.Weapon.DefinitionId == m_gunId)
     {
         if (m_currentGuns.Contains(args.Weapon))
         {
             args.Weapon.OnControlReleased();
             m_currentGuns.Remove(args.Weapon);
         }
     }
 }
 void WeaponSystem_WeaponRegistered(MyGridWeaponSystem sender, MyGridWeaponSystem.EventArgs args)
 {
     if (m_shipController.Pilot != null && args.Weapon.DefinitionId == m_gunId)
     {
         if (m_useSingleGun)
         {
             if (m_currentGuns.Count < 1)
             {
                 args.Weapon.OnControlAcquired(m_shipController.Pilot);
                 m_currentGuns.Add(args.Weapon);
             }
         }
         else
         {
             args.Weapon.OnControlAcquired(m_shipController.Pilot);
             m_currentGuns.Add(args.Weapon);
         }
     }
 }
 void WeaponSystem_WeaponRegistered(MyGridWeaponSystem sender, MyGridWeaponSystem.EventArgs args)
 {
     if (m_shipController.Pilot != null && args.Weapon.DefinitionId == m_gunId)
     {
         if (m_useSingleGun)
         {
             if (m_currentGuns.Count < 1)
             {
                 args.Weapon.OnControlAcquired(m_shipController.Pilot);
                 m_currentGuns.Add(args.Weapon);
             }
         }
         else
         {
             args.Weapon.OnControlAcquired(m_shipController.Pilot);
             m_currentGuns.Add(args.Weapon);
         }
     }
 }
Пример #8
0
 public void SetWeaponSystem(MyGridWeaponSystem weaponSystem)
 {
     GridSelectionSystem.WeaponSystem = weaponSystem;
     GridSelectionSystem.SwitchTo(m_selectedGunId, m_singleWeaponMode);
 }