commit
7bf9dabf32
@ -102,6 +102,11 @@
|
|||||||
"BOL.ui.shieldMalus": "Malus de Bouclier",
|
"BOL.ui.shieldMalus": "Malus de Bouclier",
|
||||||
"BOL.ui.defenseScore": "Score de Defense",
|
"BOL.ui.defenseScore": "Score de Defense",
|
||||||
"BOL.ui.defender": "Défenseur",
|
"BOL.ui.defender": "Défenseur",
|
||||||
|
"BOL.ui.difficulty": "Difficulty",
|
||||||
|
"BOL.ui.spellProperties": "Spell Properties",
|
||||||
|
"BOL.ui.duration": "Duration",
|
||||||
|
"BOL.ui.spellkeep": "Maintain",
|
||||||
|
"BOL.ui.concentrate": "Concentrate",
|
||||||
|
|
||||||
"BOL.featureCategory.origins": "Origines",
|
"BOL.featureCategory.origins": "Origines",
|
||||||
"BOL.featureCategory.races": "Races",
|
"BOL.featureCategory.races": "Races",
|
||||||
@ -198,6 +203,7 @@
|
|||||||
"BOL.itemProperty.slot" : "Emplacement utilisé",
|
"BOL.itemProperty.slot" : "Emplacement utilisé",
|
||||||
"BOL.itemProperty.reload": "Rechargement (Actions)",
|
"BOL.itemProperty.reload": "Rechargement (Actions)",
|
||||||
"BOL.itemProperty.weaponSize" : "Classe d'arme",
|
"BOL.itemProperty.weaponSize" : "Classe d'arme",
|
||||||
|
"BOL.itemProperty.difficulty": "Difficulty",
|
||||||
|
|
||||||
"BOL.itemStat.quantity": "Quantité",
|
"BOL.itemStat.quantity": "Quantité",
|
||||||
"BOL.itemStat.weight": "Poids",
|
"BOL.itemStat.weight": "Poids",
|
||||||
|
10
lang/fr.json
10
lang/fr.json
@ -53,8 +53,8 @@
|
|||||||
"BOL.ui.delete": "Supprimer",
|
"BOL.ui.delete": "Supprimer",
|
||||||
"BOL.ui.roll" : "Utiliser",
|
"BOL.ui.roll" : "Utiliser",
|
||||||
"BOL.ui.equipment" : "Équipement",
|
"BOL.ui.equipment" : "Équipement",
|
||||||
"BOL.ui.equipmentProperties" : "Propiétés d'équipement",
|
"BOL.ui.equipmentProperties" : "Propriétés d'équipement",
|
||||||
"BOL.ui.weaponProperties" : "Propiétés offensives",
|
"BOL.ui.weaponProperties" : "Propriétés offensives",
|
||||||
"BOL.ui.protectionProperties" : "Protection",
|
"BOL.ui.protectionProperties" : "Protection",
|
||||||
"BOL.ui.magicalProperties" : "Propriétés magiques",
|
"BOL.ui.magicalProperties" : "Propriétés magiques",
|
||||||
"BOL.ui.capacityProperties" : "Propriétés de capacité",
|
"BOL.ui.capacityProperties" : "Propriétés de capacité",
|
||||||
@ -103,6 +103,11 @@
|
|||||||
"BOL.ui.shieldMalus": "Malus de Bouclier",
|
"BOL.ui.shieldMalus": "Malus de Bouclier",
|
||||||
"BOL.ui.defenseScore": "Score de Defense",
|
"BOL.ui.defenseScore": "Score de Defense",
|
||||||
"BOL.ui.defender": "Défenseur",
|
"BOL.ui.defender": "Défenseur",
|
||||||
|
"BOL.ui.difficulty": "Difficulté",
|
||||||
|
"BOL.ui.spellProperties": "Propriétés du Sort",
|
||||||
|
"BOL.ui.duration": "Durée",
|
||||||
|
"BOL.ui.spellkeep": "Prolongation",
|
||||||
|
"BOL.ui.concentrate": "Concentration",
|
||||||
|
|
||||||
"BOL.featureCategory.origins": "Origines",
|
"BOL.featureCategory.origins": "Origines",
|
||||||
"BOL.featureCategory.races": "Races",
|
"BOL.featureCategory.races": "Races",
|
||||||
@ -199,6 +204,7 @@
|
|||||||
"BOL.itemProperty.slot" : "Emplacement utilisé",
|
"BOL.itemProperty.slot" : "Emplacement utilisé",
|
||||||
"BOL.itemProperty.reload": "Rechargement (Actions)",
|
"BOL.itemProperty.reload": "Rechargement (Actions)",
|
||||||
"BOL.itemProperty.weaponSize" : "Classe d'arme",
|
"BOL.itemProperty.weaponSize" : "Classe d'arme",
|
||||||
|
"BOL.itemProperty.difficulty": "Difficulté",
|
||||||
|
|
||||||
"BOL.itemStat.quantity": "Quantité",
|
"BOL.itemStat.quantity": "Quantité",
|
||||||
"BOL.itemStat.weight": "Poids",
|
"BOL.itemStat.weight": "Poids",
|
||||||
|
@ -115,7 +115,7 @@ export class BoLActorSheet extends ActorSheet {
|
|||||||
formData.details = this.actor.details;
|
formData.details = this.actor.details;
|
||||||
formData.attributes = this.actor.attributes;
|
formData.attributes = this.actor.attributes;
|
||||||
formData.aptitudes = this.actor.aptitudes;
|
formData.aptitudes = this.actor.aptitudes;
|
||||||
formData.resources = this.actor.resources;
|
formData.resources = this.actor.getResourcesFromType();
|
||||||
formData.equipment = this.actor.equipment;
|
formData.equipment = this.actor.equipment;
|
||||||
formData.weapons = this.actor.weapons;
|
formData.weapons = this.actor.weapons;
|
||||||
formData.protections = this.actor.protections;
|
formData.protections = this.actor.protections;
|
||||||
|
@ -12,7 +12,12 @@ export class BoLActor extends Actor {
|
|||||||
// const flags = actorData.flags;
|
// const flags = actorData.flags;
|
||||||
// Make separate methods for each Actor type (character, npc, etc.) to keep things organized.
|
// Make separate methods for each Actor type (character, npc, etc.) to keep things organized.
|
||||||
if (actorData.type === 'character') {
|
if (actorData.type === 'character') {
|
||||||
//this._prepareCharacterData(actorData);
|
actorData.type = 'player';
|
||||||
|
actorData.villainy = false;
|
||||||
|
}
|
||||||
|
if (actorData.type === 'encounter') {
|
||||||
|
actorData.type = 'tough';
|
||||||
|
actorData.villainy = true;
|
||||||
}
|
}
|
||||||
super.prepareData();
|
super.prepareData();
|
||||||
}
|
}
|
||||||
@ -24,13 +29,15 @@ export class BoLActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
updateResourcesData( ) {
|
updateResourcesData( ) {
|
||||||
let newVitality = 10 + this.data.data.attributes.vigor.value + this.data.data.resources.hp.bonus
|
if ( this.type == 'character') {
|
||||||
if ( this.data.data.resources.hp.max != newVitality) {
|
let newVitality = 10 + this.data.data.attributes.vigor.value + this.data.data.resources.hp.bonus
|
||||||
this.update( {'data.resources.hp.max': newVitality} );
|
if ( this.data.data.resources.hp.max != newVitality) {
|
||||||
}
|
this.update( {'data.resources.hp.max': newVitality} );
|
||||||
let newPower = 10 + this.data.data.attributes.mind.value + this.data.data.resources.power.bonus
|
}
|
||||||
if ( this.data.data.resources.power.max != newPower) {
|
let newPower = 10 + this.data.data.attributes.mind.value + this.data.data.resources.power.bonus
|
||||||
this.update( {'data.resources.power.max': newPower} );
|
if ( this.data.data.resources.power.max != newPower) {
|
||||||
|
this.update( {'data.resources.power.max': newPower} );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +134,35 @@ export class BoLActor extends Actor {
|
|||||||
return this.itemData.filter(i => i.type === "item" && i.data.category === "equipment" && (i.data.subtype === "other" ||i.data.subtype === "container" ||i.data.subtype === "scroll" || i.data.subtype === "jewel"));
|
return this.itemData.filter(i => i.type === "item" && i.data.category === "equipment" && (i.data.subtype === "other" ||i.data.subtype === "container" ||i.data.subtype === "scroll" || i.data.subtype === "jewel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
heroReroll( ) {
|
||||||
|
if (this.type == 'character') {
|
||||||
|
return this.data.data.resources.hero.value > 0;
|
||||||
|
} else {
|
||||||
|
if (this.data.data.type == 'adversary') {
|
||||||
|
return this.data.data.resources.hero.value > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
getResourcesFromType() {
|
||||||
|
let resources = {};
|
||||||
|
if (this.type == 'encounter') {
|
||||||
|
resources['hp'] = this.data.data.resources.hp;
|
||||||
|
if (this.data.data.type != 'base') {
|
||||||
|
resources['faith'] = this.data.data.resources.faith
|
||||||
|
resources['power'] = this.data.data.resources.power
|
||||||
|
}
|
||||||
|
if (this.data.data.type == 'adversary') {
|
||||||
|
resources['hero'] = duplicate(this.data.data.resources.hero)
|
||||||
|
resources['hero'].label = "BOL.resources.villainy"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resources = this.data.data.resources;
|
||||||
|
}
|
||||||
|
return resources
|
||||||
|
}
|
||||||
|
|
||||||
buildFeatures(){
|
buildFeatures(){
|
||||||
return {
|
return {
|
||||||
"careers": {
|
"careers": {
|
||||||
|
@ -89,7 +89,7 @@ export class BoLRoll {
|
|||||||
const adv = html.find('#adv').val();
|
const adv = html.find('#adv').val();
|
||||||
const mod = html.find('#mod').val();
|
const mod = html.find('#mod').val();
|
||||||
let careers = html.find('#career').val();
|
let careers = html.find('#career').val();
|
||||||
const career = (careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
const career = (!careers || careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
||||||
const isMalus = adv < 0;
|
const isMalus = adv < 0;
|
||||||
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
||||||
const attrValue = eval(`actor.data.data.attributes.${attr}.value`);
|
const attrValue = eval(`actor.data.data.attributes.${attr}.value`);
|
||||||
@ -118,7 +118,9 @@ export class BoLRoll {
|
|||||||
careers: attackDef.attackerData.features.careers,
|
careers: attackDef.attackerData.features.careers,
|
||||||
boons: attackDef.attackerData.features.boons,
|
boons: attackDef.attackerData.features.boons,
|
||||||
flaws: attackDef.attackerData.features.flaws,
|
flaws: attackDef.attackerData.features.flaws,
|
||||||
|
defence: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (attackDef.defender) {
|
if (attackDef.defender) {
|
||||||
dialogData.defence = attackDef.defender.defenseValue,
|
dialogData.defence = attackDef.defender.defenseValue,
|
||||||
dialogData.shieldBlock = 'none'
|
dialogData.shieldBlock = 'none'
|
||||||
@ -156,7 +158,7 @@ export class BoLRoll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let careers = html.find('#career').val();
|
let careers = html.find('#career').val();
|
||||||
const career = (careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
const career = (!careers || careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
||||||
const isMalus = adv < 0;
|
const isMalus = adv < 0;
|
||||||
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
||||||
const attrValue = eval(`attackDef.attacker.data.data.attributes.${attr}.value`);
|
const attrValue = eval(`attackDef.attacker.data.data.attributes.${attr}.value`);
|
||||||
@ -204,7 +206,7 @@ export class BoLRoll {
|
|||||||
const adv = html.find('#adv').val();
|
const adv = html.find('#adv').val();
|
||||||
const mod = html.find('#mod').val();
|
const mod = html.find('#mod').val();
|
||||||
let careers = html.find('#career').val();
|
let careers = html.find('#career').val();
|
||||||
const career = (careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
const career = (!careers || careers.length == 0) ? 0 : Math.max(...careers.map(i => parseInt(i)));
|
||||||
const isMalus = adv < 0;
|
const isMalus = adv < 0;
|
||||||
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv);
|
||||||
const aptValue = eval(`actor.data.data.aptitudes.${apt}.value`);
|
const aptValue = eval(`actor.data.data.aptitudes.${apt}.value`);
|
||||||
@ -259,6 +261,7 @@ export class BoLDefaultRoll {
|
|||||||
const tplData = {
|
const tplData = {
|
||||||
actor: actor,
|
actor: actor,
|
||||||
label: this._label,
|
label: this._label,
|
||||||
|
reroll: actor.heroReroll(),
|
||||||
isSuccess: this._isSuccess,
|
isSuccess: this._isSuccess,
|
||||||
isFailure: !this._isSuccess,
|
isFailure: !this._isSuccess,
|
||||||
isCritical: this._isCritical,
|
isCritical: this._isCritical,
|
||||||
@ -280,9 +283,10 @@ export class BoLAttackRoll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async roll() {
|
async roll() {
|
||||||
|
console.log("Attack def",this.attackDef.formula )
|
||||||
const r = new Roll(this.attackDef.formula);
|
const r = new Roll(this.attackDef.formula);
|
||||||
await r.roll({ "async": false });
|
await r.roll({ "async": false });
|
||||||
//await BoLUtility.showDiceSoNice(r);
|
await BoLUtility.showDiceSoNice(r);
|
||||||
const activeDice = r.terms[0].results.filter(r => r.active);
|
const activeDice = r.terms[0].results.filter(r => r.active);
|
||||||
const diceTotal = activeDice.map(r => r.result).reduce((a, b) => a + b);
|
const diceTotal = activeDice.map(r => r.result).reduce((a, b) => a + b);
|
||||||
this._isSuccess = (r.total >= 9);
|
this._isSuccess = (r.total >= 9);
|
||||||
@ -294,16 +298,39 @@ export class BoLAttackRoll {
|
|||||||
flavor: msgFlavor,
|
flavor: msgFlavor,
|
||||||
speaker: ChatMessage.getSpeaker({ actor: this.attackDef.attacker }),
|
speaker: ChatMessage.getSpeaker({ actor: this.attackDef.attacker }),
|
||||||
flags: { msgType: "default" }
|
flags: { msgType: "default" }
|
||||||
});
|
}).then( this.processResult() );
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async processDefense() {
|
||||||
|
if (this._isCritical) {
|
||||||
|
ChatMessage.create({
|
||||||
|
alias: this.attackDef.attacker.name,
|
||||||
|
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.attackDef.attacker.name),
|
||||||
|
content: await renderTemplate('systems/bol/templates/chat/rolls/attack-heroic-card.hbs', {
|
||||||
|
attackId: attackDef.id,
|
||||||
|
attacker: attackDef.attacker,
|
||||||
|
defender: attackDef.defender,
|
||||||
|
defenderWeapons: defenderWeapons,
|
||||||
|
damageTotal: attackDef.damageRoll.total
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
BoLUtility.sendAttackSuccess( this.attackDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async processResult( ) {
|
||||||
if (this._isSuccess) {
|
if (this._isSuccess) {
|
||||||
let attrDamage = this.attackDef.weapon.data.data.properties.damageAttribute;
|
let attrDamage = this.attackDef.weapon.data.data.properties.damageAttribute;
|
||||||
let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage)
|
let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage,
|
||||||
|
this.attackDef.weapon.data.data.properties.damageModifiers,
|
||||||
|
this.attackDef.weapon.data.data.properties.damageMultiplier)
|
||||||
let damageFormula = weaponFormula + "+" + this.attackDef.attacker.data.data.attributes[attrDamage].value;
|
let damageFormula = weaponFormula + "+" + this.attackDef.attacker.data.data.attributes[attrDamage].value;
|
||||||
|
console.log("Formula", damageFormula)
|
||||||
this.damageRoll = new Roll(damageFormula);
|
this.damageRoll = new Roll(damageFormula);
|
||||||
await this.damageRoll.roll({ "async": false });
|
await this.damageRoll.roll({ "async": false });
|
||||||
//await BoLUtility.showDiceSoNice(this.damageRoll);
|
await BoLUtility.showDiceSoNice(this.damageRoll);
|
||||||
// Update attackDef object
|
// Update attackDef object
|
||||||
this.attackDef.damageFormula = damageFormula;
|
this.attackDef.damageFormula = damageFormula;
|
||||||
this.attackDef.damageRoll = this.damageRoll;
|
this.attackDef.damageRoll = this.damageRoll;
|
||||||
@ -314,23 +341,8 @@ export class BoLAttackRoll {
|
|||||||
flavor: msgFlavor,
|
flavor: msgFlavor,
|
||||||
speaker: ChatMessage.getSpeaker({ actor: this.attackDef.attacker }),
|
speaker: ChatMessage.getSpeaker({ actor: this.attackDef.attacker }),
|
||||||
flags: { msgType: "default" }
|
flags: { msgType: "default" }
|
||||||
});
|
}).then( this.processDefense() );
|
||||||
});
|
});
|
||||||
if (this._isCritical) {
|
|
||||||
ChatMessage.create({
|
|
||||||
alias: this.attackDef.attacker.name,
|
|
||||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.attackDef.attacker.name),
|
|
||||||
content: await renderTemplate('systems/bol/templates/chat/rolls/attack-heroic-card.hbs', {
|
|
||||||
attackId: attackDef.id,
|
|
||||||
attacker: attackDef.attacker,
|
|
||||||
defender: attackDef.defender,
|
|
||||||
defenderWeapons: defenderWeapons,
|
|
||||||
damageTotal: attackDef.damageRoll.total
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
BoLUtility.sendAttackSuccess( this.attackDef);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,6 +363,7 @@ export class BoLAttackRoll {
|
|||||||
const tplData = {
|
const tplData = {
|
||||||
actor: actor,
|
actor: actor,
|
||||||
label: this._label,
|
label: this._label,
|
||||||
|
reroll: actor.heroReroll(),
|
||||||
isSuccess: this._isSuccess,
|
isSuccess: this._isSuccess,
|
||||||
isFailure: !this._isSuccess,
|
isFailure: !this._isSuccess,
|
||||||
isCritical: this._isCritical,
|
isCritical: this._isCritical,
|
||||||
|
@ -111,6 +111,7 @@ export class BoLUtility {
|
|||||||
static async chatListeners(html) {
|
static async chatListeners(html) {
|
||||||
// Damage handling
|
// Damage handling
|
||||||
html.on("click", '.damage-increase', event => {
|
html.on("click", '.damage-increase', event => {
|
||||||
|
event.preventDefault();
|
||||||
let attackId = event.currentTarget.attributes['data-attack-id'].value;
|
let attackId = event.currentTarget.attributes['data-attack-id'].value;
|
||||||
let damageMode = event.currentTarget.attributes['data-damage-mode'].value;
|
let damageMode = event.currentTarget.attributes['data-damage-mode'].value;
|
||||||
if ( game.user.isGM) {
|
if ( game.user.isGM) {
|
||||||
@ -120,11 +121,17 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
html.on("click", '.hero-reroll', event => {
|
||||||
|
event.preventDefault();
|
||||||
|
ui.notifications.warn("Not implemented up to now");
|
||||||
|
} );
|
||||||
|
|
||||||
html.on("click", '.damage-handling', event => {
|
html.on("click", '.damage-handling', event => {
|
||||||
|
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
|
||||||
//console.log("DEFENSE1", event.currentTarget, attackId, defenseMode, weaponId);
|
console.log("DEFENSE1", event.currentTarget, attackId, defenseMode, weaponId);
|
||||||
if ( game.user.isGM) {
|
if ( game.user.isGM) {
|
||||||
BoLUtility.processDamageHandling(event, attackId, defenseMode, weaponId)
|
BoLUtility.processDamageHandling(event, attackId, defenseMode, weaponId)
|
||||||
} else {
|
} else {
|
||||||
@ -165,10 +172,14 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
BoLUtility.removeChatMessageId(BoLUtility.findChatMessageId(event.currentTarget));
|
BoLUtility.removeChatMessageId(BoLUtility.findChatMessageId(event.currentTarget));
|
||||||
|
|
||||||
|
//console.log("Damage Handling", event, attackId, defenseMode, weaponId)
|
||||||
// Only GM process this
|
// Only GM process this
|
||||||
let attackDef = this.attackStore[attackId];
|
let attackDef = this.attackStore[attackId];
|
||||||
if (attackDef) {
|
if (attackDef) {
|
||||||
|
if (attackDef.defenseDone) return; // ?? Why ???
|
||||||
|
attackDef.defenseDone = true
|
||||||
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)
|
||||||
@ -249,7 +260,6 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
static removeChatMessageId(messageId) {
|
static removeChatMessageId(messageId) {
|
||||||
if (messageId){
|
if (messageId){
|
||||||
game.messages.get(messageId)?.delete();
|
game.messages.get(messageId)?.delete();
|
||||||
@ -371,8 +381,9 @@ export class BoLUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getDamageFormula(damageString) {
|
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;
|
||||||
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]);
|
||||||
@ -390,7 +401,7 @@ export class BoLUtility {
|
|||||||
modIndex = 4;
|
modIndex = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let formula = nbDice + "d" + res[2] + postForm + ((res[modIndex]) ? res[modIndex] : "");
|
let formula = "(" + nbDice + "d" + res[2] + postForm + "+" + modifier +") *" + multiplier;
|
||||||
return formula;
|
return formula;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -17,6 +17,13 @@ BOL.damageValues = {
|
|||||||
"d6BB" : "d6B + dé bonus",
|
"d6BB" : "d6B + dé bonus",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOL.damageMultiplier = {
|
||||||
|
"1": "x1",
|
||||||
|
"2": "x2",
|
||||||
|
"3": "x3",
|
||||||
|
"4": "x4",
|
||||||
|
}
|
||||||
|
|
||||||
BOL.equipmentSlots = {
|
BOL.equipmentSlots = {
|
||||||
"none" : "BOL.equipmentSlots.none",
|
"none" : "BOL.equipmentSlots.none",
|
||||||
"head" : "BOL.equipmentSlots.head",
|
"head" : "BOL.equipmentSlots.head",
|
||||||
@ -189,7 +196,8 @@ BOL.itemProperties2 = {
|
|||||||
"throwing" : "BOL.itemProperty.throwing",
|
"throwing" : "BOL.itemProperty.throwing",
|
||||||
"activable" : "BOL.itemProperty.activable",
|
"activable" : "BOL.itemProperty.activable",
|
||||||
"powder" : "BOL.itemProperty.powder",
|
"powder" : "BOL.itemProperty.powder",
|
||||||
"damage" : "BOL.itemProperty.damage"
|
"damage" : "BOL.itemProperty.damage",
|
||||||
|
"difficulty": "BOL.itemProperty.difficulty"
|
||||||
}
|
}
|
||||||
|
|
||||||
BOL.itemStats = {
|
BOL.itemStats = {
|
||||||
|
@ -4,6 +4,10 @@ export const registerHandlebarsHelpers = function () {
|
|||||||
return val == null;
|
return val == null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('exists', function (val) {
|
||||||
|
return val != null && val != undefined;
|
||||||
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper('isEmpty', function (list) {
|
Handlebars.registerHelper('isEmpty', function (list) {
|
||||||
if (list) return list.length == 0;
|
if (list) return list.length == 0;
|
||||||
else return 0;
|
else return 0;
|
||||||
|
@ -23,6 +23,7 @@ export const preloadHandlebarsTemplates = async function () {
|
|||||||
"systems/bol/templates/item/parts/properties/item/vehicle-properties.hbs",
|
"systems/bol/templates/item/parts/properties/item/vehicle-properties.hbs",
|
||||||
"systems/bol/templates/item/parts/properties/item/protection-properties.hbs",
|
"systems/bol/templates/item/parts/properties/item/protection-properties.hbs",
|
||||||
"systems/bol/templates/item/parts/properties/item/weapon-properties.hbs",
|
"systems/bol/templates/item/parts/properties/item/weapon-properties.hbs",
|
||||||
|
"systems/bol/templates/item/parts/properties/item/spell-properties.hbs",
|
||||||
"systems/bol/templates/item/parts/properties/item/magical-properties.hbs",
|
"systems/bol/templates/item/parts/properties/item/magical-properties.hbs",
|
||||||
"systems/bol/templates/item/parts/properties/feature/career-properties.hbs",
|
"systems/bol/templates/item/parts/properties/feature/career-properties.hbs",
|
||||||
"systems/bol/templates/item/parts/properties/feature/boon-properties.hbs",
|
"systems/bol/templates/item/parts/properties/feature/boon-properties.hbs",
|
||||||
|
@ -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": "0.8.9.2",
|
"version": "0.8.9.6",
|
||||||
"templateVersion": 10,
|
"templateVersion": 14,
|
||||||
"minimumCoreVersion": "0.8.6",
|
"minimumCoreVersion": "0.8.6",
|
||||||
"compatibleCoreVersion": "9",
|
"compatibleCoreVersion": "9",
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
|
@ -109,6 +109,7 @@
|
|||||||
"key": "power",
|
"key": "power",
|
||||||
"label": "BOL.resources.power",
|
"label": "BOL.resources.power",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
|
"bonus": 0,
|
||||||
"max": 0
|
"max": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,7 +117,7 @@
|
|||||||
},
|
},
|
||||||
"character": {
|
"character": {
|
||||||
"templates": [ "base" ],
|
"templates": [ "base" ],
|
||||||
"type": "npc",
|
"type": "player",
|
||||||
"villainy": false,
|
"villainy": false,
|
||||||
"xp": {
|
"xp": {
|
||||||
"key": "xp",
|
"key": "xp",
|
||||||
@ -134,6 +135,7 @@
|
|||||||
"encounter": {
|
"encounter": {
|
||||||
"templates": [ "base" ],
|
"templates": [ "base" ],
|
||||||
"type": "tough",
|
"type": "tough",
|
||||||
|
"villainy": false,
|
||||||
"size": "",
|
"size": "",
|
||||||
"environment": ""
|
"environment": ""
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
<label class="header-field-label flex2">Nom</label><br/>
|
<label class="header-field-label flex2">Nom</label><br/>
|
||||||
<input class="charname flex6" name="name" type="text" value="{{actor.name}}" placeholder="Name"/>
|
<input class="charname flex6" name="name" type="text" value="{{actor.name}}" placeholder="Name"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#if (eq data.type "player")}}
|
||||||
<div class="header-field-group flexrow">
|
<div class="header-field-group flexrow">
|
||||||
<label class="header-field-label flex2">Experience</label><br/>
|
<label class="header-field-label flex2">Experience</label><br/>
|
||||||
<div class="header-field-group flex3">
|
<div class="header-field-group flex3">
|
||||||
@ -15,7 +17,19 @@
|
|||||||
<label class="header-field-label flex1" style="font-size: 1.5em; color:#606060;"> Totale</label><br/>
|
<label class="header-field-label flex1" style="font-size: 1.5em; color:#606060;"> Totale</label><br/>
|
||||||
<input class="header-field-value flex1" type="text" name="data.xp.total" value="{{numberFormat data.xp.total decimals=0 sign=false}}" data-dtype="Number"/><br/>
|
<input class="header-field-value flex1" type="text" name="data.xp.total" value="{{numberFormat data.xp.total decimals=0 sign=false}}" data-dtype="Number"/><br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="header-field-group flexrow">
|
||||||
|
<label class="header-field-label flex2">Type : </label><br/>
|
||||||
|
<select class="field-value" name="data.type" data-dtype="String">
|
||||||
|
{{#select data.type}}
|
||||||
|
<option value="base">Piétaille</option>
|
||||||
|
<option value="tough">Coriace</option>
|
||||||
|
<option value="adversary">Adversaire</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
<ol class="items-list">
|
|
||||||
<li class="item flexrow item-header">
|
|
||||||
<div class="item-name flex2">{{localize "BOL.ui.maneuvers"}}</div>
|
|
||||||
</li>
|
|
||||||
<li class="item flexrow"><div class="item-image roll-weapon"><img src="icons/skills/melee/unarmed-punch-fist.webp" title="Attaque à mains nues"/></div><h4 class="item-name flex2"><a class="item-edit">Attaque à mains nues</a></h4></li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
{{#each combat as |combatType id|}}
|
{{#each combat as |combatType id|}}
|
||||||
<ol class="items-list">
|
<ol class="items-list">
|
||||||
<li class="item flexrow item-header">
|
<li class="item flexrow item-header">
|
||||||
|
@ -23,10 +23,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="resources flexrow">
|
<div class="resources flexrow">
|
||||||
{{#each data.resources as |resource id|}}
|
{{#each resources as |resource id|}}
|
||||||
<div class="resource stat flex1 flex-group-center">
|
<div class="resource stat flex1 flex-group-center">
|
||||||
<label class="stat-label">{{localize label}}</label><br/>
|
<label class="stat-label">{{localize label}}</label><br/>
|
||||||
<input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/>
|
<input class="stat-value" type="text" name="data.resources.{{key}}.value" value="{{numberFormat value decimals=0 sign=false}}" data-dtype="Number"/>
|
||||||
|
{{#if (eq @root.data.type 'player')}}
|
||||||
|
{{#if (exists bonus)}}
|
||||||
|
<span class="flexrow"><label class="stat-max">Bonus:</label><input class="stat-max" type="text" name="data.resources.{{key}}.bonus" value="{{numberFormat bonus decimals=0 sign=false}}" data-dtype="Number"/></span>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
<input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/>
|
<input class="stat-max" type="text" name="data.resources.{{key}}.max" value="{{numberFormat max decimals=0 sign=false}}" data-dtype="Number"/>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
<h2 class="failure"><i class="fas fa-times"></i> {{localize "BOL.ui.failure"}}...</h2>
|
<h2 class="failure"><i class="fas fa-times"></i> {{localize "BOL.ui.failure"}}...</h2>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<h3><strong>{{description}}</strong>
|
<h3><strong>{{description}}</strong></h3>
|
||||||
|
{{#if reroll}}
|
||||||
|
<a class="button hero-reroll" data-actor-id="{{actor.id}}">Relancer!</a>
|
||||||
|
{{/if}}
|
||||||
{{!#if hasDescription}}
|
{{!#if hasDescription}}
|
||||||
<!--<h4>-->
|
<!--<h4>-->
|
||||||
<!-- <pre class="rollDescr-line">{{!description}}</pre>-->
|
<!-- <pre class="rollDescr-line">{{!description}}</pre>-->
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab properties" data-group="primary" data-tab="properties">
|
<div class="tab properties" data-group="primary" data-tab="properties">
|
||||||
{{#if (equals item.type "item")}}
|
{{#if (eq item.type "item")}}
|
||||||
{{> "systems/bol/templates/item/parts/properties/item-properties.hbs"}}
|
{{> "systems/bol/templates/item/parts/properties/item-properties.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (equals item.type "feature")}}
|
{{#if (eq item.type "feature")}}
|
||||||
{{> "systems/bol/templates/item/parts/properties/feature-properties.hbs"}}
|
{{> "systems/bol/templates/item/parts/properties/feature-properties.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,12 +11,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if (equals data.category "equipment")}}
|
{{#if (eq data.category "equipment")}}
|
||||||
{{> "systems/bol/templates/item/parts/properties/item/equipment-properties.hbs"}}
|
{{> "systems/bol/templates/item/parts/properties/item/equipment-properties.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (equals data.category "capacity")}}
|
{{#if (eq data.category "capacity")}}
|
||||||
{{> "systems/bol/templates/item/parts/properties/item/capacity-properties.hbs"}}
|
{{> "systems/bol/templates/item/parts/properties/item/capacity-properties.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (equals data.category "vehicle")}}
|
{{#if (eq data.category "vehicle")}}
|
||||||
{{> "systems/bol/templates/item/parts/properties/item/vehicle-properties.hbs"}}
|
{{> "systems/bol/templates/item/parts/properties/item/vehicle-properties.hbs"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if (eq data.category "spell")}}
|
||||||
|
{{> "systems/bol/templates/item/parts/properties/item/spell-properties.hbs"}}
|
||||||
|
{{/if}}
|
||||||
|
27
templates/item/parts/properties/item/spell-properties.hbs
Normal file
27
templates/item/parts/properties/item/spell-properties.hbs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<h3 class="form-header">{{localize "BOL.ui.spellProperties"}}</h3>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-fields center">
|
||||||
|
<label class="property-label">{{localize "BOL.ui.difficulty"}}</label>
|
||||||
|
<input class="field-value" type="text" name="data.properties.difficulty" value="{{data.properties.difficulty}}" data-dtype="Number"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-fields center">
|
||||||
|
<label class="property-label">{{localize "BOL.ui.duration"}}</label>
|
||||||
|
<input class="field-value" type="text" name="data.properties.duration" value="{{data.properties.duration}}" data-dtype="String"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-fields center">
|
||||||
|
<label class="checkbox">
|
||||||
|
<input class="field-value" type="checkbox" name="data.properties.spellkeep" {{checked data.properties.spellkeep}}> {{localize "BOL.ui.spellkeep"}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-fields center">
|
||||||
|
<label class="checkbox">
|
||||||
|
<input class="field-value" type="checkbox" name="data.properties.concentrate" {{checked data.properties.concentrate}}> {{localize "BOL.ui.concentrate"}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -115,6 +115,18 @@
|
|||||||
<input class="field-value" type="text" name="data.properties.damageModifiers" value="{{data.properties.damageModifiers}}" data-dtype="Number"/>
|
<input class="field-value" type="text" name="data.properties.damageModifiers" value="{{data.properties.damageModifiers}}" data-dtype="Number"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="property-label">{{localize "BOL.itemProperty.damageMultiplier"}}</label>
|
||||||
|
<div class="form-fields center">
|
||||||
|
<select class="field-value" name="data.properties.damageMultiplier" data-dtype="String">
|
||||||
|
{{#select data.properties.damageMultiplier}}
|
||||||
|
{{#each config.damageMultiplier as |value id|}}
|
||||||
|
<option value="{{id}}">{{value}}</option>
|
||||||
|
{{/each}}
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="property-label">{{localize "BOL.itemProperty.damageSpecial"}}</label>
|
<label class="property-label">{{localize "BOL.itemProperty.damageSpecial"}}</label>
|
||||||
<div class="form-fields center">
|
<div class="form-fields center">
|
||||||
|
Loading…
Reference in New Issue
Block a user