public static void Battle(Whale Player, Enemies target, Enemies target2) { //While loop used to simulate a fight. while (Player.Health > 0 || target.Health > 0 && target2.Health > 0) { ConsoleInterface.HUD(Player); if (Player.CC == CharClass.mage) { Mage.MageMoves(Player, target); } if (Player.CC == CharClass.fighter) { Fighter.FighterMoves(Player, target); } if (Player.CC == CharClass.ranger) { Ranger.RangerMoves(Player, target); } Thread.Sleep(2900); if (target.Health <= 0) { Player.Wallet += 3; Battle(Player, target2); return; } if (target2.Health <= 0) { Player.Wallet += 3; Battle(Player, target); return; } ConsoleInterface.HUD(Player); Enemies.EnemyAI(Player, target); Thread.Sleep(2900); if (Player.Health <= 0) { ConsoleInterface.PlayerDied(Player, target); } if (target.Health <= 0) { Player.Wallet = +3; Battle(Player, target2); return; } if (target2.Health <= 0) { Player.Wallet = +3; Battle(Player, target); return; } Enemies.EnemyAI(Player, target2); Thread.Sleep(2900); if (Player.Health <= 0) { ConsoleInterface.PlayerDied(Player, target); } if (target.Health <= 0) { Player.Wallet = +3; Battle(Player, target2); return; } if (target2.Health <= 0) { Player.Wallet = +3; Battle(Player, target); return; } } }
public static int FighterMoves(Whale Player, Enemies target) { Console.Clear(); ConsoleInterface.HUD(Player); Console.WriteLine("Select a skill to use\n" + "1) Attack +1 MP\n" + "2) Lung -2 MP\n" + "3) Slam -3 MP\n" + "4) Execute -4 MP\n" + "5) Berserk -4 MP\n" + "6} Inventory\n"); string Input = Console.ReadLine().ToLower(); switch (Input) { case "1": { Player.MagicPoints += 1; return(Fighter.BasicAtk(Player, target)); } case "2": if (Player.MagicPoints >= 2) { Player.MagicPoints -= 2; return(Fighter.Lung(Player, target)); } else { OutofMP(Player, target); return(0); } case "3": if (Player.MagicPoints >= 3) { Player.MagicPoints -= 3; return(Fighter.ShieldSlam(Player, target)); } else { OutofMP(Player, target); return(0); } case "4": if (Player.MagicPoints >= 4) { Player.MagicPoints -= 4; return(Fighter.Execute(Player, target)); } else { OutofMP(Player, target); return(0); } case "5": if (Player.MagicPoints >= 4) { Player.MagicPoints -= 4; return(Fighter.Berserk(Player, target)); } else { OutofMP(Player, target); return(0); } case "6": if (Player.inventory.Count == 0) { Console.WriteLine($"{Player.Name}: ...I'm out of items."); Thread.Sleep(2500); FighterMoves(Player, target); return(0); } else { Whale.UseItem(Player); return(0); } default: return(BasicAtk(Player, target)); } }