diff --git a/obsazovani.md b/obsazovani.md index 182d127..55f0a1c 100644 --- a/obsazovani.md +++ b/obsazovani.md @@ -36,6 +36,7 @@ GET na `/api/state?game=&token=&min_round=` map: [[{ home_for_team: occupied_by_team: + protected_for_team: hill: members: [{ type: "soldier" # Pro budoucí rozšiřování diff --git a/server/hra/game.py b/server/hra/game.py index 73664bd..5630037 100644 --- a/server/hra/game.py +++ b/server/hra/game.py @@ -70,6 +70,7 @@ class Occupy(Logic): { "home_for_team": None, "occupied_by_team": None, + "protected_for_team": None, "hill": (self.configuration["hills"] [j % self.configuration["height_per_team"]] [i % self.configuration["width_per_team"]] @@ -87,6 +88,8 @@ 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 + for x, y in self.PROTECTED_AREA: + map[(home_y+y) % self.map_height][(home_x+x) % self.map_width]["protected_for_team"] = team_id # Initial stav vojáků: for soldier_id in range(max(1, self.budget_for_round(0) // self.spawn_price)): map[home_y][home_x]["members"].append(self.generate_soldier(team_id, soldier_id)) @@ -206,6 +209,7 @@ class Occupy(Logic): for field in row: new_field = { "home_for_team": field["home_for_team"], + "protected_for_team": field["protected_for_team"], "occupied_by_team": field["occupied_by_team"], "hill": field["hill"], "members": []