Exemplo n.º 1
0
        public PotionData GetPotionData(PotionType type, PotionSize size)
        {
            switch (type)
            {
            case PotionType.Health:
                return(new HealthPotionData(size));

            case PotionType.Mana:
                return(new ManaPotionData(size));

            case PotionType.Restoration:
                return(new RestorationPotionData(size));

            case PotionType.Stamina:
                return(new StaminaPotionData(size));

            case PotionType.Paralyze:
                return(new ParalyzePotionData(size));

            case PotionType.Freeze:
                return(new FreezePotionData(size));

            case PotionType.Hunger:
                return(new HungerPotionData(size));

            case PotionType.Blind:
                return(new BlindPotionData(size));

            default:
                throw new ArgumentException($"Unknown potion type: {type}", nameof(type));
            }
        }
Exemplo n.º 2
0
        private static string GetCommonDescription(PotionColor color, PotionSize size)
        {
            var sizeDescription = GetSizeDescription(size);
            var colorName       = GetColorName(color);

            return($"{sizeDescription} with {colorName} liquid.");
        }
Exemplo n.º 3
0
        public Potion(SaveData data) : base(data)
        {
            color = (PotionColor)data.GetIntValue(SaveKeyColor);
            type  = (PotionType)data.GetIntValue(SaveKeyType);
            size  = (PotionSize)data.GetIntValue(SaveKeySize);

            potionData = DataFactory.GetPotionData(type, size);
        }
Exemplo n.º 4
0
 public AbstractPotion(string _name, string _id, PotionRarity _rarity, PotionSize _potionSize, PotionColor _potionColor)
 {
     IsObtained       = false;
     Potency          = 0;
     IsCanUse         = false;
     Discarded        = false;
     IsThrown         = false;
     IsTargetRequired = false;
     Name             = _name;
     Id     = _id;
     Rarity = _rarity;
 }
Exemplo n.º 5
0
        public Potion(PotionColor color, PotionType type, PotionSize size, ItemRareness rareness) : base(new ItemConfiguration
        {
            Key      = GetKey(color),
            Name     = "Potion",
            Rareness = rareness,
            Weight   = GetWeight(size)
        })
        {
            this.color = color;
            this.type  = type;
            this.size  = size;

            potionData = DataFactory.GetPotionData(type, size);
        }
Exemplo n.º 6
0
        private static int GetWeight(PotionSize size)
        {
            switch (size)
            {
            case PotionSize.Small:
                return(200);

            case PotionSize.Medium:
                return(500);

            case PotionSize.Big:
                return(1000);

            default:
                throw new ArgumentOutOfRangeException(nameof(size), size, null);
            }
        }
Exemplo n.º 7
0
        private static string GetSizeDescription(PotionSize size)
        {
            switch (size)
            {
            case PotionSize.Small:
                return("A small phial with");

            case PotionSize.Medium:
                return("Medium size jar with");

            case PotionSize.Big:
                return("Big jar with");

            default:
                throw new ArgumentOutOfRangeException(nameof(size), size, null);
            }
        }
Exemplo n.º 8
0
        private static int GetBlindPotionEffect(PotionSize size)
        {
            switch (size)
            {
            case PotionSize.Small:
                return(2);

            case PotionSize.Medium:
                return(4);

            case PotionSize.Big:
                return(8);

            default:
                throw new ArgumentException($"Unknown potion size: {size}", nameof(size));
            }
        }
Exemplo n.º 9
0
 public HungerPotionData(PotionSize size)
     : base(size, PotionType.Hunger)
 {
 }
Exemplo n.º 10
0
 public ParalyzePotionData(PotionSize size) : base(size, PotionType.Paralyze)
 {
 }
Exemplo n.º 11
0
 public StaminaPotionData(PotionSize size)
     : base(size, PotionType.Stamina)
 {
 }
Exemplo n.º 12
0
 public ManaPotionData(PotionSize size)
     : base(size, PotionType.Mana)
 {
 }
Exemplo n.º 13
0
 public FreezePotionData(PotionSize size) : base(size, PotionType.Freeze)
 {
 }
Exemplo n.º 14
0
 protected PotionData(PotionSize size, PotionType type)
 {
     Size      = size;
     this.type = type;
 }
Exemplo n.º 15
0
 public RestorationPotionData(PotionSize size)
     : base(size, PotionType.Restoration)
 {
 }
Exemplo n.º 16
0
        private static (int health, int mana, int stamina) GetRestorationPotionEffect(PotionSize size)
        {
            switch (size)
            {
            case PotionSize.Small:
                return(20, 100, 10);

            case PotionSize.Medium:
                return(40, 200, 30);

            case PotionSize.Big:
                return(60, 400, 60);

            default:
                throw new ArgumentException($"Unknown potion size: {size}", nameof(size));
            }
        }
Exemplo n.º 17
0
 public BlindPotionData(PotionSize size) : base(size, PotionType.Blind)
 {
 }
Exemplo n.º 18
0
 public HealthPotionData(PotionSize size)
     : base(size, PotionType.Health)
 {
 }