public void AtackCheckHealthEnemy() //Se prueba que el valor total de la vida del enemigo sea el esperado despues de recibir un ataque por el orco. { //Act dwarf.Respawn(); int expectedHealthLeftEnemy = 25; orc.Equip(sword); orc.Equip(shield); dwarf.Equip(axe); dwarf.Equip(warhammer); orc.Attack(dwarf); //Assert Assert.AreEqual(expectedHealthLeftEnemy, dwarf.Health); }
public void AttackLessThanDefense() { Orc dummy = new Orc(); Dwarf gimli = new Dwarf(); gimli.ReceiveDamage(dummy.Attack()); Assert.AreEqual(gimli.HealthMax, gimli.HealthActual); }
public static void Main() { Enemy e = new Elf(); e.Attack(); Enemy o = new Orc(); o.Attack(); }
public void AtackCheckHealthEnemy() //Se prueba que el valor total de la vida del enemigo sea el esperado despues de recibir un ataque por el orco. { //Act int expectedHealthLeftEnemy = 30; orc.Attack(dwarf); //Assert Assert.AreEqual(expectedHealthLeftEnemy, dwarf.Health); }
public void Run() { // set behavior from state (hostile or neutral) // only outputs text a.SetBehavior(MonsterState.Neutral, new NeutralBehavior()); // change state (hostile or neutral // only matters if attacking or getting attacked a.SetState(MonsterState.Hostile); // acts out with behavior from state (hostile = grrr, neutral = hello) a.Act(); b.Act(); // attack test a.Attack(a, b); Console.WriteLine("Current direction"); Console.WriteLine(a.Direction); Console.WriteLine(); Console.WriteLine("New direction"); a.Direction = CreatureMovement(); Console.WriteLine(a.Direction); Console.WriteLine(); // factory test Console.WriteLine("Testing weapon factory"); TestWeaponFactory(new WeaponFactory()); Console.WriteLine(); // factory test Console.WriteLine("Testing armor factory"); TestArmorFactory(new ArmorFactory()); }