- Moved `parseItemProps` function to `core/utils.ts` for reuse across modules. - Updated various services to import and utilize the centralized `parseItemProps`. - Introduced new utility functions for handling consumable cooldowns and healing calculations. - Enhanced mob management with a new repository system, allowing for dynamic loading and validation of mob definitions from the database. - Added admin functions for creating, updating, listing, and deleting mobs, with validation using Zod. - Implemented tests for mob management functionalities. - Improved error handling and logging throughout the mob and consumable services.
19 lines
434 B
TypeScript
19 lines
434 B
TypeScript
import {
|
|
initializeMobRepository,
|
|
getMobInstance,
|
|
listMobKeys,
|
|
} from "../src/game/mobs/mobData";
|
|
|
|
async function run() {
|
|
console.log("Initializing mob repository...");
|
|
await initializeMobRepository();
|
|
console.log("Available mob keys:", listMobKeys());
|
|
const inst = getMobInstance("slime.green", 3);
|
|
console.log("Sample slime.green @ lvl3 ->", inst);
|
|
}
|
|
|
|
run().catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
});
|