private ItemType(Game game, ItemManager owner, ItemContentCollectionEntry itemInfo) { _game = game; _owner = owner; _itemInfo = itemInfo; HealthPoints = new StatModifcator(); HealthRegeneration = new StatModifcator(); AttackDamage = new StatModifcator(); AbilityPower = new StatModifcator(); CriticalChance = new StatModifcator(); Armor = new StatModifcator(); MagicResist = new StatModifcator(); AttackSpeed = new StatModifcator(); ArmorPenetration = new StatModifcator(); MagicPenetration = new StatModifcator(); ManaPoints = new StatModifcator(); ManaRegeneration = new StatModifcator(); LifeSteel = new StatModifcator(); SpellVamp = new StatModifcator(); Tenacity = new StatModifcator(); Size = new StatModifcator(); Range = new StatModifcator(); MoveSpeed = new StatModifcator(); GoldPerSecond = new StatModifcator(); }
public bool RemoveStatModificator(StatModifcator statModifcator) { if (!statModifcator.StatModified) { return(false); } BaseBonus -= statModifcator.BaseBonus; PercentBaseBonus -= statModifcator.PercentBaseBonus; FlatBonus -= statModifcator.FlatBonus; PercentBonus -= statModifcator.PercentBonus; return(true); }
public void TestStatModificator1() { //Create new stat modificator with all value to 0 var statModificator = new StatModifcator(); //Test if not modificated Assert.IsFalse(statModificator.StatModified); //Change values statModificator.BaseBonus = 1; statModificator.PercentBaseBonus = 2; statModificator.FlatBonus = 3; statModificator.PercentBonus = 4; //Test values Assert.AreEqual(1, statModificator.BaseBonus); Assert.AreEqual(2, statModificator.PercentBaseBonus); Assert.AreEqual(3, statModificator.FlatBonus); Assert.AreEqual(4, statModificator.PercentBonus); //Test if modificated Assert.IsTrue(statModificator.StatModified); }