diff --git a/icons/sante/blessure-mort.webp b/icons/sante/blessure-mort.webp new file mode 100644 index 00000000..21294caf Binary files /dev/null and b/icons/sante/blessure-mort.webp differ diff --git a/icons/sante/eraflure.webp b/icons/sante/eraflure.webp new file mode 100644 index 00000000..fc3b4a10 Binary files /dev/null and b/icons/sante/eraflure.webp differ diff --git a/icons/sante/mort.webp b/icons/sante/mort.webp new file mode 100644 index 00000000..7bbe0626 Binary files /dev/null and b/icons/sante/mort.webp differ diff --git a/module/actor-sheet.js b/module/actor-sheet.js index e0101c55..5e33065a 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -153,43 +153,18 @@ export class RdDActorSheet extends RdDBaseActorSheet { this.createEmptyTache(); }); this.html.find('.creer-tache-blessure-legere').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 'legere'); + RdDItemBlessure.createTacheSoinBlessure(this.actor, 2); }); this.html.find('.creer-tache-blessure-grave').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 'grave'); + RdDItemBlessure.createTacheSoinBlessure(this.actor, 4); }); this.html.find('.creer-tache-blessure-critique').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 'critique'); + RdDItemBlessure.createTacheSoinBlessure(this.actor, 6); }); this.html.find('.creer-une-oeuvre').click(async event => { this.selectTypeOeuvreToCreate(); }); - // Blessure control - this.html.find('.blessure-control').click(async event => { - const tr = this.html.find(event.currentTarget).parents(".item"); - let btype = tr.data("blessure-type"); - let index = tr.data('blessure-index'); - let active = this.html.find(event.currentTarget).data('blessure-active'); - //console.log(btype, index, active); - await this.actor.manageBlessureFromSheet(btype, index, active); - }); - - // Blessure data - this.html.find('.blessure-soins').change(async event => { - const tr = this.html.find(event.currentTarget).parents(".item"); - let btype = tr.data('blessure-type'); - let index = tr.data('blessure-index'); - let psoins = tr.find('.blessure-premiers_soins').val(); - let pcomplets = tr.find('.blessure-soins_complets').val(); - let jours = tr.find('.blessure-jours').val(); - let loc = tr.find('.blessure-localisation').val(); - let psdone = tr.find('.blessure-psdone:checked').val(); - let scdone = tr.find('.blessure-scdone:checked').val(); - console.log(btype, index, psoins, pcomplets, jours, loc, psdone, scdone); - await this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc, psdone, scdone); - }); - this.html.find('.blessure-premierssoins-done').change(async event => { const blessure = this.getBlessure(event); await blessure?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } }); diff --git a/module/actor.js b/module/actor.js index 6dc88e88..f51ae2aa 100644 --- a/module/actor.js +++ b/module/actor.js @@ -26,7 +26,7 @@ import { DialogConsommer } from "./dialog-item-consommer.js"; import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js"; import { RollDataAjustements } from "./rolldata-ajustements.js"; import { RdDPossession } from "./rdd-possession.js"; -import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; +import { ENTITE_INCARNE, ENTITE_NONINCARNE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; import { RdDConfirm } from "./rdd-confirm.js"; import { DialogValidationEncaissement } from "./dialog-validation-encaissement.js"; import { RdDRencontre } from "./item/rencontre.js"; @@ -46,7 +46,6 @@ const POSSESSION_SANS_DRACONIC = { } }; -const PAS_DE_BLESSURE = { "active": false, "psdone": false, "scdone": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "loc": "" }; export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre'] /* -------------------------------------------- */ @@ -403,7 +402,7 @@ export class RdDActor extends RdDBaseActor { } await this._recupereChance(); await this.transformerStress(); - this.bonusRecuperationPotion = 0; // Reset potion + await this.setBonusPotionSoin(0); } await this.resetInfoSommeil() ChatMessage.create(message); @@ -414,11 +413,8 @@ export class RdDActor extends RdDBaseActor { const maladiesPoisons = this._maladiePoisons(message); const isMaladeEmpoisonne = maladiesPoisons.length > 0; this._messageRecuperationMaladiePoisons(maladiesPoisons, message); - const blessures = duplicate(this.system.blessures); - await this._recupererBlessures(message, "legere", blessures.legeres.liste.filter(b => b.active), [], isMaladeEmpoisonne); - await this._recupererBlessures(message, "grave", blessures.graves.liste.filter(b => b.active), blessures.legeres.liste, isMaladeEmpoisonne); - await this._recupererBlessures(message, "critique", blessures.critiques.liste.filter(b => b.active), blessures.graves.liste, isMaladeEmpoisonne); - await this.update({ "system.blessures": blessures }); + + await this._recuperationBlessures(message, isMaladeEmpoisonne); await this._recupererVie(message, isMaladeEmpoisonne); } @@ -460,7 +456,7 @@ export class RdDActor extends RdDBaseActor { await this._recupereChance(); await this.transformerStress(); await this.retourSeuilDeReve(message); - this.bonusRecuperationPotion = 0; // Reset potion + await this.setBonusPotionSoin(0); await this.retourSust(message); await this.verifierPotionsEnchantees(); if (message.content != "") { @@ -523,65 +519,36 @@ export class RdDActor extends RdDBaseActor { } /* -------------------------------------------- */ - async _recupererBlessures(message, type, liste, moindres, isMaladeEmpoisonne) { - if (!this.bonusRecuperationPotion) this.bonusRecuperationPotion = 0; - let count = 0; - const definitions = RdDUtility.getDefinitionsBlessures(); - let definition = definitions.find(d => d.type == type); - for (let blessure of liste) { - if (blessure.jours >= definition.facteur) { - let rolled = await this._jetRecuperationConstitution(Misc.toInt(blessure.soins_complets) + this.bonusRecuperationPotion, message); - blessure.soins_complets = 0; - if (!isMaladeEmpoisonne && rolled.isSuccess && this._retrograderBlessure(type, blessure, moindres)) { - message.content += ` -- une blessure ${type} cicatrise`; - count++; - } - else if (rolled.isETotal) { - message.content += ` -- une blessure ${type} s'infecte (temps de guérison augmenté de ${definition.facteur} jours, perte de vie)`; - blessure.jours = 0; - await this.santeIncDec("vie", -1); - } - else { - blessure.jours++; - message.content += ` -- une blessure ${type} reste stable`; - } - } - else { - blessure.jours++; - } - } + async _recuperationBlessures(message, isMaladeEmpoisonne) { + const timestamp = game.system.rdd.calendrier.getTimestamp() + const blessures = this.filterItems(it => it.gravite > 0, 'blessure').sort(Misc.ascending(it => it.system.gravite)) + + Promise.all(blessures.map(b => b.recuperationBlessure({ + actor: this, + timestamp, + message, + isMaladeEmpoisonne, + blessures + }))); + await this.supprimerBlessures(filterToDelete); } - /* -------------------------------------------- */ - _retrograderBlessure(type, blessure, blessuresMoindres) { - if (type != "legere") { - let retrograde = blessuresMoindres.find(b => !b.active); - if (!retrograde) { - return false; - } - mergeObject(retrograde, { "active": true, "psdone": blessure.psdone, "scdone": blessure.scdone, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "loc": blessure.loc }); - } - this._supprimerBlessure(blessure); - return true; - } - - /* -------------------------------------------- */ - _supprimerBlessure(blessure) { - mergeObject(blessure, PAS_DE_BLESSURE); + async supprimerBlessures(filterToDelete) { + const toDelete = this.filterItems(filterToDelete, 'blessure') + .map(it => it.id); + await this.deleteEmbeddedDocuments('Item', toDelete); } /* -------------------------------------------- */ async _recupererVie(message, isMaladeEmpoisonne) { const tData = this.system - let blessures = [].concat(tData.blessures.legeres.liste).concat(tData.blessures.graves.liste).concat(tData.blessures.critiques.liste); - let nbBlessures = blessures.filter(b => b.active); + let blessures = this.filterItems(it => it.system.gravite > 0, 'blessure'); + if (blessures.length > 0) { + return + } let vieManquante = tData.sante.vie.max - tData.sante.vie.value; - if (nbBlessures == 0 && vieManquante > 0) { - let bonusSoins = 0; - for (let b of blessures) { - bonusSoins = Math.max(bonusSoins, Misc.toInt(b.soins_complets)); - } - let rolled = await this._jetRecuperationConstitution(bonusSoins, message) + if (vieManquante > 0) { + let rolled = await this.jetRecuperationConstitution(bonusSoins, message) if (!isMaladeEmpoisonne && rolled.isSuccess) { const gain = Math.min(rolled.isPart ? 2 : 1, vieManquante); message.content += " -- récupération de vie: " + gain; @@ -598,7 +565,7 @@ export class RdDActor extends RdDBaseActor { } /* -------------------------------------------- */ - async _jetRecuperationConstitution(bonusSoins, message = undefined) { + async jetRecuperationConstitution(bonusSoins, message = undefined) { let difficulte = Misc.toInt(bonusSoins) + Math.min(0, this.system.sante.vie.value - this.system.sante.vie.max); let rolled = await RdDResolutionTable.roll(this.system.carac.constitution.value, difficulte); if (message) { @@ -623,17 +590,13 @@ export class RdDActor extends RdDBaseActor { const updates = { 'system.sante.endurance.value': this.system.sante.endurance.max }; - if (!this.isEntite([ENTITE_INCARNE, ENTITE_BLURETTE])) { - if (this.system.blessures) { - updates['system.blessures.legeres.liste'] = [PAS_DE_BLESSURE, PAS_DE_BLESSURE, PAS_DE_BLESSURE, PAS_DE_BLESSURE, PAS_DE_BLESSURE]; - updates['system.blessures.graves.liste'] = [PAS_DE_BLESSURE, PAS_DE_BLESSURE]; - updates['system.blessures.critiques.liste'] = [PAS_DE_BLESSURE]; - } + if (this.isPersonnage() || this.isCreature()) { + await this.supprimerBlessures(it => true); updates['system.sante.vie.value'] = this.system.sante.vie.max; updates['system.sante.fatigue.value'] = 0; - if (this.isPersonnage()) { - updates['system.compteurs.ethylisme'] = { value: 1, nb_doses: 0, jet_moral: false }; - } + } + if (this.isPersonnage()) { + updates['system.compteurs.ethylisme'] = { value: 1, nb_doses: 0, jet_moral: false }; } await this.update(updates); await this.removeEffects(e => e.flags.core.statusId !== STATUSES.StatusDemiReve); @@ -1147,35 +1110,31 @@ export class RdDActor extends RdDBaseActor { } /* -------------------------------------------- */ - computeResumeBlessure(blessures = undefined) { - blessures = blessures ?? this.system.blessures; - if (!blessures) { - return "Pas de blessures possibles"; - } - let nbLegeres = this.countBlessures(blessures.legeres.liste); - let nbGraves = this.countBlessures(blessures.graves.liste); - let nbCritiques = this.countBlessures(blessures.critiques.liste); + computeResumeBlessure() { + const blessures = this.filterItems(it => it.system.gravite > 0, 'blessure') - let resume = "Blessures:"; - if (nbCritiques > 0 || nbGraves > 0 || nbLegeres > 0) { - if (nbLegeres > 0) { - resume += " " + nbLegeres + " légère" + (nbLegeres > 1 ? "s" : ""); - } - if (nbGraves > 0) { - if (nbLegeres > 0) - resume += ","; - resume += " " + nbGraves + " grave" + (nbGraves > 1 ? "s" : ""); - } - if (nbCritiques > 0) { - if (nbGraves > 0 || nbLegeres > 0) - resume += ","; - resume += " une CRITIQUE !"; - } - return resume; - } - else { + const nbLegeres = blessures.filter(it => it.isLegere()).length; + const nbGraves = blessures.filter(it => it.isGrave()).length; + const nbCritiques = blessures.filter(it => it.isCritique()).length; + + if (nbLegeres + nbGraves + nbCritiques == 0) { return "Aucune blessure"; } + let resume = "Blessures:"; + if (nbLegeres > 0) { + resume += " " + nbLegeres + " légère" + (nbLegeres > 1 ? "s" : ""); + } + if (nbGraves > 0) { + if (nbLegeres > 0) + resume += ","; + resume += " " + nbGraves + " grave" + (nbGraves > 1 ? "s" : ""); + } + if (nbCritiques > 0) { + if (nbGraves > 0 || nbLegeres > 0) + resume += ","; + resume += " une CRITIQUE !"; + } + return resume; } recompute() { @@ -1384,11 +1343,11 @@ export class RdDActor extends RdDBaseActor { ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` }); } } - if (this.type == 'personnage') { - // Gestion blessure graves : -1 pt endurance - let nbGraves = this.countBlessuresNonSoigneeByName('graves'); + if (this.isPersonnage() || this.isCreature()) { + const nbGraves = this.filterItems(it => it.isGrave(), 'blessure').length if (nbGraves > 0) { - await this.santeIncDec("endurance", -1); + // Gestion blessure graves : -1 pt endurance par blessure grave + await this.santeIncDec("endurance", - nbGraves); } } } @@ -1419,20 +1378,8 @@ export class RdDActor extends RdDBaseActor { } /* -------------------------------------------- */ - countBlessures(blessuresListe) { - return blessuresListe.filter(b => b.active).length - } - /* -------------------------------------------- */ - countBlessuresByName(name) { - return this.countBlessures(this.system.blessures[name].liste); - } - - countBlessuresNonSoigneeByName(name) { - if (this.system.blessures) { - let blessures = this.system.blessures[name].liste; - return blessures.filter(b => b.active && !b.psdone).length; - } - return 0; + countBlessures(filter = it => !it.isContusion()) { + return this.filterItems(filter, 'blessure').length } /* -------------------------------------------- */ @@ -1583,40 +1530,15 @@ export class RdDActor extends RdDBaseActor { /* -------------------------------------------- */ _computeEnduranceMax() { - let blessures = this.system.blessures; - let diffVie = this.system.sante.vie.max - this.system.sante.vie.value; - let maxEndVie = this.system.sante.endurance.max - (diffVie * 2); - let nbGraves = this.countBlessures(blessures.graves.liste); - let nbCritiques = this.countBlessures(blessures.critiques.liste); - let maxEndGraves = Math.floor(this.system.sante.endurance.max / (2 * nbGraves)); - let maxEndCritiques = nbCritiques > 0 ? 1 : this.system.sante.endurance.max; + const diffVie = this.system.sante.vie.max - this.system.sante.vie.value; + const maxEndVie = this.system.sante.endurance.max - (diffVie * 2); + const nbGraves = this.countBlessures(it => it.isGraves()) > 0 + const nbCritiques = this.countBlessures(it => it.isCritique()) > 0 + const maxEndGraves = Math.floor(this.system.sante.endurance.max / (2 * nbGraves)); + const maxEndCritiques = nbCritiques > 0 ? 1 : this.system.sante.endurance.max; return Math.max(0, Math.min(maxEndVie, maxEndGraves, maxEndCritiques)); } - /* -------------------------------------------- */ - async manageBlessureFromSheet(gravite, index) { - let listBlessures = duplicate(this.system.blessures); - let blessure = listBlessures[gravite + "s"].liste[index]; - blessure.active = !blessure.active; - if (!blessure.active) { - this._supprimerBlessure(blessure); - } - await this.update({ 'system.blessures': listBlessures }); - } - - /* -------------------------------------------- */ - async setDataBlessureFromSheet(gravite, index, psoins, pcomplets, jours, loc, psdone, scdone) { - let listBlessures = duplicate(this.system.blessures); - let blessure = listBlessures[gravite + "s"].liste[index]; - blessure.psdone = psdone; - blessure.scdone = scdone; - blessure.premiers_soins = psoins; - blessure.soins_complets = pcomplets; - blessure.jours = jours; - blessure.loc = loc; - await this.update({ 'system.blessures': listBlessures }); - } - /* -------------------------------------------- */ async jetDeMoral(situation, messageReussi = undefined, messageManque = undefined) { const jetMoral = await this._jetDeMoral(situation); @@ -2388,10 +2310,9 @@ export class RdDActor extends RdDBaseActor { /* -------------------------------------------- */ async creerTacheDepuisLivre(item, options = { renderSheet: true }) { - // TODO: déplacer vers Item pour livres const nomTache = "Lire " + item.name; - const filterTacheLecture = it => it.name == nomTache; - let tachesExistantes = this.filterItems(filterTacheLecture, 'tache'); + const filterTacheLecture = it => it.type == 'tache' && it.name == nomTache; + let tachesExistantes = this.filterItems(filterTacheLecture); if (tachesExistantes.length == 0) { const tache = { name: nomTache, type: 'tache', @@ -2407,14 +2328,14 @@ export class RdDActor extends RdDBaseActor { } } await this.createEmbeddedDocuments('Item', [tache], options); - tachesExistantes = this.filterItems(filterTacheLecture, 'tache'); + tachesExistantes = this.filterItems(filterTacheLecture); } return tachesExistantes.length > 0 ? tachesExistantes[0] : undefined; } blessuresASoigner() { // TODO or not TODO: filtrer les blessures poour lesquels on ne peut plus faire de premiers soins? - return this.filterItems(it => it.system.gravite > 0 && !(it.system.premierssoins.done && it.system.soinscomplets.done), 'blessure') + return this.filterItems(it => it.system.gravite > 0 && it.system.gravite <= 6 && !(it.system.premierssoins.done && it.system.soinscomplets.done), 'blessure') } async getTacheBlessure(blesse, blessure) { @@ -3155,8 +3076,8 @@ export class RdDActor extends RdDBaseActor { tache: Math.max(0, tache.system.points_de_tache_courant) } }) - if (bonus>=0) { - await tache.delete() + if (bonus >= 0) { + await this.deleteEmbeddedDocuments('Item', [tache.id]) } } } @@ -3311,11 +3232,11 @@ export class RdDActor extends RdDBaseActor { async _appliquerEncaissement(encaissement, show) { let santeOrig = duplicate(this.system.sante); - this.ajouterBlessure(encaissement); // Will upate the result table + const blessure = await this.ajouterBlessure(encaissement); // Will upate the result table const perteVie = this.isEntite() ? { newValue: 0 } : await this.santeIncDec("vie", -encaissement.vie); - const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, encaissement.critiques > 0); + const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, blessure?.isCritique()); mergeObject(encaissement, { alias: this.name, @@ -3325,6 +3246,7 @@ export class RdDActor extends RdDBaseActor { jetEndurance: perteEndurance.jetEndurance, endurance: santeOrig.endurance.value - perteEndurance.newValue, vie: this.isEntite() ? 0 : (santeOrig.vie.value - perteVie.newValue), + blessure: blessure, show: show ?? {} }); @@ -3344,73 +3266,33 @@ export class RdDActor extends RdDBaseActor { } /* -------------------------------------------- */ - ajouterBlessure(encaissement) { - if (this.type == 'entite') return; // Une entité n'a pas de blessures - if (encaissement.legeres + encaissement.graves + encaissement.critiques == 0) return; - + async ajouterBlessure(encaissement) { + if (this.isEntite()) return; // Une entité n'a pas de blessures + if (encaissement.gravite < 0) return; + if (encaissement.gravite > 0) { + while (this.countBlessures(it => it.system.gravite == encaissement.gravite) >= RdDItemBlessure.maxBlessures(encaissement.gravite) && encaissement.gravite <= 6) { + // Aggravation + encaissement.gravite += 2 + if (encaissement.gravite > 2) { + encaissement.vie += 2; + } + } + } const endActuelle = Number(this.system.sante.endurance.value); - let blessures = duplicate(this.system.blessures); - - let count = encaissement.legeres; - // Manage blessures - while (count > 0) { - let legere = blessures.legeres.liste.find(it => !it.active); - if (legere) { - this._setBlessure(legere, encaissement); - count--; - } - else { - encaissement.graves += count; - encaissement.legeres -= count; - break; - } + const blessure = await RdDItemBlessure.createBlessure(this, encaissement.gravite, encaissement.dmg.loc.label); + if (blessure.isCritique()) { + encaissement.endurance = endActuelle; } - count = encaissement.graves; - while (count > 0) { - let grave = blessures.graves.liste.find(it => !it.active); - if (grave) { - this._setBlessure(grave, encaissement); - count--; - } - else { - encaissement.critiques += count; - encaissement.graves -= count; - encaissement.endurance = endActuelle; - encaissement.vie = 4; - break; - } + if (blessure.isMort()) { + this.setEffect(STATUSES.StatusComma, true); + encaissement.mort = true; + ChatMessage.create({ + content: `charge + ${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !` + }); } - - count = encaissement.critiques; - while (count > 0) { - let critique = blessures.critiques.liste[0]; - if (!critique.active) { - this._setBlessure(critique, encaissement); - count--; - } else { - // TODO: status effect dead - this.setEffect(STATUSES.StatusComma, true); - ChatMessage.create({ - content: `charge - ${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !` - }); - encaissement.critiques -= count; - encaissement.mort = true; - break; - } - } - - encaissement.endurance = Math.max(encaissement.endurance, -endActuelle); - this.update({ "system.blessures": blessures }); - } - - /* -------------------------------------------- */ - _setBlessure(blessure, encaissement) { - blessure.active = true; - blessure.psdone = false; - blessure.scdone = false; - blessure.loc = encaissement.locName; + return blessure; } /* -------------------------------------------- */ @@ -3643,42 +3525,28 @@ export class RdDActor extends RdDBaseActor { /* -------------------------------------------- */ async buildPotionGuerisonList(pointsGuerison) { - let pointsGuerisonInitial = pointsGuerison; - let myData = this.system; - const blessures = duplicate(myData.blessures); - let guerisonData = { list: [], pointsConsommes: 0 } - - console.log(blessures); - for (let critique of blessures.critiques.liste) { - if (critique.active && pointsGuerison >= 6) { - pointsGuerison -= 6; - critique.active = false; - guerisonData.list.push("1 Blessure Critique (6 points)"); + const pointsGuerisonInitial = pointsGuerison; + const blessures = this.filterItems(it => it.isLegere() || it.isGrave() || it.isCritique()).sort(Misc.descending(it => it.system.gravite)) + const ids = [] + const guerisonData = { list: [], pointsConsommes: 0 } + for (let blessure of blessures) { + if (pointsGuerison >= blessure.system.gravite) { + pointsGuerison -= blessure.system.gravite; + guerisonData.list.push(`1 Blessure ${blessure.system.labelGravite} (${blessure.system.gravite} points)`); + ids.push(blessure.id) } } - for (let grave of blessures.graves.liste) { - if (grave.active && pointsGuerison >= 4) { - pointsGuerison -= 4; - grave.active = false; - guerisonData.list.push("1 Blessure Grave (4 points)"); - } + if (ids.length > 0) { + await this.supprimerBlessures(it => ids.includes(it.id)); } - for (let legere of blessures.legeres.liste) { - if (legere.active && pointsGuerison >= 2) { - pointsGuerison -= 2; - legere.active = false; - guerisonData.list.push("1 Blessure Légère (2 points)"); - } + if (blessures.length == ids.length) { + let pvManquants = this.system.sante.vie.max - this.system.sante.vie.value; + let pvSoignees = Math.min(pvManquants, Math.floor(pointsGuerison / 2)); + pointsGuerison -= pvSoignees * 2; + guerisonData.list.push(pvSoignees + " Points de Vie soignés"); + await this.santeIncDec('vie', +pvSoignees, false); } - await this.update({ "system.blessures": blessures }); - - let pvManquants = myData.sante.vie.max - myData.sante.vie.value; - let pvSoignees = Math.min(pvManquants, Math.floor(pointsGuerison / 2)); - pointsGuerison -= pvSoignees * 2; - guerisonData.list.push(pvSoignees + " Points de Vie soignés"); - await this.santeIncDec('vie', +pvSoignees, false); guerisonData.pointsConsommes = pointsGuerisonInitial - pointsGuerison; - return guerisonData; } @@ -3697,7 +3565,7 @@ export class RdDActor extends RdDBaseActor { } } if (!potionData.system.magique || potionData.rolled.isSuccess) { - this.bonusRecuperationPotion = potionData.system.herbeBonus; + await this.setBonusPotionSoin(potionData.system.herbeBonus); } ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), @@ -3705,6 +3573,10 @@ export class RdDActor extends RdDBaseActor { }); } + async setBonusPotionSoin(bonus) { + await this.update({ 'sante.bonusPotion': bonus }); + } + /* -------------------------------------------- */ async consommerPotionRepos(potionData) { potionData.alias = this.name; diff --git a/module/item/blessure.js b/module/item/blessure.js index 0c71df22..063b7885 100644 --- a/module/item/blessure.js +++ b/module/item/blessure.js @@ -1,4 +1,6 @@ import { RdDItem } from "../item.js"; +import { Misc } from "../misc.js"; +import { RdDTimestamp } from "../rdd-timestamp.js"; const BASE_TACHE_SOIN_BLESSURE = { type: "tache", @@ -6,20 +8,30 @@ const BASE_TACHE_SOIN_BLESSURE = { system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, } } const TACHES_SOIN_BLESSURE = { - 'critique': { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } }, - 'grave': { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } }, - 'legere': { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } }, 6: { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } }, 4: { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } }, 2: { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } }, } +const definitionsBlessures = [ + { type: "contusion", gravite: 0, labelGravite: 'Contusion/éraflure', max: 100, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/eraflure.webp" }, + { type: "legere", gravite: 2, labelGravite: 'Légère', max: 5, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" }, + { type: "grave", gravite: 4, labelGravite: 'Grave', max: 2, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" }, + { type: "critique", gravite: 6, labelGravite: 'Critique', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" }, + { type: "mort", gravite: 8, labelGravite: 'Mort', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/mort.webp" } +] + export class RdDItemBlessure extends RdDItem { static get defaultIcon() { return "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp"; } + prepareDerivedData() { + super.prepareDerivedData(); + this.system.labelGravite = this.getLabelGravite() + } + static prepareTacheSoin(gravite) { const tache = TACHES_SOIN_BLESSURE[gravite] if (!tache) { @@ -28,7 +40,22 @@ export class RdDItemBlessure extends RdDItem { } return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), tache) } + static async createBlessure(actor, gravite, localisation) { + const definition = RdDItemBlessure.getDefinition(gravite) + const blessure = { + name: definition.labelGravite, + type: 'blessure', + img: definition.icon, + system: { + gravite: gravite, + difficulte: - gravite, + localisation: localisation + } + } + const blessures = await actor.createEmbeddedDocuments('Item', [blessure]) + return blessures[0] + } static async createTacheSoinBlessure(actor, gravite) { const tache = RdDItemBlessure.prepareTacheSoin(gravite) @@ -51,6 +78,54 @@ export class RdDItemBlessure extends RdDItem { } } + async setSoinsBlessure(systemUpdate = {}) { + systemUpdate = mergeObject(systemUpdate, this.system, { overwrite: false }), + systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done + await this.update({ + img: this.getImgSoins(systemUpdate.gravite, systemUpdate.soinscomplets.done), + system: systemUpdate + }); + } + + async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) { + if (this.parent != actor || actor == undefined) { + return; + } + if (new RdDTimestamp(this.system.fin).isAfterIndexDate(timestamp)) { + // attente periode + return + } + if (this.system.gravite > 0) { + const update = { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } } + const gravite = this.system.gravite; + const graviteMoindre = gravite - 2; + const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length + const labelGravite = RdDItemBlessure.getLabelGravite(gravite); + + let rolled = await actor.jetRecuperationConstitution(Misc.toInt(this.system.soinscomplets.bonus) + actor.system.sante.bonusPotion, message); + + if (rolled.isETotal) { + message.content += ` -- une blessure ${labelGravite} s'infecte (temps de guérison augmenté de ${definition.facteur} jours, perte de vie)`; + mergeObject(update, { fin: { indexDate: timestamp.addJours(gravite).indexDate } }); + await actor.santeIncDec("vie", -1); + } + else { + if (!isMaladeEmpoisonne && rolled.isSuccess && this.peutRetrograder(graviteMoindre, moindres)) { + message.content += ` -- une blessure ${labelGravite} cicatrise`; + mergeObject(update, { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } }); + } + else { + message.content += ` -- une blessure ${labelGravite} reste stable`; + } + } + await this.update(update); + } + } + + peutRetrograder(graviteMoindre, moindres) { + return moindres < RdDItemBlessure.getDefinition(graviteMoindre).max + } + async calculerFinPeriodeTemporel(debut) { return await debut.nouveauJour().addJours(this.system.gravite); } @@ -61,34 +136,42 @@ export class RdDItemBlessure extends RdDItem { } } - prepareDerivedData() { - super.prepareDerivedData(); - this.system.labelGravite = this.getLabelGravite() - } - - async setSoinsBlessure(systemUpdate = {}) { - systemUpdate = mergeObject(systemUpdate, this.system, { overwrite: false }), - systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done - await this.update({ - img: this.getImgSoins(systemUpdate.soinscomplets.done), - system: systemUpdate - }); - } - - getImgSoins(soins) { - return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : 'blessure'}.webp` + getImgSoins(gravite, soins) { + let img = 'blessure' + if (gravite > 6) { + img = 'mort' + } + if (gravite <= 0) { + img = 'eraflure' + } + return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : img}.webp` } getLabelGravite() { - if (this.system.gravite >= 6) { - return 'Critique' - } - if (this.system.gravite >= 4) { - return 'Grave' - } - if (this.system.gravite >= 2) { - return 'Légère' - } - return 'Contusion/éraflure' + return RdDItemBlessure.getDefinition(this.system.gravite).labelGravite } -} \ No newline at end of file + + static getDefinition(gravite) { + return definitionsBlessures.sort(Misc.ascending(it => it.gravite)) + .find(it => it.gravite >= gravite); + } + static maxBlessures(gravite) { + return RdDItemBlessure.getDefinition(gravite).max + } + + isContusion() { + return this.system.gravite <= 0 + } + isLegere() { + return this.system.gravite > 0 && this.system.gravite <= 2 + } + isGrave() { + return this.system.gravite > 2 && this.system.gravite <= 4 + } + isCritique() { + return this.system.gravite > 4 && this.system.gravite <= 6 + } + isMort() { + return this.system.gravite > 6 + } +} diff --git a/module/rdd-bonus.js b/module/rdd-bonus.js index 25bbdb3e..2516b0ff 100644 --- a/module/rdd-bonus.js +++ b/module/rdd-bonus.js @@ -28,7 +28,7 @@ export class RdDBonus { } /* -------------------------------------------- */ - static dmg(rollData, dmgActor, isCauchemar = false) { + static dmg(rollData, dmgActor, isEntiteIncarnee = false) { let dmg = { total: 0 }; if (rollData.arme && rollData.arme.name.toLowerCase() == "esquive") { // Specific case management @@ -41,7 +41,7 @@ export class RdDBonus { dmg.dmgSurprise = RdDBonus.dmgBonus(rollData.ajustements?.attaqueDefenseurSurpris.used); dmg.dmgActor = rollData.selectedCarac ? RdDBonus._dmgPerso(dmgActor, rollData.selectedCarac.label, dmg.dmgArme) : 0; dmg.total = dmg.dmgSurprise + dmg.dmgTactique + dmg.dmgArme + dmg.dmgActor + dmg.dmgParticuliere; - dmg.mortalite = RdDBonus._calculMortalite(rollData, isCauchemar) + dmg.mortalite = RdDBonus._calculMortalite(rollData, isEntiteIncarnee) } return dmg; } @@ -62,11 +62,8 @@ export class RdDBonus { } /* -------------------------------------------- */ - static _calculMortalite(rollData, isCauchemar) { - if (isCauchemar) { - return "cauchemar"; - } - return isCauchemar ? "cauchemar" + static _calculMortalite(rollData, isEntiteIncarnee) { + return isEntiteIncarnee ? "entiteincarnee" : rollData.dmg?.mortalite ?? rollData.arme?.system.mortalite ?? "mortel"; diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 904384d6..435be56d 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -1295,13 +1295,8 @@ export class RdDCombat { blessuresStatus: actor.computeResumeBlessure(), SConst: actor.getSConst(), actorId: actor.id, - isGrave: false, - isCritique: false - } - if (actor.countBlessuresNonSoigneeByName("critiques") > 0) { // Pour éviter le cumul grave + critique - formData.isCritique = true; - } else if (actor.countBlessuresNonSoigneeByName("graves") > 0) { - formData.isGrave = true; + isGrave: actor.countBlessures(it => it.isGraves()) > 0, + isCritique: actor.countBlessures(it => it.isCritique()) > 0 } ChatUtility.createChatWithRollMode(actor.name, { diff --git a/module/rdd-roll-encaisser.js b/module/rdd-roll-encaisser.js index 4d98e413..a9fc2d84 100644 --- a/module/rdd-roll-encaisser.js +++ b/module/rdd-roll-encaisser.js @@ -30,9 +30,9 @@ export class RdDEncaisser extends Dialog { }; } else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])) { - dialogConf.default = "cauchemar" + dialogConf.default = "entiteincarnee" dialogConf.buttons = { - "cauchemar": { label: "Cauchemar", callback: html => this.performEncaisser("cauchemar") } + "entiteincarnee": { label: "Entité incarnée", callback: html => this.performEncaisser("entiteincarnee") } } } @@ -70,7 +70,6 @@ export class RdDEncaisser extends Dialog { total: Number(this.modifier), ajustement: Number(this.modifier), encaisserSpecial: this.encaisserSpecial, - loc: { result: 0, label: "" }, mortalite: mortalite } }); diff --git a/module/rdd-token-hud.js b/module/rdd-token-hud.js index d96bb139..12dcaf4d 100644 --- a/module/rdd-token-hud.js +++ b/module/rdd-token-hud.js @@ -88,10 +88,7 @@ export class RdDTokenHud { static async addExtensionHudSoins(html, sourceActor) { const target = Targets.getTarget({ warn: false }); if (target?.actor) { - const hudSoins = { - targetActor: target.actor, - blessures: target.actor.blessuresASoigner() ?? [] - }; + const hudSoins = { blessures: target.actor.blessuresASoigner() ?? [] }; if (hudSoins.blessures.length > 0) { // soins const controlIconTarget = html.find('.control-icon[data-action=combat]'); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 235d46ad..55e968de 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -19,7 +19,7 @@ import { RdDRaretes } from "./item/raretes.js"; /* -------------------------------------------- */ // This table starts at 0 -> niveau -10 const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"]; -const difficultesLibres = Misc.intArray(0, -11); +const difficultesLibres = Misc.intArray(0, -11); const ajustementsConditions = Misc.intArray(-10, 11); const ajustementsEncaissement = Misc.intArray(-10, 26); @@ -66,38 +66,31 @@ const fatigueMarche = { "tresdifficile": { "4": 4, "6": 6 } } -/* -------------------------------------------- */ -const definitionsBlessures = [ - { type: "legere", facteur: 2 }, - { type: "grave", facteur: 4 }, - { type: "critique", facteur: 6 } -] - /* -------------------------------------------- */ const nomEthylisme = ["Emeché", "Gris", "Pinté", "Pas frais", "Ivre", "Bu", "Complètement fait", "Ivre mort"]; /* -------------------------------------------- */ const definitionsEncaissement = { "mortel": [ - { minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 }, - { minimum: 16, maximum: 19, endurance: "2d6", vie: "2", eraflures: 0, legeres: 0, graves: 1, critiques: 0 }, - { minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", eraflures: 0, legeres: 0, graves: 0, critiques: 1 }, + { minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1}, + { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0}, + { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 2}, + { minimum: 16, maximum: 19, endurance: "2d6", vie: "2", gravite: 4}, + { minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", gravite: 6}, ], "non-mortel": [ - { minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 }, - { minimum: 20, maximum: undefined, endurance: "100", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 }, + { minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1}, + { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0 }, + { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 }, + { minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 2 }, + { minimum: 20, maximum: undefined, endurance: "100", vie: "0", gravite: 2 }, ], - "cauchemar": [ - { minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, - { minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 }, + "entiteincarnee": [ + { minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1}, + { minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0}, + { minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 }, + { minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 0 }, + { minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", gravite: 0 }, ] }; @@ -139,7 +132,6 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html', - 'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html', @@ -474,10 +466,6 @@ export class RdDUtility { return ajustementsEncaissement; } - static getDefinitionsBlessures() { - return definitionsBlessures; - } - /* -------------------------------------------- */ static getSegmentsFatigue(maxEnd) { maxEnd = Math.max(maxEnd, 1); @@ -618,17 +606,10 @@ export class RdDUtility { encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;'; encaissement.roll = roll; encaissement.armure = armure; + encaissement.penetration = rollData.arme?.system.penetration ?? 0; encaissement.total = jetTotal; encaissement.vie = await RdDUtility._evaluatePerte(encaissement.vie, over20); encaissement.endurance = await RdDUtility._evaluatePerte(encaissement.endurance, over20); - encaissement.penetration = rollData.arme?.system.penetration ?? 0; - encaissement.blessures = ( - encaissement.critiques > 0 ? "Critique" : - encaissement.graves > 0 ? "Grave" : - encaissement.legeres > 0 ? "Légère" : - encaissement.eraflures > 0 ? "Contusions/Eraflures" : - 'Aucune' - ); return encaissement; } diff --git a/styles/simple.css b/styles/simple.css index df341346..f5144534 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -186,7 +186,7 @@ i:is(.fas, .far) { } .system-foundryvtt-reve-de-dragon .sheet-header :is(.header-compteurs,.header-etats,.profile-img, .profile-img-token){ - padding: 0 3%; + padding: 0 0.4rem; } .system-foundryvtt-reve-de-dragon .sheet-header :is(.profile-img, .profile-img-token) { @@ -213,11 +213,13 @@ i:is(.fas, .far) { } .system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs { + width: calc(60% - 110px - 1rem); text-align: right; max-width: fit-content; } .system-foundryvtt-reve-de-dragon .sheet-header div.header-etats { + width: calc(40% - 32px - 1rem); height: 48px; max-width: fit-content; flex: initial; diff --git a/template.json b/template.json index 4d1cfd28..a58c064c 100644 --- a/template.json +++ b/template.json @@ -179,7 +179,8 @@ "value": 10, "label": "Endurance", "derivee": false - } + }, + "bonusPotion": 0 }, "attributs": { "plusdom": { @@ -364,7 +365,8 @@ "value": 0, "label": "Fatigue", "derivee": true - } + }, + "bonusPotion": 0 }, "attributs": { "sconst": { diff --git a/templates/actor/blessure.hbs b/templates/actor/blessure.hbs index 7fed6645..16d9bc12 100644 --- a/templates/actor/blessure.hbs +++ b/templates/actor/blessure.hbs @@ -2,15 +2,18 @@ - {{system.labelGravite}} ({{system.localisation}}) + {{system.labelGravite}} + {{#if (gt system.gravite 6)}} + + + {{else}} {{#if system.premierssoins.done}} {{else}} - {{/if}} @@ -23,6 +26,10 @@ {{/if}} + {{/if}} + + {{system.localisation}} + diff --git a/templates/actor/blessure.html b/templates/actor/blessure.html deleted file mode 100644 index fb5b863d..00000000 --- a/templates/actor/blessure.html +++ /dev/null @@ -1,27 +0,0 @@ -
  • - - - {{title}} - - {{#if blessure.active}} - - - - - - - - - - - {{else}} - - - - - {{/if}} -
  • diff --git a/templates/actor/blessures.html b/templates/actor/blessures.html index f5ce7fa2..0974c2a0 100644 --- a/templates/actor/blessures.html +++ b/templates/actor/blessures.html @@ -3,6 +3,7 @@ Blessures Premiers soins Soins complets + Loc. Actions {{#each blessures as |blessure|}} diff --git a/templates/actor/header-effects.html b/templates/actor/header-effects.html index 3a94f93e..a1d52317 100644 --- a/templates/actor/header-effects.html +++ b/templates/actor/header-effects.html @@ -1,4 +1,4 @@ - +
    {{#if effects}} {{#each effects as |effect key|}} @@ -9,4 +9,4 @@ {{else}} Aucun effet actif {{/if}} - +
    diff --git a/templates/actor/header-etat.html b/templates/actor/header-etat.html index a2e30510..8d928cf5 100644 --- a/templates/actor/header-etat.html +++ b/templates/actor/header-etat.html @@ -1,8 +1,8 @@
    - {{system.compteurs.etat.label}}: {{system.compteurs.etat.value}} - Sur-encombrement: {{calc.surenc}} - {{calc.resumeBlessures}} +
    {{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}
    +
    Sur-encombrement: {{calc.surenc}}
    +
    {{calc.resumeBlessures}}
    {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
    diff --git a/templates/chat-resultat-encaissement.html b/templates/chat-resultat-encaissement.html index 04d3ccd6..1950bf63 100644 --- a/templates/chat-resultat-encaissement.html +++ b/templates/chat-resultat-encaissement.html @@ -1,4 +1,5 @@ {{#if isGM}} +{{log this}} {{#if (gt endurance 0)}} De plus, {{alias}} a perdu {{endurance}} points d'endurance @@ -11,7 +12,7 @@ {{numberFormat dmg.total decimals=0 sign=true}} {{#if (eq dmg.mortalite 'non-mortel')~}}(coups non mortels) - {{~else if (eq dmg.mortalite 'cauchemar')}}(entité de cauchemar) + {{~else if (eq dmg.mortalite 'entiteincarnee')}}(entité incarnée) {{~/if}} @@ -22,15 +23,16 @@ {{~/unless}}, total: {{total}}
    {{alias}} - {{#if (eq dmg.mortalite 'cauchemar')}}subit le coup - {{else if eraflures}}subit une contusion - {{else if legeres}}subit une blessure légère - {{else if graves}}subit une blessure grave - {{else if critiques}}subit une blessure critique + {{#if (eq dmg.mortalite 'entiteincarnee')}}subit le coup {{else if mort}}vient de mourir + {{else if blessure}} + {{#if (gt blessure.system.gravite 0)}}subit une blessure {{blessure.system.labelGravite}} + {{else}}subit une contusion + {{~/if~}} {{else}}s'en sort sans une égratignure {{~/if~}} - {{~#unless (eq dmg.mortalite 'cauchemar')}} + + {{~#unless (eq dmg.mortalite 'entiteincarnee')}} {{#if dmg.loc.label}} {{#if (gt roll.total 0)}}({{dmg.loc.label}}){{/if}} {{/if}} @@ -39,7 +41,7 @@ {{~#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance {{#if (ne vie 0)}}, {{vie}} points de vie{{/if}} {{/if}} - {{#if (ne dmg.mortalite 'cauchemar')}} + {{#if (ne dmg.mortalite 'entiteincarnee')}} {{#if (gt endurance 1)}}et {{#if sonne}}est sonnécharge jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}! {{#if hasPlayerOwner}}Jet d'endurance : Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}} diff --git a/templates/item-blessure-sheet.html b/templates/item-blessure-sheet.html index a476506e..83037f2b 100644 --- a/templates/item-blessure-sheet.html +++ b/templates/item-blessure-sheet.html @@ -9,19 +9,19 @@ + {{/select}} - -
    - - -
    -
    + {{#if (lt system.gravite 7)}} +
    + + +
    - + {{#if system.premierssoins.done}}
    {{/if}} + {{/if}} {{#if options.isOwned}} {{>"systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs" this labeldebut="Obtenue" labelfin="Prochain jet"}}