import type { EventDefinition } from '../types.js';

function choice(
  choiceId: string,
  text: string,
  resolutionText: string,
  overrides?: Partial<EventDefinition['choices'][number]>
): EventDefinition['choices'][number] {
  return {
    choiceId,
    text,
    resolutionText,
    ...overrides,
  };
}

export const adolescenceCatalog: EventDefinition[] = [
  {
    id: 'firstCrush',
    category: 'adolescence',
    prompt: 'You have your first crush. What do you do?',
    minAge: 12,
    maxAge: 17,
    choices: [
      choice(
        'say_hi',
        'Talk to them confidently',
        'You introduced yourself and built confidence, regardless of outcome.',
        { effects: { stats: { social: 10, happiness: 5 } } }
      ),
      choice(
        'stay_friends',
        'Keep things friendly for now',
        'You stayed friends and avoided immediate risk.',
        { effects: { stats: { happiness: 2, social: 5 } } }
      ),
      choice(
        'avoid_them',
        'Avoid them',
        'You avoided the situation and felt lingering regret.',
        { effects: { stats: { happiness: -8, social: -5 } } }
      ),
    ],
  },
  {
    id: 'groupProjectDrama',
    category: 'adolescence',
    prompt: 'Your group project is falling apart. How do you handle it?',
    minAge: 13,
    maxAge: 18,
    choices: [
      choice(
        'lead_project',
        'Take the lead and organize everyone',
        'You stepped up, saved the project, and earned respect.',
        { energyCost: 15, effects: { stats: { social: 12, happiness: 8 } } }
      ),
      choice(
        'talk_teacher',
        'Ask the teacher for support',
        'Your teacher intervened and rebalanced responsibilities.',
        { effects: { stats: { social: 4, happiness: 4 } } }
      ),
      choice(
        'do_own_part',
        'Do your section and let others fail',
        'You protected your own grade but team tension increased.',
        { effects: { stats: { social: -6, happiness: -2 } } }
      ),
    ],
  },
  {
    id: 'curfewArgument',
    category: 'adolescence',
    prompt: 'You and your parents disagree about curfew. What now?',
    minAge: 13,
    maxAge: 18,
    choices: [
      choice(
        'negotiate',
        'Negotiate respectfully',
        'You reached a compromise and improved trust at home.',
        { effects: { stats: { social: 8, happiness: 6 } } }
      ),
      choice(
        'accept_rules',
        'Accept the current curfew',
        'You avoided conflict and kept peace at home.',
        { effects: { stats: { happiness: -1, social: 3 } } }
      ),
      choice(
        'break_rules',
        'Ignore curfew rules',
        'You broke curfew and triggered stricter rules later.',
        { effects: { stats: { happiness: -10, social: -8 } } }
      ),
    ],
  },
  {
    id: 'socialMediaPressure',
    category: 'adolescence',
    prompt: 'A post about you is trending. How do you respond?',
    minAge: 13,
    maxAge: 19,
    choices: [
      choice(
        'address_directly',
        'Address it directly',
        'You responded clearly and regained narrative control.',
        { energyCost: 10, effects: { stats: { social: 8, happiness: 4 } } }
      ),
      choice(
        'report_and_block',
        'Report and block',
        'You set boundaries and reduced the immediate damage.',
        { effects: { stats: { happiness: 3 } } }
      ),
      choice(
        'stay_silent',
        'Stay silent',
        'Silence avoided escalation, but stress lingered.',
        { effects: { stats: { happiness: -6 } } }
      ),
    ],
  },
];
