Skip to content

Hidden consumables polling functions#1193

Open
nh6574 wants to merge 4 commits intoSteamodded:mainfrom
nh6574:pollsoul
Open

Hidden consumables polling functions#1193
nh6574 wants to merge 4 commits intoSteamodded:mainfrom
nh6574:pollsoul

Conversation

@nh6574
Copy link
Contributor

@nh6574 nh6574 commented Feb 4, 2026

Adds SMODS.poll_soul(args), function to poll hidden consumables that returns the key, can return nil if none is selected. It takes the following arguments:

  • set: string set to check if the hidden consumable should replace.
  • key?: string random seed key
  • mod?: number multiplies the hidden consumable rates
  • guaranteed?: boolean always returns a key (if there's a valid consumable)
  • allow_duplicates?: boolean act as if Showman is present
  • ignore_vanilla?: boolean ignores Soul and Black Hole

Also SMODS.get_soul_rate(consumable, set) that gets the rate of a given consumable (0 if none, nil if invalid). Which also uses G.GAME.soul_mod to modify the rate globally.

Consumables now additionally take a table of sets for soul_set and a function for soul_rate.

As a bonus, now modded hidden consumables can appear even if The Soul is banned (and respect their own bans).

There's some weird jank around Soul and Black Hole that I decided not to touch much to not mess with vanilla functionality so they don't follow the same logic as the rest (hence ignore_vanilla). I'm also bad at math at 1 AM so I might have messed with some of the rate calculations in a way I don't realize.

Additional Info:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

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