Various fixes
This commit is contained in:
@ -47,7 +47,7 @@ export class RdDRoll extends Dialog {
|
||||
carac: actor.system.carac,
|
||||
finalLevel: 0,
|
||||
diffConditions: 0,
|
||||
diffLibre: rollData.competence?.data.default_diffLibre ?? 0,
|
||||
diffLibre: rollData.competence?.system.default_diffLibre ?? 0,
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusFlag: actor.isPersonnage() ? (actor.system.compteurs.surenc.value < 0) : false,
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
@ -73,6 +73,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
RollDataAjustements.calcul(rollData, actor);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getDiviseurSignificative(rollData) {
|
||||
let facteurSign = 1;
|
||||
@ -163,14 +164,14 @@ export class RdDRoll extends Dialog {
|
||||
console.log(rollData);
|
||||
// Update html, according to data
|
||||
if (rollData.competence) {
|
||||
const defaut_carac = Misc.templateData(rollData.competence).defaut_carac;
|
||||
const defaut_carac = rollData.competence.system.defaut_carac
|
||||
// Set the default carac from the competence item
|
||||
rollData.selectedCarac = rollData.carac[defaut_carac];
|
||||
$("#carac").val(defaut_carac);
|
||||
rollData.selectedCarac = rollData.carac[defaut_carac]
|
||||
$("#carac").val(defaut_carac)
|
||||
}
|
||||
if (rollData.selectedSort) {
|
||||
dialog.setSelectedSort(rollData.selectedSort);
|
||||
$(".draconic").val(rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer
|
||||
dialog.setSelectedSort(rollData.selectedSort)
|
||||
$(".draconic").val(rollData.selectedSort.data.listIndex) // Uniquement a la selection du sort, pour permettre de changer
|
||||
}
|
||||
RdDItemSort.setCoutReveReel(rollData.selectedSort);
|
||||
$("#diffLibre").val(Misc.toInt(rollData.diffLibre));
|
||||
@ -287,10 +288,10 @@ export class RdDRoll extends Dialog {
|
||||
HtmlUtility._showControlWhen($(".div-sort-ptreve-fixe"), !coutVariable);
|
||||
}
|
||||
|
||||
async setSelectedSigneDraconique(signe){
|
||||
async setSelectedSigneDraconique(signe) {
|
||||
this.rollData.signe = signe;
|
||||
this.rollData.diffLibre = Misc.data(signe).data.difficulte,
|
||||
$(".signe-difficulte").text(Misc.toSignedString(this.rollData.diffLibre));
|
||||
this.rollData.diffLibre = Misc.data(signe).data.difficulte,
|
||||
$(".signe-difficulte").text(Misc.toSignedString(this.rollData.diffLibre));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -304,9 +305,9 @@ export class RdDRoll extends Dialog {
|
||||
rollData.use.appelAuMoral = this.actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac);
|
||||
let dmgText = Misc.toSignedString(rollData.dmg.total);
|
||||
|
||||
switch (rollData.mortalite){
|
||||
case 'non-mortel': dmgText = `(${dmgText}) non-mortel`; break;
|
||||
case 'empoignade': dmgText = `empoignade`; break;
|
||||
switch (rollData.mortalite) {
|
||||
case 'non-mortel': dmgText = `(${dmgText}) non-mortel`; break;
|
||||
case 'empoignade': dmgText = `empoignade`; break;
|
||||
}
|
||||
|
||||
RollDataAjustements.calcul(rollData, this.actor);
|
||||
@ -338,7 +339,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_computeFinalLevel(rollData) {
|
||||
return RollDataAjustements.sum(rollData.ajustements);
|
||||
return RollDataAjustements.sum(rollData.ajustements)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_computeDiffCompetence(rollData) {
|
||||
@ -374,16 +375,16 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getTitle(rollData) {
|
||||
const carac = rollData.selectedCarac.label;
|
||||
const carac = rollData.selectedCarac.label
|
||||
if (!rollData.competence) {
|
||||
return carac;
|
||||
return carac
|
||||
}
|
||||
const compName = rollData.competence.name;
|
||||
const compName = rollData.competence.name
|
||||
if (rollData.draconicList && rollData.selectedSort) {
|
||||
return compName + " - " + rollData.selectedSort.name;
|
||||
return compName + " - " + rollData.selectedSort.name
|
||||
}
|
||||
// If a weapon is there, add it in the title
|
||||
const niveau = Misc.toSignedString(rollData.competence.data.niveau);
|
||||
const niveau = Misc.toSignedString(rollData.competence.system.niveau)
|
||||
if (compName == carac) {
|
||||
// cas des créatures
|
||||
return carac + " Niveau " + niveau
|
||||
|
Reference in New Issue
Block a user