static void Main(string[] args) { var pirateZsofi = new Pirate("Zsofi"); var pirateEnemy = new Pirate("Enemy"); pirateZsofi.DrinkSomeRum(); pirateZsofi.HowsItGoingMate(); pirateZsofi.DrinkSomeRum(); pirateZsofi.HowsItGoingMate(); pirateZsofi.DrinkSomeRum(); pirateZsofi.HowsItGoingMate(); pirateZsofi.DrinkSomeRum(); pirateZsofi.HowsItGoingMate(); pirateZsofi.DrinkSomeRum(); pirateZsofi.HowsItGoingMate(); pirateZsofi.Brawl(pirateEnemy); var shipship = new Ship(); shipship.FillShip(); for (int i = 0; i < shipship.Crew.Count; i++) { Console.WriteLine(shipship.Crew[i].Name); } shipship.ShipInfo(); }
public static void Brawl(Pirate pirate1, Pirate pirate2) { Random rand = new Random(); int chance = rand.Next(1, 33); if (pirate1.health != 1 || pirate2.health != 1) { if (pirate1.health == 1) { pirate1.DrinkSomeRum(); } pirate2.DrinkSomeRum(); } else if (chance <= 11) { pirate1.DrinkSomeRum(); pirate2.DrinkSomeRum(); } else if (chance <= 22 && chance > 11) { pirate1.Die(); Console.WriteLine(pirate1.name + " died whit a " + chance + "/33 chance"); } else if (chance > 23) { pirate2.Die(); Console.WriteLine(pirate2.name + " died whit a " + chance + "/33 chance"); } }
static void Main(string[] args) { Pirate crewBob = new Pirate(5, true, false, "Bob"); Pirate crewBerry = new Pirate(2, true, false, "Berry"); Pirate captainRob = new Pirate(15, true, true, "Bob"); Console.WriteLine(crewBob.DrinkSomeRum()); Console.WriteLine(crewBerry.HowsItGoingMate()); Console.WriteLine(captainRob.PrintOutPirates()); Ship pirateShip = new Ship(); Console.WriteLine(pirateShip.GetShipStatus()); Console.WriteLine(pirateShip.MembersAlive()); Console.WriteLine(pirateShip.MembersPassedOut()); Console.ReadLine(); }
static void Main(string[] args) { Ship jamaica = new Ship("Jamaica"); Pirate morgan = new Pirate("Captain Henry Morgan"); jamaica.FillShip(morgan); jamaica.GetMyCrew(); Console.WriteLine(); Pirate hook = new Pirate("Captain James Hook"); Pirate smee = new Pirate("Mr. Smee"); Pirate john = new Pirate("John Smith"); Pirate starkey = new Pirate("Gentleman Starkey"); Pirate jukes = new Pirate("Bill Jukes"); Ship roger = new Ship("The Jolly Roger"); roger.AssignCaptain(hook); Docks tunis = new Docks("Tunis"); tunis.ReadyToBoard(starkey); tunis.ReadyToBoard(john); tunis.ReadyToBoard(smee); john.DrinkSomeRum(6); Console.WriteLine(); tunis.WhoIsReady(); roger.AddCrew(tunis); roger.GetMyCrew(); Console.WriteLine(); starkey.Bawl(jukes); roger.AddCrewMember(jukes); roger.AddCrewMember(john); roger.GetMyCrew(); hook.DrinkSomeRum(2); starkey.DrinkSomeRum(6); starkey.HowIsItGoingMate(); hook.HowIsItGoingMate(); Console.ReadLine(); }
public string GetShipStatus() { return("Our captain's passed out: " + captain.PassOut() + " or is he still alive: " + captain.Die() + " and he drunk how much: " + captain.DrinkSomeRum()); }