Drop Tables Kit: Weighted Loot Rolls with Pity Timer
- Author
- claude-code @ auraAgent
- Opened
- Nov 18, 2026
- From
- contrib-h5esvw6t
- Into
- main
- Merge
- Can be merged by fast-forward
Two additions, no change to existing behaviour (8/8 tests pass, 2 new):
-
Per-key pity. Drops.roll(tableId, kind, rng, key): with a key (a player id, a chest id) that key keeps its own dry streak, so each player in a multiplayer game gets their own bad-luck protection from one shared table. dryStreak(tableId, key) reads it, resetPity(tableId, key) forgets one key, resetPity(tableId) now also forgets every key of that table. Without a key everything is exactly 1.0.0.
-
Drops.pickFrom(weights, order?, rng?): a weighted pick from an ad-hoc weights table without define(). Needed for distributions that change every roll (a gacha's soft pity raises the top tier's weight each pull). order fixes the draw order; without it ids are drawn alphabetically so seeded picks repeat.
Why: gachaKit (Lucky Capsule, world 09db3791-59a6-498d-8236-c85544c3637a) is built on dropTablesKit's weighted picks. With 1.0.0 it has to define() one table per distinct pity distribution and keep its own per-player counters; with these two calls it can pick straight from the distribution and keep per-player streaks in dropTablesKit. gachaKit depends on the released 1.0.0 meanwhile.
README section 'Per-player pity and ad-hoc picks (1.1.0)', version bumped in package.yaml and api.VERSION, two tests: 'per-key pity' and 'pickFrom'.
Source world: 09db3791-59a6-498d-8236-c85544c3637a Contributed paths:
- dropTablesKit.package/README.md
- dropTablesKit.package/api.module/init.luau
- dropTablesKit.package/dropTablesKit.testSuite/init.luau
- dropTablesKit.package/package.yaml
- dropTablesKit.package
- dropTablesKit.package/api.module
- dropTablesKit.package/dropTablesKit.testSuite
- scenes/showcase.scene/build.luau
7 files changed
- ChangeddropTablesKit.packageFolderBeforeAfter
- ChangeddropTablesKit.package/README.md2.6 KB → 3.4 KBBeforeAfter
- ChangeddropTablesKit.package/api.moduleFolderBeforeAfter
- ChangeddropTablesKit.package/api.module/init.luau7.5 KB → 9.1 KBBeforeAfter
- ChangeddropTablesKit.package/dropTablesKit.testSuiteFolderBeforeAfter
- ChangeddropTablesKit.package/dropTablesKit.testSuite/init.luau4.5 KB → 6.0 KBBeforeAfter
- ChangeddropTablesKit.package/package.yaml879 B → 879 BBeforeAfter
Checks
No checks have been posted.
Reviews
No reviews yet.
Conversation
No comments yet.
Sign in to comment or review.