import { RpgEvent, RpgPlayer, RpgServer } from '@rpgjs/server'; import { Control } from '@rpgjs/common'; import { HitResult, ApplyHitHooks } from './ai.server'; import { ActionBattleOptions } from './types'; export declare const ACTION_BATTLE_SKILL_USE = "action-battle:use-skill"; export declare const ACTION_BATTLE_HOTBAR_USE = "action-battle:use-hotbar"; export declare const ACTION_BATTLE_SKILL_PROJECTILE_TYPE = "action-battle-skill"; export declare const ACTION_BATTLE_ACTION_BAR_GUI_ID = "action-battle-action-bar"; /** * Default player attack hitboxes offsets for each direction * * These hitboxes define the attack areas relative to the player's position * for each cardinal direction. They are converted to absolute coordinates * when creating the moving hitbox. */ export declare const DEFAULT_PLAYER_ATTACK_HITBOXES: { up: { offsetX: number; offsetY: number; width: number; height: number; }; down: { offsetX: number; offsetY: number; width: number; height: number; }; left: { offsetX: number; offsetY: number; width: number; height: number; }; right: { offsetX: number; offsetY: number; width: number; height: number; }; default: { offsetX: number; offsetY: number; width: number; height: number; }; }; /** * Get knockback force from player's equipped weapon * * Retrieves the knockbackForce property from the player's equipped weapon. * Falls back to DEFAULT_KNOCKBACK.force if no weapon or property is set. * * @param player - The player to get weapon knockback from * @returns Knockback force value * * @example * ```ts * // Player with weapon having knockbackForce: 80 * const force = getPlayerWeaponKnockbackForce(player); // 80 * * // No weapon equipped * const force = getPlayerWeaponKnockbackForce(player); // 50 (default) * ``` */ export declare function getPlayerWeaponKnockbackForce(player: RpgPlayer): number; /** * Apply hit from player to target (event with AI) * * Handles damage calculation, knockback based on weapon, and visual effects. * Can be customized using hooks. * * @param player - The attacking player * @param target - The event being hit * @param hooks - Optional hooks for customizing hit behavior * @returns Hit result if AI exists, undefined otherwise * * @example * ```ts * // Basic hit * const result = applyPlayerHitToEvent(player, event); * * // With custom hooks * const result = applyPlayerHitToEvent(player, event, { * onBeforeHit(result) { * result.knockbackForce *= 2; // Double knockback * return result; * }, * onAfterHit(result) { * if (result.defeated) { * player.gold += 10; * } * } * }); * ``` */ export declare function applyPlayerHitToEvent(player: RpgPlayer, target: RpgEvent, hooks?: ApplyHitHooks, metadata?: Record): HitResult | undefined; export declare function applyActionBattleEntityHit(attacker: RpgPlayer | RpgEvent, target: RpgPlayer | RpgEvent, hooks?: ApplyHitHooks, metadata?: Record): HitResult | undefined; export declare const ACTION_BATTLE_DODGE = "action-battle:dodge"; export declare const ACTION_BATTLE_GUARD_START = Control.Defense; export declare const ACTION_BATTLE_GUARD_END = "action-battle:guard-end"; /** Open the retained legacy Action Battle-specific bar. */ export declare const openActionBattleActionBar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => void; /** Refresh the retained legacy Action Battle-specific bar. */ export declare const updateActionBattleActionBar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => void; /** * Open the generic hotbar with Action Battle skill presentation and targeting. */ export declare const openActionBattleHotbar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => Promise; /** * Refresh cooldowns and usability in an open generic hotbar. */ export declare const updateActionBattleHotbar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => void; export declare const createActionBattleServer: (rawOptions?: ActionBattleOptions) => RpgServer; declare const _default: RpgServer; export default _default; export { ACTION_BATTLE_HITBOX_FRAME_MS, ActionBattleHitTracker, createActionBattleAttackId, getNormalizedActionBattleAttackProfile, resolveActionBattleHitboxSpeed, runActionBattleActiveHitbox, scheduleActionBattleStartup, } from './core/attack-runtime'; export { DEFAULT_ACTION_BATTLE_ATTACK_PROFILE, getActionBattleControlLockDuration, normalizeActionBattleAttackProfile, type ActionBattleAttackProfileFallbacks, } from './core/attack-profile'; export type { ActionBattleAttackDirection, ActionBattleAttackHitboxConfig, ActionBattleAttackHitboxMap, ActionBattleAttackHitPolicy, ActionBattleAttackProfile, ActionBattleAttackControlOptions, ActionBattleControlLock, NormalizedActionBattleAttackControlOptions, ActionBattleGuardOptions, ActionBattleSoftTargetingOptions, ActionBattleCombatDirectorOptions, ActionBattleFeedbackOptions, ActionBattleHitReactionProfile, NormalizedActionBattleHitReactionProfile, NormalizedActionBattleAttackProfile, } from './types'; export { beginActionBattleGuard, clearActionBattleDefense, consumeActionBattleCounter, endActionBattleGuard, isActionBattleGuarding, normalizeActionBattleGuardOptions, resolveActionBattleDefense, type ActionBattleDefenseKind, type ActionBattleDefenseResolution, } from './core/defense'; export { acquireActionBattleAttackSlot, releaseActionBattleAttackSlot, } from './core/combat-director'; export { directionToActionBattleTarget, resolveActionBattleSoftTarget, type ActionBattleSoftTargetResult, } from './targeting'; export type { ActionBattleActionConfig, ActionBattleActionMode, ActionBattleActionTarget, ActionBattleProjectileImpactContext, ActionBattleProjectileOptions, ActionBattleTargetContext, ActionBattleTargetOptions, ActionBattleTargetSelector, ActionBattleUsable, ActionBattleUseContext, } from './core/contracts'; export { canActionBattleUseTarget, executeActionBattleUse, getActionBattleActionConfig, getActionBattleActionRange, handleActionBattleProjectileDestroy, handleActionBattleProjectileImpact, shouldUseActionBattleUsable, } from './core/action-use'; export { DEFAULT_ACTION_BATTLE_HIT_REACTION, isActionBattleEntityInvincible, normalizeActionBattleHitReaction, setActionBattleInvincibility, } from './core/hit-reaction'; export { canActionBattleDodge, resolveActionBattleCharge, resolveActionBattleComboStep, } from './core/player-combat'; export { DEFAULT_ACTION_BATTLE_ENEMY_ATTACK_PROFILES, normalizeActionBattleEnemyAttackProfiles, type ActionBattleEnemyAttackProfileKey, type ActionBattleEnemyAttackProfileMap, type NormalizedActionBattleEnemyAttackProfileMap, } from './core/enemy-attack-profiles'; export { resolveActionBattleWeapon, resolveActionBattleWeaponAttackProfile, } from './core/equipment'; export { ACTION_BATTLE_ENEMY_FACTION, ACTION_BATTLE_PLAYER_FACTION, canActionBattleTarget, getActionBattleFaction, getActionBattleTargets, isActionBattleCombatEntity, isActionBattleEvent, isActionBattlePlayer, matchesActionBattleTargetSelector, } from './core/targets'; export { AiDebug, AiState, AttackPattern, BattleAi, DEFAULT_KNOCKBACK, EnemyType, } from './ai.server'; export type { ApplyHitHooks, BattleAiDefeatedCallback, BattleAiDefeatedContext, BattleAiDefeatReward, BattleAiLegacyDefeatedCallback, BattleAiLegacyOptions, BattleAiOptions, BattleAiDeathPresentationOptions, BattleAiRewardItem, BattleAiRewards, HitResult, } from './ai.server';