public void BuyTV(int currentPlanetTV, PersonalStatus PS, UtilityMethods UM, Ship ship, Fuel fuel) { Console.Clear(); UM.InventoryDisplay(PS, ship, fuel); Console.WriteLine($"" + $"How many Galactic TVs would you like to buy for {currentPlanetTV} GC?"); int quantity = Convert.ToInt32(Console.ReadLine()); if ((quantity + PS.SpaceGold + PS.NoBalanaceShoes + PS.GalacticTVs) > ship.ShipCapacity) { Console.WriteLine($"" + $"You don't have enough room for that many Galactic TVs, you can only" + $" buy {(ship.ShipCapacity - (PS.SpaceGold + PS.NoBalanaceShoes + PS.GalacticTVs))}\n" + $"Press <enter> to return..."); Console.ReadLine(); return; } if ((quantity * currentPlanetTV) > PS.Cash()) { Console.WriteLine($"" + $"You can't afford that many Galactic TVs\n" + $"Press <enter> to return..."); Console.ReadLine(); return; } PS.SpendMoney(quantity * currentPlanetTV); PS.GalacticTVs += quantity; Console.WriteLine($"" + $"You have bought {quantity} bars of Space Gold for {(quantity * currentPlanetTV)} GC.\n" + $"You now have {PS.Cash()} GC and {PS.GalacticTVs} Galactic TVs."); Console.ReadLine(); return; }
// general display for all bank screens public void BankDisplay(PersonalStatus ps) { Console.WriteLine($"" + $"\tYou have {ps.Cash()} Galactic Credits in your bank account.\n" + $"\tThe title of Duke of Mercury is 1,000,000 Galactic Credits. You need {(1000000 - ps.Cash())} more\n" + $"\tGalactic Credits before you can win the King of Venus' approval.\n\n" + $"\t Press <enter> to continue..."); Console.ReadLine(); GO.Win(ps, ship); }
public void BuyFuel(PersonalStatus PS, Ship ship) { Console.WriteLine($"Your current fuel level is: {MyCurrentFuel}, fuel costs 5 GC per unit. How much fuel would you like to buy?"); try { int response = Convert.ToInt32(Console.ReadLine()); if (response * 5 > PS.Cash()) { Console.WriteLine($"You can't afford that much fuel. You can only afford {PS.Cash() / 5}"); Console.ReadLine(); BuyFuel(PS, ship); } if (response + MyCurrentFuel > ship.ShipFuelMax) { Console.WriteLine($"You dont have the capacity for that, You are ready have {MyCurrentFuel} and only a max of {ship.ShipFuelMax}"); Console.ReadLine(); BuyFuel(PS, ship); } if (response + MyCurrentFuel <= ship.ShipFuelMax && response * 5 <= PS.Cash()) { MyCurrentFuel += response; PS.SpendMoney(response * 5); Console.WriteLine($"You now have {MyCurrentFuel} amount of fuel.\n" + $"It cost {response * 5} you now have {PS.Cash()}"); return; } else { return; } } catch { return; } }
// quick list of all the class declerations // LandingPage LP, Shop Shop, ShipYard SY, GameOver GO, PersonalStatus PS, UtilityMethods UM, Ship ship, PlanetInfo PI, Fuel fuel, Asgard Asgard, Earth Earth, AlphaCentari AlphaCentari, M63 M63 //LP, Shop, SY, GO, PS, UM, ship, PI, fuel, Asgard, Earth, AlphaCentari, M63 public void FirstPage() { Console.Write("\n\n\n" + "\t\t\t\t D U K E \n" + "\t\t\t\t O F \n" + "\t\t\t\t M E R C U R Y \n" + "\t\t\t\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + "\t\t\t\t | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n" + "\t\t\t\t | | . . _____________ . * ||\n" + "\t\t\t\t | | * / _ \\ \\ \\ . ||\n" + "\t\t\t\t | | . / /#\\ \\ \\ \\__ * ||\n" + "\t\t\t\t | | . * | |##| | | |##\\ ||\n" + "\t\t\t\t | |##### | |##| | | |###\\ ||\n" + "\t\t\t\t | |###### _|_|##|____|____|_|####\\ ||\n" + "\t\t\t\t | |#######<| | //\\ | /\\\\ CAMEL | ||\n" + "\t\t\t\t | |#######<|_||| \\|/ ||____________| ||\n" + "\t\t\t\t | |###### . || /*\\ || * . * ||\n" + "\t\t\t\t | |##### . \\\\/_|_\\// ||\n" + "\t\t\t\t | | * . ------- . * . ||\n" + "\t\t\t\t | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||\n" + "\t\t\t\t |_~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n\n" + "\t\t\t\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + "\n\t\t\t\t Hello, welcome to Duke Of Mercury!\n" + "\t\t\t\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + "\t\t\t\t\t What is your name? "); //Setting the starting stats PS.WhatsMyName(Console.ReadLine()); PS.LocationChanger("Earth"); //clears the text Console.Clear(); //add story here Console.WriteLine($"\n\n\n\n" + $"\t\tOkay, {PS.NameCall()}. You were engaged to Venusian royalty but the king of Venus has forbidden your beloved \n" + $"\t\tto marry a mere commoner like yourself. But there is even worse news! \n" + $"\t\tYour beloved has other interested parties, and what's worse is they are already nobility. \n" + $"\t\tBut you are in luck there is a way to buy into galactic nobility, but it's going to be a lot of work. \n" + $"\t\tYou've got a {ship.ShipName} class ship and {PS.Cash()} Galactic Credits, \n" + $"\t\tso get out there and get to trading, {PS.NameCall()}!\n\n" + $"\n\n\n\n\n\n\n\n\t\t\tPress enter to continue past this or any screen in this game."); Console.ReadLine(); LP.LandingPagePicker(LP, Shop, SY, GO, PS, UM, ship, PI, fuel, Asgard, Earth, AlphaCentari, M63, PlanetX, Titan, planetJoe, vormir, Picium); }
public void Win(PersonalStatus ps, Ship ship) { if (ps.Cash() > 1000000) { Console.WriteLine($"\n\n\n\n" + $"\t\tYou cash in your million credits for favor and influence, \n" + $"\t\tsoon you are whisked away on a golden chariot inside a golden spaceship. \n" + $"\t\tIt's not long before you arrive at your beautiful new estate on Mercury. \n" + $"\t\tThe days here are short and hot but it's all yours. Your new butler leads \n" + $"\t\tyou inside 'Duke {ps.NameCall()} these are your new digs, and over here' he says \n" + $"\t\tindicating a large banquet hall 'is where your big ceremony will be.' \n\n" + $"\t\tYou marry your beloved and live happily ever after!\n" + $"\t\tCongratulations! You won the game!"); Console.ReadLine(); EndScreen(ps, ship); } }
public void EndScreen(PersonalStatus ps, Ship ship) { Console.Clear(); Console.WriteLine($"\n\n\n\n\n\n" + $"\n\t\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + $"\n\t\t\t\t Game Over" + $"\n\t\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + $"\n\n\t\t\tYou had {ps.Cash()} Galactic Credits at theR end of your journey" + $"\n\t\t\tYou traveled for {ps.TravelAge()} years total" + $"\n\t\t\tYou had a {ship.ShipName} class ship\n\n\n" + $"\t\t\t Thank you for playing\n\n\n" + $"\t\t\t\t Copyright 2018 The Space Game Company"); Console.ReadLine(); Console.WriteLine("Press 'alt+f4' to exit"); Console.ReadLine(); EndScreen(ps, ship); }
public void M63Buy(UtilityMethods UM, PersonalStatus PS, Ship ship, Fuel fuel, PlanetInfo PI, Shop Shop) { Console.Clear(); UM.InventoryDisplay(PS, ship, fuel); Console.WriteLine($"\n\n" + $"\tYou have {PS.Cash()} Galactic Credits, what good would you like to buy?\n" + $"\t 1 NoBalanceShoes {PI.M63NoBalanceShoes} GC per Unit\n" + $"\t 2 Space Gold {PI.M63SpaceGold} GC per Unit\n" + $"\t 3 Galactic TV {PI.M63GalacticTVs} GC per Unit \n" + $"\t 4 Return to Planetary Menu"); try { int response = Convert.ToInt32(Console.ReadLine()); //Buy Shoes if (response == 1) { Shop.BuyShoes(PI.M63NoBalanceShoes, PS, UM, ship, fuel); } //Buy Gold if (response == 2) { Shop.BuyGold(PI.M63SpaceGold, PS, UM, ship, fuel); } if (response == 3) { Shop.BuyTV(PI.M63GalacticTVs, PS, UM, ship, fuel); } if (response == 4) { return; } } catch { Console.WriteLine("Invalid Entry, try again"); return; } }
public void AsgardBuy(UtilityMethods UM, PersonalStatus PS, Ship ship, Fuel fuel, PlanetInfo PI, Shop Shop) { Console.Clear(); UM.InventoryDisplay(PS, ship, fuel); Console.WriteLine($"\n\n" + $"\t\tYou have {PS.Cash()} Galactic Credits What would you like to buy?\n" + $"\t\t 1 No Balance Shoes for {PI.AsgardNoBalanceShoes} GC\n" + $"\t\t 2 Space Gold for {PI.AsgardGold} GC\n" + $"\t\t 3 Galactic TVs for {PI.AsgardGalacticTVs} GC\n" + $"\t\t 4 Return to the Asgardian Shop"); try { int response = Convert.ToInt32(Console.ReadLine()); if (response == 1) { Shop.BuyShoes(PI.AsgardNoBalanceShoes, PS, UM, ship, fuel); } if (response == 2) { Shop.BuyGold(PI.AsgardGold, PS, UM, ship, fuel); } if (response == 3) { Shop.BuyTV(PI.AsgardGalacticTVs, PS, UM, ship, fuel); } if (response == 4) { return; } } catch { Console.WriteLine("Invalid Entry, try again"); return; } }
// travel between the stars can be dangerous public void Travel(PersonalStatus ps) { int travelEvent = rnd.Next(1, 11); Console.Clear(); Console.WriteLine("3...\n2...\n1...\nBlast Off!!"); Console.ReadLine(); Console.Clear(); Console.WriteLine("" + " * . * \n" + " #===> * . \n" + " * * *"); Console.ReadLine(); Console.Clear(); Console.WriteLine("" + " * . . * . \n" + " * ###===> . * \n" + " . . * * \n"); Console.ReadLine(); //random event if (travelEvent > 5) { Console.WriteLine("You found some space gold out there!"); if ((ps.SpaceGold + ps.NoBalanaceShoes + ps.GalacticTVs + 1) > ship.ShipCapacity) { Console.WriteLine("You dont have enough room for it though. Sad day..."); Console.ReadLine(); } if ((ps.SpaceGold + ps.NoBalanaceShoes + ps.GalacticTVs + 1) <= ship.ShipCapacity) { ps.SpaceGold += 1; Console.WriteLine($"You now have {ps.SpaceGold} space gold"); Console.ReadLine(); } } if (travelEvent == 5) { Console.WriteLine($"It's lonely out there in space {ps.NameCall()}. You are doing great! Keep it up!"); Console.ReadLine(); } if (travelEvent < 5 && travelEvent > 1) { if (ps.Cash() < 10) { Console.WriteLine("The Pirates killed you because you couldnt pay their 10 GC toll."); Console.ReadLine(); GO.Died(ps, ship); } else { Console.WriteLine("Pirate attack! You lost 10 GC to them"); } ps.SpendMoney(10); Console.WriteLine($"You now have {ps.Cash()} GCs"); Console.ReadLine(); } if (travelEvent == 1) { Console.WriteLine($"The galaxies worst pirates attack you but you easily overpower them. \n" + $"'Please don't kill us {ps.NameCall()}, we will give you 100 GC if you let us go!' \n" + $"You let them off easy this time..."); ps.EarnMoney(100); Console.ReadLine(); } Console.ReadLine(); Console.Clear(); Console.WriteLine("" + " * * . * \n" + " * . ###===> . * \n" + " * . . * "); Console.ReadLine(); Console.Clear(); Console.WriteLine("" + " * . \n" + " * . ###===>\n" + " * * . . "); Console.ReadLine(); }
// a player hud public void InventoryDisplay(PersonalStatus ps, Ship ship, Fuel fuel) { Console.WriteLine($"Space Gold: {ps.SpaceGold} No Balanace Shoes: {ps.NoBalanaceShoes} Galactic TVs: {ps.GalacticTVs} " + $"Galactic Credits: {ps.Cash()} \nCurrent Ship: {ship.ShipName} Current Fuel: {fuel.MyCurrentFuel} Cargo Space: {ship.ShipCapacity - (ps.SpaceGold + ps.NoBalanaceShoes + ps.GalacticTVs)}\n"); }
public void PurchaseShip(PersonalStatus PS, Ship ship, UtilityMethods UM, Fuel fuel) { Console.Clear(); UM.InventoryDisplay(PS, ship, fuel); //display the users current ship and credits. Ship selections with price Console.WriteLine($"\n\n" + $"\tYou currently own the {ship.ShipName}, which is a great ship, but it's time to upgrade... \n" + $"\tWhat ship are you looking to hop in today?\n" + $"\tYou currently have {PS.Cash()} credits\n" + $"\t 1 The Interstellar Connex 600 GCs\n" + $"\t 2 The StarWagon 1200GCs"); //convert response to numeric value of type int try { int shipUpgrade = Convert.ToInt32(Console.ReadLine()); //If buying the interstellar if (shipUpgrade == 1 && PS.Cash() >= 600) { string myShipUpgrade = "The Interstellar Connex"; Console.Clear(); Console.WriteLine($"You chose the {myShipUpgrade}! That's a great choice. \n" + $"It has a capacity of {ship.InterstellarConnexCapacity} slots. This is our biggest ship! " + $"\nWith a max warp speed of" + $" {ship.InterstellarConnexSpeed}. "); Console.ReadLine(); //ask if user is sure of purchase Console.WriteLine("Would you like to complete this purchase? \nyes or no?"); //user response string userShipAnswer = Console.ReadLine(); //execute the purchase if (userShipAnswer == "yes") { ship.ShipSpeed = ship.InterstellarConnexSpeed; ship.ShipCapacity = ship.InterstellarConnexCapacity; ship.ShipName = myShipUpgrade; //subtract credit after purchase PS.SpendMoney(600); //display ship bought and remaining credit Console.WriteLine($"Congratulations on your new ship purchase! " + $"You now own the {ship.ShipName} and have {PS.Cash()} remaining"); Console.ReadLine(); return; } //stop the purchase else { return; } } //stop purchase. not enough credits if (shipUpgrade == 1 && PS.Cash() < 600) { Console.WriteLine("You do not have enough credits to complete this purchase!"); Console.ReadLine(); return; } //if buying the starwagon if (shipUpgrade == 2 && PS.Cash() >= 1200) { //initialize ship string myShipUpgrade = "The StarWagon"; Console.Clear(); //summary of ship(speed, name, and capacity) Console.WriteLine($"\n\n" + $"\tYou chose the {myShipUpgrade}! That's a great choice. \n" + $"\tIt has a capacity of {ship.StarWagonCapacity} slots.\n" + $"\tWith a max warp speed of {ship.StarWagonSpeed}. This is our fastest ship by far!"); //press enter Console.ReadLine(); //confirm purchase Console.WriteLine("\n\nWould you like to complete this purchase? \nyes or no?"); string userShipAnswer = Console.ReadLine(); //after purchase is confirmed subtract credits if (userShipAnswer == "yes") { ship.ShipName = myShipUpgrade; ship.ShipCapacity = ship.StarWagonCapacity; ship.ShipSpeed = ship.StarWagonSpeed; PS.SpendMoney(1200); //display ship purchased and remaining credits Console.Clear(); Console.WriteLine($"Congratulations on your new ship purchase! You now own the {ship.ShipName} " + $"\nand have {PS.Cash()} credits remaining"); Console.ReadLine(); return; } //stop purchase else { return; } } //stop purchase if (shipUpgrade == 2 && PS.Cash() < 1200) { Console.WriteLine("You do not have enough credits to complete this purchase!"); Console.ReadLine(); return; } } catch { return; } }