tier(id: string, name: string, short: string, color: string, glow: string, rate: number) → any
| arg | type | description |
|---|
| id | string | |
| name | string | |
| short | string | |
| color | string | |
| glow | string | |
| rate | number | |
style(id: string?) → any
| arg | type | description |
|---|
| id | string? | |
normalize(def: any) → any
A banner definition checked and filled with defaults. Errors name the field that is wrong.
luckRates(b: any, luck: number) → void
The tier rates (percent, by rank) at luck level `luck`. The documented formula: with step s (the banner's `luck.perLevel`, 0.10 unless set) and L = luck (clamped to 0..`luck.max`, 10 unless set), every tier of rank r above the lowest gets its rate times (1 + s * L * (r - 1) / (T - 1)), T the number of tiers, so the top tier gains s * L of its rate (luck 5 at 0.10: x1.5) and each tier below it a proportional part; the lowest tier takes what is left so the rates still sum to 100. If the raised tiers would pass 100 they are scaled down to sum 100 and the lowest tier gets 0.
| arg | type | description |
|---|
| b | any | |
| luck | number | |
withLuck(b: any, luck: number?) → any
The banner as a player with luck level `luck` pulls it: the same banner with its tier rates from luckRates (made once per level). Luck 0 is the banner itself.
| arg | type | description |
|---|
| b | any | |
| luck | number? | |
topChance(b: any, k: number) → number
The top tier's chance (0..1) on pull number k since the last top tier: the base rate, raised by `ramp` points per pull from `soft`, and 1 at `hard`.
| arg | type | description |
|---|
| b | any | |
| k | number | |
caseOf(b: any, state: any) → void
which distinct distribution a state falls in: k (clamped to the region where it
stops changing) and whether the guarantee is due
| arg | type | description |
|---|
| b | any | |
| state | any | |
tierDist(b: any, state: any) → void
The chance (0..1) of every tier on the next pull, as an array by tier rank, for a player whose counters are `state` ({ c, g }).
| arg | type | description |
|---|
| b | any | |
| state | any | |
itemDist(b: any, tierId: string) → void
Each item's share (0..1) of a tier, by item id.
| arg | type | description |
|---|
| b | any | |
| tierId | string | |
step(b: any, state: any, rank: number) → any
The pity counters after a pull of tier rank `rank`.
| arg | type | description |
|---|
| b | any | |
| state | any | |
| rank | number | |
effective(b: any) → any
The long-run share (0..1) of every tier and item over endless pulls with pity and the guarantee in play: { tiers = { [tierId] = p }, items = { [item] = p }, top = p, meanToTop = pulls }. Exact, not a simulation: a top-tier result resets both counters, so pulls fall into cycles that each start fresh, and each tier's long-run share is its expected count in one cycle over the expected cycle length.
topWithin(b: any, c: number, n: number) → number
The chance (0..1) that the top tier comes within the next `n` pulls for a player whose counter is `c` (the guarantee does not change the top tier's chance).
| arg | type | description |
|---|
| b | any | |
| c | number | |
| n | number | |
pullsToHard(b: any, c: number) → number
Pulls left until the top tier is certain (hard pity), or nil when the banner has none.
| arg | type | description |
|---|
| b | any | |
| c | number | |
tableFor(b: any, key: string, weights: { [string]: number }, order: { string }) → string
| arg | type | description |
|---|
| b | any | |
| key | string | |
| weights | { [string]: number } | |
| order | { string } | |
roll(b: any, state: any, rng: () → void
One pull for a player in `state`: picks the tier from tierDist and the item from that tier's weights, both through dropTablesKit. `rng` returns 0..1. Returns tier id, item id, tier rank.
| arg | type | description |
|---|
| b | any | |
| state | any | |
| rng | ( | |
pct(p: number) → string
A percentage as the odds panel writes it: enough digits that no rate reads as 0.
| arg | type | description |
|---|
| p | number | |
rules(b: any) → void
The banner's pity rules in plain words, one line each.
⌬ Types
Tier = { id: string, name: string, short: string, color: string, glow: string, rate: number, rank: number }Style = { id: string, name: string, tiers: { Tier } }