private void CreateHero(EnumHeroes eHero) { MyHero = (IHero)heroFactroy.Create(eHero); MyHero.Ability = (IAbility)abilityFactory.Create(eHero); Debug.Log(MyHero.Health); MyHero.Attack(); MyHero.CastAbility(); MyHero.Death(); MyHero.Move(); MyHero.Resurection(); }
public void MissChanceMethod_ShouldReturnTrueIfMissAttack_WhenCalled() { IHero hero = ClassFactory.CreateWarrior("hero"); hero.Damage += 100; IHero dummy = ClassFactory.CreateWarrior("test"); dummy.MissChance = 100; //100% Miss Chance double health = dummy.HealthCurr; hero.Attack(dummy); Assert.AreEqual(health, dummy.HealthCurr); }
public void AttackMethod_ShouldMakeDamage_WhenCalled() { IHero attacker = ClassFactory.CreateWarrior("Grommash"); attacker.Damage += 100; //Damage too low and regeneration too fast for test IHero attacked = ClassFactory.CreateWarrior("Varian"); attacked.MissChance = 0; attacked.HealthCap = 300; attacked.HealthCurr = attacked.HealthCap; attacker.Attack(attacked); Assert.IsTrue(attacked.HealthCurr > 150 && attacked.HealthCurr < 300); }
public int Attack() => heroDecorated.Attack() + 40;
public void Turn() { player.Attack(enemy, melee); enemy.Attack(player, melee); this.moved = false; }