summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-12 20:35:52 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-12 20:35:52 +0200
commit6f6f7f59f0b7aeb86fe16566c1a6d19f330dcd33 (patch)
treeb20d012a076489df93407cc2d2d9623e6a2b6739
parentc8fd1bf7c0fd68a976689767fa10c9e7bbc08ca8 (diff)
improve(?) runaway: nonsplitkillable cells are less dangerous
-rw-r--r--strategy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/strategy.py b/strategy.py
index 4f93343..0cba570 100644
--- a/strategy.py
+++ b/strategy.py
@@ -23,7 +23,7 @@ class Strategy:
relpos = ((cell.pos[0]-c.player.center[0]),(cell.pos[1]-c.player.center[1]))
dist = math.sqrt(relpos[0]**2+relpos[1]**2)
- if (not cell.is_virus and dist < 500+2*cell.size and cell.mass > 1.25 * my_smallest) or (cell.is_virus and dist < my_largest and cell.mass < my_largest):
+ if (not cell.is_virus and dist < ((500+2*cell.size) if cell.mass > 1.25*my_smallest*2 else (300+cell.size)) and cell.mass > 1.25 * my_smallest) or (cell.is_virus and dist < my_largest and cell.mass < my_largest):
angle = math.atan2(relpos[1],relpos[0])
corridor_halfwidth = math.asin(cell.size / dist)
forbidden_intervals += canonicalize_angle_interval((angle-corridor_halfwidth, angle+corridor_halfwidth))