Merge branch 'master-improve' into 'master'

Fix jet de moral/chance

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!178
This commit is contained in:
Leratier Bretonnien 2021-03-26 06:42:14 +00:00
commit d35f3ce5a2
2 changed files with 8 additions and 3 deletions

View File

@ -1427,9 +1427,8 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async moralIncDec(ajustementMoral) {
const actorData = Misc.data(this);
if (ajustementMoral != 0) {
const actorData = Misc.data(this);
let moral = Misc.toInt(actorData.data.compteurs.moral.value) + ajustementMoral
if (moral > 3) { // exaltation
const exaltation = Misc.toInt(actorData.data.compteurs.exaltation.value) + moral - 3;
@ -2281,7 +2280,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async chanceActuelleIncDec(value, limit = true) {
chance = Math.max(Misc.templateData(this).compteurs.chance.value + value, 0);
let chance = Math.max(Misc.templateData(this).compteurs.chance.value + value, 0);
if (limit) {
chance = Math.min(chance.value, this.getChance())
}

View File

@ -24,6 +24,12 @@
</span>
</div>
<hr>
{{#if rolled.isETotal}}
Le sort a des effets imprévus!
{{else if rolled.isSuccess}}
{{#unless isSortReserve}}
<span class="poesie-extrait">
{{{selectedSort.data.description}}}
</span>
{{/unless}}
{{/if}}