Fix v12 issue + remove warnings

This commit is contained in:
2024-04-27 09:33:22 +02:00
parent d7b7bccbdf
commit 0487893f47
42 changed files with 138 additions and 179 deletions

View File

@ -10,14 +10,14 @@ export const ECRYME_CONFIG = {
"melee": "ECRY.ui.melee",
"ranged": "ECRY.ui.ranged"
},
traitLevel: [
{value: -3, text: "-3"},
{value: -2, text: "-2"},
{value: -1, text: "-1"},
{value: +1, text: "+1"},
{value: +2, text: "+2"},
{value: +3, text: "+3"}
],
traitLevel: {
"-3":{value: "-3", text: "-3"},
"-2":{value: "-2", text: "-2"},
"-1":{value: "-1", text: "-1"},
"+1":{value: "+1", text: "+1"},
"+2":{value: "+2", text: "+2"},
"+3":{value: "+3", text: "+3"}
},
impactTypes: {
physical: "ECRY.ui.physical",
mental: "ECRY.ui.mental",
@ -30,7 +30,7 @@ export const ECRYME_CONFIG = {
major: "ECRY.ui.major"
},
difficulty: {
"-1": {difficulty: "ECRY.ui.none", frequency: "ECRY.ui.none", value: "-"},
"-1": {difficulty: "ECRY.ui.none", frequency: "ECRY.ui.none", value: "-1"},
"8": { difficulty: "ECRY.ui.troublesome", frequency: "ECRY.ui.occasional", value: 8 },
"10": { difficulty: "ECRY.ui.difficult", frequency: "ECRY.ui.uncommon", value: 10 },
"12": { difficulty: "ECRY.ui.verydifficult", frequency: "ECRY.ui.rare", value: 12 },
@ -60,17 +60,16 @@ export const ECRYME_CONFIG = {
},
transcendanceOptions: {
"execution": "ECRY.ui.execution",
"preservation": "EC,RY.ui.preservation"
"preservation": "ECRY.ui.preservation"
},
bonusMalusPersoOptions: [
{value: "-3", label: "-3"},
{value: "-2", label: "-2"},
{value: "-1", label: "-1"},
{value: "0", label: "0"},
{value: "+1", label: "+1"},
{value: "+2", label: "+2"},
{value: "+3", label: "+3"}
]
bonusMalusPersoOptions: {
"-3": {value: "-3", label: "-3"},
"-2": {value: "-2", label: "-2"},
"-1": {value: "-1", label: "-1"},
"0": {value: "0", label: "0"},
"+1": {value: "1", label: "+1"},
"+2": {value: "2", label: "+2"},
"+3": {value: "3", label: "+3"}
}
}

View File

@ -216,7 +216,7 @@ export class EcrymeUtility {
confront.impactPreservation = this.getImpactFromEffect(Math.abs(confront.effectPreservation))
}
if (confront.marginPreservation > 0) {
confront.bonus1 = -confront.marginPreservation
confront.bonus1 = confront.marginPreservation
}
let msg = await this.createChatWithRollMode(this.confrontData1.alias, {
@ -558,7 +558,7 @@ export class EcrymeUtility {
let actor = game.actors.get(rollData.actorId)
// Fix difficulty
if (!rollData.difficulty || rollData.difficulty == "-") {
if (!rollData.difficulty || rollData.difficulty == "-1") {
rollData.difficulty = 0
}
rollData.difficulty = Number(rollData.difficulty)
@ -685,14 +685,14 @@ export class EcrymeUtility {
let rollData = {
rollId: foundry.utils.randomID(16),
type: "roll-data",
bonusMalusPerso: 0,
bonusMalusPerso: "0",
bonusMalusSituation: 0,
bonusMalusDef: 0,
annencyBonus: 0,
bonusMalusPortee: 0,
skillTranscendence: 0,
rollMode: game.settings.get("core", "rollMode"),
difficulty: "-",
difficulty: "-1",
useSpleen: false,
useIdeal: false,
impactMalus: 0,