#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 } };
|
||||
} else { // Usual competence
|
||||
rollData.competence = competence;
|
||||
armeItem.data.dommagesReels = armeItem.data.dommages; // Per default
|
||||
if ( !armeItem.data.unemain && !armeItem.data.deuxmains) // Force default
|
||||
armeItem.data.unemain = true;
|
||||
if (armeItem.data.unemain && armeItem.data.deuxmains) { // manage 1/2 main
|
||||
//console.log("Weapon", armeItem.data.dommages);
|
||||
if ( armeItem.data.dommages.includes("/") ) { // Sanity check
|
||||
if ( name.toLowerCase().includes("1 main") )
|
||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[0]);
|
||||
else // 2 mains
|
||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[1]);
|
||||
} else {
|
||||
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + name + " ne sont pas corrects (ie sous la forme X/Y)");
|
||||
if (armeItem ) {
|
||||
armeItem.data.dommagesReels = armeItem.data.dommages; // Per default
|
||||
if ( !armeItem.data.unemain && !armeItem.data.deuxmains) // Force default
|
||||
armeItem.data.unemain = true;
|
||||
if (armeItem.data.unemain && armeItem.data.deuxmains) { // manage 1/2 main
|
||||
//console.log("Weapon", armeItem.data.dommages);
|
||||
if ( armeItem.data.dommages.includes("/") ) { // Sanity check
|
||||
if ( name.toLowerCase().includes("1 main") )
|
||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[0]);
|
||||
else // 2 mains
|
||||
armeItem.data.dommagesReels = Number(armeItem.data.dommages.split("/")[1]);
|
||||
} 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;
|
||||
|
@ -25,21 +25,21 @@ export class RdDRollDialog extends Dialog {
|
||||
|
||||
// Common conf
|
||||
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
|
||||
if (mode == "competence") {
|
||||
dialogConf.title = "Test de compétence"
|
||||
dialogConf.height = 400
|
||||
dialogOptions.height = 420
|
||||
} else if (mode == "arme") {
|
||||
dialogConf.title = "Test de combat/arme"
|
||||
dialogConf.height = 430
|
||||
dialogOptions.height = 440
|
||||
} else if (mode == "carac") {
|
||||
dialogConf.title = "Test de caractéristique"
|
||||
dialogOptions.height = 350
|
||||
dialogOptions.height = 400
|
||||
} else if (mode == "sort") {
|
||||
dialogConf.title = "Lancer un sort"
|
||||
dialogConf.height = 490
|
||||
dialogOptions.height = 460
|
||||
}
|
||||
super(dialogConf, dialogOptions)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"version": "0.9.79",
|
||||
"version": "0.9.80",
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.6",
|
||||
"templateVersion": 48,
|
||||
|
Loading…
Reference in New Issue
Block a user