// Scripted-encounter dialogue (design §4.3). These are the most rewritten strings
// in the project and the ones a content pass is most likely to ruin.
//
// The register, in order of importance:
//  - Nobody begs. Every one of these people is competent, has a plan, and is
//    offering you information rather than asking for mercy.
//  - The game never says which call was right. `admitNote`/`denyNote` land on the
//    verdict toast, so they report what happened next and stop. No verdict on the
//    player, no reassurance either — reassurance is a verdict wearing a smile.
//  - Dazza may judge freely. He is a character inside the fiction and he is wrong
//    constantly; that is not the game speaking.
//
// `afterMs` is measured from the moment the patron reaches the rope, not from the
// previous beat, so a skipped line cannot compress the ones after it.

export interface EncounterScript {
  /** Licence names to draw from — the same person, spelled a few different ways. */
  names: readonly string[];
  beats: readonly { readonly line: string; readonly afterMs: number }[];
  admitNote?: string;
  admitDazza?: string;
  denyNote?: string;
  denyDazza?: string;
}

export const ENCOUNTER_SCRIPTS: Record<string, EncounterScript> = {
  // She is not asking to party. She is asking for ninety seconds and a jacket,
  // and she already knows the stamp rule better than you do.
  grabHerMate: {
    names: ['Bec Doyle', 'Steph Vella', 'Aleisha Marsh'],
    beats: [
      { line: 'i was inside ten minutes ago. no stamp, i know.', afterMs: 0 },
      { line: "my mate's on a date in there thats gone bad. shes done the toilet text twice.", afterMs: 2200 },
      { line: "ninety seconds. i get her and her jacket and we're both gone.", afterMs: 4600 },
    ],
    // Reports the stamp, not the room: nothing here can see the clicker count,
    // and a note that asserts capacity is simply false half the time.
    admitNote: 'Back in without a stamp. Nothing on the door says she was ever inside.',
    admitDazza: 'the count and the clicker dont agree mate. i count from the office. i COUNT',
    denyNote: 'She waits under the awning across the road, then walks toward the taxi rank.',
  },

  // The dumped bloke. The tell is the over-explaining, not the swaying. He says
  // the title of the game and does not notice he said it.
  quietBeer: {
    names: ['Trent Petersen', 'Dylan Marsh', 'Cam Duffy'],
    beats: [
      { line: 'evening. just the one, then im off.', afterMs: 0 },
      { line: 'ive had two at the RSL. before you ask.', afterMs: 2100 },
      { line: 'no, no one with me. not tonight.', afterMs: 4400 },
      { line: 'one beer. thats the whole plan.', afterMs: 6600 },
    ],
    admitNote: 'Loose at the rope. Where it goes from here is between him and the bar.',
    admitDazza: 'theres a bloke at the end of the bar not drinking his drink. keep half an eye',
    denyNote: 'He says no dramas. He is at the kebab shop ten minutes later.',
  },

  // Seven years, and he has brought a hip flask to shout the bar staff with. He
  // tells you about it, which is the entire trap — you cannot un-know it.
  lastNight: {
    names: ['Warren Kowalski', 'Raymond Vella', 'Gary Duffy'],
    beats: [
      { line: 'last one, mate. flights booked. perth on thursday.', afterMs: 0 },
      { line: 'seven years ive been coming here. you knocked me back once, back in nineteen. fair enough too.', afterMs: 2400 },
      { line: 'i brought this for sue behind the bar. she reckons she wants a proper send off.', afterMs: 4800 },
    ],
    admitNote: 'The flask went in with him.',
    denyNote: 'He waves it off. In the car park he opens the flask himself.',
  },

  // Off a twelve-hour shift in a branded work polo, which the dress code has had
  // an opinion about since 10:30. He knows. He says so before you can.
  nightShift: {
    names: ['Jared Karim', 'Tui Taufa', 'Sam Nguyen'],
    beats: [
      { line: 'sorry. straight off shift. i know how it looks.', afterMs: 0 },
      { line: 'twelve hours. the polos got the servo on it, cant do much about that.', afterMs: 2300 },
      { line: 'one beer, near the door, i wont go near the dancefloor. i dont have it in me.', afterMs: 4700 },
    ],
    admitNote: 'In he goes, logo and all, with the sign already up.',
    denyNote: 'He nods, says fair enough, and walks back toward the servo.',
  },
  // Eighteen at midnight, at the rope by quarter past. Real card, real birthday,
  // and a plan he has clearly rehearsed on the walk over.
  eighteenToday: {
    names: ['Jai Petersen', 'Cooper Nguyen', 'Lachy Marsh'],
    beats: [
      { line: 'evening. so. it went midnight about forty minutes ago.', afterMs: 0 },
      { line: 'which makes this my first legal one. checked the law twice.', afterMs: 2400 },
      { line: 'my mates did the countdown at the kebab shop. they went home. im here.', afterMs: 5000 },
    ],
    admitNote: 'First stamp on a first night. He shows the bar staff his licence unprompted.',
    denyNote: 'Legal for forty minutes and headed home. The story will improve with age.',
  },

  // Kayden has been making promises. Kayden does not have list privileges.
  // Kayden does not, strictly speaking, have a last name anyone can recall.
  kaydensMate: {
    names: ['Reece Kowalski', 'Jordan Vella', 'Tyson Doyle'],
    beats: [
      { line: 'should be right, kayden said hed leave my name at the door.', afterMs: 0 },
      { line: 'kayden. tall bloke. trainee vest. very confident handshake.', afterMs: 2300 },
      { line: 'he said quote unquote "sorted mate". thats basically a guest list.', afterMs: 4800 },
    ],
    admitNote: 'In on the authority of a man whose supervisor calls him "the situation".',
    admitDazza: 'a bloke just told the bar KAYDEN comped him. kayden cant comp a glass of water',
    denyNote: 'He takes it well. Says he will "raise it with kayden". Nobody will.',
  },

  // The buck's party straggler. Missed the church bit, missed dinner, caught the
  // food poisoning. The buck is inside; the night is nearly over; here he is.
  bigNightOut: {
    names: ['Macca OBrien', 'Davo Romano', 'Nick Taufa'],
    beats: [
      { line: 'the bucks is in there. i can hear the chanting. thats my chanting.', afterMs: 0 },
      { line: 'i missed the church bit. food poisoning at the dinner. long story. bad oysters.', afterMs: 2500 },
      { line: 'ive had a big recovery and two lemonades and i am READY to be present.', afterMs: 5200 },
    ],
    admitNote: 'The chanting gets louder, gains a name in it, then settles.',
    denyNote: 'He listens to one more chant through the wall, films a voice memo of it, and goes.',
  },

  // Engaged tonight. Still holding hands. The card says what the card says.
  twoOfThem: {
    names: ['Bree Karim', 'Holly Petersen', 'Sana Singh'],
    beats: [
      { line: 'before you say anything about the hand thing. we got engaged tonight.', afterMs: 0 },
      { line: 'TONIGHT tonight. at the lookout. theres a photo of a bird ruining it.', afterMs: 2400 },
      { line: 'we are aware of the rule. we have discussed it. the answer is no.', afterMs: 5000 },
    ],
    admitNote: 'They cross the floor like a three-legged race nobody can catch.',
    denyNote: 'They leave still attached. The rule holds. The rule is the only thing that does.',
  },
};
