示例#1
0
    protected override void PerformPickupAction()
    {
        EnemyHealth health = SpiritPotion.GetSpiritHealth(CharacterController.instance);

        fillAmount = HealthPotion.HealTarget(fillAmount, healScale, health);
        base.PerformPickupAction();
    }
示例#2
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);
        }
    }