public void TestArmorName(EquipmentManager.EquipSlot slot, int armorRatingPosition) { ArmorItem armor = new ArmorItem(slot); double[] minArmor = new double[6]; double[] maxArmor = new double[6]; minArmor[armorRatingPosition] = 1; maxArmor[armorRatingPosition] = 5; double[] minSpeed = new double[6]; double[] maxSpeed = new double[6]; minSpeed[armorRatingPosition] = 1; maxSpeed[armorRatingPosition] = 5; double[] minDamage = new double[6]; double[] maxDamage = new double[6]; minDamage[armorRatingPosition] = 1; maxDamage[armorRatingPosition] = 5; string name = ItemSpawner.GenerateArmorName(5, armor, minArmor, maxArmor, minSpeed, maxSpeed, minDamage, maxDamage); }
public void TestArmorNameByRarity(EquipmentManager.EquipSlot slot, int armorRatingPosition, GameItem.ItemRarity rarity, string description) { ArmorItem armor = new ArmorItem(rarity, slot); double[] minArmor = new double[6]; double[] maxArmor = new double[6]; minArmor[armorRatingPosition] = 1; maxArmor[armorRatingPosition] = 5; double[] minSpeed = new double[6]; double[] maxSpeed = new double[6]; minSpeed[armorRatingPosition] = 1; maxSpeed[armorRatingPosition] = 5; double[] minDamage = new double[6]; double[] maxDamage = new double[6]; minDamage[armorRatingPosition] = 1; maxDamage[armorRatingPosition] = 5; string name = ItemSpawner.GenerateArmorName(5, armor, minArmor, maxArmor, minSpeed, maxSpeed, minDamage, maxDamage); string[] ssize = name.Split(null); Assert.AreEqual(ssize[0], description); }
/// <summary> /// Constructor that only requires the slot information. /// </summary> /// <param name="newSlot">Slot to place the item into for equipment.</param> public EquippableItem(EquipmentManager.EquipSlot newSlot = EquipmentManager.EquipSlot.CHEST) : base() { this.slot = newSlot; }
/// <summary> /// Constructor for an EquippableItem. /// Overrides the item quantity and max stack count to 1 since equippables cannot stack. /// </summary> /// <param name="gui">Sprite representing the item in the inventory interface.</param> /// <param name="ground">Sprite representing the item on the ground.</param> /// <param name="newName">Name of the item.</param> /// <param name="newDesc">Description of the item.</param> /// <param name="val">Value of the item in whatever unit.</param> /// <param name="rareness">Rarity of the item for rareness systems.</param> /// <param name="newMaxStack">Maximum times the item can stack in an inventory slot.</param> /// <param name="itemQuantity">Amount of items in this stack.</param> /// <param name="itemID">The ID of the item.</param> /// <param name="newSlot">Slot the equippable can be fit into. Defaults to chest.</param> public EquippableItem(Sprite gui, Sprite ground, string newName, string newDesc, double val, ItemRarity rareness, int itemQuantity = 1, int newMaxStack = 1, int itemID = -1, EquipmentManager.EquipSlot newSlot = EquipmentManager.EquipSlot.CHEST) : base(gui, ground, newName, newDesc, val, rareness, 1, 1, itemID) { this.slot = newSlot; }
/// <summary> /// Base Equippable Item constructor. /// </summary> public EquippableItem() : base() { this.slot = EquipmentManager.EquipSlot.CHEST; }
public void TestArmorDescription(EquipmentManager.EquipSlot slot, string description) { ArmorItem armor = new ArmorItem(slot); Assert.AreEqual(description, ItemSpawner.GenerateArmorDesc(5, armor)); }
/// <summary> /// Constructor for an EquippableItem. /// Overrides the item quantity and max stack count to 1 since equippables cannot stack. /// </summary> /// <param name="gui">Sprite representing the item in the inventory interface.</param> /// <param name="ground">Sprite representing the item on the ground.</param> /// <param name="newName">Name of the item.</param> /// <param name="newDesc">Description of the item.</param> /// <param name="val">Value of the item in whatever unit.</param> /// <param name="rareness">Rarity of the item for rareness systems.</param> /// <param name="newMaxStack">Maximum times the item can stack in an inventory slot.</param> /// <param name="itemQuantity">Amount of items in this stack.</param> /// <param name="itemID">The ID of the item.</param> /// <param name="newSlot">Slot the equippable can be fit into. Defaults to chest.</param> public ArmorItem(Sprite gui, Sprite ground, string newName, string newDesc, double val, ItemRarity rareness, int itemQuantity = 1, int newMaxStack = 1, int itemID = -1, EquipmentManager.EquipSlot newSlot = EquipmentManager.EquipSlot.CHEST, double armor = 1.0, double speedModifier = 0.0, double damageModifier = 0.0) : base(gui, ground, newName, newDesc, val, rareness, 1, 1, itemID, newSlot) { InitArmor(armor, speedModifier, damageModifier); }
/// <summary> /// Base Equippable Item constructor with rarity option. /// <param name="armor">Armor Value.</param> /// <param name="speedModifier">How much this armor affects the player's velocity. (0 = 0% boost; 100.0 = 100% boost)</param> /// <param name="damageModifier">How much this armor affects the player's damage output. (0 = 0% boost; 100.0 = 100% boost)</param> /// </summary> public ArmorItem(ItemRarity rarity = ItemRarity.COMMON, EquipmentManager.EquipSlot slot = EquipmentManager.EquipSlot.CHEST, double armor = 1.0, double speedModifier = 0.0, double damageModifier = 0.0) : base(slot) { InitArmor(armor, speedModifier, damageModifier, rarity); }
/// <summary> /// Armor constructor. /// <param name="slot">The slot the item can be placed into.</param> /// <param name="armor">Armor Value.</param> /// <param name="speedModifier">How much this armor affects the player's velocity. (0 = 0% boost; 100.0 = 100% boost)</param> /// <param name="damageModifier">How much this armor affects the player's damage output. (0 = 0% boost; 100.0 = 100% boost)</param> /// </summary> public ArmorItem(EquipmentManager.EquipSlot slot = EquipmentManager.EquipSlot.CHEST, double armor = 1.0, double speedModifier = 0.0, double damageModifier = 0.0) : base(slot) { InitArmor(armor, speedModifier, damageModifier); }