Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Calculates RPG character attribute points, leveling curves, and derived stats like HP and damage in TypeScript.
26% 83%+57 ptsof test cases passed
Passed 19 of 23 test cases with the skill, and 6 of 23 without it.
3 of 3 safety checks passed
Not used yet
A mathematical core for Role-Playing Games (RPGs) to handle character progression and stat calculation.
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';
// 1. Define your game rules
const DevilHunterConfig = {
baseHP: 100,
hpPerLevel: 2,
pointsPerLevel: 5,
validAttributes: ['STR', 'CON', 'TEC', 'INT'],
attributeMultipliers: {
'CON': 5, // 1 CON = 5 HP
'STR': 0,
}
};
const engine = new RPGEngine(DevilHunterConfig);
// 2. Use it in your UI components
const level = 50;
const availablePoints = engine.calculateAvailablePoints(level);
const maxHP = engine.calculateMaxHP(level, 100, 'CON'); // Level 50, 100 CON
console.log(`At level ${level}, you have ${availablePoints} points.`);
console.log(`Max HP: ${maxHP}`);
Next to this one in the catalogue, plus more from the same author.