Beispiel #1
0
    private void EquipCurrentThing(ShopType shopType, HeroClass hero, int index = 0)
    {
        switch (shopType)
        {
        case ShopType.Items:

            if (currentlySelectedItem != null)
            {
                if (currentlySelectedItem.GetType() == typeof(Armor))
                {
                    hero.ModifyStatsFromItems(currentlySelectedItem);
                    //hero.armorSlot = currentlySelectedItem as Armor;
                }
                else if (currentlySelectedItem.GetType() == typeof(Accessory))
                {
                    hero.ModifyStatsFromItems(currentlySelectedItem);
                    //hero.accessorySlot = currentlySelectedItem as Accessory;
                }
                else if (currentlySelectedItem.GetType() == typeof(Weapon))
                {
                    hero.ModifyStatsFromItems(currentlySelectedItem);
                    //hero.weaponSlot = currentlySelectedItem as Weapon;
                }
            }

            break;

        case ShopType.Mercenaries:

            if (currentlySelectedMercenary != null)
            {
                partyBehaviour.AddCharacterToParty(currentlySelectedMercenary.name, index);
            }

            break;
        }

        ReturnToPromptScreen();
    }