def all_out_attack(self):
cells_to_consider_moving = []
for square in itertools.chain.from_iterable(self.squares):
# Do we risk undoing a multi-move capture if we move a piece that's "STILL"?
if square.owner == self.my_id and (square.move == -1 or square.move == STILL) and square.strength > (square.production * late_game_buildup_multiplier):
cells_to_consider_moving.append(square)
for square in cells_to_consider_moving:
# # Find an enemy square to attack!
# #if (square.x + square.y) % 2 == self.frame % 2:
# value_map = numpy.zeros((self.width, self.height))
# #value_map += numpy.multiply(numpy.divide(self.influence_enemy_strength_map[3], self.dij_prod_distance_map[square.x, square.y]), self.combat_zone_map)
# value_map += numpy.multiply(self.distance_map_no_decay[square.x, square.y], self.is_enemy_map)
# tx, ty = numpy.unravel_index(value_map.argmax(), (self.width, self.height))
# target = self.squares[tx, ty]
# square.move_to_target(target, False)
self.find_nearest_non_npc_enemy_direction(square)
评论列表
文章目录