fix!(lua.endpoints): allow use/sell consumables during SMODS_BOOSTER_OPENED
@S1M0N38 ya está trabajando en esto.
Desde el 1/7/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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)
- Lenguaje dominante
- Python
- Estrellas
- 80
- Forks
- 23
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/balatrobot
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coder/balatrobot#244 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coder/balatrobot#243 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
coder/balatrobot#235 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
coder/balatrobot#234 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
coder/balatrobot#233 ·
Todos los issues de coder/balatrobot
Issues similares
-
fuzz fuzz-unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
neilsh/stunt-reel#220 ·
Los mantenedores suelen responder en 1 día
-
[Issue]: use_fp4_cache is accepted but ignored; the launcher always writes FP8 recordsPosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: cli priority: p3 size: S type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
finos/open-resource-broker#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 6 días