diff --git a/AI.py b/AI.py index a15188c..edc757a 100644 --- a/AI.py +++ b/AI.py @@ -61,7 +61,7 @@ def turn(self, world): if len(my_units) > 0: unit = my_units[0] my_paths = myself.paths_from_player - path = my_paths[random.randint(0, len(my_paths) - 1)] + path = my_paths[random.randint(0, len(my_paths) - 1)] size = len(path.cells) cell = path.cells[(size + 1) / 2] world.cast_unit_spell(unit=unit, path=path, cell=cell, spell=received_spell) @@ -78,4 +78,3 @@ def turn(self, world): def end(self, world, scores): print("end started!") print("My score: " + scores[world.get_me().player_id]) - diff --git a/model.py b/model.py index 97aedd4..fd762e3 100644 --- a/model.py +++ b/model.py @@ -324,11 +324,6 @@ def __init__(self, max_ap, max_turns, turn_timeout, pick_timeout, self.deck_size = deck_size self.hand_size = hand_size - # if World.DEBUGGING_MODE: - # import datetime - # World.LOG_FILE_POINTER = open('client' + '-' + - # datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S.%f") + '.log', 'w+') - class TurnUpdates: def __init__(self, received_spell=None, friend_received_spell=None, @@ -347,5 +342,4 @@ def __init__(self, received_spell=None, friend_received_spell=None, self.got_damage_upgrade = turn_updates.got_damage_upgrade self.available_damage_upgrade = turn_updates.available_damage_upgrades self.available_range_upgrade = turn_updates.available_range_upgrades - turn_updates.received_spell = None - turn_updates.friend_received_spell = None + turn_updates = None diff --git a/world.py b/world.py index c3b8699..41b5af5 100644 --- a/world.py +++ b/world.py @@ -160,10 +160,6 @@ def _spells_init(self, msg): for spell in msg] def _handle_init_message(self, msg): - # if World.DEBUGGING_MODE: - # if World.LOG_FILE_POINTER is not None: - # World.LOG_FILE_POINTER.write(str(msg)) - # World.LOG_FILE_POINTER.write('\n') self._game_constant_init(msg['gameConstants']) self._map_init(msg["map"]) self._base_unit_init(msg["baseUnits"]) @@ -337,11 +333,6 @@ def get_paths_crossing_cell(self, cell=None, row=None, col=None): paths.append(p) return paths - # # return units of player that are currently in map - # def get_player_units(self, player_id): - # player = self.get_player_by_id(player_id) - # return player.units - # return a list of units in a cell def get_cell_units(self, cell=None, row=None, col=None): if cell is None: