Esempio n. 1
0
        public Potion(PotionType p, int level)
        {
            texture = 'P';

            maxStackSize     = 5;
            currentStackSize = 1;

            value  = 10 * level;
            weight = 2;

            if (level < 2)
            {
                name = "Potion of " + p.ToString();
            }
            else
            {
                name = "Potion of " + p.ToString() + " +" + level;
            }

            if (p == PotionType.Healing)
            {
                HealthIncrease += 100 * level;
            }
            else if (p == PotionType.Mana)
            {
                ManaIncrease += 100 * level;
            }
            else if (p == PotionType.Vigor)
            {
                StaminaIncrease += 100 * level;
            }
        }
Esempio n. 2
0
        void OnTriggerEnter2D(Collider2D collider)
        {
            if (collider.tag == "Player")
            {
                Debug.Log("WORK");
                Players.PC_Class player = collider.GetComponent <Players.PC_Class>();
                switch (Type.ToString())
                {
                case "Health":
                    if (player.HP_Pots.Count < player.InventorySize && player.IsAlive == true)
                    {
                        player.HP_Pots.Add(this);
                        Destroy(Pot);
                    }
                    break;

                case "Mana":
                    if (player.MP_Pots.Count < player.InventorySize && player.IsAlive == true)
                    {
                        player.MP_Pots.Add(this);
                        Destroy(Pot);
                    }
                    break;
                }
            }
            // If we want enemies to be able to take potions or items as well
            else if (collider.tag == "Enemy")
            {
                Debug.Log("That enemy stole your potion!");
                Destroy(Pot);
            }
        }
    public static string GetName(this PotionType PotionType)
    {
        switch (PotionType)
        {
        case PotionType.PT_LOVE_POTION:
            return("Love");

        case PotionType.PT_INVIS_POTION:
            return("Invisibility");

        case PotionType.PT_FIRE_POTION:
            return("Fire");

        case PotionType.PT_LUCK_POTION:
            return("Luck");

        case PotionType.PT_POISON_POTION:
            return("Poison");

        default: return(PotionType.ToString());
        }
    }
 void SetId()
 {
     id = potionPower.ToString() + " " + potionType.ToString() + "Potion";
     //TODO; connect potion type to spriteAssetName
 }
Esempio n. 5
0
 private static bool UsePotion_OnAction(string args)
 {
     if (args.ToLower() == "smart")
     {
         Engine.SmartPotion();
         return(true);
     }
     try
     {
         PotionType type = (PotionType)Enum.Parse(typeof(PotionType), args, true);
         if (!Engine.UsePotion(type))
         {
             Engine.AddTextMessage(string.Format("You do not have any {0} potions!", (object)type.ToString().ToLower()), Engine.DefaultFont, Hues.Load(34));
         }
     }
     catch
     {
         Engine.AddTextMessage(string.Format("Unknown potion type: {0}", (object)args));
     }
     return(true);
 }
Esempio n. 6
0
        public bool UsePotion(PotionType type)
        {
            bool flag = Engine.UsePotion(type);

            if (!flag)
            {
                Engine.AddTextMessage(string.Format("You do not have any {0} potions!", type.ToString().ToLower()), Engine.DefaultFont, Hues.Load(0x22));
            }
            return(flag);
        }
Esempio n. 7
0
        public string Details()
        {
            StringBuilder buffer = new StringBuilder(string.Empty);

            if (IsVowel())
            {
                buffer.Append("An ");
                buffer.Append(Name);
            }
            else
            {
                buffer.Append("A ");
                buffer.Append(Name);
            }
            buffer.Append("=");
            buffer.Append("=");
            switch (Type)
            {
            case ItemType.Weapon:
                buffer.Append("A robust weapon, enough to make a sizable dent in your foes.");
                buffer.Append("=");
                buffer.Append("It is of ");
                buffer.Append(quality.ToString());
                buffer.Append(" quality.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("It provides the following bonus to attack:");
                buffer.Append("=");
                buffer.Append("Attack Bonus: ");
                buffer.Append(attackBonus.ToString());
                buffer.Append("=");
                buffer.Append("=");
                if (bodyBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Body by ");
                    buffer.Append(bodyBonus.ToString());
                    buffer.Append("=");
                }
                if (mindBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Mind by ");
                    buffer.Append(mindBonus.ToString());
                    buffer.Append("=");
                }
                if (finesseBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Finesse by ");
                    buffer.Append(finesseBonus.ToString());
                    buffer.Append("=");
                }
                break;

            case ItemType.Armour:
                buffer.Append("A full set of solid armor, enough to protect your entire body.");
                buffer.Append("=");
                buffer.Append("It is of ");
                buffer.Append(quality.ToString());
                buffer.Append(" quality.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("It provides the following protection:");
                buffer.Append("=");
                buffer.Append("Defense Bonus: ");
                buffer.Append(defenseBonus.ToString());
                buffer.Append("=");
                buffer.Append("=");
                if (bodyBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Body by ");
                    buffer.Append(bodyBonus.ToString());
                    buffer.Append("=");
                }
                if (mindBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Mind by ");
                    buffer.Append(mindBonus.ToString());
                    buffer.Append("=");
                }
                if (finesseBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Finesse by ");
                    buffer.Append(finesseBonus.ToString());
                    buffer.Append("=");
                }
                break;

            case ItemType.Potion:
                buffer.Append("A stoppered glass vial containing a glowing liquid.");
                buffer.Append("=");
                buffer.Append("Drinking it will result in a");
                buffer.Append(PotionType.ToString());
                buffer.Append(" spell being cast upon you.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("There is only enough liquid for one dose.");
                break;

            case ItemType.Scroll:
                buffer.Append("A piece of paper containing the");
                buffer.Append(ScrollType.ToString());
                buffer.Append(" spell written on it in glyphs.");
                buffer.Append("=");
                buffer.Append("This item can only be used once, and then the glyphs will magically disappear.");
                break;

            case ItemType.Wand:
                buffer.Append("A wooden wand containing the ");
                buffer.Append(WandType.ToString());
                buffer.Append(" spell.");
                buffer.Append("=");
                buffer.Append("It currently has ");
                buffer.Append(charges.ToString());
                buffer.Append(" stored.");
                break;

            case ItemType.Corpse:
                buffer.Append("A frozen corpse of a long-dead traveller.");
                break;
            }
            return(buffer.ToString());
        }
Esempio n. 8
0
 public bool UsePotion(PotionType type)
 {
     bool flag = Engine.UsePotion(type);
     if (!flag)
     {
         Engine.AddTextMessage(string.Format("You do not have any {0} potions!", type.ToString().ToLower()), Engine.DefaultFont, Hues.Load(0x22));
     }
     return flag;
 }
Esempio n. 9
0
        public override bool Use()
        {
            base.Use();
            playerStats = PlayerManager.Instance.player.GetComponent <Player>();

            var potionBuff = new StatBuff {
                EffectName     = potionType.ToString(),
                EffectDuration = potionTime,
                EffectPower    = potionPower,
                Icon           = itemIcon,
                TargetStats    = playerStats
            };

            switch (potionType)
            {
            case PotionType.Vitality:
                potionBuff.EffectName = PotionType.Vitality.ToString();
                potionBuff.StatIndex  = 0;
                break;

            case PotionType.Resistance:
                potionBuff.EffectName = PotionType.Resistance.ToString();
                potionBuff.StatIndex  = 31;
                break;

            case PotionType.Strength:
                potionBuff.EffectName = PotionType.Strength.ToString();
                potionBuff.StatIndex  = 32;
                break;

            case PotionType.Luck:
                potionBuff.EffectName = PotionType.Luck.ToString();
                potionBuff.StatIndex  = 27;
                break;

            case PotionType.Speed:
                potionBuff.EffectName = PotionType.Speed.ToString();
                potionBuff.StatIndex  = 6;
                break;

            case PotionType.Regeneration:
                var regenerationBuff = new RegenerateBuff {
                    EffectName     = potionType.ToString(),
                    EffectDuration = potionTime,
                    EffectPower    = potionPower,
                    EffectRate     = potionRate,
                    StatIndex      = 28,
                    TargetStats    = playerStats
                };

                playerStats.ApplyStatusEffect(regenerationBuff);
                return(true);

            case PotionType.Invisibility:
                //make player not visible to enemies and change sprite's alpha
                break;

            case PotionType.Heal:
                if (playerStats.CurrentHealth < playerStats.stats[0].GetValue())
                {
                    playerStats.ModifyHealth(potionPower);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            playerStats.ApplyStatusEffect(potionBuff);

            return(true);
        }
 public override string ToString()
 {
     return($"ItemID:{ItemID}, ItemName:{ItemName}, PortionType:{PotionType.ToString()}, SpellEffect:{SpellEffectID}, Strength:{Strength}, Stamina:{Stamina}, Endurance: {Endurance}, Intellect: {Intellect}.");
 }