def issue_combat_task(self): 'combat logic' logging.debug('issue_combat_task.start = %s' % str(self.gamestate.time_remaining())) zones = battle.get_combat_zones(self.gamestate) logging.debug('zones = %s' % str(zones)) for zone in zones: logging.debug('group combat loop for = %s' % str(zone)) if len(zone[0]) > 0: battle.do_zone_combat(self.gamestate, zone) # check if we still have time left to calculate more orders if self.gamestate.time_remaining() < self.planner_time + 50: break logging.debug('issue_combat_task.finish = ' + str(self.gamestate.time_remaining()))
def issue_combat_task(self, ants): "combat logic" logging.debug("issue_combat_task.start = %s" % str(ants.time_remaining())) zones = battle.get_combat_zones(ants) logging.debug("zones = %s" % str(zones)) for zone in zones: logging.debug("group combat loop for = %s" % str(zone)) if len(zone[0]) > 0: battle.do_zone_combat(ants, zone) # check if we still have time left to calculate more orders if ants.time_remaining() < 100: break logging.debug("issue_combat_task.finish = " + str(ants.time_remaining()))