#41 : Gestion de l'archetype des PJs

This commit is contained in:
2020-12-02 20:52:37 +01:00
parent 03c23da4a1
commit 62b159ef9d
4 changed files with 61 additions and 3 deletions

View File

@ -4,16 +4,29 @@ import { TMRUtility } from "./tmr-utility.js";
import { RdDRollTables } from "./rdd-rolltables.js";
import { ChatUtility } from "./chat-utility.js";
/* -------------------------------------------- */
const level_category = {
"generale": "-4",
"particuliere": "-8",
"speciale": "-11",
"specialisee": "-11",
"connaissance": "-11",
"draconic": "-11",
"melee": "-6",
"tir": "-8",
"lancer": "-8"
}
/* -------------------------------------------- */
const label_category = {
"generale": "Générales",
"particuliere": "Particulières",
"specialisee": "Spécialisées",
"connaissance": "Connaissances",
"draconic": "Draconics",
"melee": "Mêlée",
"tir": "Tir",
"lancer": "Lancer"
}
/* -------------------------------------------- */
const competenceTroncs = [ ["Esquive", "Dague", "Corps à corps"],
["Epée à 1 main", "Epée à 2 mains", "Hache à 1 main", "Hache à 2 mains", "Lance", "Masse à 1 main", "Masse à 2 mains"] ];
const competence_xp = {
@ -23,6 +36,7 @@ const competence_xp = {
"-4" : [ 15, 30, 45, 60, 80, 100, 120]
}
/* -------------------------------------------- */
// This table starts at 0 -> niveau -10
const competence_xp_par_niveau = [ 5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 30, 30, 40, 40, 60, 60, 100, 100, 100, 100, 100, 100, 100, 100, 100];
const carac_array = [ "taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
@ -30,7 +44,7 @@ const difficultesLibres = [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10];
const ajustementsConditions = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10];
const ajustementsEncaissement = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16, +17, +18, +19, +20, +21, +22, +23, +24, +25];
/* -------------------------------------------- */
function _buildAllSegmentsFatigue(max) {
const cycle = [5, 2, 4, 1, 3, 0];
let fatigue = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
@ -45,6 +59,8 @@ function _buildAllSegmentsFatigue(max) {
}
return fatigue;
}
/* -------------------------------------------- */
function _cumulSegmentsFatigue(matrix) {
let cumulMatrix = [];
for (let line of matrix)
@ -59,6 +75,7 @@ function _cumulSegmentsFatigue(matrix) {
return cumulMatrix;
}
/* -------------------------------------------- */
const fatigueMatrix = _buildAllSegmentsFatigue(30);
const cumulFatigueMatrix = _cumulSegmentsFatigue(fatigueMatrix);
@ -77,12 +94,14 @@ const table2func = { "queues": {descr: "queues : Tire une queue de Dragon", fun
"souffle": { descr: "souffle: Tire un Souffle de Dragon", func: RdDRollTables.getSouffle},
"tarot" : { descr: "tarot: Tire une carte de Tarot Dracnique", func: RdDRollTables.getTarot} };
/* -------------------------------------------- */
const definitionsBlessures = [
{ type: "legere", facteur: 2 },
{ type: "grave", facteur : 4 },
{ type: "critique", facteur : 6 }
]
/* -------------------------------------------- */
const definitionsEncaissement = {
"mortel": [
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", legeres: 0, graves: 0, critiques: 0 },
@ -310,6 +329,10 @@ export class RdDUtility {
{
return level_category;
}
static getLabelCategory( )
{
return label_category;
}
static getCaracArray()
{
return carac_array;