-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
83 lines (65 loc) · 2.11 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import Functionalities.Utilities
import Functionalities.Save_game
WHOLE_GAME = Functionalities.Save_game.load_or_new_game()
player = WHOLE_GAME.player
Cities = WHOLE_GAME.cities
def welcome():
Functionalities.Utilities.text_separation()
print("Welcome to this tribute to Patrician III by FernandooMarinn (GitHub)")
Functionalities.Utilities.text_separation()
def print_menu():
Functionalities.Utilities.text_separation()
print("\nWhat do you want to do?. Your current turn is {}. Your are in {}\n\n"
"1- Choose a boat.\n"
"2- Choose a convoy.\n"
"3- View moving boats and convoys.\n"
"4- Go to city buildings.\n"
"5- Change city.\n"
"6- Check player stats.\n"
"7- Pass turn.\n"
"8- Save/Load game.\n"
"9- Exit game.\n".format(player.turn, player.city.name))
def game_loop():
while True:
change_turn(player, Cities)
Functionalities.Utilities.text_separation()
Functionalities.Utilities.text_separation()
while True:
print_menu()
option = input()
option = Functionalities.Utilities.correct_values(1, 9, option)
if option == 7:
break
else:
choose_options(option)
def change_turn(player, cities_list):
if player.turn == 0:
player.turn += 1
else:
player.change_turn()
Functionalities.Utilities.all_cities_change_turn(cities_list)
def choose_options(option):
if option == 1:
player.check_boats()
elif option == 2:
player.check_convoys()
elif option == 3:
player.view_all_traveling_units()
elif option == 4:
player.city.menu_city_buildings()
elif option == 5:
player.change_city(Cities)
elif option == 6:
player.check_player()
elif option == 8:
Functionalities.Save_game.choose_save_or_load_game(WHOLE_GAME)
elif option == 9:
goodbye()
def goodbye():
print("\n\n\nBye! See you next time!\n")
exit()
def main():
welcome()
game_loop()
if __name__ == '__main__':
main()