diff --git a/AI.py b/AI.py index 1c91fb0..4c9dae8 100644 --- a/AI.py +++ b/AI.py @@ -1,11 +1,10 @@ class AI: - + # this function is called in the beginning for deck picking and preprocess def pick(self, world): print("pick") - #self.path_to_friend_check(world) + # self.path_to_friend_check(world) world.choose_deck([1, 2, 3, 4]) - def path_to_friend_check(self, world): # path check: print(world.get_me()) @@ -20,6 +19,7 @@ def path_to_friend_check(self, world): print(world.get_second_enemy()) print(world.get_second_enemy().path_to_friend) + # it is called every turn for doing process during the game def turn(self, world): print("turn") if world.get_current_turn() == 26: @@ -35,6 +35,6 @@ def turn(self, world): print("its turn 2!!!") world.put_unit(base_unit=world.get_me().hand[0], path=world.get_me().paths_from_player[0]) + # def end(self, world, scores): print("ending") - diff --git a/world.py b/world.py index c053cd2..89a1fe6 100644 --- a/world.py +++ b/world.py @@ -489,8 +489,8 @@ def get_area_spell_targets(self, center, row=None, col=None, spell=None, type_id if center is None: center = Cell(row, col) ls = [] - for i in range(max(0, center.row - spell.range), min(center.row + spell.range, self.map.row_count)): - for j in range(max(0, center.col - spell.range), min(center.col + spell.range, self.map.column_count)): + for i in range(max(0, center.row - spell.range), min(center.row + spell.range, self.map.row_num)): + for j in range(max(0, center.col - spell.range), min(center.col + spell.range, self.map.column_num)): cell = self.map.get_cell(i, j) for u in cell.units: if self._is_unit_targeted(u, spell.target):