Skip to content

fix(sell): allow selling during SMODS_BOOSTER_OPENED - #237

Open
giordanobrunocp wants to merge 1 commit into
coder:mainfrom
giordanobrunocp:fix-sell-during-booster-pack
Open

fix(sell): allow selling during SMODS_BOOSTER_OPENED#237
giordanobrunocp wants to merge 1 commit into
coder:mainfrom
giordanobrunocp:fix-sell-during-booster-pack

Conversation

@giordanobrunocp

Copy link
Copy Markdown

Problem

sell's requires_state only allows SELECTING_HAND and SHOP. When a
Buffoon 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_OPENED to sell's requires_state, and to the
completion-check's valid_state condition further down (the polling event
that 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/set
endpoints: filled Jokers to 5/5, opened a booster pack, called
sell with joker: 0 while state == SMODS_BOOSTER_OPENED. Before the fix
this returns INVALID_STATE. After the fix it sells normally — card count
and 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

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant