Compare commits

...

7 Commits

Author SHA1 Message Date
d82a543860 Merge pull request 'v10.7.18 - le repos de Semolosse' (#651) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#651
2023-06-08 06:51:42 +02:00
2e76961ba7 Correction rendu changelog en ligne
# Conflicts:
#	changelog.md
2023-06-08 01:48:05 +02:00
a9f50bbc5e v10.7.18 2023-06-08 01:40:58 +02:00
8ba3476d7b Fix: la date des blessures ne marchait plus
la liste des types (pour aider à la saisie) est une idée mitigée

- ça évite les fautes d'orthographe dans les constantes de types
Mais:
- on peut oublier un type
- si le type n'est pas défini, il est undefined
  (donc risques de regressions)

Saisie de tous les types du template.
2023-06-08 01:34:29 +02:00
4e8f6e8872 Merge pull request 'v10.7.17 - Le doigt du destin de Sémolosse' (#649) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#649
2023-06-05 20:14:00 +02:00
727701bdcd v10.7.17 2023-06-05 20:01:40 +02:00
dcc0f0acfd Fix: validation encaissement MJ 2023-06-05 19:58:57 +02:00
9 changed files with 60 additions and 44 deletions

View File

@@ -1,6 +1,11 @@
---
# v10.7 - L'os de Semolosse
## v10.7.18 - le repos de Semolosse
- correction des dates de blessures qui ne marchaient plus
## v10.7.17 - le doigt du destin de Semolosse
- correction de la validation d'encaissement par le MJ
## v10.7.16 - la morsure de Semolosse
- correction de l'affichage des objets suite à confusion
- correction de liens dans la liste des équipements

View File

@@ -3204,25 +3204,31 @@ export class RdDActor extends RdDBaseActor {
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
return;
}
const attackerId = attacker?.id;
if (ReglesOptionelles.isUsing('validation-encaissement-gr') && !game.user.isGM) {
RdDBaseActor.remoteActorCall({
actorId: this.id,
method: 'validerEncaissement',
args: [rollData, show]
method: 'appliquerEncaissement',
args: [rollData, show, attackerId]
});
return;
}
await this.appliquerEncaissement(rollData, show, attackerId);
}
async appliquerEncaissement(rollData, show, attackerId) {
const armure = await this.computeArmure(rollData);
if (ReglesOptionelles.isUsing('validation-encaissement-gr')) {
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, (encaissement, show) => this._appliquerEncaissement(encaissement, show, attacker));
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, attackerId, (encaissement, show, attackerId) => this._appliquerEncaissement(encaissement, show, attackerId));
}
else {
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: SHOW_DICE });
await this._appliquerEncaissement(encaissement, show, attacker)
await this._appliquerEncaissement(encaissement, show, attackerId);
}
}
async _appliquerEncaissement(encaissement, show, attacker) {
async _appliquerEncaissement(encaissement, show, attackedId) {
const attacker = attackedId ? game.actors.get(attackedId) : undefined
let santeOrig = duplicate(this.system.sante);
const blessure = await this.ajouterBlessure(encaissement, attacker); // Will update the result table

View File

@@ -3,6 +3,7 @@ import { SYSTEM_SOCKET_ID } from "../constants.js";
import { Monnaie } from "../item-monnaie.js";
import { Misc } from "../misc.js";
import { RdDAudio } from "../rdd-audio.js";
import { RdDConfirm } from "../rdd-confirm.js";
import { RdDUtility } from "../rdd-utility.js";
import { SystemCompendiums } from "../settings/system-compendiums.js";
import { APP_ASTROLOGIE_REFRESH } from "../sommeil/app-astrologie.js";

View File

@@ -7,7 +7,7 @@ import { RdDUtility } from "./rdd-utility.js";
*/
export class DialogValidationEncaissement extends Dialog {
static async validerEncaissement(actor, rollData, armure, show, onEncaisser) {
static async validerEncaissement(actor, rollData, armure, show, attackerId, onEncaisser) {
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: HIDE_DICE });
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.html', {
actor: actor,
@@ -15,12 +15,12 @@ export class DialogValidationEncaissement extends Dialog {
encaissement: encaissement,
show: show
});
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, show, onEncaisser);
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser);
dialog.render(true);
}
/* -------------------------------------------- */
constructor(html, actor, rollData, armure, encaissement, show, onEncaisser) {
constructor(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser) {
// Common conf
let buttons = {
"valider": { label: "Valider", callback: html => this.onValider() },
@@ -48,6 +48,7 @@ export class DialogValidationEncaissement extends Dialog {
this.armure = armure;
this.encaissement = encaissement;
this.show = show;
this.attackerId = attackerId;
this.onEncaisser = onEncaisser;
this.forceDiceResult = {total: encaissement.roll.result };
}
@@ -66,6 +67,6 @@ export class DialogValidationEncaissement extends Dialog {
async onValider() {
this.encaissement = await RdDUtility.jetEncaissement(this.rollData, this.armure, { showDice: SHOW_DICE, forceDiceResult: this.forceDiceResult});
this.onEncaisser(this.encaissement, this.show)
this.onEncaisser(this.encaissement, this.show, this.attackerId)
}
}

View File

@@ -10,44 +10,49 @@ import { RdDRaretes } from "./item/raretes.js";
export const TYPES = {
competence: 'competence',
competencecreature: 'competencecreature',
empoignade: 'empoignade',
possession: 'possession',
blessure: 'blessure',
maladie: 'maladie',
poison: 'poison',
arme: 'arme',
armure: 'armure',
conteneur: 'conteneur',
sort: 'sort',
objet: 'objet',
monnaie: 'monnaie',
gemme: 'gemme',
munition: 'munition',
nourritureboisson: 'nourritureboisson',
herbe: 'herbe',
plante: 'plante',
faune: 'faune',
ingredient: 'ingredient',
faune: 'faune',
livre: 'livre',
potion: 'potion',
service: 'service',
musique: 'musique',
danse: 'danse',
chant: 'chant',
jeu: 'jeu',
recettecuisine: 'recettecuisine',
oeuvre: 'oeuvre',
recettealchimique: 'recettealchimique',
tache: 'tache',
sort: 'sort',
sortreserve: 'sortreserve',
rencontre: 'rencontre',
queue: 'queue',
ombre: 'ombre',
souffle: 'souffle',
tete: 'tete',
casetmr: 'casetmr',
meditation: 'meditation',
recettealchimique: 'recettealchimique',
chant: 'chant',
danse: 'danse',
jeu: 'jeu',
recettecuisine: 'recettecuisine',
musique: 'musique',
maladie: 'maladie',
poison: 'poison',
oeuvre: 'oeuvre',
monnaie: 'monnaie',
munition: 'munition',
nourritureboisson: 'nourritureboisson',
service: 'service',
signedraconique: 'signedraconique',
gemme: 'gemme',
possession: 'possession',
sortreserve: 'sortreserve',
extraitpoetique: 'extraitpoetique',
tarot: 'tarot',
empoignade: 'empoignade',
objet: 'objet'
nombreastral: 'nombreastral',
extraitpoetique: 'extraitpoetique',
}
const typesInventaireMateriel = [
TYPES.arme,
TYPES.armure,

View File

@@ -58,15 +58,6 @@ export class RdDCarac {
selectedCarac?.label.match(/(Apparence|Force|Agilité|Dextérité|Vue|Ouïe|Odorat-Goût|Empathie|Dérobée|Mêlée|Tir|Lancer)/);
}
static isIgnoreEtatGeneral(rollData) {
const selectedCarac = rollData.selectedCarac;
return !selectedCarac ||
rollData.ethylisme ||
RdDCarac.isChance(selectedCarac) ||
(RdDCarac.isReve(selectedCarac) && !rollData.competence);
}
static computeTotal(carac, beaute = undefined) {
const total = Object.values(carac ?? {}).filter(c => !c.derivee)
.map(it => parseInt(it.value))

View File

@@ -314,8 +314,8 @@ 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(".utilisation-moral"), rollData.use.appelAuMoral);
HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
// Mise à jour valeurs
this.html.find(".dialog-roll-title").text(this._getTitle(rollData));

View File

@@ -51,7 +51,7 @@ export const referenceAjustements = {
getValue: (rollData, actor) => RdDBonus.find(rollData.surpriseDefenseur).attaque,
},
etat: {
isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData),
isUsed: (rollData, actor) => !RollDataAjustements.isIgnoreEtatGeneral(rollData),
getLabel: (rollData, actor) => 'Etat général',
getValue: (rollData, actor) => actor.getEtatGeneral({ ethylisme: rollData.forceAlcool != undefined })
},
@@ -177,4 +177,11 @@ export class RollDataAjustements {
return sum;
}
static isIgnoreEtatGeneral(rollData) {
const selectedCarac = rollData.selectedCarac;
return !selectedCarac ||
rollData.ethylisme ||
RdDCarac.isChance(selectedCarac) ||
(RdDCarac.isReve(selectedCarac) && !rollData.competence);
}
}

View File

@@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "10.7.16",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.16.zip",
"version": "10.7.18",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.18.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
"compatibility": {
"minimum": "10",