def cast_fireball(state): # TODO: Add range check x, y = Util.target_tile(state) state.game_map.get_map()[x][y].set_targeted(False) for object in state.objects: if object.distance(x, y) <= Constants.FIREBALL_RADIUS and object.fighter: state.status_panel.message('You sling a fireball at: ' + object.name + ' with a BAMboosh! The damage done is ' + str(Constants.FIREBALL_DAMAGE) + ' hp.', libtcod.light_blue) object.fighter.take_damage(Constants.FIREBALL_DAMAGE, state)