def cast_confuse(state): # monster = Constants.closest_monster(util, Constants.CONFUSE_RANGE) monster = Util.target_monster(state, Constants.CONFUSE_RANGE) if monster is None: state.status_panel.message('No enemy is close enough to confuse', libtcod.red) return Constants.CANCELLED old_ai = monster.ai monster.ai = ConfusedMonster(old_ai, state) monster.clear(state.con) monster.ai.owner = monster state.status_panel.message('The eyes of the ' + monster.name + ' look vacant, as he starts to stumble around!', libtcod.light_green)