Esempio n. 1
0
        public void Init(StringBuilder hudLabelText, MyMwcObjectBuilder_Drone droneBuilder, MyModelsEnum?modelCollision = null, MyModelsEnum?modelLod2 = null, float?scale = null)
        {
            var modelLod0Enum = GetModelLod0Enum(droneBuilder.DroneType);

            MyEntity owner = null;

            base.Init(hudLabelText, modelLod0Enum, null, owner, scale, droneBuilder, modelCollision, modelLod2);

            SetWorldMatrix(droneBuilder.PositionAndOrientation.GetMatrix());

            m_fired = false;

            m_shipTypeProperties = new MyShipTypeProperties();

            m_reflectorProperies = new MyReflectorConfig(this);

            Faction = droneBuilder.Faction;

            Save = true;

            m_function = MyDroneFunction.None;

            InitWeapons();

            InitEntityDetector();

            InitPhysics(droneBuilder.DroneType);

            InitAI();

            InitSpoiledHolograms();

            InitInventory(droneBuilder.Inventory);

            // back camera is turned off by default
            Config.BackCamera.SetOff();

            m_droneObjectBuilder = droneBuilder;

            UseProperties = new MyUseProperties(MyUseType.Solo, MyUseType.None, MyTextsWrapperEnum.NotificationYouCanTake);
            UseProperties.Init(MyUseType.Solo, MyUseType.None, 0, 1, false);

            HackingTool = new Tools.MyHackingTool(this, MySession.PlayerShip.HackingTool.HackingLevel);
        }
Esempio n. 2
0
 private void LoadHackingTool()
 {
     int maxHackingLevel = 0;
     foreach (MyInventoryItem inventoryItem in MySession.Static.Inventory.GetInventoryItems())
     {
         if (inventoryItem.ObjectBuilderType != MyMwcObjectBuilderTypeEnum.SmallShip_HackingTool)
         {
             continue;
         }
         maxHackingLevel = Math.Max(maxHackingLevel, (int)((MyMwcObjectBuilder_SmallShip_HackingTool)inventoryItem.GetInventoryItemObjectBuilder(false)).HackingToolType);
     }
     if (HackingTool == null)
     {
         HackingTool = new MyHackingTool(this, maxHackingLevel);
     }
     else
     {
         HackingTool.HackingLevel = maxHackingLevel;
     }
 }