You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ItemPotion : Item
|
|
{
|
|
public readonly int Effect;
|
|
public readonly PotionType Type;
|
|
public readonly int Time; // How long does this potion last? We don't have any use for it. Just here to demonstrate the item system
|
|
public ItemPotion(string name, string iconName, int pbasePrice,int effect, PotionType type, int time = -1, string descr = "", ItemRarity rarity = ItemRarity.Common) : base(name, iconName, pbasePrice, descr,rarity)
|
|
{
|
|
Effect = effect;
|
|
Type = type;
|
|
Time = Type == PotionType.Healing ? -1 : time;
|
|
}
|
|
|
|
// This is used so we can identify a type purely through polymorphism. No hardcoding of types involved, nothing to see here!
|
|
public override ItemType GetItemType()
|
|
{
|
|
return ItemType.Potion;
|
|
}
|
|
|
|
public override string GetStats()
|
|
{
|
|
return Time > 0
|
|
? "Strength: " + Effect + "\tType: " + Type + "\tTime: " + Time
|
|
: "Strength: " + Effect + "\tType: " + Type;
|
|
}
|
|
|
|
public override void Upgrade(float upgradeFactor)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override int GetUpgradeCosts(float upgradeFactor)
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public enum PotionType
|
|
{
|
|
Healing,
|
|
Attack,
|
|
Defense
|
|
}
|
|
|