forked from public/foundryvtt-reve-de-dragon
XP compute and sheet re-org
This commit is contained in:
@ -252,6 +252,27 @@ export class RdDUtility {
|
||||
return xp;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeCompetenceTroncXP( competenceList )
|
||||
{
|
||||
let xp = 0;
|
||||
for (let troncList of competenceTroncs) {
|
||||
let minNiveau = 15;
|
||||
for (let troncName of troncList) {
|
||||
let comp = RdDUtility.findCompetence( competenceList, troncName);
|
||||
minNiveau = (comp.data.niveau < minNiveau) ? comp.data.niveau : minNiveau;
|
||||
}
|
||||
if ( minNiveau > 0 ) minNiveau = 0; // Clamp à 0, pour le tronc commun
|
||||
let minNiveauXP = competence_xp_par_niveau[minNiveau+10];
|
||||
xp += minNiveauXP;
|
||||
for (let troncName of troncList) {
|
||||
let comp = RdDUtility.findCompetence( competenceList, troncName);
|
||||
xp += competence_xp_par_niveau[comp.data.niveau+10] - minNiveauXP;
|
||||
}
|
||||
}
|
||||
return xp;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeCarac( data)
|
||||
{
|
||||
|
Reference in New Issue
Block a user