public void LoadBattleLoot(List <LootDefinition> battleLoot)
    {
        KeepLoot = false;
        takeAllButton.gameObject.SetActive(true);
        passButton.gameObject.SetActive(true);
        partyInventory.SetActivated();

        LootType   = LootEventType.Battle;
        ActionType = LootResultType.Waiting;

        gameObject.SetActive(true);
        partyInventory.DiscardAll();

        foreach (var item in RaidSolver.GenerateLoot(battleLoot, RaidSceneManager.Raid))
        {
            partyInventory.DistributeItem(item);
        }

        partyInventory.DeactivateEmptySlots();

        title.text       = LocalizationManager.GetString("str_overlay_loot_battle_title");
        description.text = LocalizationManager.GetString("str_overlay_loot_battle_description");

        if (partyInventory.HasSomething())
        {
            ScrollOpened();
        }
        else
        {
            Close();
        }
    }
Exemplo n.º 2
0
    public void LoadSingleLoot(string code, int amount)
    {
        KeepLoot = false;
        takeAllButton.gameObject.SetActive(true);
        passButton.gameObject.SetActive(true);
        partyInventory.SetActivated();

        ActionType = LootResultType.Waiting;

        gameObject.SetActive(true);
        partyInventory.DiscardAll();

        foreach (var item in RaidSolver.GenerateLoot(code, amount, RaidSceneManager.Raid))
        {
            partyInventory.DistributeItem(item);
        }

        partyInventory.DeactivateEmptySlots();

        title.text       = LocalizationManager.GetString("str_overlay_loot_chest_title");
        description.text = LocalizationManager.GetString("str_overlay_loot_chest_description");

        if (!partyInventory.HasSomething())
        {
            Close();
        }
    }
    public void LoadCurioLoot(Curio curio, CurioInteraction interaction, CurioResult curioResult, RaidInfo raid, bool keepLoot)
    {
        KeepLoot = keepLoot;
        if (keepLoot)
        {
            takeAllButton.gameObject.SetActive(false);
            passButton.gameObject.SetActive(false);
            partyInventory.SetDeactivated();
        }
        else
        {
            takeAllButton.gameObject.SetActive(true);
            passButton.gameObject.SetActive(true);
            partyInventory.SetActivated();
        }

        LootType   = LootEventType.Curio;
        ActionType = LootResultType.Waiting;

        gameObject.SetActive(true);
        partyInventory.DiscardAll();

        if (curio.IsQuestCurio)
        {
            if (curioResult != null)
            {
                partyInventory.DistributeItem(new ItemDefinition("quest_item", curioResult.Item, 1));
            }
        }
        else
        {
            if (curioResult.IsCombined)
            {
                foreach (var result in interaction.Results)
                {
                    if (result.IsCombined && result.Item != "Nothing")
                    {
                        foreach (var item in RaidSolver.GenerateLoot(result, raid))
                        {
                            partyInventory.DistributeItem(item);
                        }
                    }
                }
            }
            else
            if (curioResult.Item != "Nothing")
            {
                foreach (var item in RaidSolver.GenerateLoot(curioResult, raid))
                {
                    partyInventory.DistributeItem(item);
                }
            }

            if (RaidSceneManager.RaidPanel.SelectedHero != null)
            {
                var extraLoot = RaidSceneManager.RaidPanel.SelectedHero.HeroClass.ExtraCurioLoot;
                if (extraLoot != null)
                {
                    foreach (var item in RaidSolver.GenerateLoot(extraLoot.Code, extraLoot.Count, raid))
                    {
                        partyInventory.DistributeItem(item);
                    }
                }
            }
        }

        partyInventory.DeactivateEmptySlots();

        title.text       = LocalizationManager.GetString("str_overlay_loot_chest_title");
        description.text = LocalizationManager.GetString("str_overlay_loot_chest_description");

        if (partyInventory.HasSomething())
        {
            ScrollOpened();
        }
        else
        {
            Close();
        }
    }