public virtual int startFight() { createEnemies(); while (true) { if (EnemyList.Count < 1) { Console.WriteLine("You Are The Winner"); return(0); } if (hero.getLife() < 1) { Console.WriteLine("se fudeu"); return(1); } showHero(); showEnemies(); round(); calculateDamage(); removeDeads(); } }
public override void roundEnemies(Monster Enemy) { int Mode = random.Next(0, 100); int chanceATK = 33; if (Enemy.getLife() >= Enemy.getLifeSize() * 0.80) { chanceATK = 75; } else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.80) { chanceATK = 50; } else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.50) { chanceATK = 25; } else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.15) { chanceATK = 10; } if ((0 < Mode) && (Mode <= chanceATK)) { Enemy.Attack(); } else if ((chanceATK < Mode) && (Mode <= 100)) { Enemy.Defence(); } }
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); } }
public virtual void calculateDamageEnemies(Monster Enemy) { if (Enemy.getLife() < 1) { } else if (Enemy.getMode().Equals("RUN")) { Enemy.receiveDamage(Enemy.getLife()); Console.WriteLine("Monster " + Enemy.getID() + " foge de voce"); } else if (Enemy.getMode().Equals("ATK")) { Console.Write("Monster " + Enemy.getID() + " lhe ameaça com um poderoso golpe, "); if (hero.getMode().Equals("DEF")) { int dano = Enemy.getATK() - hero.getDEF(); hero.receiveDamage(dano); if (dano > 0) { Console.WriteLine("voce se defende mas mesmo assim recebe algum dano!!"); Console.WriteLine("Dano: " + dano); } else { Console.WriteLine("voce defende completamente o ataque!!"); } } else { int dano = Enemy.getATK(); hero.receiveDamage(dano); Console.WriteLine("o ataque lhe acerta com tudo!!"); Console.WriteLine("Dano: " + dano); } } else if (Enemy.getMode().Equals("DEF")) { Console.WriteLine("Monster " + Enemy.getID() + " mantem a guarda alta"); } }
public virtual void calculateDamageEnemies(Monster Enemy) { if (Enemy.getLife() < 1) { } else if (Enemy.getMode().Equals("RUN")) { Enemy.receiveDamage(Enemy.getLife()); library.slowWrite("Monster " + Enemy.getID() + " ran from you", Constants.TEXT_SPEED1, true); } else if (Enemy.getMode().Equals("ATK")) { library.slowWrite("Monster " + Enemy.getID() + " threatens you with a powerful hit! ", Constants.TEXT_SPEED1, true); if (hero.getMode().Equals("DEF")) { int dano = Enemy.getATK() - hero.getDEF(); hero.receiveDamage(dano); if (dano > 0) { library.slowWrite("You defend yourself, turning the attack not so effective.", Constants.TEXT_SPEED1, true); library.slowWrite("Damage taken: " + dano, Constants.TEXT_SPEED1, true); } else { library.slowWrite("You defend all the damage!!", Constants.TEXT_SPEED1, true); } } else { int dano = Enemy.getATK(); hero.receiveDamage(dano); library.slowWrite("The attack hit the bull's eye!!", Constants.TEXT_SPEED1, true); library.slowWrite("Damage taken: " + dano, Constants.TEXT_SPEED1, true); } } else if (Enemy.getMode().Equals("DEF")) { library.slowWrite("Monster " + Enemy.getID() + " keeps on his guard", Constants.TEXT_SPEED1, true); } }
public virtual void removeDeads() { for (int i = 0; i < EnemyList.Count; i++) { Monster aux = EnemyList[i]; if (aux.getLife() < 1) { EnemyList.Remove(aux); i = -1; } } }