From 158abc80775a82b474a525c18d9cd55fdc1b948f Mon Sep 17 00:00:00 2001 From: Boris Zaitsev Date: Tue, 30 Jul 2019 16:49:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=81=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D1=82=D1=8C=20=D0=BD=D0=B0=20=D1=81=D0=B2=D0=BE=D0=B5?= =?UTF-8?q?=D0=B9=20=D1=82=D0=B5=D1=80=D1=80=D0=B8=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В случае, если у игрока шлейф нулевой длины, то есть он находится на своей территории, то пропускается проверка коллизий с другими игроками. Это означает, что игрок не погибнет от столкновений, пока он не отойдет на 30 мини-ячеек от своей территории. --- paperio/local_runner/game_objects/game.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/paperio/local_runner/game_objects/game.py b/paperio/local_runner/game_objects/game.py index 3a7dbab..c467667 100644 --- a/paperio/local_runner/game_objects/game.py +++ b/paperio/local_runner/game_objects/game.py @@ -127,11 +127,13 @@ def check_loss(self, player, players): is_loss = True self.append_event('line crossed by other player', player, p) - for p in players: - if is_intersect((player.x, player.y), (p.x, p.y)) and p != player: - if len(player.lines) >= len(p.lines): - is_loss = True - self.append_event('faced with other player', player, p) + if len(player.lines) > 0: + for p in players: + if is_intersect((player.x, player.y), (p.x, p.y)) and p != player: + if len(player.lines) >= len(p.lines): + is_loss = True + self.append_event('faced with other player', player, p) + break if len(player.territory.points) == 0: is_loss = True