@@ -74,6 +74,7 @@ def __init__(self, cfg: GameConfig, namer: Namer, quads: typing.List[typing.List
74
74
self .player_idx : int = player_idx
75
75
self .game_name : typing .Optional [str ] = game_name
76
76
self .waiting_for_other_players : bool = False
77
+ self .checking_game_sync : bool = False
77
78
78
79
def draw (self , players : typing .List [Player ], map_pos : (int , int ), turn : int , heathens : typing .List [Heathen ],
79
80
is_night : bool , turns_until_change : int ): # pragma: no cover
@@ -190,6 +191,7 @@ def draw(self, players: typing.List[Player], map_pos: (int, int), turn: int, hea
190
191
(heathen .location [1 ] - map_pos [1 ]) * 8 + 4 , 0 , heathen_x , 60 , 8 , 8 )
191
192
# Outline a heathen if the player can attack it.
192
193
if self .selected_unit is not None and not isinstance (self .selected_unit , Heathen ) and \
194
+ self .selected_unit in players [self .player_idx ].units and \
193
195
not self .selected_unit .has_acted and \
194
196
abs (self .selected_unit .location [0 ] - heathen .location [0 ]) <= 1 and \
195
197
abs (self .selected_unit .location [1 ] - heathen .location [1 ]) <= 1 :
@@ -333,12 +335,13 @@ def draw(self, players: typing.List[Player], map_pos: (int, int), turn: int, hea
333
335
for setl_quad in self .selected_settlement .quads :
334
336
for i in range (setl_quad .location [0 ] - 1 , setl_quad .location [0 ] + 2 ):
335
337
for j in range (setl_quad .location [1 ] - 1 , setl_quad .location [1 ] + 2 ):
336
- if not any (s_q .location == (i , j ) for s_q in self .selected_settlement .quads ):
338
+ if not any (s_q .location == (i , j ) for s_q in self .selected_settlement .quads ) and \
339
+ 0 <= i <= 99 and 0 <= j <= 89 :
337
340
pyxel .rectb ((i - map_pos [0 ]) * 8 + 4 , (j - map_pos [1 ]) * 8 + 4 , 8 , 8 , pyxel .COLOR_WHITE )
338
341
if self .deploying_army_from_unit :
339
342
for i in range (self .selected_unit .location [0 ] - 1 , self .selected_unit .location [0 ] + 2 ):
340
343
for j in range (self .selected_unit .location [1 ] - 1 , self .selected_unit .location [1 ] + 2 ):
341
- if self .selected_unit .location != (i , j ):
344
+ if self .selected_unit .location != (i , j ) and 0 <= i <= 99 and 0 <= j <= 89 :
342
345
pyxel .rectb ((i - map_pos [0 ]) * 8 + 4 , (j - map_pos [1 ]) * 8 + 4 , 8 , 8 , pyxel .COLOR_WHITE )
343
346
344
347
# Also display the number of units the player can move at the bottom-right of the screen.
@@ -356,10 +359,14 @@ def draw(self, players: typing.List[Player], map_pos: (int, int), turn: int, hea
356
359
# There are a few situations in which we override the default help text:
357
360
# - If the current game has multiplayer enabled, and the player is waiting for other players to finish their
358
361
# turn.
362
+ # - If the current game has multiplayer enabled, and the player's local game state is being validated to ensure
363
+ # that it is in sync with the game server.
359
364
# - If a unit is selected that can settle, alerting the player as to the settle button.
360
365
# - If a unit is selected that can heal other units, alerting the player as to how to heal other units.
361
366
if self .game_config .multiplayer and self .waiting_for_other_players :
362
367
pyxel .text (2 , 189 , "Waiting for other players..." , pyxel .COLOR_WHITE )
368
+ elif self .game_config .multiplayer and self .checking_game_sync :
369
+ pyxel .text (2 , 189 , "Checking game sync, please wait..." , pyxel .COLOR_WHITE )
363
370
elif self .selected_unit is not None and self .selected_unit .plan .can_settle :
364
371
pyxel .text (2 , 189 , "S: Found new settlement" , pyxel .COLOR_WHITE )
365
372
elif self .selected_unit is not None and self .selected_unit .plan .heals and not self .selected_unit .has_acted :
@@ -606,7 +613,7 @@ def process_left_click(self, mouse_x: int, mouse_y: int, settled: bool,
606
613
new_settl .strength *= 2
607
614
new_settl .max_strength *= 2
608
615
case Faction .FRONTIERSMEN :
609
- new_settl .satisfaction = 75
616
+ new_settl .satisfaction = 75.0
610
617
case Faction .IMPERIALS :
611
618
new_settl .strength /= 2
612
619
new_settl .max_strength /= 2
@@ -927,7 +934,7 @@ def handle_new_settlement(self, player: Player):
927
934
[self .quads [self .selected_unit .location [1 ]][self .selected_unit .location [0 ]]],
928
935
setl_resources , [])
929
936
if player .faction == Faction .FRONTIERSMEN :
930
- new_settl .satisfaction = 75
937
+ new_settl .satisfaction = 75.0
931
938
elif player .faction == Faction .IMPERIALS :
932
939
new_settl .strength /= 2
933
940
new_settl .max_strength /= 2
0 commit comments