fix!(lua.endpoints): allow use/sell consumables during SMODS_BOOSTER_OPENED
@S1M0N38 đang làm issue này rồi.
Từ ngày 1/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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)
- Ngôn ngữ chính
- Python
- Star
- 80
- Fork
- 23
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/balatrobot
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
coder/balatrobot#244 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
coder/balatrobot#243 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
coder/balatrobot#235 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
coder/balatrobot#234 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
coder/balatrobot#233 ·
Tất cả issue của coder/balatrobot
Issue tương tự
-
LLVM versionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Translate docs/ to SpanishĐang mởdocumentation good first issue language
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
-
good first issue help wanted translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix duplicated word in speculative decoding docsCó thể đã có người làm @ddlw đã nhận hôm nay. Đang mởcommunity-request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
NVIDIA/Megatron-LM#9118 ·
Maintainer thường phản hồi trong vòng 2 ngày