import Database from 'better-sqlite3'; import { Corpse, CorpseState, LootTable } from '../../schema/corpse.js'; export declare class CorpseRepository { private db; private inventoryRepo; constructor(db: Database.Database); /** * Create a corpse when a character dies */ createFromDeath(characterId: string, characterName: string, characterType: 'pc' | 'npc' | 'enemy' | 'neutral', options?: { encounterId?: string; position?: { x: number; y: number; }; worldId?: string; regionId?: string; creatureType?: string; cr?: number; }): Corpse; /** * Get corpse by ID */ findById(id: string): Corpse | null; /** * Get corpse for a specific character */ findByCharacterId(characterId: string): Corpse | null; /** * Get all corpses in an encounter */ findByEncounterId(encounterId: string): Corpse[]; /** * Get corpses in a region */ findByRegion(worldId: string, regionId: string): Corpse[]; /** * Get corpses at or near a specific position */ findNearPosition(worldId: string, x: number, y: number, radius?: number): Corpse[]; /** * Add item to corpse inventory */ addToCorpseInventory(corpseId: string, itemId: string, quantity?: number): void; /** * Get items in corpse inventory */ getCorpseInventory(corpseId: string): Array<{ itemId: string; quantity: number; looted: boolean; }>; /** * Get unlootable items from corpse */ getAvailableLoot(corpseId: string): Array<{ itemId: string; quantity: number; }>; /** * Loot an item from a corpse * @param transferToLooter - If true, adds item to looter's inventory */ lootItem(corpseId: string, itemId: string, looterId: string, quantity?: number, transferToLooter?: boolean): { success: boolean; itemId: string; quantity: number; transferred: boolean; reason?: string; }; /** * Loot all items from a corpse * @param transferToLooter - If true, adds all items to looter's inventory */ lootAll(corpseId: string, looterId: string, transferToLooter?: boolean): Array<{ itemId: string; quantity: number; transferred: boolean; }>; /** * Loot currency from a corpse * @param transferToLooter - If true, adds currency to looter's inventory */ lootCurrency(corpseId: string, looterId: string, transferToLooter?: boolean): { success: boolean; currency: { gold: number; silver: number; copper: number; }; transferred: boolean; reason?: string; }; /** * Generate loot for a corpse based on creature type */ generateLoot(corpseId: string, creatureType: string, cr?: number): { itemsAdded: Array<{ name: string; quantity: number; }>; currency: { gold: number; silver: number; copper: number; }; harvestable: Array<{ resourceType: string; quantity: number; }>; }; /** * Harvest a resource from a corpse * @param createItem - If true, creates an item in the items table and adds to harvester inventory */ harvestResource(corpseId: string, resourceType: string, harvesterId: string, options?: { skillCheck?: { roll: number; dc: number; }; createItem?: boolean; }): { success: boolean; quantity: number; resourceType: string; itemId?: string; transferred: boolean; reason?: string; }; /** * Process corpse decay based on time passed */ processDecay(hoursAdvanced: number): { corpseId: string; oldState: CorpseState; newState: CorpseState; }[]; /** * Update corpse state */ updateState(corpseId: string, newState: CorpseState): void; /** * Clean up gone corpses */ cleanupGoneCorpses(): number; /** * Mark corpse as loot generated */ private markLootGenerated; /** * Create a loot table */ createLootTable(table: Omit): LootTable; /** * Find loot table by ID */ findLootTableById(id: string): LootTable | null; /** * Find loot table by creature type */ findLootTableByCreatureType(creatureType: string, cr?: number): LootTable | null; /** * List all loot tables */ listLootTables(): LootTable[]; private rollQuantity; private rowToCorpse; private rowToLootTable; } //# sourceMappingURL=corpse.repo.d.ts.map