Example #1
0
        public void CreateAbilityWithCostNotEnoughRessourceWithCooldown()
        {
            //create a mana stat
            float IntManaScale = 17.0f;
            Stat intStat = new Stat("Intel", 15);
            DerivativeStat manaPool = new DerivativeStat(intStat, IntManaScale);

            Ability ability = new Ability("MyAbility", manaPool);
            ability.Description = "MyDescription";
            ability.GetType = AbilityType.Active;
            ability.Cost = 100.0f;
            ability.Cooldown = new Osiris.Ability.Cooldown(0, 10);

            Assert.IsTrue(ability.Cooldown.OnCooldown);
            Assert.IsFalse(ability.Cooldown.IsReady);

            ability.Cooldown.Step(2);
            ability.Cooldown.Step(2);
            ability.Cooldown.Step(2);
            ability.Cooldown.Step(2);
            ability.Cooldown.Step(2);

            Assert.IsFalse(ability.Cooldown.OnCooldown);
            Assert.IsTrue(ability.Cooldown.IsReady);
        }
Example #2
0
        public void CreateAbilityWithCost()
        {
            //create a mana stat
            float IntManaScale = 17.0f;
            Stat intStat = new Stat("Intel", 15);
            DerivativeStat manaPool = new DerivativeStat(intStat, IntManaScale);

            Ability ability = new Ability("MyAbility", manaPool);
            ability.Description = "MyDescription";
            ability.GetType = AbilityType.Active;
            ability.Cost = 100.0f;

            Assert.IsTrue(ability.Name == "MyAbility");
            Assert.IsTrue(ability.HasEnoughRessourceToCast);
        }
Example #3
0
        public MokupMember(int id , float agilityValue)
        {
            Id = id;

            Statistics = new List<Stat>();
            Attributes = new List<DerivativeStat>();

            var str = new Stat("Strenght", 10);
            Statistics.Add(str);
            var agi = new Stat("Agility", agilityValue);
            Statistics.Add(agi);
            var intel = new Stat("Intelligence", 10);
            Statistics.Add(intel);

            var health = new DerivativeStat(str, 10);
            health.Name = "Health";
            var mana = new DerivativeStat(intel, 17);
            mana.Name = "Mana";

            Attributes.Add(health);
            Attributes.Add(mana);
        }
Example #4
0
 public Ability(string cName, DerivativeStat cDerivative)
 {
     Name = cName;
     costDerivative = cDerivative;
     Cooldown = new Cooldown(0, 0);
 }
Example #5
0
        public void CreateAbilityWithManaCostFromIntel()
        {
            float SpellCost = 133;
            float spellBaseDmg = 100;
            float spellScaleFactor = 3;
            float intelStats = 10;
            var intel = new Stat("Intelligence", intelStats);
            var mana = new DerivativeStat(intel, 20);
            mana.Name = "mana";

            var fireballSpell = new Spell("Fireball", intel, mana, spellScaleFactor, spellBaseDmg, SpellCost);

            Assert.IsTrue(fireballSpell.HasEnoughRessourceToCast);

            var manaAmmountBeforeSpellcast = mana.CurrentValue;
            var dmg = fireballSpell.Cast();
            var manaAmmountAfterSpellCast = mana.CurrentValue;
            Assert.IsTrue(manaAmmountBeforeSpellcast-manaAmmountAfterSpellCast == SpellCost );
            Assert.AreEqual(dmg, (spellBaseDmg + (intelStats * spellScaleFactor)));
        }