public virtual void showHero() { // Console.Clear(); string[,] arrValues = new string[4, 1]; arrValues[0, 0] = "Hero " + hero.getName(); arrValues[1, 0] = "Life " + hero.getLife().ToString(); arrValues[2, 0] = "ATK " + hero.getATK().ToString(); arrValues[3, 0] = "DEF " + hero.getDEF().ToString(); ArrayPrinter.PrintToConsole(arrValues); }
public virtual void calculateDamageHero() { Monster aux = null; if (hero.getMode().Equals("ATK")) { for (int i = 0; i < EnemyList.Count; i++) { if (EnemyList[i].getID() == IndexMonster) { aux = EnemyList[i]; } } Console.Write("Voce atacou seu inimigo " + aux.getName() + " com toda sua força, "); if (aux.getMode().Equals("DEF")) { int dano = hero.getATK() - aux.getDEF(); aux.receiveDamage(dano); if (dano > 0) { if (aux.getLife() > 0) { Console.WriteLine("ele defende seu ataque parcialmente e ganha uma nova cicatriz"); Console.WriteLine("Dano: " + dano); } else { Console.WriteLine("mesmo se defendendo ele não resiste ao ataque e morre"); } } else { Console.WriteLine("ele defende completamente seu ataque!!"); } } else { if (hero.getCombo() == 3) { aux.receiveDamage(hero.getATK()); Console.WriteLine("You used the combo! SUPER DAMAGE!!!"); Console.WriteLine("Damage: " + hero.getATK()); hero.setCombo(0); } else { aux.receiveDamage(hero.getATK()); Console.WriteLine("Great attack!"); Console.WriteLine("Damage: " + hero.getATK()); hero.addCombo(); } } } else { Console.WriteLine("Voce decide se defender nessa rodada"); } }
public virtual void calculateDamageHero() { Monster aux = null; if (hero.getMode().Equals("ATK")) { for (int i = 0; i < EnemyList.Count; i++) { if (EnemyList[i].getID() == IndexMonster) { aux = EnemyList[i]; } } library.slowWrite("You have attacked your enemy " + aux.getName() + " with all your strenght! ", Constants.TEXT_SPEED1, false); if (aux.getMode().Equals("DEF")) { int dano = hero.getATK() - aux.getDEF(); aux.receiveDamage(dano); if (dano > 0) { if (aux.getLife() > 0) { library.slowWrite("He partially defends your attack and wins a beatiful scar.", Constants.TEXT_SPEED1, true); library.slowWrite("Damage given: " + dano, Constants.TEXT_SPEED1, true); } else { library.slowWrite("He tries to defend himself, but doesn't resist and dies!", Constants.TEXT_SPEED1, true); } } else { library.slowWrite("He completely defend your attack!!!", Constants.TEXT_SPEED1, true); } } else { if (hero.getCombo() == 3) { aux.receiveDamage(hero.getATK()); library.slowWrite("You used the combo! SUPER DAMAGE!!!", Constants.TEXT_SPEED1, true); library.slowWrite("Damage given: " + hero.getATK(), Constants.TEXT_SPEED1, true); hero.setCombo(0); } else { aux.receiveDamage(hero.getATK()); library.slowWrite("Great attack!", Constants.TEXT_SPEED1, true); library.slowWrite("Damage: " + hero.getATK(), Constants.TEXT_SPEED1, true); hero.addCombo(); } } } else { library.slowWrite("You decide to defend yourself this turn.", Constants.TEXT_SPEED1, true); } }