Пример #1
0
 public static void InitializeConfig()
 {
     LootRoller.Initialize(_lootConfigFile.Value);
     MagicItemEffectDefinitions.Initialize(_magicEffectsConfigFile.Value);
     GatedItemTypeHelper.Initialize(_itemInfoConfigFile.Value);
     RecipesHelper.Initialize(_recipesConfigFile.Value);
     EnchantCostsHelper.Initialize(_enchantCostsConfigFile.Value);
     MagicItemNames.Initialize(_itemNamesConfigFile.Value);
     AdventureDataManager.Initialize(_adventureDataConfigFile.Value);
 }
Пример #2
0
        private void OnAugmentComplete(AugmentRecipe recipe, MagicItemEffect newEffect)
        {
            if (recipe != null)
            {
                var magicItem = recipe.FromItem.GetMagicItem();

                if (magicItem.HasEffect(MagicEffectType.Indestructible))
                {
                    recipe.FromItem.m_shared.m_useDurability = recipe.FromItem.m_dropPrefab?.GetComponent <ItemDrop>().m_itemData.m_shared.m_useDurability ?? false;

                    if (recipe.FromItem.m_shared.m_useDurability)
                    {
                        recipe.FromItem.m_durability = recipe.FromItem.GetMaxDurability();
                    }
                }

                magicItem.ReplaceEffect(recipe.EffectIndex, newEffect);

                if (magicItem.Rarity == ItemRarity.Rare)
                {
                    magicItem.DisplayName = MagicItemNames.GetNameForItem(recipe.FromItem, magicItem);
                }

                // Note: I do not know why I have to do this, but this is the only thing that causes this item to save correctly
                recipe.FromItem.Extended().RemoveComponent <MagicItemComponent>();
                recipe.FromItem.Extended().AddComponent <MagicItemComponent>().SetMagicItem(magicItem);

                InventoryGui.instance?.UpdateCraftingPanel();

                var player = Player.m_localPlayer;
                if (player.GetCurrentCraftingStation() != null)
                {
                    player.GetCurrentCraftingStation().m_craftItemDoneEffects.Create(player.transform.position, Quaternion.identity);
                }

                OnSelectorValueChanged(recipe.EffectIndex, true);

                MagicItemEffects.Indestructible.MakeItemIndestructible(recipe.FromItem);

                Game.instance.GetPlayerProfile().m_playerStats.m_crafts++;
                Gogan.LogEvent("Game", "Augmented", recipe.FromItem.m_shared.m_name, 1);

                EquipmentEffectCache.Reset(player);
            }
        }
Пример #3
0
        private void OnAugmentComplete(AugmentRecipe recipe, MagicItemEffect newEffect)
        {
            if (recipe != null)
            {
                var magicItem = recipe.FromItem.GetMagicItem();

                if (magicItem.HasBeenAugmented())
                {
                    magicItem.ReplaceEffect(magicItem.AugmentedEffectIndex, newEffect);
                }
                else
                {
                    magicItem.ReplaceEffect(recipe.EffectIndex, newEffect);
                }

                if (magicItem.Rarity == ItemRarity.Rare)
                {
                    magicItem.DisplayName = MagicItemNames.GetNameForItem(recipe.FromItem, magicItem);
                }

                // Note: I do not know why I have to do this, but this is the only thing that causes this item to save correctly
                recipe.FromItem.Extended().RemoveComponent <MagicItemComponent>();
                recipe.FromItem.Extended().AddComponent <MagicItemComponent>().SetMagicItem(magicItem);

                InventoryGui.instance?.UpdateCraftingPanel();

                var player = Player.m_localPlayer;
                if (player.GetCurrentCraftingStation() != null)
                {
                    player.GetCurrentCraftingStation().m_craftItemDoneEffects.Create(player.transform.position, Quaternion.identity);
                }

                OnSelectorValueChanged(recipe.EffectIndex, true);

                Game.instance.GetPlayerProfile().m_playerStats.m_crafts++;
                Gogan.LogEvent("Game", "Augmented", recipe.FromItem.m_shared.m_name, 1);
            }
        }