Amélioration du moral
Les bon moments sont affichés en tooltips sur le moral Simplification moralIncDec: Utilisation d'un seul update
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# 13.0
|
# 13.0
|
||||||
|
|
||||||
|
## 13.0.36 - Le bonheur des zyglutes d'Illisys
|
||||||
|
|
||||||
|
- Les bon moments sont affichés en tooltip sur le moral
|
||||||
|
|
||||||
## 13.0.36 - Les rêveries d'Illisys
|
## 13.0.36 - Les rêveries d'Illisys
|
||||||
|
|
||||||
- Corrections v14
|
- Corrections v14
|
||||||
|
|||||||
+14
-14
@@ -1174,7 +1174,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSConst() { return RdDCarac.calculSConst(this.getConstitution()) }
|
getSConst() { return RdDCarac.calculSConst(this.getConstitution()) }
|
||||||
|
|
||||||
async _gainXpConstitutionJetEndurance() {
|
async _gainXpConstitutionJetEndurance() {
|
||||||
await this.updateCaracXP('constitution', Misc.toInt(this.system.carac.constitution.xp) + 1)
|
await this.updateCaracXP('constitution', Misc.toInt(this.system.carac.constitution.xp) + 1)
|
||||||
return `${this.name} a obtenu 1 sur son Jet d'Endurance et a gagné 1 point d'Expérience en Constitution. Ce point d'XP a été ajouté automatiquement.`;
|
return `${this.name} a obtenu 1 sur son Jet d'Endurance et a gagné 1 point d'Expérience en Constitution. Ce point d'XP a été ajouté automatiquement.`;
|
||||||
@@ -1214,22 +1214,22 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async moralIncDec(ajustement, bonmoment = "") {
|
async moralIncDec(ajustement, bonmoment = "") {
|
||||||
let moral = parseInt(this.system.compteurs.moral.value)
|
const moral = parseInt(this.system.compteurs.moral.value);
|
||||||
if (ajustement != 0) {
|
if (ajustement != 0) {
|
||||||
if (ajustement > 0 && bonmoment != "" && bonmoment != undefined) {
|
|
||||||
await this.update({ 'system.compteurs.bonmoments': [...this.system.compteurs.bonmoments, bonmoment] })
|
|
||||||
}
|
|
||||||
const moralTheorique = moral + ajustement
|
const moralTheorique = moral + ajustement
|
||||||
if (moralTheorique > 3) { // exaltation
|
const newExaltation = parseInt(this.system.compteurs.exaltation.value) + Math.max(0, moralTheorique - 3)
|
||||||
const exaltation = parseInt(this.system.compteurs.exaltation.value) + moralTheorique - 3
|
const newDissolution = parseInt(this.system.compteurs.dissolution.value) + Math.max(0, - moralTheorique - 3)
|
||||||
await this.update({ 'system.compteurs.exaltation.value': exaltation })
|
const newMoral = Math.max(-3, Math.min(moralTheorique, 3))
|
||||||
|
const moralUpdates = {
|
||||||
|
'system.compteurs.exaltation.value': newExaltation,
|
||||||
|
'system.compteurs.dissolution.value': newDissolution,
|
||||||
|
'system.compteurs.moral.value': newMoral
|
||||||
}
|
}
|
||||||
if (moralTheorique < -3) { // dissolution
|
if (ajustement > 0 && bonmoment != "" && bonmoment != undefined && !this.system.compteurs.bonmoments.includes(bonmoment)) {
|
||||||
const dissolution = parseInt(this.system.compteurs.dissolution.value) - 3 - moralTheorique
|
moralUpdates['system.compteurs.bonmoments'] = [...this.system.compteurs.bonmoments, bonmoment]
|
||||||
await this.update({ 'system.compteurs.dissolution.value': dissolution })
|
|
||||||
}
|
}
|
||||||
moral = Math.max(-3, Math.min(moralTheorique, 3));
|
await this.update(moralUpdates)
|
||||||
await this.update({ 'system.compteurs.moral.value': moral })
|
return newMoral
|
||||||
}
|
}
|
||||||
return moral
|
return moral
|
||||||
}
|
}
|
||||||
@@ -1571,7 +1571,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCompetenceXP(compName, newXP, display = true) {
|
async checkCompetenceXP(compName, newXP, display = true) {
|
||||||
return this.getCompetence(compName)?.checkCompetenceXP( newXP, display)
|
return this.getCompetence(compName)?.checkCompetenceXP(newXP, display)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.hbs',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.hbs',
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.hbs',
|
||||||
@@ -173,6 +173,7 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.hbs',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/actor/tooltip-bonmoments.hbs',
|
||||||
//Items
|
//Items
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
|
||||||
@@ -300,6 +301,7 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('grammar-un', str => Grammar.articleIndetermine(str));
|
Handlebars.registerHelper('grammar-un', str => Grammar.articleIndetermine(str));
|
||||||
Handlebars.registerHelper('grammar-accord', (genre, ...args) => Grammar.accord(genre, args));
|
Handlebars.registerHelper('grammar-accord', (genre, ...args) => Grammar.accord(genre, args));
|
||||||
Handlebars.registerHelper('json-stringify', object => JSON.stringify(object))
|
Handlebars.registerHelper('json-stringify', object => JSON.stringify(object))
|
||||||
|
Handlebars.registerHelper('escapeHtml', object => foundry.utils.escapeHTML(object))
|
||||||
|
|
||||||
// math
|
// math
|
||||||
Handlebars.registerHelper('math-sum', (...values) => values.slice(0, -1).reduce(Misc.sum(), 0))
|
Handlebars.registerHelper('math-sum', (...values) => values.slice(0, -1).reduce(Misc.sum(), 0))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
<li class="caracteristique flexrow list-item">
|
<li class="caracteristique flexrow list-item">
|
||||||
<label>{{system.compteurs.moral.label}}
|
<label data-tooltip-html="{{> "systems/foundryvtt-reve-de-dragon/templates/actor/tooltip-bonmoments.hbs"}}">{{system.compteurs.moral.label}}
|
||||||
<span>
|
<span>
|
||||||
<a class="flex-shrink moral-malheureux" data-tooltip="Jet de moral situation malheureuse"><i class="fa-regular fa-face-frown"></i></a>
|
<a class="flex-shrink moral-malheureux" data-tooltip="Jet de moral situation malheureuse"><i class="fa-regular fa-face-frown"></i></a>
|
||||||
<a class="flex-shrink moral-neutre" data-tooltip="Jet de moral situation neutre"><i class="fa-regular fa-face-meh"></i></a>
|
<a class="flex-shrink moral-neutre" data-tooltip="Jet de moral situation neutre"><i class="fa-regular fa-face-meh"></i></a>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<div class="toolclip themed theme-dark">
|
||||||
|
<p><b>Bon moments du jour</b></p>
|
||||||
|
{{#if system.compteurs.bonmoments}}
|
||||||
|
{{#each system.compteurs.bonmoments as |bonmoment|}}
|
||||||
|
<p>{{bonmoment}}</p>
|
||||||
|
{{/each}}
|
||||||
|
{{else}}
|
||||||
|
<p>Rien de notable</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
{{log this}}
|
|
||||||
<form class="{{cssClass}}" autocomplete="off">
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{img}}" data-edit="img" data-tooltip="{{name}}"/>
|
<img class="profile-img" src="{{img}}" data-edit="img" data-tooltip="{{name}}"/>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
{{#if (gt result.qualite 0)}}
|
{{#if (eq result.appreciation.moral '')}}
|
||||||
|
<span>L'œuvre n'est pas prévue pour gagner du moral</span>
|
||||||
|
{{else if (lte result.qualite 0)}}
|
||||||
|
<span>Qualité de {{result.qualite}}, pas d'appréciation</span>
|
||||||
|
{{else}}
|
||||||
<a class='chat-card-button apprecier' data-tooltip="Aprécier">
|
<a class='chat-card-button apprecier' data-tooltip="Aprécier">
|
||||||
<i class="fa-solid fa-face-smile-beam"></i> Apprécier
|
<i class="fa-solid fa-face-smile-beam"></i> Apprécier
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
<div>
|
<div>
|
||||||
<span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span>
|
<span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span>
|
||||||
{{log 'rolled' rolled}}
|
|
||||||
{{#if (regle-optionnelle 'afficher-colonnes-reussite')}}
|
{{#if (regle-optionnelle 'afficher-colonnes-reussite')}}
|
||||||
<span class="rdd-niveau-requis">(Réussite colonne {{plusMoins rolled.niveauNecessaire}} / avec ajustement {{plusMoins rolled.ajustementNecessaire}}) </span>
|
<span class="rdd-niveau-requis">(Réussite colonne {{plusMoins rolled.niveauNecessaire}} / avec ajustement {{plusMoins rolled.ajustementNecessaire}}) </span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
Reference in New Issue
Block a user