diff --git a/lang/fr.json b/lang/fr.json index 9480606..4c0ea3e 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -475,6 +475,7 @@ "BOL.chat.applydamagetotarget": "Appliquer les dommages à la cible", "BOL.chat.fightoption": "Option de combat", "BOL.chat.reroll": "Relancer (1 P. Heroisme)", + "BOL.chat.heroicreminder": "En plus des actions indiquées sur les boutons ci-dessous, vous pouvez : Si vous dépensez un Point dh'Eheoisme en plus, tout ces effets peuvent être doublés", "BOL.chat.toheroic": "Transformer en succés Héroïque (1 P. Héroisme/Vilainie)", "BOL.chat.tolegend": "Transformer en succes Légendaire (1 P. Heroisme/Vilainie)", "BOL.chat.hurttitle": "{name} va encaisser {damageTotal} dégats !", @@ -518,8 +519,8 @@ "BOL.chat.horoscopepoints": "Coût : {points} Points d'Astrologie", "BOL.chat.horoscopeminorsuccess": "Votre horoscope mineur est un succès : éditez le nom de l'horoscope sur votre fiche. Vous bénéficiez d'1 dé Bonus pour cette situation.", "BOL.chat.horoscopeminorfailure": "Votre horoscope mineur est un échec : éditez le nom de l'horoscope sur votre fiche. Vous souffrez d'1 dé Malus pour cette situation.", - "BOL.chat.horoscopemajorsuccess": "Votre horoscope majeur est un succès : vous bénéficiez d'1 point d'Héroisme pour cette aventure. Ce point a été ajouté automatiquement.", - "BOL.chat.horoscopemajorfailure": "Votre horoscope majeur est un échec : vous perdez 1 point d'Héroisme pour cette aventure. Ce point a été enlevé automatiquement.", + "BOL.chat.horoscopemajorsuccess": "Votre horoscope majeur est un succès : {horoscopeName} bénéficie d'1 point d'Héroisme de plus pour cette aventure. Ce point a été ajouté automatiquement.", + "BOL.chat.horoscopemajorfailure": "Votre horoscope majeur est un échec : {horoscopeName} a perdu 1 point d'Héroisme pour cette aventure. Ce point a été enlevé automatiquement.", "BOL.chat.horoscopemajorgroupsuccess": "Votre horoscope majeur de groupe est un succès. Vous et vos amis bénéficiez de {careerBonus} dés bonus pendant cette aventure.", "BOL.chat.horoscopemajorgroupfailure": "Votre horoscope majeur de groupe est un échec. Vous et vos amis souffrez de {careerBonus} dés malus pendant cette aventure.", "BOL.chat.usedhoroscope": "Horoscope utilisé", @@ -535,7 +536,7 @@ "BOL.chat.criticalinfo": "C'est un succès Héroïque ou Légendaire ! Choisissez vos options et effets !", "BOL.chat.criticalbuttonjournal": "Succès Héroïque/Légendaire", - "BOL.chat.losshp": "{name}} a perdu {lossHP} points de Vitalité. Si il se repose quelques minutes, il peut récupérer {recupHP} points de Vitalité.", + "BOL.chat.losshp": "{{name}} a perdu {lossHP} points de Vitalité. Si il se repose quelques minutes, il peut récupérer {recupHP} points de Vitalité.", "BOL.chat.applyrecup": "Récupérer pendant quelques minutes (+{recupHP} Vitalité)", "BOL.chat.inforecup": "{name} vient de récupérer {recupHP} points de Vitalité après quelques minutes de repos.", diff --git a/module/actor/actor.js b/module/actor/actor.js index ab54c06..1c23155 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -505,11 +505,17 @@ export class BoLActor extends Actor { this.createEmbeddedDocuments('Item', [horoscope]) } if (rollData.horoscopeType == "major") { - if (rollData.isSuccess) { - this.subHeroPoints(1) - } else { - this.addHeroPoints(1) + let actorHoroscope = this + if(rollData.targetId) { + let token = game.scenes.current.tokens.get(rollData.targetId) + actorHoroscope = token.actor } + if (rollData.isSuccess) { + actorHoroscope.addHeroPoints(1) + } else { + actorHoroscope.subHeroPoints(1) + } + rollData.horoscopeName = actorHoroscope.name } if (rollData.horoscopeType == "majorgroup") { let rID = randomID(16) @@ -800,6 +806,7 @@ export class BoLActor extends Actor { whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name), content: await renderTemplate('systems/bol/templates/chat/chat-recup-information.hbs', { name: this.name, + img: this.img, actorId: this.id, lossHP: lossHP, recupHP: Math.ceil(lossHP / 2) @@ -811,7 +818,8 @@ export class BoLActor extends Actor { /*-------------------------------------------- */ async applyRecuperation(recupHP) { let hp = duplicate(this.system.resources.hp) - hp.value += recupHP + //console.log("RECUP !!!!", hp, recupHP) + hp.value += Number(recupHP) hp.value = Math.min(hp.value, hp.max) this.update({ 'system.resources.hp': hp }) let msg = await ChatMessage.create({ diff --git a/module/bol.js b/module/bol.js index 695c79b..26bd6d7 100644 --- a/module/bol.js +++ b/module/bol.js @@ -122,7 +122,7 @@ Hooks.once('ready', async function () { BoLUtility.ready() BoLCharacterSummary.ready() - registerUsageCount('bol') + registerUsageCount(game.system.id) welcomeMessage() diff --git a/module/controllers/bol-rolls.js b/module/controllers/bol-rolls.js index 7d2a8d3..2aaa2fb 100644 --- a/module/controllers/bol-rolls.js +++ b/module/controllers/bol-rolls.js @@ -220,6 +220,9 @@ export class BoLRoll { /* -------------------------------------------- */ static horoscopeCheck(actor, event, horoscopeType) { + + let target = BoLUtility.getTarget() + let cost = (horoscopeType == "minor") ? 1 : 2 if (cost > actor.getAstrologyPoints()) { ui.notifications.warn(game.i18n.localize("BOL.ui.astrologyNoPoints")) @@ -233,6 +236,7 @@ export class BoLRoll { rollData.astrologyPointsCost = cost rollData.label = game.i18n.localize('BOL.ui.makeHoroscope') rollData.description = game.i18n.localize('BOL.ui.makeHoroscope') + " " + game.i18n.localize(rollData.horoscopeTypeLabel) + rollData.targetId = target?.id console.log("HOROSCOPE!", rollData); return this.displayRollDialog(rollData); @@ -685,6 +689,7 @@ export class BoLDefaultRoll { flavor: msgFlavor, speaker: ChatMessage.getSpeaker({ actor: actor }), }) + this.rollData.roll = duplicate(this.rollData.roll) // Remove object, keep data (v111 ready) msg.setFlag("world", "bol-roll-data", this.rollData) }) } diff --git a/module/system/bol-combat.js b/module/system/bol-combat.js index f68e925..2e12f8e 100644 --- a/module/system/bol-combat.js +++ b/module/system/bol-combat.js @@ -33,18 +33,20 @@ export class BoLCombatManager extends Combat { /************************************************************************************/ nextRound() { - let combatants = this.combatants.contents - let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char. - for (let c of combatants) { - //let actor = game.actors.get(c.actorId) - c.actor.clearRoundModifiers() - let toRemove = [] - if (autoRemoveDead && c.actor.type == "encounter" && (c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) { - toRemove.push( c.id || c._id) - } - //console.log("REM", autoRemoveDead, toRemove, c.actor) - if (toRemove.length>0) { - this.deleteEmbeddedDocuments('Combatant', toRemove) + if (game.user.isGM) { + let combatants = this.combatants.contents + let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char. + for (let c of combatants) { + //let actor = game.actors.get(c.actorId) + c.actor.clearRoundModifiers() + let toRemove = [] + if (autoRemoveDead && c.actor.type == "encounter" && (c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) { + toRemove.push(c.id || c._id) + } + //console.log("REM", autoRemoveDead, toRemove, c.actor) + if (toRemove.length > 0) { + this.deleteEmbeddedDocuments('Combatant', toRemove) + } } } super.nextRound() @@ -52,21 +54,25 @@ export class BoLCombatManager extends Combat { /************************************************************************************/ startCombat() { - let combatants = this.combatants.contents - for (let c of combatants) { - let actor = game.actors.get(c.actorId) - actor.storeVitaliteCombat() + if (game.user.isGM) { + let combatants = this.combatants.contents + for (let c of combatants) { + let actor = game.actors.get(c.actorId) + actor.storeVitaliteCombat() + } } return super.startCombat() } /************************************************************************************/ _onDelete() { - let combatants = this.combatants.contents - for (let c of combatants) { - let actor = game.actors.get(c.actorId) - actor.clearInitiative() - actor.displayRecuperation() + if (game.user.isGM) { + let combatants = this.combatants.contents + for (let c of combatants) { + let actor = game.actors.get(c.actorId) + actor.clearInitiative() + actor.displayRecuperation() + } } super._onDelete() } diff --git a/module/system/bol-utility.js b/module/system/bol-utility.js index f0b6b67..6bf5e2d 100644 --- a/module/system/bol-utility.js +++ b/module/system/bol-utility.js @@ -27,8 +27,8 @@ export class BoLUtility { onChange: lang => window.location.reload() }) game.settings.register("bol", "auto-remove-dead", { - name: "Enlever les PNJs morts automatiquement", - hint: "Supprime les PNJ (piétaille, créatures, coriaces) automatiquement du combat lorsqu'ils sont à 0 Vitalité ou moins", + name: "Enlever les PNJs morts automatiquement au round suivant", + hint: "Supprime les PNJ (piétaille, créatures, coriaces) automatiquement du combat lorsqu'ils sont à 0 Vitalité ou moins, lors du passage au round suivant", scope: "world", config: true, default: false, diff --git a/system.json b/system.json index 863b2ff..f590a7f 100644 --- a/system.json +++ b/system.json @@ -14,7 +14,7 @@ ], "url": "https://www.uberwald.me/gitea/public/bol", "license": "LICENSE.txt", - "version": "10.5.14", + "version": "10.5.15", "compatibility": { "minimum": "10", "verified": "10" @@ -202,7 +202,7 @@ ], "socket": true, "manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json", - "download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.14.zip", + "download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.5.15.zip", "background": "systems/bol/ui/page_accueil.webp", "gridDistance": 1.5, "gridUnits": "m", diff --git a/templates/chat/rolls/attack-damage-card.hbs b/templates/chat/rolls/attack-damage-card.hbs index 2bafc89..aca0590 100644 --- a/templates/chat/rolls/attack-damage-card.hbs +++ b/templates/chat/rolls/attack-damage-card.hbs @@ -3,5 +3,7 @@ {{#if isCritical}} - - {{/if}} + {{#if isRealCritical}} + + {{/if}} +{{/if}} diff --git a/templates/chat/rolls/default-roll-card.hbs b/templates/chat/rolls/default-roll-card.hbs index 4d82bfd..392deb4 100644 --- a/templates/chat/rolls/default-roll-card.hbs +++ b/templates/chat/rolls/default-roll-card.hbs @@ -60,11 +60,17 @@ {{localize "BOL.chat.criticalbuttonjournal"}} + {{#if (and isCritical weapon)}} +
+ {{{localize "BOL.chat.heroicreminder"}}} +
+ {{/if}} {{/if}} {{#if (and isSuccess weapon)}} {{> "systems/bol/templates/chat/rolls/attack-damage-card.hbs"}} {{/if}} + {{#if (and isSuccess spell)}} {{> "systems/bol/templates/chat/rolls/spell-roll-card.hbs"}} {{/if}} diff --git a/templates/chat/rolls/horoscope-roll-card.hbs b/templates/chat/rolls/horoscope-roll-card.hbs index 2e69471..f149356 100644 --- a/templates/chat/rolls/horoscope-roll-card.hbs +++ b/templates/chat/rolls/horoscope-roll-card.hbs @@ -11,9 +11,9 @@ {{#if (eq horoscopeType "major")}} {{#if isSuccess}} - {{localize "BOL.chat.horoscopemajorsuccess"}} + {{localize "BOL.chat.horoscopemajorsuccess" horoscopeName=horoscopeName}} {{else}} - {{localize "BOL.chat.horoscopemajorfailure"}} + {{localize "BOL.chat.horoscopemajorfailure" horoscopeName=horoscopeName}} {{/if}} {{/if}}