fix(sell): allow selling during SMODS_BOOSTER_OPENED - #237
Open
giordanobrunocp wants to merge 1 commit into
Open
fix(sell): allow selling during SMODS_BOOSTER_OPENED#237giordanobrunocp wants to merge 1 commit into
giordanobrunocp wants to merge 1 commit into
Conversation
sell requires_state only allowed SELECTING_HAND/SHOP, so a Buffoon pack pulled with a full Joker roster (5/5) had no way to make room for the new Joker via the API, even though the base game lets you sell from the pack screen. Verified live: without this change `sell` returns INVALID_STATE during SMODS_BOOSTER_OPENED; calling G.FUNCS.sell_card while the pack UI is open works fine, but the completion-check's valid_state gate needed the same state added or the request just hangs waiting for a state it'll never see. Tested manually against a running instance: filled Jokers to 5/5, opened a pack, sold Joker index 0 mid-pack, got a normal gamestate response back with the game state remaining consistent (still SMODS_BOOSTER_OPENED, sell reflected in jokers/money).
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.
Problem
sell'srequires_stateonly allowsSELECTING_HANDandSHOP. When aBuffoon pack is opened while the Joker roster is already full (5/5), there's
no way to make room via the API before picking a card from the pack — even
though the base game's own UI lets you sell a Joker from the booster pack
screen. Any Joker offered by the pack (including a Legendary pulled from a
Soul card) is effectively unreachable in that situation; the only workaround
is skipping the whole pack.
Fix
Adds
G.STATES.SMODS_BOOSTER_OPENEDtosell'srequires_state, and to thecompletion-check's
valid_statecondition further down (the polling eventthat waits for the sell to finish also gates on state, so both places needed
the change or the request just hangs waiting for a state transition that
never happens).
Testing
Tested manually against a running instance via the debug
add/setendpoints: filled Jokers to 5/5, opened a booster pack, called
sellwithjoker: 0whilestate == SMODS_BOOSTER_OPENED. Before the fixthis returns
INVALID_STATE. After the fix it sells normally — card countand money update correctly, game state stays consistent and still reports
SMODS_BOOSTER_OPENED— and the pack can then be resolved as usual.🤖 Generated with Claude Code