import type { DrunkStage } from '../data/types';

// Single authority for intoxication thresholds. Renderer reads stages for tells;
// scenes read them for gameplay; nobody hardcodes numbers.
export function drunkStage(intoxication: number): DrunkStage {
  if (intoxication < 0.2) return 'sober';
  if (intoxication < 0.45) return 'tipsy';
  if (intoxication < 0.65) return 'loose';
  if (intoxication < 0.85) return 'messy';
  return 'maggot';
}

/** Visible-at-the-rope tells begin at 'loose'. */
export function hasVisibleTells(intoxication: number): boolean {
  const s = drunkStage(intoxication);
  return s === 'loose' || s === 'messy' || s === 'maggot';
}
