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):

FieldStarts atRole
ship.luck0Flat 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.luckMult0Multiplier 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]):

RarityBase weightMult_LUCK_BIAS
common501.0×0
uncommon301.25×0.01
rare151.5×0.02
epic41.75×0.03
legendary12.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

RarityWeight = base × (1 + 50 × bias)
common50 × 1.00 = 50.0
uncommon30 × 1.50 = 45.0
rare15 × 2.00 = 30.0
epic4 × 2.50 = 10.0
legendary1 × 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, rarity common
  • Max level: 20
  • Effect: { stat: 'luckMult', mode: 'flat', base: 0.10, perLevel: 0, k: -1 } — flat +0.10 per rank to ship.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:

ArtifactTrigger archetype
crate_busterCrate broken
killstreak_rainKill-streak milestone
bloodlustKill-streak milestone
refreshVarious
event_rewardEvent resolved
caretakerplayer_healed
lodestoneCrate broken
hunterweapon_fire counter

Burst +luck on trigger

These artifacts apply a temporary +luck buff via modify_stat when their signal fires:

ArtifactTriggerTier 1 → Tier 4 luckBonusDuration
caretakerplayer_healed30 / 45 / 65 / 908–15s
bloodlustKill-streak milestone60 / 90 / 130 / 18015–20s
lodestoneCrate breaks40 / 60 / 90 / 13010–18s
hunterEvery N shots fired (50→30)50 / 75 / 110 / 1606–10s
absorption_barrierSurvive timer seconds without damage35 / 50 / 70 / 100until 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.