示例#1
0
 async def visit_middle(self):
     self.log("Visiting middle")
     # If found enemies before moving, store it on the board
     if self.bot_player.known_enemy_units.not_structure:
         self.register_enemy_units(
             self.bot_player.known_enemy_units.not_structure)
     await self.move_scout_to(
         util.add_to_location(
             util.get_mean_location(
                 self.bot_player.start_location,
                 self.bot_player.enemy_start_locations[0]), randint(-9, 9)))
示例#2
0
 def _set_best_location(self, request):
     """ Sets best location to build
     :param core.register_board.request.Request request:
     """
     if request.unit_type_id == UnitTypeId.REFINERY:
         request.location = self.bot_player.state.vespene_geyser(UnitTypeId.VESPENEGEYSER).closest_to(self.true_start_location or self.bot_player.start_location)
     else:
         our_expansion = self.bot_player.get_owned_expansions_locations()[0]
         resources_list = self.bot_player.get_resources_locations(our_expansion)
         resource_location = resources_list[random.randint(0, len(resources_list)-1)]
         # command_center = self.bot_player.units.structure[0]
         command_center = self.bot_player.owned_expansions.popitem()[1]
         request.location = get_mean_location(resource_location.position, command_center.position)
示例#3
0
 async def visit_middle(self):
     self.log("Visiting middle")
     await self.move_units_to(
         util.get_mean_location(self.bot_player.start_location,
                                self.bot_player.enemy_start_locations[0]))
示例#4
0
 def set_mean_location(self):
     self.mean_location = util.get_mean_location(
         self.bot_player.start_location,
         self.bot_player.enemy_start_locations[0])