Skip to content

Chocolate Die grand fix - #925

Open
Nanuzer0 wants to merge 7 commits into
SpectralPack:mainfrom
Nanuzer0:fix_chocodie
Open

Chocolate Die grand fix#925
Nanuzer0 wants to merge 7 commits into
SpectralPack:mainfrom
Nanuzer0:fix_chocodie

Conversation

@Nanuzer0

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR comprehensively fixes, restores, and polishes Chocolate Die, its events, and associated items/stickers.


Chocolate Die (j_cry_chocolate_dice)

  • Restored Roll Range: Restored roll range from [2, 10] to [1, 10] to re-enable Event 1.
  • Nil Safety: Added safety guards when initializing, starting, and finishing events on round transitions.
  • Event List Tooltip Cleanup (choco0): Temporarily commented out the unfinished choco0 ("Possible Events") tooltip box for now (due to Balatro engine limitations with interactive sub-tooltips on hover). Preserved the code in comments so a custom UI can re-enable it in the future.

Event 1: Ghostly Possession, Ghost Joker (j_cry_ghost), & Possessed Sticker (cry_possessed)

  • Re-enabled: Uncommented and re-enabled Event 1, Ghost Joker, and the Possessed sticker.
  • Ghost Tooltip & Probability Crash: Fixed variable order and missing probability parameters in j_cry_ghost:loc_vars.
  • Dissolution Loop Crash: Iterated backwards (for i = #G.jokers.cards, 1, -1 do) when Ghost self-destructs with possessed Jokers to prevent table indexing crashes.
  • Possessed Sticker Scoring Crash: Fixed Card:calculate_joker where possessed cards called context.callback without checking if a callback was provided.
  • Sticker Lifecycle: Ensured cry_possessed sticker is properly applied and stripped during Ghost triggers.
  • Event 1 Tooltip Crash: Fixed choco1:loc_vars crash by referencing registered center G.P_CENTERS.j_cry_ghost.

Event 2: Haunted House

  • Blind Skipping: Fixed blind skip prevention to properly disable skip buttons during Small and Big Blinds.

Event 3: Witch's Brews

  • Potion RNG & Safety: Fixed potion generation RNG and ensured hand level reduction cannot drop hand levels below level 1.
  • Potion Tooltips: Fixed c_cry_potion info tooltip references.

Event 4: Lunar Abyss

  • Scoring Timing: Moved Mult division to context.final_scoring_step so Mult divides by the number of played face cards right after Jokers calculate.
  • UI Message: Centered the division announcement banner over played cards (G.play).
  • Face Card RNG: Fixed RNG key for Club face card conversions.

Event 5: Bloodsucker

  • Card Destruction: Switched to standard SMODS destruction return ({ remove = not SMODS.is_eternal(context.destroying_card) }) instead of manual dissolution event scheduling.

Event 6: Please Take One

  • Booster Opening: Added Cryptid.open_booster() helper and fixed trigger context (context.post_jokers and context.start_shop) so the free booster pack opens cleanly at the start of the shop without UI conflicts or double activations.

Event 7: Festive Atmosphere

  • Trigger Timing: Fixed shop trigger to context.post_jokers and context.start_shop to prevent duplicate shop triggers.

Event 8: Candy Rain

  • Trigger Timing: Fixed cash-out trigger to context.post_jokers and context.cash_out to prevent duplicate candy generation.

General Improvements & Cleanup

  • Removed obsolete lovely patches from spooky.toml.
  • Added nil guards and cleanup across event handlers.

fix event 6, fix double activation for some events, move booster pack activation to a separate function and remove a redundant patch
…olate Die

- Hide blind skip and tags on Small/Big blind UI when ev_cry_choco2 is active

- Hook G.FUNCS.skip_blind to prevent skipping via shortcuts

- Remove broken legacy regex patch from spooky.toml

- Add nil checks to chocolate_dice loc_vars, calculate, and remove_from_deck
- Fix redundant pseudoseed call in potion random_event generation

- Prevent hand levels from being reduced below Level 1

- Fix UI level text during potion level-down animation to display -1 instead of +1
- Fix mult division not applying
- Add a mult division message
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