| name | rpg-stat-catalyst |
| description | A core TypeScript library for RPG game mathematics. Handles attribute points, leveling curves, and stat derivation (HP, Dmg, etc.). |
RPG Stat Catalyst
A mathematical core for Role-Playing Games (RPGs) to handle character progression and stat calculation.
Requirements
- TypeScript
- No external runtime dependencies
Usage
-
Copy resources/types.ts and resources/calculator.ts to your project (e.g., lib/rpg/).
-
Initialize the engine with your game's specific configuration:
import { RPGEngine } from '@/lib/rpg/calculator';
const DevilHunterConfig = {
baseHP: 100,
hpPerLevel: 2,
pointsPerLevel: 5,
validAttributes: ['STR', 'CON', 'TEC', 'INT'],
attributeMultipliers: {
'CON': 5,
'STR': 0,
}
};
engine = ();
level = ;
availablePoints = engine.(level);
maxHP = engine.(level, , );
.();
.();