Files
TheLadder/content/corporateladder/events/routine.js
T
JesseMarkowitzandClaude Opus 5 1d4ac0fdbd Add the Corporate Ladder pack, and two engine features it needed
Seventeen events across the mailroom: ordinary days, Marlene Hobb and Trevor
Pike, a misrouted envelope that can be delivered or kept, and a hard-times
branch that fires on negative money and always leaves an ungated way out.

Writing real content turned up two things the engine could not express.

Per-turn upkeep (`pack.upkeep`): the MVP spec wants recurring income and costs,
but effects only run when a player chooses something, and baking wages into
every option would be tedious and easy to get wrong. Upkeep entries carry their
own conditions, which turned out to be enough for the loan service charge to be
a three-step function that escalates with the size of the debt — no multiply
operation, no engine change. Upkeep changes are recorded separately from choice
changes so the UI can distinguish them.

Per-character starting relationships: Trevor starts below the pack default on
`likes_you` because he arrived two weeks earlier and has priced that in.
Characterisation as data rather than as an opening cutscene. Nobody starts
feared, either — `fears_you` defaults to 10, since a midpoint default would mean
every new hire arrives already intimidating.

The content suite plays 60 seeded runs and asserts every event fires and every
option is taken at least once. That caught real dead content: Trevor's favour
chain sat behind a gate no plausible player could reach, taking two events and a
hard-times escape route with it, and debt could pass 5,500 while the service
charge stayed flat, so the failure spiral flattened out instead of tightening.
Both fixed in the data — the gate softened and given another route up, the loan
capped and its charge tiered.

The validator also gained a real fix: it counted an event with a cooldown as a
stage's fallback, but a cooldown can exclude it, so a stage could still run dry.

86 tests. Reasoning in docs/DECISIONS.md §11-13, including the seeding trap that
makes a correlated chooser look exactly like a content bug.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMSFHyVPitUoosW5wyEADj
2026-09-09 21:58:20 -04:00

350 lines
12 KiB
JavaScript

// Ordinary days in the mailroom.
//
// The first three carry no conditions, no cooldown and no `once`, which makes
// them the stage's floor: whatever else is excluded, there is always a turn to
// play. Everything else in the pack leans on that.
export const routine = [
{
id: 'first_day',
stage: 'mailroom',
weight: 99999,
once: true,
description:
'Marlene Hobb hands you a laminated card with the org chart on it. Your ' +
'name is not on the card. She says it will be, eventually, in pen.',
options: [
{
id: 'listen',
label: 'Ask her to walk you through it.',
result: 'She walks you through it. Then she walks you through it again.',
effects: [
{ path: 'skills.negotiation', op: 'add', value: 2 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 4 },
{ path: 'notable', op: 'push', value: 'Let Marlene explain the org chart. Twice.' },
],
},
{
id: 'wing_it',
label: "Say you'll pick it up as you go.",
result: 'She puts the card back in her pocket without comment.',
effects: [
{ path: 'skills.logistics', op: 'add', value: 2 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: -2 },
],
},
{
id: 'ask_trevor',
label: 'Ask Trevor where you actually sit.',
result:
'He shows you a desk, then mentions he has been here two weeks longer ' +
'than you. This will not be the last time.',
effects: [
{ path: 'relationships.trevor.likes_you', op: 'add', value: 3 },
{ path: 'relationships.trevor.wants_to_help_you', op: 'add', value: 2 },
],
},
],
},
{
id: 'mail_cart',
stage: 'mailroom',
weight: 100,
description:
"The mail cart's left front wheel has developed a shriek. Facilities has " +
'classified it as "cosmetic."',
options: [
{
id: 'push',
label: "Push it anyway. Everyone will know you're coming.",
result: 'By Thursday, two floors can time their morning by you.',
effects: [
{ path: 'skills.logistics', op: 'add', value: 1 },
{ path: 'reputation', op: 'add', value: -2 },
],
},
{
id: 'requisition',
label: 'Spend the morning on a requisition form.',
result:
'The form requires the cart\'s asset number. The asset number is on the ' +
'wheel. You fill it in from underneath.',
effects: [
{ path: 'skills.negotiation', op: 'add', value: 2 },
{ path: 'skills.logistics', op: 'add', value: 1 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 1 },
],
},
{
id: 'swap',
label: 'Swap it with the good cart from the third floor.',
result: 'The third floor has no way of proving anything. They try anyway.',
effects: [
{ path: 'skills.logistics', op: 'add', value: 3 },
{ path: 'reputation', op: 'add', value: -3 },
{ path: 'relationships.trevor.fears_you', op: 'add', value: 3 },
],
},
],
},
{
id: 'sorting_backlog',
stage: 'mailroom',
weight: 100,
description:
'Two bins came in overnight and neither is labelled. Trevor has decided ' +
'this is a good day to reorganise his desk.',
options: [
{
id: 'grind',
label: 'Sort both bins yourself.',
result: 'It takes until four. Marlene notices, which is the point.',
effects: [
{ path: 'skills.logistics', op: 'add', value: 3 },
{ path: 'reputation', op: 'add', value: 2 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 3 },
// Trevor's bin got sorted too, and he is not too proud to notice.
{ path: 'relationships.trevor.likes_you', op: 'add', value: 2 },
],
},
{
id: 'split',
label: 'Ask Trevor to take one.',
requires: [{ path: 'skills.negotiation', op: '>=', value: 15 }],
result: 'He takes one. He takes the lighter one, but he takes one.',
effects: [
{ path: 'skills.negotiation', op: 'add', value: 2 },
{ path: 'skills.logistics', op: 'add', value: 1 },
{ path: 'relationships.trevor.likes_you', op: 'add', value: -2 },
],
},
{
id: 'halfway',
label: 'Sort what fits before lunch and leave the rest.',
result: 'The rest is still there on Monday, and so are you.',
effects: [
{ path: 'reputation', op: 'add', value: -2 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: -2 },
],
},
],
},
{
id: 'franking_machine',
stage: 'mailroom',
weight: 70,
description:
'The franking machine is making a noise it has not made before. The manual ' +
'is in a drawer that is locked, and the key is a subject nobody will be ' +
'drawn on.',
options: [
{
id: 'fix',
label: 'Take the panel off and have a look.',
requires: [{ path: 'skills.logistics', op: '>=', value: 20 }],
result: 'It was a spring. It is now a spring in the right place.',
effects: [
{ path: 'skills.logistics', op: 'add', value: 3 },
{ path: 'reputation', op: 'add', value: 4 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 3 },
{
path: 'notable',
op: 'push',
value: 'Fixed the franking machine, which nobody had managed since 2019.',
},
],
},
{
id: 'cycle',
label: 'Turn it off and on.',
result: 'The noise stops. Nothing has been learned by anyone.',
effects: [{ path: 'skills.logistics', op: 'add', value: 1 }],
},
{
id: 'escalate',
label: 'Log it with Facilities and wait.',
result: 'Facilities classifies it as cosmetic.',
effects: [
{ path: 'skills.negotiation', op: 'add', value: 1 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: -1 },
],
},
],
},
{
id: 'birthday_card',
stage: 'mailroom',
weight: 45,
cooldown: 5,
description:
'A card is going round for someone on the fourth floor. You have never met ' +
'them. The envelope already has two twenties in it and your name is next ' +
'on the list.',
options: [
{
id: 'contribute',
label: 'Put something in.',
result: 'You are now a person who puts something in.',
effects: [
{ path: 'money', op: 'add', value: -20 },
{ path: 'reputation', op: 'add', value: 3 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 2 },
{ path: 'relationships.trevor.likes_you', op: 'add', value: 2 },
],
},
{
id: 'sign_only',
label: 'Sign it and pass it on.',
result: 'You write "all the best" and immediately regret the phrasing.',
effects: [{ path: 'reputation', op: 'add', value: -1 }],
},
{
id: 'pass',
label: 'Pass it on unsigned.',
result: 'Trevor checks the list. Trevor notices the list.',
effects: [
{ path: 'reputation', op: 'add', value: -3 },
{ path: 'relationships.trevor.likes_you', op: 'add', value: -2 },
],
},
],
},
{
id: 'elevator',
stage: 'mailroom',
weight: 30,
cooldown: 10,
description:
'You are alone in the elevator with a man whose name is on the quarterly. ' +
'He looks at your cart. He asks how long the mail takes to get to eleven.',
options: [
{
id: 'honest',
label: 'Tell him the truth: forty minutes, on a good day.',
result: 'He says "forty" once, to himself, and gets out on nine.',
effects: [
{ path: 'reputation', op: 'add', value: 5 },
{ path: 'skills.negotiation', op: 'add', value: 2 },
{
path: 'notable',
op: 'push',
value: 'Told an executive the truth about the eleventh floor.',
},
],
},
{
id: 'optimistic',
label: 'Tell him twenty.',
result: 'He seems pleased. Somebody, eventually, will have to make it twenty.',
effects: [
{ path: 'reputation', op: 'add', value: -3 },
{ path: 'skills.negotiation', op: 'add', value: 1 },
],
},
{
id: 'unsure',
label: "Say you're not sure.",
result: 'The rest of the ride is four floors long.',
effects: [{ path: 'reputation', op: 'add', value: -1 }],
},
],
},
{
id: 'overtime_week',
stage: 'mailroom',
weight: 40,
cooldown: 7,
description:
'There is a weekend inventory. It pays. Marlene mentions it in the tone of ' +
'someone who has been told to mention it.',
options: [
{
id: 'take',
label: 'Take the shift.',
result: 'Two days of counting things that were already counted.',
effects: [
{ path: 'money', op: 'add', value: 180 },
{ path: 'skills.logistics', op: 'add', value: 2 },
{ path: 'reputation', op: 'add', value: 2 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: 2 },
],
},
{
id: 'negotiate',
label: 'Take it, for a bit more.',
requires: [{ path: 'skills.negotiation', op: '>=', value: 30 }],
result:
'Marlene does not enjoy the conversation, but she does have the ' +
'authority, and you both find that out at the same time.',
effects: [
{ path: 'money', op: 'add', value: 260 },
{ path: 'skills.negotiation', op: 'add', value: 3 },
{ path: 'relationships.marlene.likes_you', op: 'add', value: -1 },
{
path: 'notable',
op: 'push',
value: 'Negotiated a better rate for the weekend inventory.',
},
],
},
{
id: 'decline',
label: 'Pass.',
result: 'You have a weekend. It is the only one anyone gets.',
effects: [],
},
],
},
{
id: 'promotion_rumor',
stage: 'mailroom',
weight: 25,
cooldown: 12,
requires: [{ path: 'turn', op: '>=', value: 30 }],
description:
'There is a post going in Dispatch. Trevor has heard about it. Trevor ' +
'mentions that he has heard about it.',
options: [
{
id: 'ask_marlene',
label: 'Ask Marlene to put your name forward.',
requires: [{ path: 'relationships.marlene.wants_to_help_you', op: '>=', value: 60 }],
result: 'She says she will see. From Marlene this is close to a contract.',
effects: [
{ path: 'reputation', op: 'add', value: 5 },
{ path: 'relationships.marlene.wants_to_help_you', op: 'add', value: -5 },
{
path: 'notable',
op: 'push',
value: 'Asked Marlene to put your name forward for Dispatch.',
},
],
},
{
id: 'ask_around',
label: 'Ask around on your own.',
result: 'You learn the post has been open for eleven months.',
effects: [
{ path: 'skills.negotiation', op: 'add', value: 3 },
{ path: 'reputation', op: 'add', value: 2 },
],
},
{
id: 'ignore',
label: 'Stay where you are for now.',
result: 'Trevor mentions it again on Thursday.',
effects: [],
},
],
},
];
export default routine;