@@ -22,7 +22,7 @@ class Game:
22
22
def __init__ (self , message_queue : multiprocessing .Queue ) -> None :
23
23
self .message_queue = message_queue
24
24
self .arena = Arena (self .message_queue )
25
- self .round : str = "0-0"
25
+ self .round : list [ str , int ] = [ "0-0" , 0 ]
26
26
self .time : None = None
27
27
self .forfeit_time : int = settings .FORFEIT_TIME + random .randint (50 , 150 )
28
28
self .found_window = False
@@ -60,7 +60,7 @@ def callback(self, hwnd, extra) -> None: # pylint: disable=unused-argument
60
60
def loading_screen (self ) -> None :
61
61
"""Loop that runs while the game is in the loading screen"""
62
62
game_functions .default_pos ()
63
- while game_functions .get_round () != "1-1" :
63
+ while game_functions .get_round ()[ 0 ] != "1-1" :
64
64
if self .check_failed_to_connect_window ():
65
65
return
66
66
sleep (1 )
@@ -115,21 +115,80 @@ def game_loop(self) -> None:
115
115
game_functions .forfeit ()
116
116
return
117
117
118
- if self .round != ran_round :
119
- if self .round in game_assets .PVP_ROUND :
118
+ if self .round [ 0 ] != ran_round :
119
+ if self .round [ 0 ] in game_assets .PVP_ROUND :
120
120
game_functions .default_pos ()
121
121
self .pvp_round ()
122
- ran_round : str = self .round
123
- elif self .round in game_assets .PVE_ROUND :
122
+ ran_round : str = self .round [ 0 ]
123
+ elif self .round [ 0 ] in game_assets .PVE_ROUND :
124
124
game_functions .default_pos ()
125
125
self .pve_round ()
126
- ran_round : str = self .round
127
- elif self .round in game_assets .CAROUSEL_ROUND :
126
+ ran_round : str = self .round [ 0 ]
127
+ elif self .round [ 0 ] in game_assets .CAROUSEL_ROUND :
128
128
self .carousel_round ()
129
- ran_round : str = self .round
130
- elif self .round in game_assets .SECOND_ROUND :
129
+ ran_round : str = self .round [ 0 ]
130
+ elif self .round [ 0 ] in game_assets .SECOND_ROUND :
131
131
self .second_round ()
132
- ran_round : str = self .round
132
+ ran_round : str = self .round [0 ]
133
+ elif self .round [0 ] in game_assets .ENCOUNTER_ROUNDS :
134
+ print (f"\n [Encounter Round] { self .round } " )
135
+ print (" Do nothing" )
136
+ self .message_queue .put ("CLEAR" )
137
+ self .arena .check_health ()
138
+ ran_round : str = self .round [0 ]
139
+ if self .round [1 ] == 1 and self .round [0 ].split ("-" )[1 ] == "1" :
140
+ game_assets .CAROUSEL_ROUND = {
141
+ carousel_round
142
+ for carousel_round in game_assets .CAROUSEL_ROUND
143
+ if not carousel_round .startswith (self .round [0 ].split ("-" ))
144
+ }
145
+ game_assets .PVE_ROUND = {
146
+ pve_round
147
+ for pve_round in game_assets .PVE_ROUND
148
+ if not pve_round .startswith (self .round [0 ].split ("-" ))
149
+ }
150
+ game_assets .PVP_ROUND = {
151
+ pvp_round
152
+ for pvp_round in game_assets .PVP_ROUND
153
+ if not pvp_round .startswith (self .round [0 ].split ("-" ))
154
+ }
155
+ game_assets .ANVIL_ROUNDS = {
156
+ anvil_round
157
+ for anvil_round in game_assets .ANVIL_ROUNDS
158
+ if not anvil_round .startswith (self .round [0 ].split ("-" ))
159
+ }
160
+ game_assets .ITEM_PLACEMENT_ROUNDS = {
161
+ item_placement_round
162
+ for item_placement_round in game_assets .ITEM_PLACEMENT_ROUNDS
163
+ if not item_placement_round .startswith (self .round [0 ].split ("-" ))
164
+ }
165
+ for index , round_msg in enumerate (
166
+ game_functions .check_encounter_round ()
167
+ ):
168
+ if index == 0 :
169
+ continue
170
+ if round_msg == "carousel" :
171
+ game_assets .CAROUSEL_ROUND .add (
172
+ self .round [0 ].split ("-" ) + "-" + str (index + 1 )
173
+ )
174
+ game_assets .ANVIL_ROUNDS .add (
175
+ self .round [0 ].split ("-" ) + "-" + str (index + 2 )
176
+ )
177
+ game_assets .ITEM_PLACEMENT_ROUNDS .add (
178
+ self .round [0 ].split ("-" ) + "-" + str (index + 2 )
179
+ )
180
+ elif round_msg == "pve" :
181
+ game_assets .PVE_ROUND .add (
182
+ self .round [0 ].split ("-" ) + "-" + str (index + 1 )
183
+ )
184
+ elif round_msg == "pvp" :
185
+ game_assets .PVP_ROUND .add (
186
+ self .round [0 ].split ("-" ) + "-" + str (index + 1 )
187
+ )
188
+ elif round_msg == "encounter" :
189
+ game_assets .ENCOUNTER_ROUNDS .add (
190
+ self .round [0 ].split ("-" ) + "-" + str (index + 1 )
191
+ )
133
192
sleep (0.5 )
134
193
135
194
def second_round (self ) -> None :
0 commit comments