Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public int Attack() => heroDecorated.Attack() + 40;
Exemplo n.º 5
0
 public void Turn()
 {
     player.Attack(enemy, melee);
     enemy.Attack(player, melee);
     this.moved = false;
 }