Unsolicited feedback incoming:
Hey boss I noticed you've got a few lines of if has_token_stack(buffer, -x) to try and individually catch a bunch of possible cases.
There's an inbuilt thing already that can to do that (under ScriptsConditional>Combat): has_above_token_stack( TOKEN, int ).
So to clear a token with negative stacks, just slap a "not" in front of it:
- if not has_above_token_stack(buffer,0):
- clear_tokens(buffer)
Protip if you're using "not has_above_token_stack(0)" you might want to specify -1 stacks instead of 0 stacks. Otherwise it will "clear" a stack of 0 tokens. Not a massive performance improvement by itself, but it's the principle of the thing.
Also the has_wearable() condition can check multiple items so has_wearable(earrings_health_3,earrings_health_4) would probably save a cycle or two. But mostly it's much easier to read in the UI when playing.
(This ain't a criticism or anything it's just a PSA cause I've been editing a mod with a lot of conditions and when using the brainwashing earrings that autoplays your turns the >15s laaaag vs Sandtrap mid-turn when checking/upgrading hundreds of cards before it continued playing gives me PTSD. The smaller the number of checks and scripts that end up actually running, the better.)