Random & Mystery Awards

recipe random award

Random & Mystery Awards

A mystery award gives the player something unpredictable when they hit a special shot. Cade doesn’t have a dedicated “mystery” block — you build it from a scoring rule whose points is a random expression, using the formula functions backed by the noise generator.

A random points award

When the mystery scoop is hit, award a value somewhere in a range:

score "event" "mystery_award" {
  when    = device.mystery_scoop.activated
  points  = uniform(5000, 25000)
}

uniform(min, max) returns a value between the two bounds each time the rule fires. For a coarser “pick a tier” feel, roll a die and scale it:

score "event" "mystery_tier" {
  when    = device.mystery_scoop.activated
  points  = dice_roll(5) * 10000
}

Gating it

Most tables only light mystery sometimes. Add a condition so the award only pays when it’s qualified, and clear the flag afterward:

score "event" "mystery_award" {
  when      = device.mystery_scoop.activated
  condition = var.mystery_lit == true
  points    = uniform(5000, 25000)
  update {
    mystery_lit = false
  }
}

How it works

The random functions (rand(), uniform(), dice_roll(), and more) draw from Cade’s noise generator, which is deterministic — seed it and the same game replays identically, which makes random awards testable. For the full function list and seeding, see the Noise Generator. For how points and condition expressions are evaluated, see Writing Expressions.