Пример #1
0
 void OnItemsLoaded(ItemsBlocks param0)
 {
     foreach (KeyValuePair <string, V8Plugin> plugin in plugins)
     {
         plugin.Value.Invoke("On_ItemsLoaded", param0); // Deprecated
         plugin.Value.Invoke("OnItemsLoaded", param0);
     }
 }
Пример #2
0
 public void OnItemsLoaded(ItemsBlocks items)
 {
     this.Invoke("On_ItemsLoaded", new object[] { items });
 }
Пример #3
0
 public void OnItemsLoaded(ItemsBlocks items)
 {
     Invoke("On_ItemsLoaded", items);
 }
Пример #4
0
//        private void LoadWeaponStuff()
//        {
//            _loadObject = new GameObject();
//            _loadObject.AddComponent<BundleBehaviour>();
//            UnityEngine.Object.DontDestroyOnLoad(_loadObject);
//        }

//        public void AddItem(ItemDataBlock itemDataBlock)
//        {
//            Logger.Log("Adding: " + itemDataBlock.name);
//            _dataBlocks.Add(itemDataBlock.name, _all.Length);
//            _dataBlocksByUniqueID.Add(itemDataBlock.uniqueID, _all.Length);
//
//            ItemDataBlock[] _newAll = new ItemDataBlock[_all.Length + 1];
//            for (var i = 0; i < _all.Length; i++)
//            {
//                _newAll[i] = _all[i];
//            }
//
//            _newAll[_newAll.Length - 1] = itemDataBlock;
//
//            _all = _newAll;
//
//            _dataBlocksField.SetValue(null, _dataBlocks);
//            _datablocksByUniqueIDField.SetValue(null, _dataBlocksByUniqueID);
//            _allField.SetValue(null, _all);
//        }

        public void AddItem(ItemsBlocks items, ItemDataBlock itemDataBlock)
        {
            Logger.Log("[CustomItems] Adding: " + itemDataBlock.name);
            items.Add(itemDataBlock);
        }
Пример #5
0
        private void OnItemsLoaded(ItemsBlocks items)
        {
            Items = items;

            #region Items

//            var testItemDataBlock = ScriptableObject.CreateInstance<TestItemDataBlock>();
//            NewItems.Add(testItemDataBlock);
//            AddItem(items, testItemDataBlock);

            var modifiedM4DataBlock = ScriptableObject.CreateInstance <ModifiedM4DataBlock>();
            modifiedM4DataBlock.ammoType           = (AmmoItemDataBlock)items.Find(idb => idb.name == "9mm Ammo");
            modifiedM4DataBlock.deploySound        = Facepunch.Bundling.Load <AudioClip>("content/item/m4/sfx/m4_deploy");
            modifiedM4DataBlock.dryFireSound       = Facepunch.Bundling.Load <AudioClip>("content/shared/sfx/dryfire_rifle-1");
            modifiedM4DataBlock.fireSound          = Facepunch.Bundling.Load <AudioClip>("content/item/pistol/sfx/pistol_fire_4");
            modifiedM4DataBlock.fireSound_Far      = Facepunch.Bundling.Load <AudioClip>("content/effect/sfx/rifle_far");
            modifiedM4DataBlock.fireSound_Silenced =
                Facepunch.Bundling.Load <AudioClip>("content/effect/sfx/silenced_shot");
            modifiedM4DataBlock.muzzleflashVM    = Facepunch.Bundling.Load <GameObject>("content/effect/Flash");
            modifiedM4DataBlock.muzzleFlashWorld = Facepunch.Bundling.Load <GameObject>("content/effect/flash_tp");
            modifiedM4DataBlock.reloadSound      = Facepunch.Bundling.Load <AudioClip>("content/item/sfx/gsr1911_reload-1");
            modifiedM4DataBlock.shotBob          = Facepunch.Bundling.Load <BobEffect>("content/headbob/effect/Gun Kickback");
            modifiedM4DataBlock.tracerPrefab     = Facepunch.Bundling.Load <GameObject>("content/effect/TracerPrefab");
            modifiedM4DataBlock._itemRepPrefab   = Facepunch.Bundling.Load <ItemRepresentation>("content/item/m4/m4.irp");
            modifiedM4DataBlock._viewModelPrefab = Facepunch.Bundling.Load <ViewModel>("content/item/m4/VM-M4");
            NewItems.Add(modifiedM4DataBlock);
            AddItem(items, modifiedM4DataBlock);

//            LoadWeaponStuff();

            var instantHealthItemDataBlock = ScriptableObject.CreateInstance <InstantHealthItemDataBlock>();
            NewItems.Add(instantHealthItemDataBlock);
            AddItem(items, instantHealthItemDataBlock);

            var instantHealthBlueprintDataBlock = ScriptableObject.CreateInstance <InstantHealthBlueprintDataBlock>();
            NewItems.Add(instantHealthBlueprintDataBlock);
            AddItem(items, instantHealthBlueprintDataBlock);

            _avxDollarDataBlock = ScriptableObject.CreateInstance <AVXDollarDataBlock>();
            NewItems.Add(_avxDollarDataBlock);
            AddItem(items, _avxDollarDataBlock);

            var drugOneDataBlock = ScriptableObject.CreateInstance <DrugOneDataBlock>();
            NewItems.Add(drugOneDataBlock);
            AddItem(items, drugOneDataBlock);

            var tpOneDataBlock = ScriptableObject.CreateInstance <TPOneDataBlock>();
            NewItems.Add(tpOneDataBlock);
            AddItem(items, tpOneDataBlock);

            var tpTwoDataBlock = ScriptableObject.CreateInstance <TPTwoDataBlock>();
            NewItems.Add(tpTwoDataBlock);
            AddItem(items, tpTwoDataBlock);

            var tpThreeDataBlock = ScriptableObject.CreateInstance <TPThreeDataBlock>();
            NewItems.Add(tpThreeDataBlock);
            AddItem(items, tpThreeDataBlock);

            var tpFourDataBlock = ScriptableObject.CreateInstance <TPFourDataBlock>();
            NewItems.Add(tpFourDataBlock);
            AddItem(items, tpFourDataBlock);

            var parachuteDataBlock = ScriptableObject.CreateInstance <ParachuteDataBlock>();
            NewItems.Add(parachuteDataBlock);
            AddItem(items, parachuteDataBlock);

            var electronicJunkDataBlock = ScriptableObject.CreateInstance <ElectronicJunkDataBlock>();
            NewItems.Add(electronicJunkDataBlock);
            AddItem(items, electronicJunkDataBlock);

            var copperDataBlock = ScriptableObject.CreateInstance <CopperDataBlock>();
            NewItems.Add(copperDataBlock);
            AddItem(items, copperDataBlock);

            var batteriesDataBlock = ScriptableObject.CreateInstance <BatteriesDataBlock>();
            NewItems.Add(batteriesDataBlock);
            AddItem(items, batteriesDataBlock);

            var ironShardsDataBlock = ScriptableObject.CreateInstance <IronShardsDataBlock>();
            NewItems.Add(ironShardsDataBlock);
            AddItem(items, ironShardsDataBlock);

            var healingStationDataBlock = ScriptableObject.CreateInstance <HealingStationDataBlock>();
            NewItems.Add(healingStationDataBlock);
            AddItem(items, healingStationDataBlock);

            var healingStationBlueprintDataBlock = ScriptableObject.CreateInstance <HealingStationBlueprintDataBlock>();
            NewItems.Add(healingStationBlueprintDataBlock);
            AddItem(items, healingStationBlueprintDataBlock);

            var lootboxDataBlock = ScriptableObject.CreateInstance <LootboxDataBlock>();
            NewItems.Add(lootboxDataBlock);
            AddItem(items, lootboxDataBlock);

            var lootboxBlueprintDataBlock = ScriptableObject.CreateInstance <LootboxBlueprintDataBlock>();
            NewItems.Add(lootboxBlueprintDataBlock);
            AddItem(items, lootboxBlueprintDataBlock);

            var bigLootboxDataBlock = ScriptableObject.CreateInstance <BigLootboxDataBlock>();
            NewItems.Add(bigLootboxDataBlock);
            AddItem(items, bigLootboxDataBlock);

            var bigLootboxBlueprintDataBlock = ScriptableObject.CreateInstance <BigLootboxBlueprintDataBlock>();
            NewItems.Add(bigLootboxBlueprintDataBlock);
            AddItem(items, bigLootboxBlueprintDataBlock);

            var landmineDataBlock = ScriptableObject.CreateInstance <LandmineDataBlock>();
            NewItems.Add(landmineDataBlock);
            AddItem(items, landmineDataBlock);

            var landmineBlueprintDataBlock = ScriptableObject.CreateInstance <LandmineBlueprintDataBlock>();
            NewItems.Add(landmineBlueprintDataBlock);
            AddItem(items, landmineBlueprintDataBlock);

            var respawnFlagDataBlock = ScriptableObject.CreateInstance <RespawnFlagDataBlock>();
            NewItems.Add(respawnFlagDataBlock);
            AddItem(items, respawnFlagDataBlock);

            var respawnFlagBlueprintDataBlock = ScriptableObject.CreateInstance <RespawnFlagBlueprintDataBlock>();
            NewItems.Add(respawnFlagBlueprintDataBlock);
            AddItem(items, respawnFlagBlueprintDataBlock);

            var metalBarricadeDataBlock = ScriptableObject.CreateInstance <MetalBarricadeDataBlock>();
            NewItems.Add(metalBarricadeDataBlock);
            AddItem(items, metalBarricadeDataBlock);

            var metalBarricadeBlueprintDataBlock = ScriptableObject.CreateInstance <MetalBarricadeBlueprintDataBlock>();
            NewItems.Add(metalBarricadeBlueprintDataBlock);
            AddItem(items, metalBarricadeBlueprintDataBlock);

//            var portalRadioDataBlock = ScriptableObject.CreateInstance<PortalRadioDataBlock>();
//            NewItems.Add(portalRadioDataBlock);
//            AddItem(items, portalRadioDataBlock);
//
//            var portalRadioBlueprintDataBlock = ScriptableObject.CreateInstance<PortalRadioBlueprintDataBlock>();
//            NewItems.Add(portalRadioBlueprintDataBlock);
//            AddItem(items, portalRadioBlueprintDataBlock);

//            var bookshelfDataBlock = ScriptableObject.CreateInstance<BookshelfDataBlock>();
//            NewItems.Add(bookshelfDataBlock);
//            AddItem(items, bookshelfDataBlock);
//
//            var bookshelfBlueprintDataBlock = ScriptableObject.CreateInstance<BookshelfBlueprintDataBlock>();
//            NewItems.Add(bookshelfBlueprintDataBlock);
//            AddItem(items, bookshelfBlueprintDataBlock);

            var absolomM4BlueprintDataBlock = ScriptableObject.CreateInstance <AbsolomM4BlueprintDataBlock>();
            NewItems.Add(absolomM4BlueprintDataBlock);
            AddItem(items, absolomM4BlueprintDataBlock);

//            var raidFlagDataBlock = ScriptableObject.CreateInstance<RaidFlagDataBlock>();
//            NewItems.Add(raidFlagDataBlock);
//            AddItem(items, raidFlagDataBlock);
//
//            var raidFlagBlueprintDataBlock = ScriptableObject.CreateInstance<RaidFlagBlueprintDataBlock>();
//            NewItems.Add(raidFlagBlueprintDataBlock);
//            AddItem(items, raidFlagBlueprintDataBlock);

//            var ironBaseDataBlock = ScriptableObject.CreateInstance<IronBaseDataBlock>();
//            NewItems.Add(ironBaseDataBlock);
//            AddItem(items, ironBaseDataBlock);
//
//            var ironBaseBlueprintDataBlock = ScriptableObject.CreateInstance<IronBaseBlueprintDataBlock>();
//            NewItems.Add(ironBaseBlueprintDataBlock);
//            AddItem(items, ironBaseBlueprintDataBlock);

//            var smallLadderDataBlock = ScriptableObject.CreateInstance<SmallLadderDataBlock>();
//            NewItems.Add(smallLadderDataBlock);
//            AddItem(items, smallLadderDataBlock);
//
//            var bigLadderDataBlock = ScriptableObject.CreateInstance<BigLadderDataBlock>();
//            NewItems.Add(bigLadderDataBlock);
//            AddItem(items, bigLadderDataBlock);
//
//            var smallLadderBlueprintDataBlock = ScriptableObject.CreateInstance<SmallLadderBlueprintDataBlock>();
//            NewItems.Add(smallLadderBlueprintDataBlock);
//            AddItem(items, smallLadderBlueprintDataBlock);
//
//            var bigLadderBlueprintDataBlock = ScriptableObject.CreateInstance<BigLadderBlueprintDataBlock>();
//            NewItems.Add(bigLadderBlueprintDataBlock);
//            AddItem(items, bigLadderBlueprintDataBlock);

            var shelfDataBlock = ScriptableObject.CreateInstance <ShelfDataBlock>();
            NewItems.Add(shelfDataBlock);
            AddItem(items, shelfDataBlock);

            var shelfBlueprintDataBlock = ScriptableObject.CreateInstance <ShelfBlueprintDataBlock>();
            NewItems.Add(shelfBlueprintDataBlock);
            AddItem(items, shelfBlueprintDataBlock);

            var oneManBunkerDataBlock = ScriptableObject.CreateInstance <OneManBunkerDataBlock>();
            NewItems.Add(oneManBunkerDataBlock);
            AddItem(items, oneManBunkerDataBlock);

            var oneManBunkerBlueprintDataBlock = ScriptableObject.CreateInstance <OneManBunkerBlueprintDataBlock>();
            NewItems.Add(oneManBunkerBlueprintDataBlock);
            AddItem(items, oneManBunkerBlueprintDataBlock);

//            var waterBridgeDataBlock = ScriptableObject.CreateInstance<WaterBridgeDataBlock>();
//            NewItems.Add(waterBridgeDataBlock);
//            AddItem(items, waterBridgeDataBlock);
//
//            var waterBridgeBlueprintDataBlock = ScriptableObject.CreateInstance<WaterBridgeBlueprintDataBlock>();
//            NewItems.Add(waterBridgeBlueprintDataBlock);
//            AddItem(items, waterBridgeBlueprintDataBlock);
//
//            var woodFactoryDataBlock = ScriptableObject.CreateInstance<WoodFactoryDataBlock>();
//            NewItems.Add(woodFactoryDataBlock);
//            AddItem(items, woodFactoryDataBlock);
//
//            var woodFactoryBlueprintDataBlock = ScriptableObject.CreateInstance<WoodFactoryBlueprintDataBlock>();
//            NewItems.Add(woodFactoryBlueprintDataBlock);
//            AddItem(items, woodFactoryBlueprintDataBlock);

            var flagDataBlock = ScriptableObject.CreateInstance <FlagDataBlock>();
            NewItems.Add(flagDataBlock);
            AddItem(items, flagDataBlock);

            var keycardADataBlock = ScriptableObject.CreateInstance <KeycardADataBlock>();
            NewItems.Add(keycardADataBlock);
            AddItem(items, keycardADataBlock);

            var keycardBDataBlock = ScriptableObject.CreateInstance <KeycardBDataBlock>();
            NewItems.Add(keycardBDataBlock);
            AddItem(items, keycardBDataBlock);

            var keycardCDataBlock = ScriptableObject.CreateInstance <KeycardCDataBlock>();
            NewItems.Add(keycardCDataBlock);
            AddItem(items, keycardCDataBlock);

            var keycardC1DataBlock = ScriptableObject.CreateInstance <KeycardC1DataBlock>();
            NewItems.Add(keycardC1DataBlock);
            AddItem(items, keycardC1DataBlock);

            var diamondsDataBlock = ScriptableObject.CreateInstance <DiamondsDataBlock>();
            NewItems.Add(diamondsDataBlock);
            AddItem(items, diamondsDataBlock);

            var buildingLootboxDataBlock = ScriptableObject.CreateInstance <BuildingLootboxDataBlock>();
            NewItems.Add(buildingLootboxDataBlock);
            AddItem(items, buildingLootboxDataBlock);

            var buildingLootboxBlueprintDataBlock =
                ScriptableObject.CreateInstance <BuildingLootboxBlueprintDataBlock>();
            NewItems.Add(buildingLootboxBlueprintDataBlock);
            AddItem(items, buildingLootboxBlueprintDataBlock);

            var turretDataBlock = ScriptableObject.CreateInstance <TurretDataBlock>();
            NewItems.Add(turretDataBlock);
            AddItem(items, turretDataBlock);

            var turretBlueprintDataBlock = ScriptableObject.CreateInstance <TurretBlueprintDataBlock>();
            NewItems.Add(turretBlueprintDataBlock);
            AddItem(items, turretBlueprintDataBlock);

            var turretSilencerDataBlock = ScriptableObject.CreateInstance <TurretSilencerDataBlock>();
            NewItems.Add(turretSilencerDataBlock);
            AddItem(items, turretSilencerDataBlock);

            var turretRangeExtensionDataBlock = ScriptableObject.CreateInstance <TurretRangeExtensionDataBlock>();
            NewItems.Add(turretRangeExtensionDataBlock);
            AddItem(items, turretRangeExtensionDataBlock);

            var turretDamageExtension = ScriptableObject.CreateInstance <TurretDamageExtension>();
            NewItems.Add(turretDamageExtension);
            AddItem(items, turretDamageExtension);

            var silencedTurretDataBlock = ScriptableObject.CreateInstance <SilencedTurretDataBlock>();
            NewItems.Add(silencedTurretDataBlock);
            AddItem(items, silencedTurretDataBlock);

            var silencedTurretBlueprintDataBlock = ScriptableObject.CreateInstance <SilencedTurretBlueprintDataBlock>();
            NewItems.Add(silencedTurretBlueprintDataBlock);
            AddItem(items, silencedTurretBlueprintDataBlock);

            var rangeTurretDataBlock = ScriptableObject.CreateInstance <RangeTurretDataBlock>();
            NewItems.Add(rangeTurretDataBlock);
            AddItem(items, rangeTurretDataBlock);

            var rangeTurretBlueprintDataBlock = ScriptableObject.CreateInstance <RangeTurretBlueprintDataBlock>();
            NewItems.Add(rangeTurretBlueprintDataBlock);
            AddItem(items, rangeTurretBlueprintDataBlock);

            var damageTurretDataBlock = ScriptableObject.CreateInstance <DamageTurretDataBlock>();
            NewItems.Add(damageTurretDataBlock);
            AddItem(items, damageTurretDataBlock);

            var damageTurretBlueprintDataBlock = ScriptableObject.CreateInstance <DamageTurretBlueprintDataBlock>();
            NewItems.Add(damageTurretBlueprintDataBlock);
            AddItem(items, damageTurretBlueprintDataBlock);

            var jointDataBlock = ScriptableObject.CreateInstance <JointDataBlock>();
            NewItems.Add(jointDataBlock);
            AddItem(items, jointDataBlock);

            #endregion

            Logger.Log("[CustomItems] Loaded all items.");
        }
Пример #6
0
 public void OnItemsLoaded(ItemsBlocks items)
 {
     Invoke("On_ItemsLoaded", items);
 }
Пример #7
0
        public static ItemDataBlock[] ItemsLoaded(System.Collections.Generic.List<ItemDataBlock> items, Dictionary<string, int> stringDB, Dictionary<int, int> idDB)
        {
            ItemsBlocks blocks = new ItemsBlocks(items);
            if (OnItemsLoaded != null)
                OnItemsLoaded(blocks);

            int num = 0;
            foreach (ItemDataBlock block in blocks)
            {
                stringDB.Add(block.name, num);
                idDB.Add(block.uniqueID, num);
                num++;
            }
            Fougerite.Server.GetServer().Items = blocks;
            return blocks.ToArray();
        }
Пример #8
0
 void OnItemsLoaded(ItemsBlocks param0)
 {
     foreach (KeyValuePair<string, V8Plugin> plugin in plugins)
     {
         plugin.Value.Invoke("On_ItemsLoaded", param0); // Deprecated
         plugin.Value.Invoke("OnItemsLoaded", param0);
     }
 }