def cast_lightning(state): monster = Util.closest_monster(state, Constants.LIGHTNING_RANGE) if monster is None: state.status_panel.message('No enemy is close enough to strike with lightning', libtcod.red) return Constants.CANCELLED state.status_panel.message('A lightning bolt strikes the ' + monster.name + ' with a ZAP! The damage done is ' + str(Constants.LIGHTNING_DAMAGE) + ' hp.', libtcod.light_blue) monster.fighter.take_damage(Constants.LIGHTNING_DAMAGE, state)