public DerivativeStat(Stat cStrenghtStat, float scaling) { CurrentPercentage = 1.0f; strenghtStat = cStrenghtStat; Modifiers = new List<StatModifier>(); Scaling = scaling; }
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); }
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); }
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); }
public ReferenceStatModifier(Stat statRef, float Scale) : base(statRef.Name, 0) { Reference = statRef; scale = Scale; }
public SpeedStat(Stat agilityStat) { agility = agilityStat; }
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))); }