parent
dc6f280359
commit
dc67c36b0a
@ -1624,21 +1624,14 @@ export class RdDActor extends Actor {
|
|||||||
let xp = Math.abs(rolled.finalLevel);
|
let xp = Math.abs(rolled.finalLevel);
|
||||||
let xpCarac = Math.floor(xp / 2); // impair: arrondi inférieur en carac
|
let xpCarac = Math.floor(xp / 2); // impair: arrondi inférieur en carac
|
||||||
|
|
||||||
let xpComp;
|
let xpComp = 0;
|
||||||
if (competenceName) {
|
|
||||||
xpComp = xp - xpCarac;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
xpComp = 0;
|
|
||||||
xpCarac = Math.max(xpCarac, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( competenceName ) {
|
if ( competenceName ) {
|
||||||
|
xpComp = xp - xpCarac;
|
||||||
let competence = duplicate( RdDUtility.findCompetence( this.data.items, competenceName ) );
|
let competence = duplicate( RdDUtility.findCompetence( this.data.items, competenceName ) );
|
||||||
competence.data.xp += xpComp;
|
competence.data.xp += xpComp;
|
||||||
await this.updateEmbeddedEntity( "OwnedItem", competence);
|
await this.updateEmbeddedEntity( "OwnedItem", competence);
|
||||||
} else {
|
} else {
|
||||||
xpCarac = 1; // Si pas de competence, le max d'XP en carac est de 1 (cf p. 144)
|
xpCarac = Math.max(xpCarac, 1);
|
||||||
}
|
}
|
||||||
if ( !carac[caracName].isderivee) {
|
if ( !carac[caracName].isderivee) {
|
||||||
carac[caracName].xp += xpCarac;
|
carac[caracName].xp += xpCarac;
|
||||||
|
Loading…
Reference in New Issue
Block a user