Various enhancements

This commit is contained in:
sladecraven 2022-02-23 20:39:58 +01:00
parent f63692b6b5
commit eacd32927c
18 changed files with 562 additions and 475 deletions

View File

@ -137,6 +137,9 @@
"BOL.ui.bonusmalus": "Additionnal bonus/malus", "BOL.ui.bonusmalus": "Additionnal bonus/malus",
"BOL.ui.nbdices": "Number of Dices", "BOL.ui.nbdices": "Number of Dices",
"BOL.ui.totalmod": "Total Mod.", "BOL.ui.totalmod": "Total Mod.",
"BOL.ui.rangeModifiers": "Range modifier",
"BOL.ui.money": "Bougette",
"BOL.ui.moneyTitle": "Gold & Treasure",
"BOL.featureCategory.origins": "Origines", "BOL.featureCategory.origins": "Origines",
"BOL.featureCategory.races": "Races", "BOL.featureCategory.races": "Races",
@ -152,6 +155,12 @@
"BOL.featureSubtypes.flaw": "Désavantage", "BOL.featureSubtypes.flaw": "Désavantage",
"BOL.featureSubtypes.language": "Langage", "BOL.featureSubtypes.language": "Langage",
"BOL.featureSubtypes.gods": "Faith & Gods", "BOL.featureSubtypes.gods": "Faith & Gods",
"BOL.bougette.nomoney": "Nothing",
"BOL.bougette.tolive": "To live",
"BOL.bougette.easylife": "Easy Life",
"BOL.bougette.luxury" : "Luxury life",
"BOL.bougette.rich": "Rich!",
"BOL.itemCategory.object": "Objet", "BOL.itemCategory.object": "Objet",
"BOL.itemCategory.equipment": "Équipement", "BOL.itemCategory.equipment": "Équipement",

View File

@ -139,6 +139,9 @@
"BOL.ui.bonusmalus": "Dés Bonus/Malus additionnels", "BOL.ui.bonusmalus": "Dés Bonus/Malus additionnels",
"BOL.ui.nbdices": "Nombre de dés", "BOL.ui.nbdices": "Nombre de dés",
"BOL.ui.totalmod": "Total Mod.", "BOL.ui.totalmod": "Total Mod.",
"BOL.ui.rangeModifiers": "Mod. de Portée",
"BOL.ui.money": "Bougette",
"BOL.ui.moneyTitle": "Or et Piecettes",
"BOL.featureCategory.origins": "Origines", "BOL.featureCategory.origins": "Origines",
"BOL.featureCategory.races": "Races", "BOL.featureCategory.races": "Races",
@ -147,6 +150,12 @@
"BOL.featureCategory.flaws": "Désavantages", "BOL.featureCategory.flaws": "Désavantages",
"BOL.featureCategory.languages": "Langues", "BOL.featureCategory.languages": "Langues",
"BOL.bougette.nomoney": "A sec",
"BOL.bougette.tolive": "De quoi vivre",
"BOL.bougette.easylife": "A l'aise",
"BOL.bougette.luxury" : "Luxe&Volupté",
"BOL.bougette.rich": "Richissime",
"BOL.featureSubtypes.origin": "Origine", "BOL.featureSubtypes.origin": "Origine",
"BOL.featureSubtypes.race": "Race", "BOL.featureSubtypes.race": "Race",
"BOL.featureSubtypes.career": "Carrière", "BOL.featureSubtypes.career": "Carrière",

View File

@ -3,6 +3,7 @@
* @extends {ActorSheet} * @extends {ActorSheet}
*/ */
import {BoLRoll} from "../controllers/bol-rolls.js"; import {BoLRoll} from "../controllers/bol-rolls.js";
import { BoLUtility } from "../system/bol-utility.js";
export class BoLActorSheet extends ActorSheet { export class BoLActorSheet extends ActorSheet {
@ -34,7 +35,7 @@ export class BoLActorSheet extends ActorSheet {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("itemId")); const item = this.actor.items.get(li.data("itemId"));
item.sheet.render(true); item.sheet.render(true);
}); })
// Equip/Unequip item // Equip/Unequip item
html.find('.item-equip').click(this._onToggleEquip.bind(this)); html.find('.item-equip').click(this._onToggleEquip.bind(this));
@ -135,12 +136,13 @@ export class BoLActorSheet extends ActorSheet {
formData.vehicles = this.actor.vehicles; formData.vehicles = this.actor.vehicles;
formData.ammos = this.actor.ammos; formData.ammos = this.actor.ammos;
formData.misc = this.actor.misc; formData.misc = this.actor.misc;
formData.combat = this.actor.buildCombat(); formData.combat = this.actor.buildCombat()
formData.features = this.actor.buildFeatures() formData.features = this.actor.buildFeatures()
formData.isGM = game.user.isGM formData.isGM = game.user.isGM
formData.options= this.options formData.options= this.options
formData.owner= this.document.isOwner formData.owner= this.document.isOwner
formData.editScore= this.options.editScore formData.editScore= this.options.editScore
formData.useBougette = BoLUtility.getUseBougette()
formData.isSorcerer = this.actor.isSorcerer() formData.isSorcerer = this.actor.isSorcerer()
formData.isAlchemist = this.actor.isAlchemist() formData.isAlchemist = this.actor.isAlchemist()

View File

@ -10,10 +10,7 @@ export class BoLActor extends Actor {
/** @override */ /** @override */
prepareData() { prepareData() {
const actorData = this.data; const actorData = this.data;
// console.log(actorData);
// const data = actorData.data;
// const flags = actorData.flags;
// Make separate methods for each Actor type (character, npc, etc.) to keep things organized.
if (actorData.type === 'character') { if (actorData.type === 'character') {
actorData.type = 'player'; actorData.type = 'player';
actorData.villainy = false; actorData.villainy = false;
@ -356,7 +353,19 @@ export class BoLActor extends Actor {
if ( protect.data.subtype == 'helm') { if ( protect.data.subtype == 'helm') {
formula += "+1" formula += "+1"
} else if ( protect.data.subtype == 'armor') { } else if ( protect.data.subtype == 'armor') {
formula += "+" + protect.data.properties.soak.formula; if ( BoLUtility.this.getRollArmor() ) {
if ( !protect.data.properties.soak.formula || protect.data.properties.soak.formula=="") {
ui.notifications.warn(`L'armure ${protect.name} n'a pas de formule pour la protection !`)
} else {
formula += "+" + protect.data.properties.soak.formula
}
} else {
if ( protect.data.properties.soak.value == undefined ) {
ui.notifications.warn(`L'armure ${protect.name} n'a pas de valeur fixe pour la protection !`)
} else {
formula += "+ " + protect.data.properties.soak.value
}
}
} }
} }
console.log("Protect Formula", formula) console.log("Protect Formula", formula)

View File

@ -6,7 +6,6 @@ import { BoLItemSheet } from "./item/item-sheet.js";
import { System, BOL } from "./system/config.js"; import { System, BOL } from "./system/config.js";
import { preloadHandlebarsTemplates } from "./system/templates.js"; import { preloadHandlebarsTemplates } from "./system/templates.js";
import { registerHandlebarsHelpers } from "./system/helpers.js"; import { registerHandlebarsHelpers } from "./system/helpers.js";
import { registerSystemSettings } from "./system/settings.js";
import registerHooks from "./system/hooks.js"; import registerHooks from "./system/hooks.js";
import { Macros } from "./system/macros.js"; import { Macros } from "./system/macros.js";
import { BoLUtility } from "./system/bol-utility.js"; import { BoLUtility } from "./system/bol-utility.js";
@ -50,9 +49,6 @@ Hooks.once('init', async function () {
// Inot useful stuff // Inot useful stuff
BoLUtility.init(); BoLUtility.init();
// Register System Settings
registerSystemSettings();
// Preload Handlebars Templates // Preload Handlebars Templates
await preloadHandlebarsTemplates(); await preloadHandlebarsTemplates();
@ -95,6 +91,7 @@ function welcomeMessage() {
<strong>Bienvenue dans Barbarians of Lemuria (Ludospherik version)</strong> <strong>Bienvenue dans Barbarians of Lemuria (Ludospherik version)</strong>
<p>Les livres nécessaires pour jouer sont disponibles sur le site de l'éditeur : http://www.ludospherik.fr/content/14-barbarians-of-lemuria</p> <p>Les livres nécessaires pour jouer sont disponibles sur le site de l'éditeur : http://www.ludospherik.fr/content/14-barbarians-of-lemuria</p>
<p>Bon jeu en Lemurie !</p> <p>Bon jeu en Lemurie !</p>
<p>Tout le support et le suivi de ce système es disponible via le Discord Foundry FR : https://discord.gg/pPSDNJk </p>
` }); ` });
} }

View File

@ -75,15 +75,17 @@ export class BoLRoll {
ui.notifications.warn("Unable to find weapon !"); ui.notifications.warn("Unable to find weapon !");
return; return;
} }
let weaponData = weapon.data.data; let weaponData = weapon.data.data
let attribute = eval(`actor.data.data.attributes.${weaponData.properties.attackAttribute}`) let attribute = eval(`actor.data.data.attributes.${weaponData.properties.attackAttribute}`)
let aptitude = eval(`actor.data.data.aptitudes.${weaponData.properties.attackAptitude}`) let aptitude = eval(`actor.data.data.aptitudes.${weaponData.properties.attackAptitude}`)
console.debug("WEAPON!", weaponData)
let attackDef = { let attackDef = {
mode: "weapon", mode: "weapon",
actor: actor, actor: actor,
actorData: actorData, actorData: actorData,
weapon: weapon, weapon: weapon,
isRanged: weaponData.properties.ranged || weaponData.properties.throwing,
target: target, target: target,
careerBonus: 0, careerBonus: 0,
defender: (target) ? game.actors.get(target.data.actorId) : undefined, defender: (target) ? game.actors.get(target.data.actorId) : undefined,
@ -92,10 +94,10 @@ export class BoLRoll {
attrValue: attribute.value, attrValue: attribute.value,
aptValue: aptitude.value, aptValue: aptitude.value,
mod: 0, mod: 0,
modRanged: 0,
label: (weapon.name) ? weapon.name : game.i18n.localize('BOL.ui.noWeaponName'), label: (weapon.name) ? weapon.name : game.i18n.localize('BOL.ui.noWeaponName'),
description: actor.name + " - " + game.i18n.localize('BOL.ui.weaponAttack'), description: actor.name + " - " + game.i18n.localize('BOL.ui.weaponAttack'),
} }
console.debug("WEAPON!", attackDef, weaponData);
return this.displayRollDialog(attackDef); return this.displayRollDialog(attackDef);
} }
@ -177,7 +179,7 @@ export class BoLRoll {
} }
$('#roll-modifier').val( this.rollData.attrValue + "+" + this.rollData.aptValue + "+" + this.rollData.careerBonus + "+" + this.rollData.mod + "+" + $('#roll-modifier').val( this.rollData.attrValue + "+" + this.rollData.aptValue + "+" + this.rollData.careerBonus + "+" + this.rollData.mod + "+" +
this.rollData.weaponModifier + "-" + this.rollData.defence + "+" + this.rollData.shieldMalus ) this.rollData.modRanged + "+" + this.rollData.weaponModifier + "-" + this.rollData.defence + "+" + this.rollData.shieldMalus )
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -195,6 +197,10 @@ export class BoLRoll {
this.rollData.mod = Number(event.currentTarget.value) this.rollData.mod = Number(event.currentTarget.value)
this.updateTotalDice() this.updateTotalDice()
}) })
html.find('#modRanged').change((event) => {
this.rollData.modRanged = Number(event.currentTarget.value)
this.updateTotalDice()
})
html.find('#attr').change((event) => { html.find('#attr').change((event) => {
let attrKey = event.currentTarget.value let attrKey = event.currentTarget.value
@ -264,6 +270,7 @@ export class BoLRoll {
rollData.shieldMalus = 0 rollData.shieldMalus = 0
} }
rollData.careerBonus = rollData.careerBonus ?? 0 rollData.careerBonus = rollData.careerBonus ?? 0
rollData.modRanged = rollData.modRanged ?? 0
rollData.mod = rollData.mod ?? 0 rollData.mod = rollData.mod ?? 0
rollData.id = randomID(16) rollData.id = randomID(16)
@ -449,17 +456,16 @@ export class BoLDefaultRoll {
bonusDmg = 12 bonusDmg = 12
} }
let attrDamageValue = this.getDamageAttributeValue(this.rollData.weapon.data.data.properties.damageAttribute) let attrDamageValue = this.getDamageAttributeValue(this.rollData.weapon.data.data.properties.damageAttribute)
let weaponFormula = BoLUtility.getDamageFormula(this.rollData.weapon.data.data.properties.damage, let weaponFormula = BoLUtility.getDamageFormula(this.rollData.weapon.data.data)
this.rollData.weapon.data.data.properties.damageModifiers,
this.rollData.weapon.data.data.properties.damageMultiplier)
let damageFormula = weaponFormula + "+" + bonusDmg + "+" + attrDamageValue let damageFormula = weaponFormula + "+" + bonusDmg + "+" + attrDamageValue
console.log("DAMAGE !!!", damageFormula, attrDamageValue) console.log("DAMAGE !!!", damageFormula, attrDamageValue)
//console.log("Formula", weaponFormula, damageFormula, this.rollData.weapon.data.data.properties.damage) //console.log("Formula", weaponFormula, damageFormula, this.rollData.weapon.data.data.properties.damage)
this.rollData.damageFormula = damageFormula this.rollData.damageFormula = damageFormula
this.rollData.damageRoll = new Roll(damageFormula) this.rollData.damageRoll = new Roll(damageFormula)
this.rollData.damageTotal = this.rollData.damageRoll.total
await this.rollData.damageRoll.roll({ "async": false }) await this.rollData.damageRoll.roll({ "async": false })
this.rollData.damageTotal = this.rollData.damageRoll.total
} }
$(`#${this.rollData.optionsId}`).hide() // Hide the options roll buttons $(`#${this.rollData.optionsId}`).hide() // Hide the options roll buttons
this.sendDamageMessage() this.sendDamageMessage()

View File

@ -1,14 +1,48 @@
import { BoLDefaultRoll } from "../controllers/bol-rolls.js"; import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
// Spell circle to min PP cost // Spell circle to min PP cost
const __circle2minpp = { 0: 0, 1: 2,2: 6, 3: 11} const __circle2minpp = { 0: 0, 1: 2, 2: 6, 3: 11 }
export class BoLUtility { export class BoLUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async init() { static init() {
this.attackStore = {} this.attackStore = {}
game.settings.register("bol", "rollArmor", {
name: "Effectuer des jets pour les armures",
hint: "Effectue un jet de dés pour les armures (valeur fixe si désactivé)",
scope: "world",
config: true,
default: true,
type: Boolean,
onChange: lang => window.location.reload()
});
game.settings.register("bol", "useBougette", {
name: "Utiliser la Bougette (règle fan-made)",
hint: "Utilise un indicateur de Bougette, comme décrit dans l'aide de jeu Gold&Glory du RatierBretonnien (https://www.lahiette.com/leratierbretonnien/)",
scope: "world",
config: true,
default: false,
type: Boolean,
onChange: lang => window.location.reload()
});
this.rollArmor = game.settings.get("bol", "rollArmor") // Roll armor or not
this.useBougette = game.settings.get("bol", "useBougette") // Use optionnal bougette rules
console.log("UTIL", this)
}
/* -------------------------------------------- */
static getRollArmor() {
return this.rollArmor
}
/* -------------------------------------------- */
static getUseBougette() {
return this.useBougette
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -117,60 +151,60 @@ export class BoLUtility {
} else { } else {
BoLUtility.processAttackSuccess(attackDef); BoLUtility.processAttackSuccess(attackDef);
} }
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async chatListeners(html) { static async chatListeners(html) {
// Damage handling // Damage handling
html.on("click", '.chat-damage-apply', event => { html.on("click", '.chat-damage-apply', event => {
let rollData = BoLUtility.getLastRoll() let rollData = BoLUtility.getLastRoll()
$(`#${rollData.applyId}`).hide() $(`#${rollData.applyId}`).hide()
BoLUtility.sendAttackSuccess(rollData) BoLUtility.sendAttackSuccess(rollData)
}); });
html.on("click", '.chat-damage-roll', event => { html.on("click", '.chat-damage-roll', event => {
event.preventDefault(); event.preventDefault();
let rollData = BoLUtility.getLastRoll() let rollData = BoLUtility.getLastRoll()
rollData.damageMode = event.currentTarget.attributes['data-damage-mode'].value; rollData.damageMode = event.currentTarget.attributes['data-damage-mode'].value;
let bolRoll = new BoLDefaultRoll(rollData) let bolRoll = new BoLDefaultRoll(rollData)
bolRoll.rollDamage() bolRoll.rollDamage()
}); });
html.on("click", '.transform-heroic-roll', event => { html.on("click", '.transform-heroic-roll', event => {
event.preventDefault(); event.preventDefault();
let rollData = BoLUtility.getLastRoll() let rollData = BoLUtility.getLastRoll()
rollData.actor.subHeroPoints(1) rollData.actor.subHeroPoints(1)
let r = new BoLDefaultRoll( rollData ) let r = new BoLDefaultRoll(rollData)
r.upgradeToCritical(); r.upgradeToCritical();
} ); });
html.on("click", '.hero-reroll', event => { html.on("click", '.hero-reroll', event => {
event.preventDefault(); event.preventDefault();
let rollData = BoLUtility.getLastRoll() let rollData = BoLUtility.getLastRoll()
rollData.actor.subHeroPoints(1) rollData.actor.subHeroPoints(1)
rollData.reroll = false // Disable reroll option for second roll rollData.reroll = false // Disable reroll option for second roll
let r = new BoLDefaultRoll( rollData ) let r = new BoLDefaultRoll(rollData)
r.roll(); r.roll();
} ); });
html.on("click", '.damage-handling', event => { html.on("click", '.damage-handling', event => {
event.preventDefault(); event.preventDefault();
let attackId = event.currentTarget.attributes['data-attack-id'].value; let attackId = event.currentTarget.attributes['data-attack-id'].value;
let defenseMode = event.currentTarget.attributes['data-defense-mode'].value; let defenseMode = event.currentTarget.attributes['data-defense-mode'].value;
let weaponId = (event.currentTarget.attributes['data-weapon-id']) ? event.currentTarget.attributes['data-weapon-id'].value : -1 let weaponId = (event.currentTarget.attributes['data-weapon-id']) ? event.currentTarget.attributes['data-weapon-id'].value : -1
if ( game.user.isGM) { if (game.user.isGM) {
BoLUtility.processDamageHandling(event, attackId, defenseMode, weaponId) BoLUtility.processDamageHandling(event, attackId, defenseMode, weaponId)
} else { } else {
game.socket.emit("system.bol", { msg: "msg_damage_handling", data: {event: event, attackId: attackId, defenseMode: defenseMode, weaponId: weaponId} }); game.socket.emit("system.bol", { msg: "msg_damage_handling", data: { event: event, attackId: attackId, defenseMode: defenseMode, weaponId: weaponId } });
} }
}); });
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async processDamageHandling(event, attackId, defenseMode, weaponId=-1) { static async processDamageHandling(event, attackId, defenseMode, weaponId = -1) {
if ( !game.user.isGM) { if (!game.user.isGM) {
return; return;
} }
BoLUtility.removeChatMessageId(BoLUtility.findChatMessageId(event.currentTarget)); BoLUtility.removeChatMessageId(BoLUtility.findChatMessageId(event.currentTarget));
@ -184,12 +218,12 @@ export class BoLUtility {
attackDef.defenseMode = defenseMode; attackDef.defenseMode = defenseMode;
if (defenseMode == 'damage-with-armor') { if (defenseMode == 'damage-with-armor') {
let armorFormula = attackDef.defender.getArmorFormula() let armorFormula = attackDef.defender.getArmorFormula()
attackDef.rollArmor = new Roll(armorFormula) attackDef.rollArmor = new Roll(armorFormula)
attackDef.rollArmor.roll( {async: false} ) attackDef.rollArmor.roll({ async: false })
attackDef.armorProtect = (attackDef.rollArmor.total<0) ? 0 : attackDef.rollArmor.total; attackDef.armorProtect = (attackDef.rollArmor.total < 0) ? 0 : attackDef.rollArmor.total;
attackDef.finalDamage = attackDef.damageRoll.total - attackDef.armorProtect; attackDef.finalDamage = attackDef.damageRoll.total - attackDef.armorProtect;
attackDef.finalDamage = (attackDef.finalDamage<0) ? 0 : attackDef.finalDamage; attackDef.finalDamage = (attackDef.finalDamage < 0) ? 0 : attackDef.finalDamage;
attackDef.defender.sufferDamage(attackDef.finalDamage); attackDef.defender.sufferDamage(attackDef.finalDamage);
} }
if (defenseMode == 'damage-without-armor') { if (defenseMode == 'damage-without-armor') {
@ -197,21 +231,21 @@ export class BoLUtility {
attackDef.defender.sufferDamage(attackDef.finalDamage); attackDef.defender.sufferDamage(attackDef.finalDamage);
} }
if (defenseMode == 'hero-reduce-damage') { if (defenseMode == 'hero-reduce-damage') {
let armorFormula = attackDef.defender.getArmorFormula(); let armorFormula = attackDef.defender.getArmorFormula();
attackDef.rollArmor = new Roll(armorFormula) attackDef.rollArmor = new Roll(armorFormula)
attackDef.rollArmor.roll( {async: false} ); attackDef.rollArmor.roll({ async: false });
attackDef.armorProtect = (attackDef.rollArmor.total<0) ? 0 : attackDef.rollArmor.total; attackDef.armorProtect = (attackDef.rollArmor.total < 0) ? 0 : attackDef.rollArmor.total;
attackDef.rollHero = new Roll("1d6"); attackDef.rollHero = new Roll("1d6");
attackDef.rollHero.roll( {async: false} ); attackDef.rollHero.roll({ async: false });
attackDef.finalDamage = attackDef.damageRoll.total - attackDef.rollHero.total - attackDef.armorProtect; attackDef.finalDamage = attackDef.damageRoll.total - attackDef.rollHero.total - attackDef.armorProtect;
attackDef.finalDamage = (attackDef.finalDamage<0) ? 0 : attackDef.finalDamage; attackDef.finalDamage = (attackDef.finalDamage < 0) ? 0 : attackDef.finalDamage;
attackDef.defender.sufferDamage(attackDef.finalDamage); attackDef.defender.sufferDamage(attackDef.finalDamage);
attackDef.defender.subHeroPoints(1); attackDef.defender.subHeroPoints(1);
} }
if (defenseMode == 'hero-in-extremis') { if (defenseMode == 'hero-in-extremis') {
attackDef.finalDamage = 0; attackDef.finalDamage = 0;
attackDef.weaponHero = attackDef.defender.weapons.find(item => item._id == weaponId); attackDef.weaponHero = attackDef.defender.weapons.find(item => item._id == weaponId);
attackDef.defender.deleteEmbeddedDocuments("Item", [ weaponId ]); attackDef.defender.deleteEmbeddedDocuments("Item", [weaponId]);
} }
ChatMessage.create({ ChatMessage.create({
alias: attackDef.defender.name, alias: attackDef.defender.name,
@ -221,7 +255,7 @@ export class BoLUtility {
attacker: attackDef.attacker, attacker: attackDef.attacker,
rollArmor: attackDef.rollArmor, rollArmor: attackDef.rollArmor,
rollHero: attackDef.rollHero, rollHero: attackDef.rollHero,
weaponHero : attackDef.weaponHero, weaponHero: attackDef.weaponHero,
armorProtect: attackDef.armorProtect, armorProtect: attackDef.armorProtect,
defender: attackDef.defender, defender: attackDef.defender,
defenseMode: attackDef.defenseMode, defenseMode: attackDef.defenseMode,
@ -264,11 +298,11 @@ export class BoLUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static removeChatMessageId(messageId) { static removeChatMessageId(messageId) {
if (messageId){ if (messageId) {
game.messages.get(messageId)?.delete(); game.messages.get(messageId)?.delete();
} }
} }
static findChatMessageId(current) { static findChatMessageId(current) {
return BoLUtility.getChatMessageId(BoLUtility.findChatMessage(current)); return BoLUtility.getChatMessageId(BoLUtility.findChatMessage(current));
} }
@ -378,23 +412,29 @@ export class BoLUtility {
if (sockmsg.name == "msg_damage_handling") { if (sockmsg.name == "msg_damage_handling") {
BoLUtility.processDamageHandling(sockmsg.data.event, sockmsg.data.attackId, sockmsg.data.defenseMode) BoLUtility.processDamageHandling(sockmsg.data.event, sockmsg.data.attackId, sockmsg.data.defenseMode)
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static computeSpellCost( spell, nbOptCond= 0) { static computeSpellCost(spell, nbOptCond = 0) {
let pp = spell.data.data.properties.ppcost let pp = spell.data.data.properties.ppcost
let minpp = __circle2minpp[spell.data.data.properties.circle] let minpp = __circle2minpp[spell.data.data.properties.circle]
pp = (pp-nbOptCond<minpp) ? minpp : pp-nbOptCond pp = (pp - nbOptCond < minpp) ? minpp : pp - nbOptCond
return pp return pp
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static getDamageFormula(damageString, modifier=0, multiplier = 1) { static getDamageFormula(weaponData) {
let damageString = weaponData.properties.damage
let modifier = weaponData.properties.damageModifiers ?? 0
let multiplier = weaponData.properties.damageMultiplier ?? 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;
let reroll = (weaponData.properties.damageReroll1) ? "r1" : "" // Reroll 1 option
let formula = damageString let formula = damageString
if ( damageString.includes("d") || damageString.includes("D")) { if (damageString.includes("d") || damageString.includes("D")) {
var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g'); var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g');
let res = myReg.exec(damageString); let res = myReg.exec(damageString);
let nbDice = parseInt(res[1]); let nbDice = parseInt(res[1]);
@ -412,7 +452,7 @@ export class BoLUtility {
modIndex = 4; modIndex = 4;
} }
} }
formula = "(" + nbDice + "d" + res[2] + postForm + "+" + modifier +") *" + multiplier; formula = "(" + nbDice + "d" + res[2] + reroll + postForm + "+" + modifier + ") *" + multiplier;
} }
return formula; return formula;
} }

View File

@ -271,4 +271,12 @@ BOL.actorIcons = {
"loot": "icons/containers/bags/sack-simple-leather-brown.webp" "loot": "icons/containers/bags/sack-simple-leather-brown.webp"
} }
BOL.bougetteState = {
"nomoney": "BOL.bougette.nomoney",
"tolive": "BOL.bougette.tolive",
"easylife": "BOL.bougette.easylife",
"luxury": "BOL.bougette.luxury",
"rich": "BOL.bougette.rich"
}
BOL.debug = false; BOL.debug = false;

View File

@ -1,65 +0,0 @@
import { BoLUtility } from "./bol-utility.js";
export class BoLRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["bol", "dialog"], width: 600, height: 320, 'z-index': 99999 };
// let html = await renderTemplate(`systems/bol/templates/roll/roll-dialog-${rollData.mode}.hbs`, rollData);
let html = await renderTemplate(`systems/bol/templates/roll/roll-dialog.hbs`, rollData);
return new BoLRollDialog(actor, rollData, html, options );
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: rollData.title,
content: html,
buttons: {
roll: {
icon: '<i class="fas fa-check"></i>',
label: game.i18n.localize("Roll"),
callback: () => { this.roll() }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: game.i18n.localize("Cancel"),
callback: () => { this.close() }
} },
default: "roll",
close: close
}
super(conf, options);
console.log("ROLLDATA ", rollData);
this.actor = actor;
this.rollData = rollData;
}
/* -------------------------------------------- */
roll () {
BoLUtility.rollBoL( this.rollData )
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
let dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#bonusMalus').change((event) => {
this.rollData.bonusMalus = Number(event.currentTarget.value);
});
html.find('#d6Bonus').change((event) => {
this.rollData.d6Bonus = Number(event.currentTarget.value);
});
html.find('#d6Malus').change((event) => {
this.rollData.d6Malus = Number(event.currentTarget.value);
});
}
}

View File

@ -1,23 +0,0 @@
export const registerSystemSettings = function() {
game.settings.register("bol", "displayDifficulty", {
name: "Affiche la difficulté",
hint: "Active l'affichage de la difficulté sur les jets de compétences/attributs et d'armes.",
scope: "world",
config: true,
default: true,
type: Boolean,
onChange: lang => window.location.reload()
});
game.settings.register("bol", "rollArmor", {
name: "Effectuer des jets pour les armures",
hint: "Effectue un jet de dés pour les armures (valeur fixe si désactivé)",
scope: "world",
config: true,
default: true,
type: Boolean,
onChange: lang => window.location.reload()
});
};

File diff suppressed because one or more lines are too long

View File

@ -7,8 +7,8 @@
"url": "https://github.com/ZigmundKreud/bol", "url": "https://github.com/ZigmundKreud/bol",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"flags": {}, "flags": {},
"version": "1.0.10", "version": "1.1.0",
"templateVersion": 20, "templateVersion": 21,
"minimumCoreVersion": "0.8.6", "minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "9", "compatibleCoreVersion": "9",
"scripts": [], "scripts": [],

View File

@ -138,6 +138,9 @@
"templates": [ "base" ], "templates": [ "base" ],
"type": "player", "type": "player",
"villainy": false, "villainy": false,
"bougette": {
"state": "nomoney"
},
"xp": { "xp": {
"key": "xp", "key": "xp",
"label": "BOL.traits.xp", "label": "BOL.traits.xp",

View File

@ -1,336 +1,394 @@
<!--ARMES--> <!--ARMES-->
<button class="create_item">Créer un Equipement</button> <button class="create_item">Créer un Equipement</button>
{{#if useBougette}}
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.weapons"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.moneyTitle"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-name flex4 left">&nbsp;</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> </li>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <li class="item flexrow" data-item-id="{{item._id}}">
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <h4 class="item-name flex4 left">
<div class="item-field flex1 right"></div> <div class="item-image"><img src="icons/containers/bags/coinpouch-simple-leather-brown.webp" title="{{localize "BOL.ui.money"}}" /></div>
</li> {{localize "BOL.ui.money"}}
{{#each weapons as |item id|}} </h4>
<li class="item flexrow" data-item-id="{{item._id}}"> <select class="field-value" name="data.bougette.state" data-dtype="String">
<h4 class="item-name flex4 left"> {{#select data.bougette.state}}
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> {{#each config.bougetteState as |value id|}}
<a class="item-edit">{{item.name}}</a> <option value="{{id}}">{{localize value}}</option>
</h4> {{/each}}
<div class="item-field flex2 center"> {{/select}}
{{#if item.data.properties.equipable}} </select>
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> </li>
{{/if}} </ol>
</div> {{/if}}
<div class="item-field group-btns flex1 center">
{{#if item.data.properties.stackable}} <ol class="items-list">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; <li class="item flexrow item-header">
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <div class="item-name flex4 left">{{localize "BOL.ui.weapons"}}</div>
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
{{/if}} <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<span class="item-field">{{item.data.price}}</span> <div class="item-field flex1 right"></div>
</div> </li>
<div class="item-field flex1 center"> {{#each weapons as |item id|}}
{{#if data.properties.equipable}} <li class="item flexrow" data-item-id="{{item._id}}">
{{#if data.worn}} <h4 class="item-name flex4 left">
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
{{else}} <a class="item-edit">{{item.name}}</a>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> </h4>
{{/if}} <div class="item-field flex2 center">
{{/if}} {{#if item.data.properties.equipable}}
</div> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
<div class="item-field flex1 right"> "BOL.equipmentSlots." item.data.properties.slot)}}</span>
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> {{/if}}
</div> </div>
</li> <div class="item-field group-btns flex1 center">
{{/each}} {{#if item.data.properties.stackable}}
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
<span class="item-field">{{item.data.quantity}}</span>&nbsp;
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
{{/if}}
</div>
<div class="item-field flex1 center">
<span class="item-field">{{item.data.price}}</span>
</div>
<div class="item-field flex1 center">
{{#if data.properties.equipable}}
{{#if data.worn}}
<span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
class="fas fa-shield-alt"></i></a></span>
{{else}}
<span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
{{/if}}
{{/if}}
</div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--PROTECTIONS--> <!--PROTECTIONS-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.protections"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.protections"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.protection"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.protection"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each protections as |item id|}} {{#each protections as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field flex2 center"> </div>
{{#if item.data.properties.equipable}} <div class="item-field flex2 center">
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{data.properties.soak.formula}}</span> {{#if item.data.properties.equipable}}
{{/if}} <span class="item-field"
</div> style="font-size: smaller; font-style: italic; color:#4b4a44">{{data.properties.soak.formula}}</span>
<div class="item-field group-btns flex1 center"> {{/if}}
{{#if item.data.properties.stackable}} </div>
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; <div class="item-field group-btns flex1 center">
<span class="item-field">{{item.data.quantity}}</span>&nbsp; {{#if item.data.properties.stackable}}
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
{{/if}} data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
</div> <span class="item-field">{{item.data.quantity}}</span>&nbsp;
<div class="item-field flex1 center"> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<span class="item-field">{{item.data.price}}</span> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
</div> {{/if}}
<div class="item-field flex1 center"> </div>
{{#if data.properties.equipable}} <div class="item-field flex1 center">
{{#if data.worn}} <span class="item-field">{{item.data.price}}</span>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> </div>
{{else}} <div class="item-field flex1 center">
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.properties.equipable}}
{{/if}} {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
</div> class="fas fa-shield-alt"></i></a></span>
<div class="item-field flex1 right"> {{else}}
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
</div> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</li> {{/if}}
{{/each}} {{/if}}
</div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--MUNITIONS--> <!--MUNITIONS-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.ammos"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.ammos"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each ammos as |item id|}} {{#each ammos as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field group-btns flex1 center"> </div>
{{#if item.data.properties.stackable}} <div class="item-field group-btns flex1 center">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; {{#if item.data.properties.stackable}}
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
{{/if}} <span class="item-field">{{item.data.quantity}}</span>&nbsp;
</div> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<div class="item-field flex1 center"> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
<span class="item-field">{{item.data.price}}</span> {{/if}}
</div> </div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">
{{#if data.properties.equipable}} <span class="item-field">{{item.data.price}}</span>
{{#if data.worn}} </div>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-field flex1 center">
{{else}} {{#if data.properties.equipable}}
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
{{/if}} class="fas fa-shield-alt"></i></a></span>
</div> {{else}}
<div class="item-field flex1 right"> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</div> {{/if}}
</li> {{/if}}
{{/each}} </div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--CONTENEURS--> <!--CONTENEURS-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.containers"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.containers"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each containers as |item id|}} {{#each containers as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field group-btns flex1 center"> </div>
{{#if item.data.properties.stackable}} <div class="item-field group-btns flex1 center">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; {{#if item.data.properties.stackable}}
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
{{/if}} <span class="item-field">{{item.data.quantity}}</span>&nbsp;
</div> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<div class="item-field flex1 center"> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
<span class="item-field">{{item.data.price}}</span> {{/if}}
</div> </div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">
{{#if data.properties.equipable}} <span class="item-field">{{item.data.price}}</span>
{{#if data.worn}} </div>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-field flex1 center">
{{else}} {{#if data.properties.equipable}}
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
{{/if}} class="fas fa-shield-alt"></i></a></span>
</div> {{else}}
<div class="item-field flex1 right"> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</div> {{/if}}
</li> {{/if}}
{{/each}} </div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--TRESOR--> <!--TRESOR-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.treasure"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.treasure"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each treasure as |item id|}} {{#each treasure as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field group-btns flex1 center"> </div>
{{#if item.data.properties.stackable}} <div class="item-field group-btns flex1 center">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; {{#if item.data.properties.stackable}}
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
{{/if}} <span class="item-field">{{item.data.quantity}}</span>&nbsp;
</div> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<div class="item-field flex1 center"> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
<span class="item-field">{{item.data.price}}</span> {{/if}}
</div> </div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">
{{#if data.properties.equipable}} <span class="item-field">{{item.data.price}}</span>
{{#if data.worn}} </div>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-field flex1 center">
{{else}} {{#if data.properties.equipable}}
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
{{/if}} class="fas fa-shield-alt"></i></a></span>
</div> {{else}}
<div class="item-field flex1 right"> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</div> {{/if}}
</li> {{/if}}
{{/each}} </div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--VEHICULES--> <!--VEHICULES-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.vehicles"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.vehicles"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each vehicles as |item id|}} {{#each vehicles as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field group-btns flex1 center"> </div>
{{#if item.data.properties.stackable}} <div class="item-field group-btns flex1 center">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; {{#if item.data.properties.stackable}}
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
{{/if}} <span class="item-field">{{item.data.quantity}}</span>&nbsp;
</div> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<div class="item-field flex1 center"> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
<span class="item-field">{{item.data.price}}</span> {{/if}}
</div> </div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">
{{#if data.properties.equipable}} <span class="item-field">{{item.data.price}}</span>
{{#if data.worn}} </div>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-field flex1 center">
{{else}} {{#if data.properties.equipable}}
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
{{/if}} class="fas fa-shield-alt"></i></a></span>
</div> {{else}}
<div class="item-field flex1 right"> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</div> {{/if}}
</li> {{/if}}
{{/each}} </div>
<div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol> </ol>
<!--DIVERS--> <!--DIVERS-->
<ol class="items-list"> <ol class="items-list">
<li class="item flexrow item-header"> <li class="item flexrow item-header">
<div class="item-name flex4 left">{{localize "BOL.ui.misc"}}</div> <div class="item-name flex4 left">{{localize "BOL.ui.misc"}}</div>
<div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div> <div class="item-field flex2 center">{{localize "BOL.ui.slot"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.qty"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.price"}}</div>
<div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div> <div class="item-field flex1 center">{{localize "BOL.ui.equip"}}</div>
<div class="item-field flex1 right"></div> <div class="item-field flex1 right"></div>
</li> </li>
{{#each misc as |item id|}} {{#each misc as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
<h4 class="item-name flex4 left"> <h4 class="item-name flex4 left">
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}"/></div> <div class="item-image"><img src="{{item.img}}" title="{{item.name}}" /></div>
<a class="item-edit">{{item.name}}</a> <a class="item-edit">{{item.name}}</a>
</h4> </h4>
<div class="item-field flex2 center"> <div class="item-field flex2 center">
{{#if item.data.properties.equipable}} {{#if item.data.properties.equipable}}
<span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat "BOL.equipmentSlots." item.data.properties.slot)}}</span> <span class="item-field" style="font-size: smaller; font-style: italic; color:#4b4a44">{{localize (concat
{{/if}} "BOL.equipmentSlots." item.data.properties.slot)}}</span>
</div> {{/if}}
<div class="item-field group-btns flex1 center"> </div>
{{#if item.data.properties.stackable}} <div class="item-field group-btns flex1 center">
<a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp; {{#if item.data.properties.stackable}}
<span class="item-field">{{item.data.quantity}}</span>&nbsp; <a class="inc-dec-btns" data-operator="minus" data-target="data.quantity" data-incr="1" data-min="0"
<a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0" data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-minus-square"></i></a>&nbsp;
{{/if}} <span class="item-field">{{item.data.quantity}}</span>&nbsp;
</div> <a class="inc-dec-btns" data-operator="plus" data-target="data.quantity" data-incr="1" data-min="0"
<div class="item-field flex1 center"> data-max="{{item.data.properties.stacksize}}"><i class="fas fa-plus-square"></i></a>
<span class="item-field">{{item.data.price}}</span> {{/if}}
</div> </div>
<div class="item-field flex1 center"> <div class="item-field flex1 center">
{{#if data.properties.equipable}} <span class="item-field">{{item.data.price}}</span>
{{#if data.worn}} </div>
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.unequip"}}"><i class="fas fa-shield-alt"></i></a></span> <div class="item-field flex1 center">
{{else}} {{#if data.properties.equipable}}
<span class="item-field"><a class="item-control item-equip" title="{{localize "BOL.ui.equip"}}" style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span> {{#if data.worn}}
{{/if}} <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.unequip"}}"><i
{{/if}} class="fas fa-shield-alt"></i></a></span>
</div> {{else}}
<div class="item-field flex1 right"> <span class="item-field"><a class="item-control item-equip" title="{{localize " BOL.ui.equip"}}"
<a class="item-control item-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a> style="color:lightgray;"><i class="fas fa-shield-alt"></i></a></span>
</div> {{/if}}
</li> {{/if}}
{{/each}} </div>
</ol> <div class="item-field flex1 right">
<a class="item-control item-delete" title="{{localize " BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>

View File

@ -1,22 +1,43 @@
<div class="flexrow" style="margin-bottom: 1px;"> {{#if isRanged}}
<div class="flex1 center bg-darkred"> <div class="flexrow" style="margin-bottom: 1px;">
<label for="mod">{{localize 'BOL.ui.modifiers'}}</label> <div class="flex1 center bg-darkred">
</div> <label for="modRanged">{{localize 'BOL.ui.rangeModifiers'}}</label>
<div class="flex1 center cell"> </div>
<select name="mod" id="mod" value="{{mod}}"> <div class="flex1 center cell">
{{#select mod}} <select name="modRanged" id="modRanged" value="{{mod}}">
<option value="4">Inmanquable (+4)</option> {{#select modRanged}}
<option value="2">Trés Facile (+2)</option> <option value="1">Bout portant (+1)</option>
<option value="1">Facile (+1)</option> <option value="0">Courte (0)</option>
<option value="0">Moyenne (0)</option> <option value="-1">Moyenne (-1)</option>
<option value="-1">Ardue (-1)</option> <option value="-2">Longue (-2)</option>
<option value="-2">Difficile (-2)</option> <option value="-4">Très longue (-4)</option>
<option value="-4">Très Difficile (-4)</option> <option value="-6">Extrême (-6)</option>
<option value="-6">Impossible (-6)</option> <option value="-8">Maximale (-8)</option>
<option value="-8">Héroïque (-8)</option> {{/select}}
<option value="-10">Mythique (-10)</option> </select>
<option value="-12">Divine (-12)</option> </div>
{{/select}} </div>
</select> {{/if}}
</div>
</div> <div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.modifiers'}}</label>
</div>
<div class="flex1 center cell">
<select name="mod" id="mod" value="{{mod}}">
{{#select mod}}
<option value="4">Inmanquable (+4)</option>
<option value="2">Trés Facile (+2)</option>
<option value="1">Facile (+1)</option>
<option value="0">Moyenne (0)</option>
<option value="-1">Ardue (-1)</option>
<option value="-2">Difficile (-2)</option>
<option value="-4">Très Difficile (-4)</option>
<option value="-6">Impossible (-6)</option>
<option value="-8">Héroïque (-8)</option>
<option value="-10">Mythique (-10)</option>
<option value="-12">Divine (-12)</option>
{{/select}}
</select>
</div>
</div>

4
ui/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,2,20,16,48,54.627
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

4
ui/attributes/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,2,20,21,30,17.02
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

4
ui/icons/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,2,20,21,29,59.667
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails