Various fixes #9

Merged
sladecraven merged 3 commits from master into master 2022-01-20 16:27:28 +01:00
10 changed files with 62 additions and 21 deletions

BIN
images/map_lemurie.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -158,6 +158,8 @@
"BOL.weaponCategory.ranged": "Arme de tir", "BOL.weaponCategory.ranged": "Arme de tir",
"BOL.weaponCategory.other": "Autre", "BOL.weaponCategory.other": "Autre",
"BOL.itemProperty.damageMultiplier": "Damages Multiplier",
"BOL.itemProperty.attackBonusDice": "Attack Bonus Dice",
"BOL.itemProperty.equipable": "Équipable", "BOL.itemProperty.equipable": "Équipable",
"BOL.itemProperty.protection": "Protection", "BOL.itemProperty.protection": "Protection",
"BOL.itemProperty.blocking": "Blocage", "BOL.itemProperty.blocking": "Blocage",

View File

@ -159,6 +159,8 @@
"BOL.weaponCategory.ranged": "Arme de tir", "BOL.weaponCategory.ranged": "Arme de tir",
"BOL.weaponCategory.other": "Autre", "BOL.weaponCategory.other": "Autre",
"BOL.itemProperty.damageMultiplier": "Multiplicateur de dommages",
"BOL.itemProperty.attackBonusDice": "Dé de Bonus d'attaque",
"BOL.itemProperty.equipable": "Équipable", "BOL.itemProperty.equipable": "Équipable",
"BOL.itemProperty.protection": "Protection", "BOL.itemProperty.protection": "Protection",
"BOL.itemProperty.blocking": "Blocage", "BOL.itemProperty.blocking": "Blocage",

View File

@ -105,7 +105,12 @@ export class BoLRoll {
rollData.id = randomID(16) rollData.id = randomID(16)
// Weapon mode specific management // Weapon mode specific management
rollData.weaponModifier = 0
rollData.attackBonusDice = false
if (rollData.mode == "weapon") { if (rollData.mode == "weapon") {
//console.log("WEAPON", rollData.weapon)
rollData.weaponModifier = rollData.weapon.data.data.properties.attackModifiers?? 0;
rollData.attackBonusDice = rollData.weapon.data.data.properties.attackBonusDice
if (rollData.defender) { // If target is selected if (rollData.defender) { // If target is selected
rollData.defence = rollData.defender.defenseValue, rollData.defence = rollData.defender.defenseValue,
rollData.shieldBlock = 'none' rollData.shieldBlock = 'none'
@ -118,8 +123,6 @@ export class BoLRoll {
} }
} }
console.log("ROL1", rollData)
const rollOptionContent = await renderTemplate(rollOptionTpl, rollData); const rollOptionContent = await renderTemplate(rollOptionTpl, rollData);
let d = new Dialog({ let d = new Dialog({
title: rollData.label, title: rollData.label,
@ -154,12 +157,13 @@ export class BoLRoll {
} }
const isMalus = rollData.adv.includes('M'); const isMalus = rollData.adv.includes('M');
const dicePool = __adv2dice[rollData.adv] let dicePool = __adv2dice[rollData.adv]
dicePool += (rollData.attackBonusDice) ? 1 : 0
//// const dicePool = (isMalus) ? 2 - parseInt(rollData.adv) : 2 + parseInt(rollData.adv); //// const dicePool = (isMalus) ? 2 - parseInt(rollData.adv) : 2 + parseInt(rollData.adv);
const attrValue = (rollData.attrKey) && eval(`rollData.actor.data.data.attributes.${rollData.attrKey}.value`) || 0; const attrValue = (rollData.attrKey) && eval(`rollData.actor.data.data.attributes.${rollData.attrKey}.value`) || 0;
const aptValue = (rollData.aptKey) && eval(`rollData.actor.data.data.aptitudes.${rollData.aptKey}.value`) || 0 const aptValue = (rollData.aptKey) && eval(`rollData.actor.data.data.aptitudes.${rollData.aptKey}.value`) || 0
const modifiers = parseInt(attrValue) + parseInt(aptValue) + parseInt(rollData.mod) + parseInt(rollData.career) - rollData.defence - shieldMalus; const modifiers = rollData.weaponModifier + parseInt(attrValue) + parseInt(aptValue) + parseInt(rollData.mod) + parseInt(rollData.career) - rollData.defence - shieldMalus;
const formula = (isMalus) ? dicePool + "d6kl2 + " + modifiers : dicePool + "d6kh2 + " + modifiers; const formula = (isMalus) ? dicePool + "d6kl2 + " + modifiers : dicePool + "d6kh2 + " + modifiers;
rollData.formula = formula; rollData.formula = formula;
rollData.modifiers = modifiers rollData.modifiers = modifiers
@ -177,6 +181,7 @@ export class BoLRoll {
} }
export class BoLDefaultRoll { export class BoLDefaultRoll {
constructor(rollData) { constructor(rollData) {
BoLUtility.storeRoll(rollData) BoLUtility.storeRoll(rollData)
this.rollData = rollData this.rollData = rollData

View File

@ -381,24 +381,28 @@ export class BoLUtility {
static getDamageFormula(damageString, modifier=0, multiplier = 1) { static getDamageFormula(damageString, modifier=0, multiplier = 1) {
if (damageString[0] == 'd') { damageString = "1" + damageString } // Help parsing if (damageString[0] == 'd') { damageString = "1" + damageString } // Help parsing
if (modifier == null) modifier = 0; if (modifier == null) modifier = 0;
var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g');
let res = myReg.exec(damageString); let formula = damageString
let nbDice = parseInt(res[1]); if ( damageString.includes("d") || damageString.includes("D")) {
let postForm = 'kh' + nbDice; var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g');
let modIndex = 3; let res = myReg.exec(damageString);
if (res[3]) { let nbDice = parseInt(res[1]);
if (res[3] == 'M') { let postForm = 'kh' + nbDice;
postForm = 'kl' + nbDice; let modIndex = 3;
nbDice++; if (res[3]) {
modIndex = 4; if (res[3] == 'M') {
} postForm = 'kl' + nbDice;
if (res[3] == 'B') { nbDice++;
postForm = 'kh' + nbDice; modIndex = 4;
nbDice++; }
modIndex = 4; if (res[3] == 'B') {
postForm = 'kh' + nbDice;
nbDice++;
modIndex = 4;
}
} }
formula = "(" + nbDice + "d" + res[2] + postForm + "+" + modifier +") *" + multiplier;
} }
let formula = "(" + nbDice + "d" + res[2] + postForm + "+" + modifier +") *" + multiplier;
return formula; return formula;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -10,6 +10,9 @@ System.debugMode = true;
export const BOL = {}; export const BOL = {};
BOL.damageValues = { BOL.damageValues = {
"1": "1",
"2": "2",
"3": "3",
"d3" : "d3", "d3" : "d3",
"d6M" : "d6M (Malus)", "d6M" : "d6M (Malus)",
"d6" : "d6", "d6" : "d6",

2
packs/aides-de-jeu.db Normal file

File diff suppressed because one or more lines are too long

1
packs/cartes.db Normal file

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"url": "https://github.com/ZigmundKreud/bol", "url": "https://github.com/ZigmundKreud/bol",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"flags": {}, "flags": {},
"version": "0.9.0.0", "version": "0.9.0.2",
"templateVersion": 16, "templateVersion": 16,
"minimumCoreVersion": "0.8.6", "minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "9", "compatibleCoreVersion": "9",
@ -90,6 +90,24 @@
"tag": "item", "tag": "item",
"type": "Item", "type": "Item",
"private": false "private": false
},
{
"label": "Aides de Jeu",
"type": "JournalEntry",
"name": "aides-de-jeu",
"path": "packs/aides-de-jeu.db",
"system": "bol",
"entity": "JournalEntry",
"private": false
},
{
"label": "Cartes",
"type": "Scene",
"name": "cartes",
"path": "packs/cartes.db",
"system": "bol",
"entity": "Scene",
"private": false
} }
], ],
"system": [], "system": [],

View File

@ -26,6 +26,10 @@
<label class="checkbox"> <label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.ignoreshield" {{checked data.properties.ignoreshield}}> {{localize "BOL.itemProperty.ignoreshield"}} <input class="field-value" type="checkbox" name="data.properties.ignoreshield" {{checked data.properties.ignoreshield}}> {{localize "BOL.itemProperty.ignoreshield"}}
</label> </label>
<label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.attackBonusDice" {{checked data.properties.attackBonusDice}}> {{localize "BOL.itemProperty.attackBonusDice"}}
</label>
{{#if data.properties.ranged}} {{#if data.properties.ranged}}
<label class="checkbox"> <label class="checkbox">
<input class="field-value" type="checkbox" name="data.properties.reloadable" {{checked data.properties.reloadable}}> {{localize "BOL.itemProperty.reloadable"}} <input class="field-value" type="checkbox" name="data.properties.reloadable" {{checked data.properties.reloadable}}> {{localize "BOL.itemProperty.reloadable"}}