public Weapon(int itemid) : base(itemid) { this.damage = int.Parse(ItemStats.GetStat(itemid, "damage")); this.damageType = StatParser.ParseDamageType(ItemStats.GetStat(itemid, "damagetype")); this.proc = null; size = StatParser.ParseWeaponSize(ItemStats.GetStat(itemid, "size")); this.Equippable = true; }
public Item(int itemid) { this.id = itemid; this.name = ItemStats.GetStat(itemid, "name"); this.info = ItemStats.GetStat(itemid, "info"); this.weight = int.Parse(ItemStats.GetStat(itemid, "weight")); this.value = int.Parse(ItemStats.GetStat(itemid, "value")); this.speed = int.Parse(ItemStats.GetStat(itemid, "speed")); this.speedbonus = int.Parse(ItemStats.GetStat(itemid, "speedbonus")); this.strengthbonus = int.Parse(ItemStats.GetStat(itemid, "strengthbonus")); this.hpbonus = int.Parse(ItemStats.GetStat(itemid, "hpbonus")); this.type = this.setItemType(itemid); this.Equippable = false; }
public Equipable(int itemid) : base(itemid) { this.Equippable = true; protection = new Dictionary <DamageType, int>(); foreach (DamageType type in Enum.GetValues(typeof(DamageType))) { protection[type] = int.Parse(ItemStats.GetStat(itemid, type.ToString().ToLower())); } bonus = new Dictionary <Stat, int>(); foreach (Stat stat in Enum.GetValues(typeof(Stat))) { bonus[stat] = int.Parse(ItemStats.GetStat(itemid, type.ToString().ToLower() + "bonus")); } }
private ConsumableType setConsumableType(int itemid) { switch (ItemStats.GetStat(itemid, "consumabletype")) { case "HealthPotion": return(ConsumableType.HealthPotion); case "StrengthPotion": return(ConsumableType.StrengthPotion); case "SpeedPotion": return(ConsumableType.SpeedPotion); default: return(ConsumableType.None); } }
protected ItemType setItemType(int itemid) { switch (ItemStats.GetStat(itemid, "type")) { case "weapon": return(ItemType.Weapon); case "armour": return(ItemType.Armour); case "consumable": return(ItemType.Consumable); default: return(ItemType.None); } }
public static Item CreateItem(int itemid) { switch (ItemStats.GetStat(itemid, "type")) { case "weapon": return(new Weapon(itemid)); case "armour": return(new Armour(itemid)); case "consumable": return(new Consumable(itemid)); default: return(new Item(itemid)); } }
public Armour(int itemid) : base(itemid) { location = StatParser.ParseArmourLocation(ItemStats.GetStat(itemid, "location")); this.Equippable = true; }
public Consumable(int itemid) : base(itemid) { this.consumabletype = this.setConsumableType(itemid); this.effectiveness = int.Parse(ItemStats.GetStat(itemid, "effectiveness")); this.count = 1; }