Optimize quantum enhancements's set_ability#1322
Merged
Aurelius7309 merged 6 commits intoSteamodded:mainfrom Apr 10, 2026
Merged
Optimize quantum enhancements's set_ability#1322Aurelius7309 merged 6 commits intoSteamodded:mainfrom
set_ability#1322Aurelius7309 merged 6 commits intoSteamodded:mainfrom
Conversation
set_ability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR targeted to optimize quantum enhancements by providing
Card.quantum_set_abilityfunction, which works mostly the same asCard.set_abilitybut without any kind of resizing or sprite manipulations.As a result, calculating time for 80 steel cards in hand + 2 jokers with quantum effect was decreased from 8 seconds to 3 seconds. Additionally, it significantly decreases a lag during selecting cards in hand + hovering them.
Sadly, because by patching
Card:set_abilitywill be difficult to exclude all side effects, new method was used, which leads to some noticeable changes from previous implementation:Card:set_abilitywill not be reflected inCard.quantum_set_abilitySMODS.Center.set_abilitysome changes to card outside ofabilitytable is made, they will persist. Modders can checkcard.from_quantumto account for this behaviour.SMODS.calculate_context({setting_ability = true})will not be called between switching quantum enhancements. Maybe it's a good thing?Additional Info: