>>715626747I have no clue what the context of this code here and I don't really know anything about balatro so I could be wrong about something but it looks like its a giant if else block to get a message value by checking every applicable ability name and hardcoding an associated message and multiplier.
It would be better to have some sort of struct for the abilities that has its name, message, and multiplier so you can just reference it with something like "self.ability.message". You could also include the secondary conditions some have in that object, like the "self.mult > 0".
In all actuality the efficiency difference is beyond negligible, its moreso just painful to imagine the developer writing all this out when they didn't need to.
It could be a problem if you have people on you're team who are designing new cards/abilities but arent programmers bu that might not be a problem depending on their team makeup.
It would've also made modding braindead easy if there was better code/data separation but Ive heard the game has a thriving modding scene so it seems to not be a big deal.