Luck Stat
Luck tilts the level-up reward rarity roll toward higher tiers. It does not affect XP gain, pickup magnetism, weapon damage, or any other roll outside the level-up card selection — only the rarity weights on _rollRarity in engine/world/leveling.ts.
Higher luck shifts probability mass off common and onto uncommon / rare / epic / legendary, with the strongest pull toward legendary.
Stat shape on the ship
Two fields on ship cooperate (engine/core/state.ts:300-301):
| Field | Starts at | Role |
|---|---|---|
ship.luck | 0 | Flat base luck. Set by artifact triggers (Caretaker, Bloodlust, Hunter, Lodestone, Absorption Barrier, etc.) granting a numeric bonus like +30, +90, +160. Also accumulates from the Luck modifier’s passive flat additions via the artifact flat-bonus system. |
ship.luckMult | 0 | Multiplier on top of luck. The Luck modifier (data/modifiers.ts) pumps this stat: +0.10 per rank, capped at 20 ranks → +2.00 additive at L20 (+200%). |
The roll uses the combined value:
effectiveLuck = ship.luck * (1 + ship.luckMult)
So luckMult only does anything once ship.luck > 0. A run with the Luck modifier maxed but no luck-granting artifacts active gets effectiveLuck = 0 * (1 + 2) = 0 — same baseline as no luck at all. The modifier amplifies a base; it doesn’t create one.
How luck shifts the rarity roll
_rollRarity() in engine/world/leveling.ts:171-191 multiplies each rarity’s base weight by (1 + effectiveLuck * _LUCK_BIAS[i]):
| Rarity | Base weight | Mult | _LUCK_BIAS |
|---|---|---|---|
| common | 50 | 1.0× | 0 |
| uncommon | 30 | 1.25× | 0.01 |
| rare | 15 | 1.5× | 0.02 |
| epic | 4 | 1.75× | 0.03 |
| legendary | 1 | 2.0× | 0.04 |
common is always weight-50 — luck never starves it. The other four scale faster per point of effective luck, with legendary scaling fastest (4× the rate of uncommon). This is intentional so that stacking luck has a visible legendary payoff rather than just inflating uncommons.
Example: effectiveLuck = 50
| Rarity | Weight = base × (1 + 50 × bias) |
|---|---|
| common | 50 × 1.00 = 50.0 |
| uncommon | 30 × 1.50 = 45.0 |
| rare | 15 × 2.00 = 30.0 |
| epic | 4 × 2.50 = 10.0 |
| legendary | 1 × 3.00 = 3.0 |
Total weight 138.0 (vs 100 baseline). Legendary share goes from 1% → ~2.2%; common share drops from 50% → ~36%.
The Luck modifier
data/modifiers.ts:268-282:
- ID:
luck - Icon: 🎲
- Category:
utility, raritycommon - Max level: 20
- Effect:
{ stat: 'luckMult', mode: 'flat', base: 0.10, perLevel: 0, k: -1 }— flat+0.10per rank toship.luckMult. At L20 that’s+2.00(+200%additive). - Description: “Better odds of rare level-up cards”
luckMult is in _FLAT_AS_PERCENT_STATS (engine/world/leveling.ts:211) so reward cards display rank gains as percentages (e.g. +10%).
Artifacts that grant luck
The flat ship.luck base comes from artifacts. Every artifact has a passive flat-bonus stat (ARTIFACT_FLAT_BONUSES in data/artifacts/index.ts) and most luck-themed artifacts also fire a modify_stat action on their trigger to spike ship.luck for a duration.
Passive flat-bonus → luck
These artifacts contribute flat luck just by being equipped:
| Artifact | Trigger archetype |
|---|---|
crate_buster | Crate broken |
killstreak_rain | Kill-streak milestone |
bloodlust | Kill-streak milestone |
refresh | Various |
event_reward | Event resolved |
caretaker | player_healed |
lodestone | Crate broken |
hunter | weapon_fire counter |
Burst +luck on trigger
These artifacts apply a temporary +luck buff via modify_stat when their signal fires:
| Artifact | Trigger | Tier 1 → Tier 4 luckBonus | Duration |
|---|---|---|---|
caretaker | player_healed | 30 / 45 / 65 / 90 | 8–15s |
bloodlust | Kill-streak milestone | 60 / 90 / 130 / 180 | 15–20s |
lodestone | Crate breaks | 40 / 60 / 90 / 130 | 10–18s |
hunter | Every N shots fired (50→30) | 50 / 75 / 110 / 160 | 6–10s |
absorption_barrier | Survive timer seconds without damage | 35 / 50 / 70 / 100 | until hit |
The modify_stat calls all target stat: 'luck' in flat mode, so they stack additively with each other and with the passive flat-bonus on the same artifact. stacking: 'refresh' + maxStacks: 1 on most of them means re-triggering refreshes the duration rather than stacking new instances of the same source.
What luck does not affect
- Pickup magnet range (uses
ship.magnetRange) - XP gain per warp crystal (uses
ship.xpGainMult) - Weapon damage, fire rate, crit, anything in the fire pipeline
- Affix roll pools / affix drop tables
- Boss / event spawn odds
- Crate contents
Luck is strictly a level-up card rarity tilt. Every other “rarity” or “odds” system in the game uses its own roll function.
Related
gameplay/concepts/rarity-tints.md— how rarity colors map to multsgameplay/concepts/pity-system.md— separate system for gacha pulls (not affected by luck)engine/world/leveling.ts—_rollRarity()and_LUCK_BIASdata/modifiers.ts— Luck modifier definitiondata/artifacts/— Caretaker, Bloodlust, Lodestone, Hunter, Absorption Barrier