summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-09-23 23:42:39 +0200
committerFlorian Jung <flo@windfisch.org>2015-09-23 23:53:41 +0200
commitb12734d412869ebd85320cc171723e6b9686336c (patch)
tree6c2a549c327a87eb20602b0339c889577bbe68cb
parent40e1693809b788470cd3daf62d13d21b1353667e (diff)
mechanic fix (plus more)
-rw-r--r--mechanics.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mechanics.py b/mechanics.py
index c290a5f..d15df83 100644
--- a/mechanics.py
+++ b/mechanics.py
@@ -21,10 +21,10 @@ def get_my_largest_cell(c):
return sorted(c.player.own_cells, key = lambda x: x.mass)[-1]
def is_enemy(cell, c):
- return (not cell.same_player(c.player.own_cells[0])) and cell.mass > 1.25 * get_my_smallest_cell(c).mass
+ return not cell.is_virus and not cell.is_food and not cell.is_ejected_mass and (not cell.same_player(random_own_cell(c))) and cell.mass > 1.25 * get_my_smallest_cell(c).mass
def is_splitkiller(cell, c):
- return (not cell.same_player(c.player.own_cells[0])) and cell.mass > 2.5 * get_my_smallest_cell(c).mass
+ return not cell.is_virus and not cell.is_food and not cell.is_ejected_mass and(not cell.same_player(random_own_cell(c))) and cell.mass > 2.5 * get_my_smallest_cell(c).mass and cell.mass < 10 * get_my_smallest_cell(c).mass
def is_edible(cell, c):
return cell.is_food or cell.is_ejected_mass or ( (not cell.same_player(c.player.own_cells[0])) and not is_enemy(cell,c) and get_my_largest_cell(c).mass > 1.25 * cell.mass )