fix!(lua.endpoints): allow use/sell consumables during SMODS_BOOSTER_OPENED
@S1M0N38 がすでに取り組んでいます。
2026年7月1日 から。
評価
この issue はまだ評価されていません。
説明
The use and sell endpoints reject valid actions during SMODS_BOOSTER_OPENED that the game actually permits. Verified against the patched source in vendors/lovely/dump/.
use — missing state entirely
src/lua/endpoints/use.lua has requires_state = { SELECTING_HAND, SHOP }, so using a consumable from inventory while a pack is open is blocked with INVALID_STATE.
The game explicitly allows it. SMODS patches Card:can_use_consumeable (card.lua:1818 in the dump) to include the state:
if G.STATE == G.STATES.SELECTING_HAND or G.STATE == G.STATES.TAROT_PACK
or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.PLANET_PACK
or G.STATE == G.STATES.SMODS_BOOSTER_OPENED then
Using an inventory consumable mid-pack is a non-destructive interrupt (TAROT_INTERRUPT): use_card saves prev_state, runs the consumable, then restores the pack — G.GAME.pack_choices is unchanged and the pack stays open (functions/button_callbacks.lua:2291-2305).
sell — wrongly restricted to Buffoon packs
src/lua/endpoints/sell.lua:58-72 rejects every sell unless the open pack is a Buffoon pack:
if G.STATE == G.STATES.SMODS_BOOSTER_OPENED then
... if pack_set ~= "Joker" then
send_response({ message = "Can only sell jokers when a Buffoon pack is open", ... })
The game has no such restriction. Card:can_sell_card (card.lua:1896 in the dump) only checks area.config.type == joker — and G.consumeables is created with type = 'joker' (game.lua:2291), so jokers and consumables are sellable during any pack type. Freeing a slot before picking from a pack is intended gameplay.
Fix
use.lua: addG.STATES.SMODS_BOOSTER_OPENEDtorequires_state. Existingmax_highlightedtarget logic already matches the game. Hand-target consumables only apply when the pack exposes a hand (draw_handpacks — same conditionrearrange.lua:88-89already uses).sell.lua: remove the Buffoon-only guard; keep the universalcan_sell_cardchecks (not during play, not eternal).
Both gaps are untested — test_sell.py has no SMODS_BOOSTER_OPENED cases; test_use.py asserts NOT_ALLOWED in states the game permits.
Ref: #156 (subset — sell joker in Buffoon pack)
- 主要言語
- Python
- スター
- 80
- フォーク
- 23
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/balatrobot のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
coder/balatrobot#244 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
coder/balatrobot#243 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
coder/balatrobot#235 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
coder/balatrobot#234 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
coder/balatrobot#233 ·
coder/balatrobot の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:docs documentation effort:M ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mczielinski/ob-analytics#423 ·
メンテナーはふだん 1 日以内に返信
-
infra
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
vllm-project/vllm-ascend#21033 ·
メンテナーはふだん 1 日以内に返信