Answer the fuse button: advise on fusions when Fusion Jokers is installed

Hovering a joker that is a fusion component now names the fusion it feeds,
its cost with discounts applied, and what is still missing. In the shop the
card is counted as if already bought, so it answers the buy-side question
("Buy to fuse into Diamond Bard ($12 to fuse)") instead of restating what
you already own.

The line worth having is the last one. Fusing CONSUMES its components --
fuse_card calls ingredient:remove() -- so every combo those jokers held with
the rest of the board dies with them, and the FUSE button cannot tell you
that. "Fusing drops combos with: Smeared" is computed from the surviving
board, and a component being spent is not counted as a loss.

Three things about their code shaped this:

  * Card:get_card_fusion() would have answered most of it, but it drives its
    price flicker with math.randomseed(love.timer.getTime() * 8). An advisor
    reseeding Lua's RNG on every hover has no business doing that, so this
    reads FusionJokers.fusions directly and mirrors their discount arithmetic
    (flat then percentage, per-result and universal, floored, min $1).
  * Recipes take repeated components -- their own debug fusion needs 3x Joker
    -- so components are counted by quantity, not presence.
  * Affordability is judged only on plain numbers: Fusion Jokers uses to_big,
    and Talisman turns G.GAME.dollars into an object. Guessing wrong about
    someone's money is worse than staying quiet, so the money line just
    does not appear.

Ownership is board membership, not card.area, matching copy_source and
dagger_victim -- the area pointer answers differently for the same card
depending on who built it.

Verified against the shipped recipe table: all 15 resolve at the right cost,
and all 30 components are jokers the database already knows. Not installed
means silence, like every other integration.

918 tests pass on 5.4 and LuaJIT (31 new), and 18/18 in the real game.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-22 15:16:14 -07:00
parent c479f7854d
commit 319f79bc5d
6 changed files with 426 additions and 1 deletions
+18
View File
@@ -92,6 +92,24 @@ In-game: **Mods > Combo Advisor > Config**. Changes persist across sessions.
Defaults live in `config.lua`.
## Works with other mods
Each integration gates on the other mod's presence — if it isn't installed,
nothing happens and nothing is logged.
- **[Fusion Jokers](https://github.com/wingedcatgirl/Fusion-Jokers)** — hover
any joker that is a fusion component and the advisor names the fusion it
feeds, its cost (discounts included), and what you are still missing:
*"Fuses into Diamond Bard ($12) — still needs Rough Gem"*. In the shop it
answers the buy-side question instead: *"Buy to fuse into Diamond Bard
($12 to fuse)"*. Because fusing **consumes** its components, a ready fusion
also tells you what you'd give up — *"Fusing drops combos with: Smeared"*
which is the one thing the FUSE button can't tell you itself.
- **[JokerDisplay](https://github.nh6574.com/JokerDisplay)** — a live
`(2 combos)` counter under every joker, toggleable in the config tab.
- **Too Many Jokers** — its collection search also matches synergy tags, so you
can search for `money`, `Hearts`, or `held-card retriggers`.
## Installation
1. Install [Lovely](https://github.com/ethangreen-dev/lovely-injector) and