Apr-28-2021, 07:28 AM
def choose_enemy_spell(self): magic_choice = random.randrange(0, len(self.magic)) spell = self.magic[magic_choice] magic_dmg = spell.generate_damage() pct = self.hp / self.maxhp * 100 if self.mp < spell.cost or spell.type == "white" and pct > 50: self.choose_enemy_spell() else: return spell, magic_dmgIn one case you return nothing, in the other case you return (spell, magic_dmg). It is the first case that will give you the error.