public void Move(IGamePerson enemy) { if (((Player)enemy).Visibile == true) { Console.WriteLine("Ход БОССА"); enemy.HealphPoints -= ((IGamePerson)this).Damage; PrintResult(enemy); ((IGamePerson)this).Damage = RandomFactory.GenerateRandom(100, 500); } else { PrintResult(enemy); } }
void PrintResult(IGamePerson person) { Console.WriteLine("Cила БОССА {0}", ((IGamePerson)this).Damage); Console.WriteLine("Здоровье БОССА {0}\nВаше здоровье {1}", ((IGamePerson)this).HealphPoints, person.HealphPoints); }
public void Move(IGamePerson enemy) { Console.WriteLine("Ваш ход"); string move = Console.ReadLine(); object powerSpell = null; foreach (Tuple <string, object> tuple in playerSpells.GetValue(0, move)) { Console.Write("Ваше заклинание: {0}\n", tuple.Item1); powerSpell = tuple.Item2; } if (powerSpell != null) { if ((int)powerSpell < 0 && counterMoves == 0) { if (move == "Spirit" && ExistSpirit == false) { ExistSpirit = true; enemy.HealphPoints += ((IGamePerson)this).Damage * (int)powerSpell; PrintResult(enemy); return; } if (move == "Death Ray" && ExistSpirit == true) { enemy.HealphPoints += ((IGamePerson)this).Damage * (int)powerSpell; PrintResult(enemy); return; } else if (move != "Death Ray") { enemy.HealphPoints += ((IGamePerson)this).Damage * (int)powerSpell; PrintResult(enemy); return; } else { Console.WriteLine("Заклинание Death Ray применить нельзя, вызовите Spirit"); } } else if ((int)powerSpell > 0) { ((IGamePerson)this).HealphPoints += ((IGamePerson)this).Damage * (int)powerSpell; PrintResult(enemy); } else if ((int)powerSpell == 0 && counterMoves == 0) { this.Visibile = false; this.counterMoves = 3; Console.WriteLine("Вы невидимы в течении 3 ходов"); Console.WriteLine("Ваше здоровье {0}\nЗдоровье врага {1}", ((IGamePerson)this).HealphPoints, enemy.HealphPoints); return; } else { Console.WriteLine($"Заклинание {move} невозможно применить в данный момент"); counterMoves--; return; } if (counterMoves == 0) { Visibile = true; } else { counterMoves--; } } else { Console.WriteLine($"Заклинания {move} неcуществует"); if (counterMoves != 0) { counterMoves--; } return; } }
void PrintResult(IGamePerson person) { Console.WriteLine("Cила заклинания {0}", ((IGamePerson)this).Damage); Console.WriteLine("Ваше здоровье {0}\nЗдоровье врага {1}", ((IGamePerson)this).HealphPoints, person.HealphPoints); }