Merge branch 'v1.2' of gitlab.com:LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.2
This commit is contained in:
commit
fb9117aee3
@ -1438,7 +1438,7 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCaracXP(caracName) {
|
async checkCaracXP(caracName) {
|
||||||
let carac = this.data.data.carac[caracName];
|
let carac = this.data.data.carac[caracName];
|
||||||
console.log("XP chek", carac, caracName);
|
console.log("XP check", carac, caracName);
|
||||||
if (carac && carac.xp > 0) {
|
if (carac && carac.xp > 0) {
|
||||||
let xpNeeded = RdDUtility.getCaracNextXp(carac.value);
|
let xpNeeded = RdDUtility.getCaracNextXp(carac.value);
|
||||||
if (carac.xp >= xpNeeded) {
|
if (carac.xp >= xpNeeded) {
|
||||||
|
@ -26,41 +26,42 @@ const carac_array = ["taille", "apparence", "constitution", "force", "agilite",
|
|||||||
const difficultesLibres = [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10];
|
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 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];
|
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];
|
||||||
const carac_xp_par_valeur = [6, 6, 7, 7, 8, 8, 9, 9, 10, 20, 30, 40, 50, 60, 70];
|
|
||||||
const XP_CARAC_OFFSET = 7;
|
const tableCaracDerivee = {
|
||||||
const taille2derivee = { 1: { poids: "moins de 1kg", plusdom:-5, sconst: 0.5, sust: 0.1 },
|
// xp: coût pour passer du niveau inférieur à ce niveau
|
||||||
2: { poids: "1-5", plusdom:-4, sconst: 0.5, sust: 0.3 },
|
1: { xp: 3, poids: "moins de 1kg", plusdom:-5, sconst: 0.5, sust: 0.1 },
|
||||||
3: { poids: "6-10", plusdom:-3, sconst: 1, sust: 0.5 },
|
2: { xp: 3, poids: "1-5", plusdom:-4, sconst: 0.5, sust: 0.3 },
|
||||||
4: { poids: "11-20", plusdom:-3, sconst: 1, sust: 1 },
|
3: { xp: 4, poids: "6-10", plusdom:-3, sconst: 1, sust: 0.5 , beaute:'hideux'},
|
||||||
5: { poids: "21-30", plusdom:-2, sconst: 1, sust: 1 },
|
4: { xp: 4, poids: "11-20", plusdom:-3, sconst: 1, sust: 1 , beaute:'repoussant'},
|
||||||
6: { poids: "31-40", plusdom:-1, sconst: 2, sust: 2 },
|
5: { xp: 5, poids: "21-30", plusdom:-2, sconst: 1, sust: 1 , beaute:'franchement très laid'},
|
||||||
7: { poids: "41-50", plusdom:-1, sconst: 2, sust: 2 },
|
6: { xp: 5, poids: "31-40", plusdom:-1, sconst: 2, sust: 2 , beaute:'laid'},
|
||||||
8: { poids: "51-60", plusdom:0, sconst: 2, sust: 2 },
|
7: { xp: 6, poids: "41-50", plusdom:-1, sconst: 2, sust: 2 , beaute:'très désavantagé'},
|
||||||
9: { poids: "61-65", plusdom:0, sconst: 3, sust: 2 },
|
8: { xp: 6, poids: "51-60", plusdom:0, sconst: 2, sust: 2 , beaute:'désavantagé'},
|
||||||
10: { poids: "66-70", plusdom:0, sconst: 3, sust: 3 },
|
9: { xp: 7, poids: "61-65", plusdom:0, sconst: 3, sust: 2 , beaute:'pas terrible'},
|
||||||
11: { poids: "71-75", plusdom:0, sconst: 3, sust: 3 },
|
10: { xp: 7, poids: "66-70", plusdom:0, sconst: 3, sust: 3 , beaute:'commun'},
|
||||||
12: { poids: "76-80", plusdom:+1, sconst: 4, sust: 3 },
|
11: { xp: 8, poids: "71-75", plusdom:0, sconst: 3, sust: 3 , beaute:'pas mal'},
|
||||||
13: { poids: "81-90", plusdom:+1, sconst: 4, sust: 3 },
|
12: { xp: 8, poids: "76-80", plusdom:+1, sconst: 4, sust: 3 , beaute:'avantagé'},
|
||||||
14: { poids: "91-100", plusdom:+2, sconst: 4, sust: 4 },
|
13: { xp: 9, poids: "81-90", plusdom:+1, sconst: 4, sust: 3 , beaute:'mignon'},
|
||||||
15: { poids: "101-110", plusdom:+2, sconst: 5, sust: 4 },
|
14: { xp: 9, poids: "91-100", plusdom:+2, sconst: 4, sust: 4 , beaute:'beau'},
|
||||||
16: { poids: "111-120", plusdom:+3, sconst: 5, sust: 4 },
|
15: { xp: 10, poids: "101-110", plusdom:+2, sconst: 5, sust: 4 , beaute:'très beau'},
|
||||||
17: { poids: "121-131", plusdom:+3, sconst: 5, sust: 5 },
|
16: { xp: 20, poids: "111-120", plusdom:+3, sconst: 5, sust: 4 , beaute:'éblouissant'},
|
||||||
18: { poids: "131-141", plusdom:+4, sconst: 6, sust: 5 },
|
17: { xp: 30, poids: "121-131", plusdom:+3, sconst: 5, sust: 5 },
|
||||||
19: { poids: "141-150", plusdom:+4, sconst: 6, sust: 5 },
|
18: { xp: 40, poids: "131-141", plusdom:+4, sconst: 6, sust: 5 },
|
||||||
20: { poids: "151-160", plusdom:+4, sconst: 6, sust: 6 },
|
19: { xp: 50, poids: "141-150", plusdom:+4, sconst: 6, sust: 5 },
|
||||||
21: { poids: "161-180", plusdom:+5, sconst: 7, sust: 6 },
|
20: { xp: 60, poids: "151-160", plusdom:+4, sconst: 6, sust: 6 },
|
||||||
22: { poids: "181-200", plusdom:+5, sconst: 7, sust: 7 },
|
21: { xp: 70, poids: "161-180", plusdom:+5, sconst: 7, sust: 6 },
|
||||||
23: { poids: "201-300", plusdom:+6, sconst: 7, sust: 8 },
|
22: { xp: 80, poids: "181-200", plusdom:+5, sconst: 7, sust: 7 },
|
||||||
24: { poids: "301-400", plusdom:+6, sconst: 8, sust: 9 },
|
23: { xp: 90, poids: "201-300", plusdom:+6, sconst: 7, sust: 8 },
|
||||||
25: { poids: "401-500", plusdom:+7, sconst: 8, sust: 10 },
|
24: { xp: 100, poids: "301-400", plusdom:+6, sconst: 8, sust: 9 },
|
||||||
26: { poids: "501-600", plusdom:+7, sconst: 8, sust: 11 },
|
25: { xp: 110, poids: "401-500", plusdom:+7, sconst: 8, sust: 10 },
|
||||||
27: { poids: "601-700", plusdom:+8, sconst: 9, sust: 12 },
|
26: { xp: 120, poids: "501-600", plusdom:+7, sconst: 8, sust: 11 },
|
||||||
28: { poids: "701-800", plusdom:+8, sconst: 9, sust: 13 },
|
27: { xp: 130, poids: "601-700", plusdom:+8, sconst: 9, sust: 12 },
|
||||||
29: { poids: "801-900", plusdom:+9, sconst: 9, sust: 14 },
|
28: { xp: 140, poids: "701-800", plusdom:+8, sconst: 9, sust: 13 },
|
||||||
30: { poids: "901-1000", plusdom:+9, sconst: 10, sust: 15 },
|
29: { xp: 150, poids: "801-900", plusdom:+9, sconst: 9, sust: 14 },
|
||||||
31: { poids: "1001-1500", plusdom:+10, sconst: 10, sust: 16 },
|
30: { xp: 160, poids: "901-1000", plusdom:+9, sconst: 10, sust: 15 },
|
||||||
32: { poids: "1501-2000", plusdom:+11, sconst: 10, sust: 17 }
|
31: { xp: 170, poids: "1001-1500", plusdom:+10, sconst: 10, sust: 16 },
|
||||||
};
|
32: { xp: 180, poids: "1501-2000", plusdom:+11, sconst: 10, sust: 17 }
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
function _buildAllSegmentsFatigue(max) {
|
function _buildAllSegmentsFatigue(max) {
|
||||||
@ -403,7 +404,8 @@ export class RdDUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getCaracNextXp(value) {
|
static getCaracNextXp(value) {
|
||||||
return carac_xp_par_valeur[value - XP_CARAC_OFFSET];
|
// xp est le coût pour atteindre cette valeur, on regarde donc le coût de la valeur+1
|
||||||
|
return tableCaracDerivee[Number(value)+1].xp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -457,10 +459,10 @@ export class RdDUtility {
|
|||||||
let bonusDomKey = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2);
|
let bonusDomKey = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2);
|
||||||
bonusDomKey = Math.min( Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
bonusDomKey = Math.min( Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
||||||
|
|
||||||
let tailleData = taille2derivee[bonusDomKey];
|
let tailleData = tableCaracDerivee[bonusDomKey];
|
||||||
data.attributs.plusdom.value = tailleData.plusdom;
|
data.attributs.plusdom.value = tailleData.plusdom;
|
||||||
|
|
||||||
tailleData = taille2derivee[Number(data.carac.taille.value)];
|
tailleData = tableCaracDerivee[Number(data.carac.taille.value)];
|
||||||
data.attributs.sconst.value = tailleData.sconst;
|
data.attributs.sconst.value = tailleData.sconst;
|
||||||
data.attributs.sust.value = tailleData.sust;
|
data.attributs.sust.value = tailleData.sust;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user