예제 #1
0
        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();
        }
예제 #2
0
 public bool RemoveStatModificator(StatModifcator statModifcator)
 {
     if (!statModifcator.StatModified)
     {
         return(false);
     }
     BaseBonus        -= statModifcator.BaseBonus;
     PercentBaseBonus -= statModifcator.PercentBaseBonus;
     FlatBonus        -= statModifcator.FlatBonus;
     PercentBonus     -= statModifcator.PercentBonus;
     return(true);
 }
예제 #3
0
        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);
        }