#38 - Gestion des armes 1/2mains
This commit is contained in:
parent
11bca6fc23
commit
3f73c6fec8
@ -1070,18 +1070,20 @@ export class RdDActor extends Actor {
|
|||||||
rollData.carac = { carac_creature: { label: name, value: competence.data.carac_value } };
|
rollData.carac = { carac_creature: { label: name, value: competence.data.carac_value } };
|
||||||
} else { // Usual competence
|
} else { // Usual competence
|
||||||
rollData.competence = competence;
|
rollData.competence = competence;
|
||||||
armeItem.data.dommagesReels = armeItem.data.dommages; // Per default
|
if (armeItem ) {
|
||||||
if ( !armeItem.data.unemain && !armeItem.data.deuxmains) // Force default
|
armeItem.data.dommagesReels = armeItem.data.dommages; // Per default
|
||||||
armeItem.data.unemain = true;
|
if ( !armeItem.data.unemain && !armeItem.data.deuxmains) // Force default
|
||||||
if (armeItem.data.unemain && armeItem.data.deuxmains) { // manage 1/2 main
|
armeItem.data.unemain = true;
|
||||||
//console.log("Weapon", armeItem.data.dommages);
|
if (armeItem.data.unemain && armeItem.data.deuxmains) { // manage 1/2 main
|
||||||
if ( armeItem.data.dommages.includes("/") ) { // Sanity check
|
//console.log("Weapon", armeItem.data.dommages);
|
||||||
if ( name.toLowerCase().includes("1 main") )
|
if ( armeItem.data.dommages.includes("/") ) { // Sanity check
|
||||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[0]);
|
if ( name.toLowerCase().includes("1 main") )
|
||||||
else // 2 mains
|
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[0]);
|
||||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[1]);
|
else // 2 mains
|
||||||
} else {
|
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[1]);
|
||||||
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + name + " ne sont pas corrects (ie sous la forme X/Y)");
|
} else {
|
||||||
|
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + name + " ne sont pas corrects (ie sous la forme X/Y)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rollData.arme = armeItem;
|
rollData.arme = armeItem;
|
||||||
|
@ -25,21 +25,21 @@ export class RdDRollDialog extends Dialog {
|
|||||||
|
|
||||||
// Common conf
|
// Common conf
|
||||||
let dialogConf = { content: html, title: "Test", buttons: myButtons, default: "rollButton" }
|
let dialogConf = { content: html, title: "Test", buttons: myButtons, default: "rollButton" }
|
||||||
let dialogOptions = { classes: ["rdddialog"], width: 600, height: 400, 'z-index': 99999 }
|
let dialogOptions = { classes: ["rdddialog"], width: 600, height: 460, 'z-index': 99999 }
|
||||||
|
|
||||||
// Select proper roll dialog template and stuff
|
// Select proper roll dialog template and stuff
|
||||||
if (mode == "competence") {
|
if (mode == "competence") {
|
||||||
dialogConf.title = "Test de compétence"
|
dialogConf.title = "Test de compétence"
|
||||||
dialogConf.height = 400
|
dialogOptions.height = 420
|
||||||
} else if (mode == "arme") {
|
} else if (mode == "arme") {
|
||||||
dialogConf.title = "Test de combat/arme"
|
dialogConf.title = "Test de combat/arme"
|
||||||
dialogConf.height = 430
|
dialogOptions.height = 440
|
||||||
} else if (mode == "carac") {
|
} else if (mode == "carac") {
|
||||||
dialogConf.title = "Test de caractéristique"
|
dialogConf.title = "Test de caractéristique"
|
||||||
dialogOptions.height = 350
|
dialogOptions.height = 400
|
||||||
} else if (mode == "sort") {
|
} else if (mode == "sort") {
|
||||||
dialogConf.title = "Lancer un sort"
|
dialogConf.title = "Lancer un sort"
|
||||||
dialogConf.height = 490
|
dialogOptions.height = 460
|
||||||
}
|
}
|
||||||
super(dialogConf, dialogOptions)
|
super(dialogConf, dialogOptions)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "0.9.79",
|
"version": "0.9.80",
|
||||||
"minimumCoreVersion": "0.7.5",
|
"minimumCoreVersion": "0.7.5",
|
||||||
"compatibleCoreVersion": "0.7.6",
|
"compatibleCoreVersion": "0.7.6",
|
||||||
"templateVersion": 48,
|
"templateVersion": 48,
|
||||||
|
Loading…
Reference in New Issue
Block a user