Permettre les jets de chance sans astrologie

Quand on fait un jet de chance pour la journée, permettre de
ne pas utiliser l'ajustement astrologique
This commit is contained in:
Vincent Vandemeulebrouck 2023-12-08 22:26:29 +01:00
parent 7267cd4096
commit f34db764cb
8 changed files with 38 additions and 16 deletions

View File

@ -19,10 +19,6 @@ export class RdDBonus {
}
static isAjustementAstrologique(rollData) {
return RdDCarac.isChance(rollData.selectedCarac) ||
rollData.selectedSort?.system.isrituel;
}
/* -------------------------------------------- */
static isDefenseAttaqueFinesse(rollData) {
if (rollData.isEmpoignade && rollData.rolled?.isPart) {

View File

@ -44,6 +44,7 @@ export class RdDRoll extends Dialog {
diffLibre: rollData.competence?.system.default_diffLibre ?? 0,
perteMoralEchec: false, /* Pour l'affichage dans le chat */
use: {
astrologique: true,
moral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
libre: true,
coeur: undefined,
@ -214,6 +215,10 @@ export class RdDRoll extends Dialog {
this.rollData[attribute] = event.currentTarget.checked;
this.updateRollResult(html);
});
this.html.find('input.use-astrologique').change((event) => {
this.rollData.use.astrologique = event.currentTarget.checked;
this.updateRollResult(html);
});
this.html.find('input.use-encTotal').change((event) => {
this.rollData.use.encTotal = event.currentTarget.checked;
this.updateRollResult(html);
@ -314,6 +319,7 @@ export class RdDRoll extends Dialog {
HtmlUtility.showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerobee(rollData.selectedCarac));
HtmlUtility.showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
HtmlUtility.showControlWhen(this.html.find(".use-astrologique"), rollData.ajustements.astrologique.visible);
HtmlUtility.showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral);
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
HtmlUtility.showControlWhen(this.html.find(".utilisation-coeur"), rollData.ajustements.coeur.visible);

View File

@ -215,15 +215,16 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-astrologique.hbs',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-item-hautrevant.html',
'systems/foundryvtt-reve-de-dragon/templates/partial-item-frequence.html',

View File

@ -74,6 +74,17 @@ export const referenceAjustements = {
getLabel: (rollData, actor) => 'Sur-encombrement',
getValue: (rollData, actor) => actor.computeMalusSurEncombrement()
},
rituel: {
isUsed: (rollData, actor) => actor.isPersonnage() && ReglesOptionnelles.isUsing("astrologie") && rollData.selectedSort?.system.isrituel,
getLabel: (rollData, actor) => 'Astrologique',
getValue: (rollData, actor) => actor.ajustementAstrologique()
},
astrologique: {
isVisible: (rollData, actor) => actor.isPersonnage() && ReglesOptionnelles.isUsing("astrologie") && RdDCarac.isChance(rollData.selectedCarac),
isUsed: (rollData, actor) => RdDCarac.isChance(rollData.selectedCarac) && rollData.use.astrologique,
getLabel: (rollData, actor) => 'Astrologique',
getValue: (rollData, actor) => actor.ajustementAstrologique()
},
moral: {
isVisible: (rollData, actor) => actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac) && rollData.use?.moral,
isUsed: (rollData, actor) => rollData.use.moral,
@ -84,18 +95,13 @@ export const referenceAjustements = {
isVisible: (rollData, actor) => actor.isPersonnage() && RdDCarac.isVolonte(rollData.selectedCarac),
isUsed: (rollData, actor) => rollData.use.coeur != undefined,
getLabel: (rollData, actor) => 'Ajustement de cœur',
getValue: (rollData, actor) => -2 * (rollData.use?.coeur?.coeur ?? 0)
getValue: (rollData, actor) => -2 * (rollData.use.coeur?.coeur ?? 0)
},
moralTotal: {
isUsed: (rollData, actor) => RdDCarac.isVolonte(rollData.selectedCarac),
getLabel: (rollData, actor) => 'Moral',
getValue: (rollData, actor) => actor.getMoralTotal()
},
astrologique: {
isUsed: (rollData, actor) => ReglesOptionnelles.isUsing("astrologie") && RdDBonus.isAjustementAstrologique(rollData),
getLabel: (rollData, actor) => 'Astrologique',
getValue: (rollData, actor) => actor.ajustementAstrologique()
},
facteurSign: {
isUsed: (rollData, actor) => rollData.diviseurSignificative > 1,
getLabel: (rollData, actor) => Misc.getFractionHtml(rollData.diviseurSignificative),
@ -193,4 +199,5 @@ export class RollDataAjustements {
RdDCarac.isChance(selectedCarac) ||
(RdDCarac.isReve(selectedCarac) && !rollData.competence);
}
}

View File

@ -788,6 +788,10 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
.rdd-roll-dialog div.dialog-content input {
font-size: 1rem;
}
.rdd-roll-dialog div.dialog-content input[type="checkbox"]{
width: 1rem;
vertical-align: sub;
}
.rdd-roll-part {
align-items: center;
border-radius: 6px; padding: 3px;

View File

@ -6,9 +6,10 @@
<div class="flexrow">
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-astrologique.hbs"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs"}}
</div>
<div class="flex-group-left">
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}}

View File

@ -8,9 +8,10 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-astrologique.hbs"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-coeur.hbs"}}
</div>
<div class="flex-group-left">
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}}

View File

@ -0,0 +1,6 @@
<div class="flexrow use-astrologique">
<label>
Appliquer l'ajustement astrologique
<input class="attribute-value use-astrologique" type="checkbox" {{#if use.astrologique}}checked{{/if}}/>
</label>
</div>