From 074b6cc570cdf897a2f9974617b53267faff6a13 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 31 Aug 2015 20:07:10 +0200 Subject: virus{,2,3} logs for deviation --- strategy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'strategy.py') diff --git a/strategy.py b/strategy.py index 21a06cf..67b3da9 100644 --- a/strategy.py +++ b/strategy.py @@ -113,17 +113,17 @@ class Strategy: my_smallest = min(self.c.player.own_cells, key=lambda cell : cell.mass) my_largest = max(self.c.player.own_cells, key=lambda cell : cell.mass) - friendly_cells = list(filter(lambda c : c.name in friendly_players, self.c.world.cells.values())) + friendly_cells = list(filter(lambda c : c.is_virus or c.name in friendly_players, self.c.world.cells.values())) if friendly_cells: dist_to_friend = min(map(lambda c : (self.c.player.center-c.pos).len() - max(my_largest.size, c.size), friendly_cells)) else: dist_to_friend = float('inf') - if dist_to_friend < 20 or my_largest.mass < 60: + if dist_to_friend < 20 or my_largest.mass < 36: if self.do_approach_friends: print("not approaching friends") self.do_approach_friends = False - elif dist_to_friend > 200 and my_largest.mass > 60 + 1*16: + elif dist_to_friend > 200 and my_largest.mass > 36 + 10*16: if not self.do_approach_friends: print("approaching friends") self.do_approach_friends = True -- cgit v1.2.1