Back to Pickle Rustlers
SOURCE / PINNED RELEASE

Made of little things.

Pickle Rustlers

Release
039e51f55e34…
Author-recorded commit
40608586a8a1…
License
LICENSE
Author’s source reference
nostr://npub12lm3rxsva8kfempyjkxupt09e02n3fezurkyadyqfejdc5e0r2kscqty6r/wss%3A%2F%2Fgit.napplet.soy%2F/n-bad44e7ab35

Archive hash verified: f38e99afa0992052…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/game/levels.ts
// The campaign: five days, each with its own twist, ending with the Onion King.
// After the victory screen, "Keep riding" continues into endless days.

export interface Level {
  name: string;
  blurb: string;
  quota: number;
  dayLength: number;
  startOnions: number;
  onionCap: number;
  spawnEvery: number; // seconds between onion arrivals (randomized ±30%)
  sizeMix: [number, number, number]; // chance of small / medium / big onions
  onionSpeed: number; // added to the base walking speed
  goldenChance: number;
  enemyTank: boolean;
  dust: boolean;
  boss: boolean;
}

export const LEVELS: Level[] = [
  {
    name: 'High Noon',
    blurb: 'Rope the pickles and drag them to the Giant Jar.',
    quota: 6,
    dayLength: 110,
    startOnions: 2,
    onionCap: 6,
    spawnEvery: 5.5,
    sizeMix: [0.3, 0.55, 0.15],
    onionSpeed: 0,
    goldenChance: 0.12,
    enemyTank: false,
    dust: false,
    boss: false,
  },
  {
    name: 'Onion Stampede',
    blurb: 'The onions are multiplying. Peel fast, ride faster.',
    quota: 8,
    dayLength: 110,
    startOnions: 5,
    onionCap: 12,
    spawnEvery: 3.2,
    sizeMix: [0.25, 0.45, 0.3],
    onionSpeed: 0.8,
    goldenChance: 0.12,
    enemyTank: false,
    dust: false,
    boss: false,
  },
  {
    name: 'Iron Onion',
    blurb: 'The onions stole a tank. Watch for the red rings.',
    quota: 9,
    dayLength: 115,
    startOnions: 4,
    onionCap: 12,
    spawnEvery: 3.4,
    sizeMix: [0.2, 0.45, 0.35],
    onionSpeed: 1,
    goldenChance: 0.12,
    enemyTank: true,
    dust: false,
    boss: false,
  },
  {
    name: 'Dust Devil',
    blurb: 'A dust storm rolls in. Follow the beams home.',
    quota: 10,
    dayLength: 120,
    startOnions: 5,
    onionCap: 14,
    spawnEvery: 3,
    sizeMix: [0.25, 0.4, 0.35],
    onionSpeed: 1.2,
    goldenChance: 0.22,
    enemyTank: false,
    dust: true,
    boss: false,
  },
  {
    name: 'The Onion King',
    blurb: 'Peel the Onion King AND brine 8 pickles to save the West.',
    quota: 8,
    dayLength: 150,
    startOnions: 3,
    onionCap: 10,
    spawnEvery: 4.5,
    sizeMix: [0.4, 0.4, 0.2],
    onionSpeed: 1.2,
    goldenChance: 0.15,
    enemyTank: false,
    dust: false,
    boss: true,
  },
];

export const CAMPAIGN_DAYS = LEVELS.length;

/** Day 1..5 are the campaign; later days are endless encores that keep ramping up. */
export function levelFor(day: number): Level {
  if (day <= CAMPAIGN_DAYS) return LEVELS[day - 1];
  const extra = day - CAMPAIGN_DAYS;
  return {
    name: `Encore ${extra}`,
    blurb: extra % 2 ? 'The onions want a rematch, and they brought the tank.' : 'Another dust storm. Another stampede.',
    quota: Math.min(16, 10 + extra),
    dayLength: 120,
    startOnions: 5 + extra,
    onionCap: Math.min(22, 14 + extra * 2),
    spawnEvery: Math.max(1.4, 3 - extra * 0.25),
    sizeMix: [0.2, 0.4, 0.4],
    onionSpeed: Math.min(3, 1.4 + extra * 0.25),
    goldenChance: 0.15,
    enemyTank: extra % 2 === 1,
    dust: extra % 2 === 0,
    boss: false,
  };
}