Commit a7274dc4 authored by Reece's avatar Reece

Added an ending

I've made the game so you can actually win or lose.. I might add a dynamic contract bit but idk yet..
parent 5c710bfe
...@@ -23,6 +23,7 @@ bankbal = 0 ...@@ -23,6 +23,7 @@ bankbal = 0
insurancevalue = 0 insurancevalue = 0
contract = 0 contract = 0
payoutloss = 0 payoutloss = 0
date = 0
################################################################################################ ################################################################################################
# Routes # # Routes #
################################################################################################ ################################################################################################
...@@ -35,20 +36,23 @@ Routes = [ ...@@ -35,20 +36,23 @@ Routes = [
Outcomes = [ Outcomes = [
# ['Weather', 'Type of outcome ( 0 - None, 1 - Low, 2 - Average, 3 - Severe )', 'Details#1', 'Details#2', 'Details#2', 'money'], # ['Weather', 'Type of outcome ( 0 - None, 1 - Low, 2 - Average, 3 - Severe )', 'Details#1', 'Details#2', 'Details#2', 'money'],
['Sunny', 0, 'It\'s pretty hot today Captain, I\'ll be on the deck tanning if you need me!', 'It\'s such a nice day!, I love this weather!', 'I can hardly see! It\'s refelcting off the water!', 0],
['Fair', 0, 'Sea is clear today Captain, smooth sailing ahead!', 'If the weather stays like this, we will arrive on time!', 'I\'ve never seen the sea so calm!', 0], ['Fair', 0, 'Sea is clear today Captain, smooth sailing ahead!', 'If the weather stays like this, we will arrive on time!', 'I\'ve never seen the sea so calm!', 0],
['Overcast', 0, 'I heard it rains if you look at grey clouds, let\'s hope that isn\'t not true!', '', '', 0], ['Overcast', 0, 'I heard it rains if you look at grey clouds, let\'s hope that isn\'t not true!', 'It\'s getting dark, I think it might rain soon!', 'I love this sort of weather!', 0],
['Slow rain', 0, 'Don\'t mind me Captain, just putting on my coat.', '', '', 0], ['Slight rain', 0, 'Don\'t mind me Captain, just putting on my coat.', 'We better cover the cargo with a tarp to keep it safe!', 'I love the sound of rain against the window.', 0],
['Windy', 1, 'Seems to be a slight breeze, I wouldn\'t worry about it too much.', 'The ship is rocking a little, I hope the cargo is secure.', 'Windy isn\'t too dangerous right?', 1000], ['Windy', 1, 'Seems to be a slight breeze, I wouldn\'t worry about it too much.', 'The ship is rocking a little, I hope the cargo is secure.', 'Windy isn\'t too dangerous right?', 1000],
['Weather', 1, 'Dialog', 'Dialog', 'Dialog', 2500], ['Moderate rain', 1, '', 'Dialog', 'Dialog', 2500],
['Weather', 2, 'Dialog', 'Dialog', 'Dialog', 5000], ['Weather', 2, 'Dialog', 'Dialog', 'Dialog', 5000],
['Weather', 2, 'Dialog', 'Dialog', 'Dialog', 7500], ['Heavy rain', 2, 'Even my raincoat is wet!', 'Dialog', 'Dialog', 7500],
['Weather', 3, 'Dialog', 'Dialog', 'Dialog', 10000] ['Stormy', 3, 'Dialog', 'Dialog', 'Dialog', 10000]
] ]
# Start of the game. # Start of the game.
# Player will set up their company, picking difficulty and insurance. # Player will set up their company, picking difficulty and insurance.
# After they will pick the contracts and start playing. # After they will pick the contracts and start playing.
# Clears the screen
clear()
print(" /$$ /$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$ \n") print(" /$$ /$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$ \n")
print(" /$$$$$$ /$$__ $$ /$$__ $$| $$_____/ /$$__ $$| $$$ | $$ /$$__ $$ /$$$$$$ \n") print(" /$$$$$$ /$$__ $$ /$$__ $$| $$_____/ /$$__ $$| $$$ | $$ /$$__ $$ /$$$$$$ \n")
print(" /$$__ $$ | $$ \ $$| $$ \__/| $$ | $$ \ $$| $$$$| $$| $$ \__/ /$$__ $$ \n") print(" /$$__ $$ | $$ \ $$| $$ \__/| $$ | $$ \ $$| $$$$| $$| $$ \__/ /$$__ $$ \n")
...@@ -69,34 +73,7 @@ print(" \____ $$ | $$ | $$ | $$ $$| $$ | $$| $$ | $$| $$\ ...@@ -69,34 +73,7 @@ print(" \____ $$ | $$ | $$ | $$ $$| $$ | $$| $$ | $$| $$\
print(" /$$ \ $$ | $$ | $$ | $$$$$$/| $$$$$$/| $$$$$$/| $$ \ $$ /$$ \ $$ \n") print(" /$$ \ $$ | $$ | $$ | $$$$$$/| $$$$$$/| $$$$$$/| $$ \ $$ /$$ \ $$ \n")
print("| $$$$$$/ |__/ |__/ \______/ \______/ \______/ |__/ \__/ | $$$$$$/ \n") print("| $$$$$$/ |__/ |__/ \______/ \______/ \______/ |__/ \__/ | $$$$$$/ \n")
print(" \_ $$_/ \_ $$_/ \n") print(" \_ $$_/ \_ $$_/ \n")
print(" \__/ \__/") print(" \__/ \__/ \n")
# Clears the screen
#clear()
print("Hello!...\nWelcome to the company start up centre.\nI'm dave, your company advisor. I have already read your application and it looks like you want to start a freight company") print("Hello!...\nWelcome to the company start up centre.\nI'm dave, your company advisor. I have already read your application and it looks like you want to start a freight company")
print("In order to help you out, we will need some information from you.\n") print("In order to help you out, we will need some information from you.\n")
...@@ -174,11 +151,11 @@ input("Press 'Enter' to continue") ...@@ -174,11 +151,11 @@ input("Press 'Enter' to continue")
################################################################################################ ################################################################################################
clear() clear()
while date < 32:
print("--- Summary ---\nCompany name: " + companyName + "\nBank Balance: £", bankbal, "\nWeather: Clear\nLocation: Contracts Office\n")
print("--- Summary ---\nCompany name: " + companyName + "\nBank Balance: £", bankbal, "\nWeather: Clear\nLocation: Contracts Office\n") response3 = ""
while response3 not in firstcontract:
response3 = ""
while response3 not in firstcontract:
response3 = input("Good Morning captain we have 3 contracts available for you to carry out. Please take a look....\n\nCONTRACT 1 ~ COST: £20,000 ~ PAYOUT ~ £100,000 ~\n-Cargo in excess of £10,000,000\n-Scotland -> Sweden\n-3 Day limit from acceptance of contract\n\nCONTRACT 2 ~ COST:£10,000 ~ PAYOUT ~ £50,000~\n-Cargo in excess of £100,000\n-Scotland -> France\n-7 day time limit from acceptance of contract\n\nCONTRACT 3 ~ COST: :£15,000 ~ PAYOUT ~ £75,000~\n-Cargo in excess of £2,500,000\n-Scotland -> Portugal\n-5 day time limit from acceptance of contract\n\nplease pick a contract 1/2/3\n") response3 = input("Good Morning captain we have 3 contracts available for you to carry out. Please take a look....\n\nCONTRACT 1 ~ COST: £20,000 ~ PAYOUT ~ £100,000 ~\n-Cargo in excess of £10,000,000\n-Scotland -> Sweden\n-3 Day limit from acceptance of contract\n\nCONTRACT 2 ~ COST:£10,000 ~ PAYOUT ~ £50,000~\n-Cargo in excess of £100,000\n-Scotland -> France\n-7 day time limit from acceptance of contract\n\nCONTRACT 3 ~ COST: :£15,000 ~ PAYOUT ~ £75,000~\n-Cargo in excess of £2,500,000\n-Scotland -> Portugal\n-5 day time limit from acceptance of contract\n\nplease pick a contract 1/2/3\n")
if response3 == "1": if response3 == "1":
...@@ -199,24 +176,28 @@ while response3 not in firstcontract: ...@@ -199,24 +176,28 @@ while response3 not in firstcontract:
else: else:
print("Have you been in the pub again captain? you aren't making any sense try saying that again but slower") print("Have you been in the pub again captain? you aren't making any sense try saying that again but slower")
input("Press 'Enter' to continue")
###################################################################################### input("Press 'Enter' to continue")
# Contract 1 #
######################################################################################
clear()
income = 0
payoutloss = 0
print("--- Summary ---\nCompany name: " + companyName + "\nBank balance: ", bankbal, "\nSchedule: Day of departure\nTime: 12:36pm\nWeather: Fair")
print("----------------------------------------------\nCurrent Location: " + Routes[contract][0] + "\nTarget Location: " + Routes[contract][1] + "\nContract duration:", Routes[contract][2]) ######################################################################################
# Contract #
######################################################################################
clear()
income = 0
payoutloss = 0
print("--- Summary ---\nCompany name: " + companyName + "\nBank balance: ", bankbal, "\nSchedule: Day of departure\nTime: 12:36pm\nWeather: Fair")
print("\nDave: Okay Captain, all of the cargo has been loaded. If you\'re ready, we can set off!\n") print("----------------------------------------------\nCurrent Location: " + Routes[contract][0] + "\nTarget Location: " + Routes[contract][1] + "\nContract duration:", Routes[contract][2])
input("Press 'Enter' to continue") print("\nDave: Okay Captain, all of the cargo has been loaded. If you\'re ready, we can set off!\n")
input("Press 'Enter' to continue")
for i in range(Routes[contract][2]):
clear()
for i in range(Routes[contract][2]):
day = i+1 day = i+1
date = date + 1
hour = randint(1, 12) hour = randint(1, 12)
minute = randint(1, 59) minute = randint(1, 59)
...@@ -244,154 +225,44 @@ for i in range(Routes[contract][2]): ...@@ -244,154 +225,44 @@ for i in range(Routes[contract][2]):
input("Press 'Enter' to continue") input("Press 'Enter' to continue")
hour = randint(1, 12) hour = randint(1, 12)
minute = randint(1, 59) minute = randint(1, 59)
if (hour < 10): if (hour < 10):
hour = "0" + str(hour) hour = "0" + str(hour)
if (minute < 10): if (minute < 10):
minute = "0" + str(minute) minute = "0" + str(minute)
print("--- Summary ---\nCompany name: " + companyName + "\nBank balance: ", bankbal, "\nSchedule: Unload cargo\nTime:", hour, ":", minute, "\nWeather: Fair") print("--- Summary ---\nCompany name: " + companyName + "\nBank balance: ", bankbal, "\nSchedule: Unload cargo\nTime:", hour, ":", minute, "\nWeather: Fair")
income = (Routes[contract][3] - payoutloss)
print("----------------------------------------------\nCurrent Location: " + Routes[contract][1] + "\nContract payout: ", Routes[contract][3], "\nPenalties: ", payoutloss, "\nTotal Income from Haul: ", income)
print("")
input("Press 'Enter' to continue")
income = (Routes[contract][3] - payoutloss)
print("----------------------------------------------\nCurrent Location: " + Routes[contract][1] + "\nContract payout: ", Routes[contract][3], "\nPenalties: ", payoutloss, "\nTotal Income from Haul: ", income)
bankbal = bankbal + income
print("")
input("Press 'Enter' to continue")
if bankbal is 0 or bankbal < 0:
break
clear()
if date < 32:
print("Unfortunately you have run out of money! You cannot continue.")
exit()
else:
print("Okay Captain! You've managed to make it this far! Let\'s see how you\'ve done!")
print("Obviously, We would like out loan back, so we will deduct that from your balance.")
input("Press 'Enter' to continue")
print("--- Summary ---\nCompany name: " + companyName + "\nBank balance: ", bankbal, "\nSchedule: Debrief\n ---------------")
if bankbal < 0:
print("Unfortunately, you haven\'t managed to break even and you\'re now in debt.")
print("As this was actually all a simulation, nothing will happen and we will clear your balance.")
elif bankbal is 0:
print("Amazingly you have managed to have a balance of £0.")
print("This doesn\'t mean you have lost the game, but you haven\'t won either.")
elif bankbal > 0:
print("Wow! I under estimated your ability at the high seas Captain!")
print("Unfortunately though, we cannot give you any of this money as this is all a simulation!")
else:
print("Something has gone wrong.")
print("Reopen the game in order to play again!")
exit()
\ No newline at end of file
if contractpicked == 1:
print("DAYS LEFT: 3")
print("Location: Roswyth Docks - Aberdeen")
print("Target Location: Port of Gothenburg - Sweden\n")
print("You set sail out of the port in Aberdeen and begin the journey to Sweden\n")
response4 = ""
while response4 not in route:
response4 = input("You glance over at your GPS system and you have a choice of routes that you can take. Route 1 is the recommened route, you will arrive on time and the sea looks calm. Route 2 is faster but the weather isn't lookin all that promising. Which route do you want to take?\n\n route 1/route 2\n\n")
if response4 == "route 1":
route1 = 1
print("You decide against going for the faster route and take the safer route\n")
if response4 == "route 2":
route2 = 1
print("You have chosen to take the faster route. You are expected to arrive in Sweden a day ahead of time\n")
print("The day turns quickly into night as you keep on plodding on your journey\n")
########################################################################################
#DAY 2#
########################################################################################
print("DAY 2")
print("WEATHER: Light Rain")
print("TIME: 07:00am")
print("BALANCE: £",bankbal)
if route1 == 1:
print("\n\nYou are woken up by your alarm at 7am and you are ready to continue with your journey ")
if route2 == 1:
print("\n\n\You are woken up by your alarm at 7am. You are ahead of schedule, you may even get a raise on your pay")
if contractpicked == 1:
print("\nDAYS LEFT: 2")
print("Location: Atalantic Ocean")
print("Target Location: Port of Gothenburg - Sweden\n")
response5 = ""
while response5 not in route:
response5 = input("You hear over the ships radio: \n ~STORM WARNING~ ATTENTION ALL SHIPS IN THE VICINITY A STORM WILL BE PASSING OVER THE AREA WITHIN THE NEXT HOUR PLEASE STEER CLEAR OF THE AREA ~STORM WARNING~\n\n The radio then goes silent and you look back at your GPS and notice 2 routes that you could take. Route 1, the safest option but you may arrive in Sweden a little bit later than you had planned. Route 2 heads through the stormy sea and you will arrive in Sweden ahead of schedule\n\nWhich route do you want to take\n\n route 1/route2\n")
if response5 == "route 1":
route1 = 2
print("You choose to go the recommend route but this could make you late for your drop off")
elif response5 == "route 2":
route2 = 2
print("You take the faster route as the rain begins to get gradually heavier and heavier\n\n")
print("DAY 2")
print("WEATHER: Heavy Rain")
print("TIME: 10:00am")
print("BALANCE: £",bankbal)
if contractpicked == 1:
print("\nDAYS LEFT: 2")
print("Location: Atalantic Ocean")
print("Target Location: Port of Gothenburg - Sweden\n")
if route1 == 2:
print("You begrudgingly travel down the much slower route as the rain bounces down on your ship. You hear ove the radio that the storm is raging on but luckily you are safe. Better to be a little bit later but at least you and your cargo is safe")
if route2 == 2:
print("You stubbornly continue on a far more dangerous path. The rain is bouncing down heavily on your ship and visibility is low. The storm is forecast to continue for the next couple of hours. Swaying from side to side you try to keep the boat on course but with a large crash some 40% of your cargo falls overboard and is iredemiable.")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment