/** * Encounter pressure: how hard a director leans on a player who is struggling, read from the * player's own state, quantized to a tier, and bounded by the rule's cap. The plan is a value, not * a callback, so a test can sweep it and a probe can print it. */ /** What the director reads about the player before it chooses a tier. */ export interface PressureReading { /** Player health fraction `0..1`. A healthier player is leaned on harder. */ health: number; /** Encounter progress `0..1` — waves cleared over waves authored. Further in leans harder. */ progress: number; /** Seconds the encounter has run. Longer leans harder, up to the window. */ elapsed: number; } /** The weights and window that turn a reading into an index, plus the hard cap. */ export interface PressureRule { /** Weight of the player staying in control (health). Default `0.5`. */ healthWeight?: number; /** Weight of how far through the encounter the player is. Default `1`. */ progressWeight?: number; /** Weight of time spent past `timeFloorSeconds`. Default `0.5`. */ timeWeight?: number; /** Seconds of encounter time before the clock term starts. Default `90`. */ timeFloorSeconds?: number; /** Seconds at which the clock term is full. Default `300`. */ timeWindowSeconds?: number; /** Highest tier this rule can reach. Default `2`. Every plan bound derives from it. */ maxTier?: number; } /** One bounded answer to "how hard now", plus the effects the encounter layer applies. */ export interface PressurePlan { /** `0..maxTier`. */ tier: number; /** The weighted reading in `0..1` before quantization. */ index: number; /** Extra units each pressure-scaled group gains: `0..maxTier`. */ countBonus: number; /** Extra elite slots unlocked: `0..maxTier`. */ eliteSlots: number; /** Multiplier on authored entry delays, `>= 1 / (1 + maxTier / 2)`. */ cadenceScale: number; /** True when the tier sits on the rule's cap. */ atCap: boolean; /** One line naming the terms, for a probe or a test failure. */ reason: string; } /** * Turn one reading into a bounded pressure plan. * * The index is the weighted mean of three terms — the player's health (staying in control), how far * through the encounter they are, and how long it has run — each clamped to `0..1`, then split into * `maxTier + 1` bands. A hurt player is leaned on *less*, so a director that reads this plan never * piles on someone already losing. Because every term and every derived effect is a clamp of an * authored cap, the rule cannot climb: a full-health player on a long run lands on * `tier === maxTier` with `countBonus === maxTier`, never above it. * * @capability encounter-pressure bounded difficulty tier read from player health, encounter progress and time */ export declare function evaluatePressure(reading: PressureReading, rule?: PressureRule): PressurePlan;