summaryrefslogtreecommitdiff
path: root/strategy.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-31 20:07:10 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-31 20:07:10 +0200
commit074b6cc570cdf897a2f9974617b53267faff6a13 (patch)
treef9e2e21d00c997d0754c6f89911acb313182aeed /strategy.py
parent1b71192eca047f8d13d6570bb623627389e5acc3 (diff)
virus{,2,3} logs for deviation
Diffstat (limited to 'strategy.py')
-rw-r--r--strategy.py6
1 files changed, 3 insertions, 3 deletions
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