Esempio n. 1
0
    public InventoryItem ToItem()
    {
        switch (type)
        {
        case InvItemType.Bottle:
            Bottle bottle = new Bottle(sprite);
            switch (potionType)
            {
            case PotionType.Empty:
                break;

            case PotionType.Body:
            {
                BodyPotion potion = new BodyPotion(partialSprite, fullSprite, potionScale);
                potion.Fill(fillAmount);
                bottle.containedPotion = potion;
                break;
            }

            case PotionType.Spirit:
            {
                SpiritPotion potion = new SpiritPotion(partialSprite, fullSprite, potionScale);
                potion.Fill(fillAmount);
                bottle.containedPotion = potion;
                break;
            }

            case PotionType.Stamina:
            {
                StaminaPotion potion = new StaminaPotion(partialSprite, fullSprite, potionScale);
                potion.Fill(fillAmount);
                bottle.containedPotion = potion;
                break;
            }

            case PotionType.InfiniteStamina:
            {
                bottle.containedPotion = new InfiniteStaminaPotion(fullSprite, duration);
                break;
            }

            case PotionType.LightResist:
                bottle.containedPotion = new LightResistPotion(fullSprite, duration);
                break;

            case PotionType.Transmutation:
                bottle.containedPotion = new TransmutationPotion(fullSprite, inventoryMenu);
                break;
            }
            return(bottle);

        case InvItemType.Sword:
            return(new SwordItem(sprite, swordData));

        case InvItemType.Bow:
            return(new ShooterItem(sprite, shooterData, false));

        case InvItemType.Staff:
            return(new ShooterItem(sprite, shooterData, true));

        case InvItemType.Talisman:
        // TODO
        default:
            return(null);
        }
    }
Esempio n. 2
0
 protected override void PerformPickupAction()
 {
     fillAmount = StaminaPotion.RestoreCharacterStamina(fillAmount, restoreScale);
     base.PerformPickupAction();
 }