Attack process path #3

Merged
sladecraven merged 2 commits from master into master 2021-12-29 20:53:46 +01:00
12 changed files with 520 additions and 203 deletions

View File

@ -94,6 +94,10 @@
"BOL.ui.misc" : "Divers", "BOL.ui.misc" : "Divers",
"BOL.ui.noWeaponName" : "Unknown Weapon", "BOL.ui.noWeaponName" : "Unknown Weapon",
"BOL.ui.targetDefence": "Defence", "BOL.ui.targetDefence": "Defence",
"BOL.ui.applyShieldMalus": "Apply Small Shield Malus",
"BOL.ui.shieldMalus": "Shield Malus",
"BOL.ui.defenseScore": "Defense Score",
"BOL.ui.defender": "Defender",
"BOL.featureCategory.origins": "Origines", "BOL.featureCategory.origins": "Origines",
"BOL.featureCategory.races": "Races", "BOL.featureCategory.races": "Races",

View File

@ -96,6 +96,10 @@
"BOL.ui.speed" : "Vitesse", "BOL.ui.speed" : "Vitesse",
"BOL.ui.noWeaponName" : "Arme Inconnue", "BOL.ui.noWeaponName" : "Arme Inconnue",
"BOL.ui.targetDefence": "Défense", "BOL.ui.targetDefence": "Défense",
"BOL.ui.applyShieldMalus": "Appliquer le Malus de Petit Bouclier",
"BOL.ui.shieldMalus": "Malus de Bouclier",
"BOL.ui.defenseScore": "Score de Defense",
"BOL.ui.defender": "Défenseur",
"BOL.featureCategory.origins": "Origines", "BOL.featureCategory.origins": "Origines",
"BOL.featureCategory.races": "Races", "BOL.featureCategory.races": "Races",

View File

@ -28,6 +28,10 @@ export class BoLActor extends Actor {
} }
} }
/* -------------------------------------------- */
_onUpdate() {
this.manageHealthState()
}
/* -------------------------------------------- */ /* -------------------------------------------- */
get itemData(){ get itemData(){
return Array.from(this.data.items.values()).map(i => i.data); return Array.from(this.data.items.values()).map(i => i.data);
@ -184,6 +188,43 @@ export class BoLActor extends Actor {
} }
}; };
} }
/*-------------------------------------------- */
manageHealthState() {
if (this.data.data.resources.hp.value == 0 ) {
// TODO : Message pour depense heroisme
}
}
/*-------------------------------------------- */
async subHeroPoints( nb) {
let newHeroP = this.data.data.resources.hero.value - nb;
newHeroP = (newHeroP < 0 ) ? 0 : newHeroP;
await this.update( { 'data.resources.hero.value': newHeroP} );
}
/*-------------------------------------------- */
async sufferDamage( damage) {
let newHP = this.data.data.resources.hp.value - damage;
await this.update( { 'data.resources.hp.value': newHP} );
}
/* -------------------------------------------- */
getArmorFormula( ) {
let protectWorn = this.protections.filter( item => item.data.worn);
let formula = ""
console.log("Protections: ", protectWorn)
for (let protect of protectWorn) {
if ( protect.data.subtype == 'helm') {
formula += "+1"
} else {
formula += "+" + protect.data.properties.soak.formula;
}
}
console.log("Protect Formula", formula)
return (formula == "") ? 0 :formula;
}
/* -------------------------------------------- */ /* -------------------------------------------- */
toggleEquipItem(item) { toggleEquipItem(item) {
const equipable = item.data.data.properties.equipable; const equipable = item.data.data.properties.equipable;

View File

@ -10,6 +10,7 @@ import {registerSystemSettings} from "./system/settings.js";
import registerHooks from "./system/hooks.js"; import registerHooks from "./system/hooks.js";
// import {DataLoader} from "./system/data.js"; // import {DataLoader} from "./system/data.js";
import { Macros } from "./system/macros.js"; import { Macros } from "./system/macros.js";
import { BoLUtility } from "./system/bol-utility.js";
Hooks.once('init', async function () { Hooks.once('init', async function () {
@ -20,6 +21,12 @@ Hooks.once('init', async function () {
config: BOL config: BOL
}; };
// Game socket
game.socket.on("system.bol", sockmsg => {
BoLUtility.onSocketMessage(sockmsg);
});
/** /**
* Set an initiative formula for the system * Set an initiative formula for the system
* @type {String} * @type {String}
@ -39,6 +46,9 @@ Hooks.once('init', async function () {
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("bol", BoLItemSheet, { makeDefault: true }); Items.registerSheet("bol", BoLItemSheet, { makeDefault: true });
// Inot useful stuff
BoLUtility.init();
// Register System Settings // Register System Settings
registerSystemSettings(); registerSystemSettings();

View File

@ -31,12 +31,7 @@ export class BoLRoll {
// const elt = $(event.currentTarget)[0]; // const elt = $(event.currentTarget)[0];
// let key = elt.attributes["data-rolling"].value; // let key = elt.attributes["data-rolling"].value;
let target = BoLUtility.getTarget() let target = BoLUtility.getTarget()
if ( !target) {
ui.notifications.warn("No target selected for attack !");
return;
}
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
console.log("ITEM", target);
const weapon = actor.items.get(li.data("item-id")); const weapon = actor.items.get(li.data("item-id"));
if (!weapon) { if (!weapon) {
ui.notifications.warn("Unable to find weapon !"); ui.notifications.warn("Unable to find weapon !");
@ -50,7 +45,7 @@ export class BoLRoll {
weapon :weapon, weapon :weapon,
mod: 0, mod: 0,
target : target, target : target,
defender: game.actors.get(target.data.actorId), defender: (target) ? game.actors.get(target.data.actorId) : undefined,
adv :dataset.adv || 0, adv :dataset.adv || 0,
attribute : eval(`actor.data.data.attributes.${weaponData.properties.attackAttribute}`), attribute : eval(`actor.data.data.attributes.${weaponData.properties.attackAttribute}`),
aptitude : eval(`actor.data.data.aptitudes.${weaponData.properties.attackAptitude}`), aptitude : eval(`actor.data.data.aptitudes.${weaponData.properties.attackAptitude}`),
@ -74,7 +69,7 @@ export class BoLRoll {
boons:actorData.features.boons, boons:actorData.features.boons,
flaws:actorData.features.flaws flaws:actorData.features.flaws
}; };
console.log(dialogData.careers);
const rollOptionContent = await renderTemplate(rollOptionTpl, dialogData); const rollOptionContent = await renderTemplate(rollOptionTpl, dialogData);
let d = new Dialog({ let d = new Dialog({
title: label, title: label,
@ -123,8 +118,17 @@ 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: attackDef.defender.defenseValue,
}; };
if ( attackDef.defender) {
dialogData.defence = attackDef.defender.defenseValue,
dialogData.shieldBlock = 'none'
let shields = attackDef.defender.shields
for( let shield of shields) {
dialogData.shieldBlock = (shield.data.properties.blocking.blockingAll) ? 'blockall' : 'blockone';
dialogData.shieldAttackMalus = (shield.data.properties.blocking.malus)? shield.data.properties.blocking.malus : 1;
dialogData.applyShieldMalus = false
}
}
const rollOptionContent = await renderTemplate(rollOptionTpl, dialogData); const rollOptionContent = await renderTemplate(rollOptionTpl, dialogData);
let d = new Dialog({ let d = new Dialog({
title: attackDef.label, title: attackDef.label,
@ -144,13 +148,20 @@ export class BoLRoll {
const apt = html.find('#apt').val(); const apt = html.find('#apt').val();
const adv = html.find('#adv').val(); const adv = html.find('#adv').val();
const mod = html.find('#mod').val() || 0; const mod = html.find('#mod').val() || 0;
let shieldMalus = 0;
const applyShieldMalus = html.find('#applyShieldMalus').val() || false;
if (applyShieldMalus || dialogData.shieldBlock =='blockall') {
shieldMalus = dialogData.shieldAttackMalus;
}
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.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`);
const aptValue = eval(`attackDef.attacker.data.data.aptitudes.${apt}.value`); const aptValue = eval(`attackDef.attacker.data.data.aptitudes.${apt}.value`);
const modifiers = parseInt(attrValue) + parseInt(aptValue) + parseInt(mod) + parseInt(career) - dialogData.defence; const modifiers = parseInt(attrValue) + parseInt(aptValue) + parseInt(mod) + parseInt(career) - dialogData.defence - shieldMalus;
const formula = (isMalus) ? dicePool + "d6kl2 + " + modifiers : dicePool + "d6kh2 + " + modifiers; const formula = (isMalus) ? dicePool + "d6kl2 + " + modifiers : dicePool + "d6kh2 + " + modifiers;
attackDef.formula = formula; attackDef.formula = formula;
let r = new BoLAttackRoll(attackDef); let r = new BoLAttackRoll(attackDef);
@ -270,7 +281,7 @@ export class BoLAttackRoll {
async roll(){ async roll(){
const r = new Roll(this.attackDef.formula); const r = new Roll(this.attackDef.formula);
await r.roll({"async": true}); await r.roll({"async": false});
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);
@ -290,13 +301,26 @@ export class BoLAttackRoll {
let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage) let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage)
let damageFormula = weaponFormula + "+" + this.attackDef.attacker.data.data.attributes[attrDamage].value; let damageFormula = weaponFormula + "+" + this.attackDef.attacker.data.data.attributes[attrDamage].value;
this.damageRoll = new Roll(damageFormula); this.damageRoll = new Roll(damageFormula);
await this.damageRoll.roll({"async": true}); await this.damageRoll.roll({"async": false});
// Update attackDef object
this.attackDef.damageFormula = damageFormula;
this.attackDef.damageRoll = this.damageRoll;
this._buildDamageChatMessage(this.attackDef.attacker, this.attackDef.weapon, this.damageRoll.total).then(msgFlavor => { this._buildDamageChatMessage(this.attackDef.attacker, this.attackDef.weapon, this.damageRoll.total).then(msgFlavor => {
this.damageRoll.toMessage({ this.damageRoll.toMessage({
user: game.user.id, user: game.user.id,
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( result => {
if (this.attackDef.target) {
// Broadcast to GM or process it directly in case of GM defense
if ( !game.user.isGM) {
game.socket.emit("system.bol", { msg: "msg_attack_success", data: this.attackDef });
} else {
BoLUtility.processAttackSuccess( this.attackDef);
}
}
}); });
}); });
} }

View File

@ -0,0 +1,21 @@
export class RdDCombatManager extends Combat {
/************************************************************************************/
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
console.log(`${game.data.system.data.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
// Structure input data
ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant._id;
// calculate initiative
if ( game.combat.current.round == 1) {
for (let cId = 0; cId < ids.length; cId++) {
const combatant = this.combatants.get(ids[cId]);
// TODO
console.log("TODO : Compute init for actor");
}
}
}
}

View File

@ -1,8 +1,11 @@
export class BoLUtility { export class BoLUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async init() { static async init() {
this.attackStore = {};
Hooks.on('renderChatLog', (log, html, data) => BoLUtility.chatListeners(html));
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -87,10 +90,81 @@ export class BoLUtility {
static blindMessageToGM(chatOptions) { static blindMessageToGM(chatOptions) {
let chatGM = duplicate(chatOptions); let chatGM = duplicate(chatOptions);
chatGM.whisper = this.getUsers(user => user.isGM); chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content; chatGM.content = "Blind message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM); console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-fragged-kingdom", { msg: "msg_gm_chat_message", data: chatGM }); game.socket.emit("system.fvtt-fragged-kingdom", { msg: "msg_gm_chat_message", data: chatGM });
} }
/* -------------------------------------------- */
static async chatListeners(html) {
// Damage handling
html.on("click", '.damage-handling', event => {
let attackId = event.currentTarget.attributes['data-attack-id'].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
//console.log("DEFENSE1", event.currentTarget, attackId, defenseMode, weaponId);
if ( game.user.isGM) {
BoLUtility.processDamageHandling(event, attackId, defenseMode, weaponId)
} else {
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) {
if ( !game.user.isGM) {
return;
}
BoLUtility.removeChatMessageId(BoLUtility.findChatMessageId(event.currentTarget));
// Only GM process this
let attackDef = this.attackStore[attackId];
console.log("DEFENSE2", attackId, defenseMode, weaponId, attackDef);
if (attackDef) {
attackDef.defenseMode = defenseMode;
if (defenseMode == 'damage-with-armor') {
let armorFormula = attackDef.defender.getArmorFormula();
attackDef.rollArmor = new Roll(armorFormula)
attackDef.rollArmor.roll( {async: false} );
attackDef.finalDamage = attackDef.damageRoll.total - attackDef.rollArmor.total;
attackDef.finalDamage = (attackDef.finalDamage<0) ? 0 : attackDef.finalDamage;
attackDef.defender.sufferDamage(attackDef.finalDamage);
}
if (defenseMode == 'damage-without-armor') {
attackDef.finalDamage = attackDef.damageRoll.total;
attackDef.defender.sufferDamage(attackDef.finalDamage);
}
if (defenseMode == 'hero-reduce-damage') {
attackDef.rollHero = new Roll("1d6");
attackDef.rollHero.roll( {async: false} );
attackDef.finalDamage = attackDef.damageRoll.total - attackDef.rollHero.total;
attackDef.finalDamage = (attackDef.finalDamage<0) ? 0 : attackDef.finalDamage;
attackDef.defender.sufferDamage(attackDef.finalDamage);
attackDef.defender.subHeroPoints(1);
}
if (defenseMode == 'hero-in-extremis') {
attackDef.finalDamage = 0;
attackDef.weaponHero = attackDef.defender.weapons.find(item => item._id == weaponId);
attackDef.defender.deleteEmbeddedDocuments("Item", [ weaponId ]);
}
ChatMessage.create({
alias: attackDef.defender.name,
whisper: BoLUtility.getWhisperRecipientsAndGMs(attackDef.defender.name),
content: await renderTemplate('systems/bol/templates/chat/rolls/defense-result-card.hbs', {
attackId: attackDef.id,
attacker: attackDef.attacker,
rollArmor: attackDef.rollArmor,
rollHero: attackDef.rollHero,
weaponHero : attackDef.weaponHero,
defender: attackDef.defender,
defenseMode: attackDef.defenseMode,
finalDamage: attackDef.finalDamage
})
})
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static createChatMessage(name, rollMode, chatOptions) { static createChatMessage(name, rollMode, chatOptions) {
switch (rollMode) { switch (rollMode) {
@ -122,6 +196,36 @@ export class BoLUtility {
return weapon.data.type == 'ranged' || weapon.data.thrown; return weapon.data.type == 'ranged' || weapon.data.thrown;
} }
/* -------------------------------------------- */
static removeChatMessageId(messageId) {
if (messageId){
game.messages.get(messageId)?.delete();
}
}
static findChatMessageId(current) {
return BoLUtility.getChatMessageId(BoLUtility.findChatMessage(current));
}
static getChatMessageId(node) {
return node?.attributes.getNamedItem('data-message-id')?.value;
}
static findChatMessage(current) {
return BoLUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id'));
}
static findNodeMatching(current, predicate) {
if (current) {
if (predicate(current)) {
return current;
}
return BoLUtility.findNodeMatching(current.parentElement, predicate);
}
return undefined;
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static getTarget() { static getTarget() {
if (game.user.targets && game.user.targets.size == 1) { if (game.user.targets && game.user.targets.size == 1) {
@ -179,6 +283,38 @@ export class BoLUtility {
}); });
} }
/* -------------------------------------------- */
static async processAttackSuccess(attackDef) {
if (!game.user.isGM) { // Only GM process this
return;
}
// Build and send the defense message to the relevant people (ie GM + defender)
let defenderWeapons = attackDef.defender.weapons;
console.log("DEF WEP", attackDef)
this.attackStore[attackDef.id] = attackDef; // Store !
ChatMessage.create({
alias: attackDef.defender.name,
whisper: BoLUtility.getWhisperRecipientsAndGMs(attackDef.defender.name),
content: await renderTemplate('systems/bol/templates/chat/rolls/defense-request-card.hbs', {
attackId: attackDef.id,
attacker: attackDef.attacker,
defender: attackDef.defender,
defenderWeapons: defenderWeapons,
damageTotal: attackDef.damageRoll.total
})
});
}
/* -------------------------------------------- */
static onSocketMessage(sockmsg) {
if (sockmsg.name == "msg_attack_success") {
BoLUtility.processAttackSuccess(sockmsg.data);
}
if (sockmsg.name == "msg_damage_handling") {
BoLUtility.processDamageHandling(sockmsg.data.event, sockmsg.data.attackId, sockmsg.data.defenseMode)
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static getDamageFormula(damageString) { static getDamageFormula(damageString) {
if (damageString[0] == 'd') { damageString = "1" + damageString } // Help parsing if (damageString[0] == 'd') { damageString = "1" + damageString } // Help parsing

View File

@ -2,14 +2,21 @@
"name": "bol", "name": "bol",
"title": "Barbarians of Lemuria", "title": "Barbarians of Lemuria",
"description": "The Barbarians of Lemuria system for FoundryVTT!", "description": "The Barbarians of Lemuria system for FoundryVTT!",
"author": "Zigmund",
"authors": [],
"url": "https://github.com/ZigmundKreud/bol",
"license": "LICENSE.txt",
"flags": {},
"version": "0.8.9.0", "version": "0.8.9.0",
"minimumCoreVersion": "0.8.6", "minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "0.8.9", "compatibleCoreVersion": "9",
"templateVersion": 8,
"author": "Zigmund",
"esmodules": ["module/bol.js"],
"styles": ["css/bol.css"],
"scripts": [], "scripts": [],
"esmodules": [
"module/bol.js"
],
"styles": [
"css/bol.css"
],
"languages": [ "languages": [
{ {
"lang": "en", "lang": "en",
@ -29,7 +36,9 @@
"system": "bol", "system": "bol",
"path": "./packs/boons.db", "path": "./packs/boons.db",
"entity": "Item", "entity": "Item",
"tag": "boon" "tag": "boon",
"type": "Item",
"private": false
}, },
{ {
"name": "flaws", "name": "flaws",
@ -37,7 +46,9 @@
"system": "bol", "system": "bol",
"path": "./packs/flaws.db", "path": "./packs/flaws.db",
"entity": "Item", "entity": "Item",
"tag": "flaw" "tag": "flaw",
"type": "Item",
"private": false
}, },
{ {
"name": "careers", "name": "careers",
@ -45,7 +56,9 @@
"system": "bol", "system": "bol",
"path": "./packs/careers.db", "path": "./packs/careers.db",
"entity": "Item", "entity": "Item",
"tag": "career" "tag": "career",
"type": "Item",
"private": false
}, },
{ {
"name": "origins", "name": "origins",
@ -53,7 +66,9 @@
"system": "bol", "system": "bol",
"path": "./packs/origins.db", "path": "./packs/origins.db",
"entity": "Item", "entity": "Item",
"tag": "origin" "tag": "origin",
"type": "Item",
"private": false
}, },
{ {
"name": "races", "name": "races",
@ -61,7 +76,9 @@
"system": "bol", "system": "bol",
"path": "./packs/races.db", "path": "./packs/races.db",
"entity": "Item", "entity": "Item",
"tag": "race" "tag": "race",
"type": "Item",
"private": false
}, },
{ {
"name": "equipment", "name": "equipment",
@ -69,16 +86,20 @@
"system": "bol", "system": "bol",
"path": "./packs/equipment.db", "path": "./packs/equipment.db",
"entity": "Item", "entity": "Item",
"tag": "item" "tag": "item",
"type": "Item",
"private": false
} }
], ],
"system": [],
"dependencies": [],
"socket": true,
"manifest": "https://raw.githubusercontent.com/ZigmundKreud/bol/master/system.json",
"download": "https://github.com/ZigmundKreud/bol/archive/refs/heads/master.zip",
"protected": false,
"background": "ui/splash-page.webp", "background": "ui/splash-page.webp",
"gridDistance": 1.5, "gridDistance": 1.5,
"gridUnits": "m", "gridUnits": "m",
"primaryTokenAttribute": "resources.hp", "primaryTokenAttribute": "resources.hp",
"secondaryTokenAttribute": "resources.hero", "secondaryTokenAttribute": "resources.hero"
"url": "https://github.com/ZigmundKreud/bol",
"manifest": "https://raw.githubusercontent.com/ZigmundKreud/bol/master/system.json",
"download": "https://github.com/ZigmundKreud/bol/archive/refs/heads/master.zip",
"license": "LICENSE.txt"
} }

View File

@ -0,0 +1,14 @@
<img class="chat-icon" src="{{defender.img}}" alt="{{defender.name}}"/>
Va encaisser {{damageTotal}} dégats !
<button class="damage-handling" data-defense-mode="damage-with-armor" data-attack-id="{{attackId}}">Encaisser avec la protection de l'armure</button>
<button class="damage-handling" data-defense-mode="damage-without-armor" data-attack-id="{{attackId}}">Encaisser sans la protection de l'armure</button>
{{#if defender.data.data.resources.hero.value}}
<button class="damage-handling" data-defense-mode="hero-reduce-damage" data-attack-id="{{attackId}}">Juste une égratignure (1 Point d'Héroisme)</button>
{{#each defenderWeapons as |weapon idx|}}
<button class="damage-handling" data-defense-mode="hero-in-extremis" data-attack-id="{{@root.attackId}}" data-weapon-id="{{weapon._id}}">Parade in Extremis avec {{weapon.name}} (1 Point d'Héroisme)</button>
{{/each}}
{{/if}}

View File

@ -0,0 +1,22 @@
<img class="chat-icon" src="{{defender.img}}" alt="{{defender.name}}"/>
<h3>Dégats subis par {{defender.name}}</h3>
<ul>
<li>
{{#if (eq defenseMode "damage-with-armor")}}
Protection de l'armure : {{rollArmor.total}}.
{{/if}}
{{#if (eq defenseMode "damage-without-armor")}}
Aucune protection d'armure !
{{/if}}
{{#if (eq defenseMode "hero-reduce-damage")}}
Un point d'héroisme dépensé, pour une réduction des dommages de {{rollHero.total}}.
{{/if}}
{{#if (eq defenseMode "hero-in-extremis")}}
Aucun dommage encaissé, grâce à la parade in-extremis avec {{weaponHero.name}}. L'arme a été détruite pendant cette parade !
Un point d'héroisme a également été dépensé.
{{/if}}
</li>
<li>
Encaissement final : {{finalDamage}} dégats !
</li>
</ul>

View File

@ -55,6 +55,26 @@
</div> </div>
<div class="flex1 center cell">{{defence}}</div> <div class="flex1 center cell">{{defence}}</div>
</div> </div>
{{#if (eq shieldBlock 'blockall')}}
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.shieldMalus'}}</label>
</div>
<div class="flex1 center cell">{{shieldAttackMalus}}</div>
</div>
{{/if}}
{{#if (eq shieldBlock 'blockone')}}
<div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred">
<label for="mod">{{localize 'BOL.ui.shieldMalus'}}</label>
</div>
<div class="flex1 center cell">
<label class="checkbox">
<input class="field-value" type="checkbox" id="applyShieldMalus" name="applyShieldMalus" {{checked applyShieldMalus}}> {{localize "BOL.ui.applyShieldMalus"}}
</label>
</div>
</div>
{{/if}}
{{#if careers.items}} {{#if careers.items}}
<div class="flexrow" style="margin-bottom: 1px;"> <div class="flexrow" style="margin-bottom: 1px;">
<div class="flex1 center bg-darkred"> <div class="flex1 center bg-darkred">

View File

@ -1,11 +1,11 @@
<form class="skill-roll-dialog"> <form class="skill-roll-dialog">
{{#if defender}} {{#if defender}}
<div class="property flexrow"> <div class="property flexrow">
<label class="property-label">{{localize "Defender"}} : </label> <label class="property-label">{{localize "BOL.ui.defender"}} : </label>
<label class="property-label">{{defender.name}}</label> <label class="property-label">{{defender.name}}</label>
</div> </div>
<div class="property flexrow"> <div class="property flexrow">
<label class="property-label">{{localize "Defense score"}}</label> <label class="property-label">{{localize "BOL.ui.defenseScore"}}</label>
<label class="property-label">{{defender.data.aptitudes.def.value}}</label> <label class="property-label">{{defender.data.aptitudes.def.value}}</label>
</div> </div>
{{/if}} {{/if}}