import type { EntityPosition } from "../scene/entityStore.js"; export interface CameraShake { amplitude: number; decay: number; } export interface HitReactionConfig { hitstopMs: number; knockback: number; vertical?: number; shake?: CameraShake; /** Trauma (0..1) fed to a trauma² camera-shake channel — the calibrated alternative to `shake`. */ trauma?: number; /** Slow-mo factor during hitstop (e.g. 0.05 = 5% speed); read by the game's own time-scale system, not applied here. */ timescale?: number; } export interface HitReactionInput { attackerPos: EntityPosition; targetPos: EntityPosition; power?: number; } export interface HitReaction { hitstopMs: number; impulse: [number, number, number]; shake: CameraShake | null; trauma: number | null; timescale: number | null; } /** A calibrated `resolveHitReaction` config for a named impact event — hitstop + trauma so feel works with zero tuning. */ export interface ImpactPreset { hitstopMs: number; trauma: number; timescale?: number; knockback?: number; vertical?: number; } /** * Calibrated per-event impact feel — hitstop and trauma numbers harvested * from a shipped game-feel reference, not hand-invented per game. `explosion` * and `playerHit` are "heavy hit" events (60–90ms hitstop @ 0.05 timescale); * `pickup`/`jumpLand` are light events with no hitstop. Trauma is later * clamped to 1.0 by `resolveHitReaction`. * * @capability impact-feel calibrated hitstop + trauma preset for a named impact event */ export declare const impactPresets: { readonly pickup: { readonly hitstopMs: 0; readonly trauma: 0.15; }; readonly jumpLand: { readonly hitstopMs: 0; readonly trauma: 0.2; }; readonly enemyKilled: { readonly hitstopMs: 40; readonly trauma: 0.3; }; readonly playerHit: { readonly hitstopMs: 70; readonly trauma: 0.4; readonly timescale: 0.05; }; readonly explosion: { readonly hitstopMs: 90; readonly trauma: 0.7; readonly timescale: 0.05; }; }; /** A named key into {@link impactPresets} (`"pickup" | "jumpLand" | "enemyKilled" | "playerHit" | "explosion"`). */ export type ImpactPresetName = keyof typeof impactPresets; /** * Resolves hit feel (hitstop, knockback impulse, camera shake) from either a * named `impactPresets` event (`resolveHitReaction("explosion", input)`) or a * raw `HitReactionConfig` override. * * @capability impact-feel resolve hitstop/knockback/shake feel from an impact preset or raw config */ export declare function resolveHitReaction(config: HitReactionConfig | ImpactPresetName, input: HitReactionInput): HitReaction; export declare function applyImpulse(position: EntityPosition, impulse: [number, number, number]): EntityPosition;