private void SL_OnPacksLoaded() { try { Items = new Items(); Log.Print("Items created"); List <Item> correct = new List <Item>(); List <Item> incorrect = new List <Item>(); foreach (Item item in References.RPM_ITEM_PREFABS.Values) { if (ItemUtils.IsValidGear(item, true)) { correct.Add(item); } else { if (item is Equipment) { incorrect.Add(item); } } } Log.Debug("Items considered correct gears: "); foreach (Item item in correct) { UnityEngine.Object.DontDestroyOnLoad(DiabloItemExtension.AddToItem(item)); Log.Debug("ID:" + item.ItemID + " Name:" + item.Name + " : Value: " + item.Value + " Durability: " + item.MaxDurability); } Log.Debug("Items that aren't considered correct gears: "); foreach (Item item in incorrect) { Log.Debug(item.name + " is an unused gear item. ID: " + item.ItemID); } Debug.Log("Finished Adding diablo item extension to all gear items."); /* * Tag ingredient = TagSourceManager.GetCraftingIngredient(Recipe.CraftingType.Survival); * correct.Where(x=> !x.HasTag(ingredient)).ToList().ForEach(x => x.Tags.Add(ingredient)); * Items.GetHellStones().ForEach(x => x.Get().Tags.Add(ingredient)); * // adds ingredient tag so they can be added as ingredients */ Recipes.Init(); DoTests(); } catch (Exception e) { Debug.Log("FAILED TO LOAD GRINDWARD!!!"); Console.Write(e.ToString()); Crash(); } }
protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { Character character = _affectedCharacter; if (character && character.Inventory && character.Inventory.Pouch) { List <Item> items = character.Inventory.Pouch.GetContainedItems().Where(x => ItemUtils.IsValidGear(x)).ToList(); if (items.Count() == 1) { UseOnGear((Equipment)items[0], character); } } }