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)); } }
private static string GetCommonDescription(PotionColor color, PotionSize size) { var sizeDescription = GetSizeDescription(size); var colorName = GetColorName(color); return($"{sizeDescription} with {colorName} liquid."); }
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); }
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; }
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); }
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); } }
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); } }
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)); } }
public HungerPotionData(PotionSize size) : base(size, PotionType.Hunger) { }
public ParalyzePotionData(PotionSize size) : base(size, PotionType.Paralyze) { }
public StaminaPotionData(PotionSize size) : base(size, PotionType.Stamina) { }
public ManaPotionData(PotionSize size) : base(size, PotionType.Mana) { }
public FreezePotionData(PotionSize size) : base(size, PotionType.Freeze) { }
protected PotionData(PotionSize size, PotionType type) { Size = size; this.type = type; }
public RestorationPotionData(PotionSize size) : base(size, PotionType.Restoration) { }
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)); } }
public BlindPotionData(PotionSize size) : base(size, PotionType.Blind) { }
public HealthPotionData(PotionSize size) : base(size, PotionType.Health) { }