import type { GameModelAPI } from '../domains/gameModel.js'; import type { Scalars, SeedPropertyInput } from '../generated/graphql.js'; import type { EngineDetector } from './engine.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link CombatKit}. Must match the deployed combat blueprint. */ export interface CombatKitOptions { /** The `typePrefix` the combat blueprint was deployed with. */ typePrefix?: string; /** * The compute module whose referee serves `attack_mob` when the app runs * an engine. Defaults to `'mob-engine'`. */ engineModuleName?: string; } /** The verdict of a routed attack ({@link CombatKit.attackRouted}). */ export interface KitRoutedAttack { success: boolean; /** The target's remaining health/hp after an accepted hit. */ health?: number; killed?: boolean; /** The denial reason (engine referee) or error message (model path). */ reason?: string; /** Which authority resolved the attack. */ via: 'engine' | 'model'; } /** A parsed view of one combatant. */ export interface KitCombatant { containerId: string; displayName: string; ownerUserId: string | null; combatKey: string; hp: number; maxHp: number; attack: number; defense: number; alive: boolean; } /** A parsed view of one status effect. */ export interface KitStatusEffect { containerId: string; displayName: string; ownerUserId: string | null; effectId: string; targetKey: string; magnitude: number; ticksLeft: number; } /** * Runtime helpers for the {@link combatBlueprint} conventions: spawn * combatants, attack (server-side damage formula + death flip), arm status * effects the tick automation applies over time, respawn, and route * competitive realtime attacks through a compute referee. `hostSynced` * remains a low-stakes/legacy fallback for persisting elected-host state; * it is not an anti-cheat boundary. Denials resolve with `success: false`. * * Obtained via `client.kit(appId).combat`. */ export declare class CombatKit { private readonly appId; private readonly gameModel; private readonly engines?; private readonly names; private readonly engineModuleName; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: CombatKitOptions, engines?: EngineDetector | undefined); /** * Route an attack through the strongest available authority: the compute * referee (`attack_mob` on the mob engine — presence/range validated * server-side) when the engine is deployed (capability-detected, cached), * else today's model attack function. One call, both deployments. * * @param input.targetId - The target container (engine mob slot or model * combatant). * @param input.attackerId - The caller's combatant container — required * for the model path, ignored by the engine referee (it referees by the * caller's live actor position). * @param input.amount - Engine-path damage (clamped by the referee). */ attackRouted(input: { targetId: string; attackerId?: string; amount?: number; }): Promise; /** * Spawn a combatant with a unique `combat_key` (the status-effect join * key) and the `owner_user_id` mirror. */ spawnCombatant(input: { ownerUserId: Scalars['BigInt']['input']; displayName: string; hp?: number; maxHp?: number; attack?: number; defense?: number; combatKey?: string; sessionId?: string; properties?: SeedPropertyInput[]; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** Read one combatant's state. */ state(combatantId: string): Promise; /** * Attack a target with your combatant. The damage formula and the death * flip run server-side. Resolves with the target's remaining hp. */ attack(attackerId: string, targetId: string): Promise>; /** * Arm a status effect against a target's `combat_key`: creates the * caller's StatusEffect container (when `effectContainerId` is omitted) * and invokes the gated apply function; the interval automation then * ticks it server-side. */ applyEffect(input: { targetKey: string; effectId: string; magnitude: number; ticks: number; effectContainerId?: string; sessionId?: string; }): Promise>; /** List the active status effects targeting a combat_key. */ effects(targetKey?: string): Promise; /** Respawn your downed combatant at full hp. */ respawn(combatantId: string): Promise>; /** Revive a downed combatant (blueprint deployed with `reviveGroup`). */ revive(combatantId: string): Promise>; /** * Persist host-simulated hp (blueprint deployed with `hostSynced: true`; * `is_host` enforced server-side). Resolves with the clamped hp. */ syncCombatant(combatantId: string, hp: number): Promise>; } //# sourceMappingURL=combat.d.ts.map