-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmenu_viewMapAndSurroundings.py
161 lines (138 loc) · 7.52 KB
/
menu_viewMapAndSurroundings.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
from globals import *
#This document contains screens for:
# viewMapYourStronghold
# viewMapEnemyStronghold
# viewMapCurrentFief
# viewSurroundings
def ViewMapAndSurroundings(screen, userStronghold, attackStronghold, STRONGHOLD, USER_STRONGHOLD):
global firstMapRead
#This page prints the world map with your stronghold's location marked on it
if screen == "viewMapYourStronghold":
os.system("clear")
headerSuperStripped()
print(' -------------------------------------------------------------------------------------------------------------- ')
print(' W O R L D M A P ')
serverMap.name = "serverMap"
if firstMapRead:
serverMap.read()
firstMapRead = False
PrintLegend()
print('')
#print(' ' + UNDERLINE + WARNING + 'World Map' + RESET + ': [Current Location - Row: ' + WARNING + str(userStronghold.yCoordinate) + RESET + ' Column: ' + WARNING + str(userStronghold.xCoordinate) + RESET + ']')
WorldMapLocation(int(userStronghold.yCoordinate), int(userStronghold.xCoordinate), serverMap, userStronghold.name)
print('')
print(" Avalible Commands:")
print(' -------------------------------------------------------')
print(' {1}: Return to Stronghold')
print(' {2}: Look at Surroundings')
print(' {3}: View Temperature Map')
print(' --------------------------------------------------------')
print('')
command = input(" Enter your command: ")
if command == '1':
screen = "stronghold"
if command == '2':
screen = 'viewSurroundings'
USER_STRONGHOLD = True
STRONGHOLD = True
if command == '3':
screen = "tempMap"
#This page prints the world map with your stronghold's location marked on it
if screen == "viewMapEnemyStronghold":
os.system("clear")
headerSuperStripped()
serverMap.name = "serverMap"
if firstMapRead:
serverMap.read()
firstMapRead = False
PrintLegend()
print('')
print(' ' + UNDERLINE + WARNING + 'World Map' + RESET + ': [Current Location - Row: ' + WARNING + str(attackStronghold.yCoordinate) + RESET + ' Column: ' + WARNING + str(attackStronghold.xCoordinate) + RESET + ']')
WorldMapLocation(int(attackStronghold.yCoordinate), int(attackStronghold.xCoordinate), serverMap, userStronghold.name)
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
return 'enemyStrongholdDetails'
#This page prints the world map with your stronghold's location marked on it
if screen == "viewMapCurrentFief":
os.system("clear")
headerSuperStripped()
serverMap.name = "serverMap"
if firstMapRead:
serverMap.read()
firstMapRead = False
PrintLegend()
print('')
print(' ' + UNDERLINE + WARNING + 'World Map' + RESET + ': [Current Location - Row: ' + WARNING + str(attackFief.yCoordinate) + RESET + ' Column: ' + WARNING + str(attackFief.xCoordinate) + RESET + ']')
WorldMapLocation(int(attackFief.yCoordinate), int(attackFief.xCoordinate), serverMap, userStronghold.name)
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
if str(attackFief.ruler) == str(userStronghold.ruler):
return 'ownedFiefDetails'
if str(attackFief.ruler) != str(userStronghold.ruler):
return "enemyFiefDetails"
#This page prints the world map with your stronghold's location marked on it
if screen == "viewSurroundings":
os.system("clear")
serverMap.name = "serverMap"
serverMap.read()
if STRONGHOLD:
headerStripped()
print('\n\n\n ')
print(' You stand atop the tallest tower in your stronghold and take a look around. This is what you see: \n\n\n')
if USER_STRONGHOLD:
ListSurroundings(serverMap.worldMap, userStronghold.xCoordinate, userStronghold.yCoordinate)
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
return "stronghold"
else:
ListSurroundings(serverMap.worldMap, attackStronghold.xCoordinate, attackStronghold.yCoordinate)
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
return "enemyStrongholdDetails"
else:
headerStripped()
print('\n\n\n ')
print(' You stand atop the highest point in the fiefdom and take a look around. This is what you see: \n\n\n')
ListSurroundings(serverMap.worldMap, attackFief.xCoordinate, attackFief.yCoordinate)
print('')
print(' In all:')
if int(attackFief.adjacentWater) > 0:
if int(attackFief.adjacentWater) == 1:
print(' There is one body of ' + textColor.BLUE + 'water' + textColor.RESET + ' nearby')
elif int(attackFief.adjacentWater) > 1:
print(' There are ' + str(attackFief.adjacentWater) + ' bodies of ' + textColor.BLUE + 'water' + textColor.RESET + ' nearby')
if int(attackFief.adjacentRivers) > 0:
if int(attackFief.adjacentRivers) == 1:
print(' There is one ' + textColor.BLUE + 'river' + textColor.RESET + ' nearby')
elif int(attackFief.adjacentRivers) > 1:
print(' There are ' + str(attackFief.adjacentRivers) + ' ' + textColor.BLUE + 'rivers' + textColor.RESET + ' nearby')
if int(attackFief.adjacentPlains) > 0:
if int(attackFief.adjacentPlains) == 1:
print(' There is one ' + textColor.YELLOW + 'plains' + textColor.RESET + ' nearby')
elif int(attackFief.adjacentPlains) > 1:
print(' There are ' + str(attackFief.adjacentPlains) + ' ' + textColor.YELLOW + 'plains' + textColor.RESET + ' nearby')
if int(attackFief.adjacentForests) > 0:
if int(attackFief.adjacentForests) == 1:
print(' There is one ' + textColor.GREEN + 'forest' + textColor.RESET + ' nearby')
elif int(attackFief.adjacentForests) > 1:
print(' There are ' + str(attackFief.adjacentForests) + ' ' + textColor.GREEN + 'forests' + textColor.RESET + ' nearby')
if int(attackFief.adjacentMountains) > 0:
if int(attackFief.adjacentMountains) == 1:
print(' There is one ' + textColor.DARK_GRAY + 'mountain' + textColor.RESET + ' nearby')
elif int(attackFief.adjacentMountains) > 1:
print(' There are ' + str(attackFief.adjacentMountains) + ' ' + textColor.DARK_GRAY + 'mountains' + textColor.RESET + ' nearby')
if str(attackFief.ruler) == str(userStronghold.ruler):
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
return 'ownedFiefDetails'
if str(attackFief.ruler) != str(userStronghold.ruler):
print('')
time.sleep(1)
nothing = input(' Press Enter to Continue')
return "enemyFiefDetails"
return screen