From dbcff21a7867acffaad0c8c1b3dba542320d75f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kore=C4=8Dek?= Date: Wed, 14 Sep 2022 18:37:07 +0200 Subject: [PATCH] =?UTF-8?q?Strategick=C3=A1:=20Z=C3=ADsk=C3=A1v=C3=A1n?= =?UTF-8?q?=C3=AD=20p=C5=99=C3=ADbytku=20hr=C3=A1=C4=8D=C5=AF=20za=20kolo?= =?UTF-8?q?=20z=20configu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/hra/game.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/hra/game.py b/server/hra/game.py index e20bc34..f6742c6 100644 --- a/server/hra/game.py +++ b/server/hra/game.py @@ -41,6 +41,8 @@ class Occupy(Logic): assert(teams_count == self.teams_width * self.teams_height) self.map_width = self.teams_width * configuration["width_per_team"] self.map_height = self.teams_height * configuration["height_per_team"] + # born per round - nultý index je počet vojáků každého týmu v zero-stavu + self.bpr = self.configuration["born_per_round"] def generate_soldier(self, team_id, soldier_id): return { @@ -74,7 +76,9 @@ class Occupy(Logic): for _ in range(self.teams_width): map[home_y][home_x]["home_for_team"] = team_id map[home_y][home_x]["occupied_by_team"] = team_id - map[home_y][home_x]["members"].append(self.generate_soldier(team_id, 0)) + # Initial stav vojáků: + for soldier_id in range(self.bpr[0]): + map[home_y][home_x]["members"].append(self.generate_soldier(team_id, soldier_id)) team_id += 1 home_x += self.configuration["width_per_team"] home_y += self.configuration["height_per_team"] @@ -156,7 +160,8 @@ class Occupy(Logic): # Přidáme vojáky v homes: for team_id in range(self.teams_count): home_pos = home_positions[team_id] - soldier_lists[home_pos[0]][home_pos[1]][team_id].append(highest_ids[team_id] + 1) + for i in range(self.bpr[(round_id + 1) % len(self.bpr)]): + soldier_lists[home_pos[0]][home_pos[1]][team_id].append(highest_ids[team_id] + i + 1) # Vojáci se pomlátí: for y in range(self.map_height):