Merge branch 'stabilisation-v1.2' into 'v1.2'

Stabilisation v1.2

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!123
This commit is contained in:
Leratier Bretonnien 2021-01-22 09:08:47 +00:00
commit e5a019afd3
6 changed files with 40 additions and 45 deletions

View File

@ -2514,7 +2514,7 @@ export class RdDActor extends Actor {
let competence = this.data.items.find(item => item.type == 'competence' && item.name.toLowerCase() == "alchimie");
let diffAlchimie = RdDAlchimie.getDifficulte(alchimieData);
let rollData = {
recetteName: recette.name,
recette: recette,
competence: competence,
diffLibre: diffAlchimie // Per default at startup
}
@ -2550,37 +2550,26 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
buildVehiculesList() {
if ( !this.data.data.subacteurs) return [];
let myArray = [];
for (let vehiculeLink of this.data.data.subacteurs.vehicules) {
let vehicule = game.actors.get( vehiculeLink.id );
myArray.push( { id: vehiculeLink.id, name: vehicule.data.name, categorie: vehicule.data.data.categorie,
structure: vehicule.data.data.structure, img: vehicule.data.img } );
}
return myArray;
return this._buildActorLinksList(
this.data.data.subacteurs?.vehicules??[],
vehicle => {return { id: vehicle.id, name: vehicle.data.name, categorie: vehicle.data.data.categorie,
structure: vehicle.data.data.structure, img: vehicle.data.img } ;});
}
/* -------------------------------------------- */
buildSuivantsList() {
if ( !this.data.data.subacteurs) return [];
let myArray = [];
for (let suivantLink of this.data.data.subacteurs.suivants) {
let suivant = game.actors.get( suivantLink.id );
myArray.push( { id: suivantLink.id, name: suivant.data.name, img: suivant.data.img } );
}
return myArray;
return this._buildActorLinksList(this.data.data.subacteurs?.suivants ?? []);
}
/* -------------------------------------------- */
buildMonturesList() {
if ( !this.data.data.subacteurs) return [];
let myArray = [];
for (let montureLink of this.data.data.subacteurs.montures) {
let monture = game.actors.get( montureLink.id );
myArray.push( { id: montureLink.id, name: monture.data.name, img: monture.data.img } );
return this._buildActorLinksList(this.data.data.subacteurs?.montures ?? []);
}
return myArray;
_buildActorLinksList(links, actorTransformation=it => { return { id: it.id, name: it.data.name, img: it.data.img }; }) {
return links.map(link => game.actors.get(link.id))
.filter(it => it != null)
.map(actorTransformation);
}
/* -------------------------------------------- */

View File

@ -225,7 +225,8 @@ export class RdDCommands {
/* -------------------------------------------- */
async rollDeDraconique(msg) {
let ddr = new DeDraconique().evaluate();
await RdDDice.show(ddr, rollMode);
ddr.showDice = true;
await RdDDice.show(ddr);
RdDCommands._chatAnswer(msg, `Lancer d'un Dé draconique: ${ddr.total}`);
}

View File

@ -220,7 +220,6 @@ Hooks.once("init", async function () {
RdDCombat.init();
RdDTokenHud.init();
RdDActor.init();
StatusEffects.init();
});
/* -------------------------------------------- */
@ -236,10 +235,13 @@ function messageDeBienvenue() {
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
StatusEffects.onReady();
/* -------------------------------------------- */
/* Affiche/Init le calendrier */
let calendrier = new RdDCalendrier();

View File

@ -8,7 +8,7 @@ const statusDemiSurprise = new Set(['sonne', 'prone', 'restrain']);
const statusSurpriseTotale = new Set(['unconscious', 'blind']);
export class StatusEffects {
static init() {
static onReady() {
StatusEffects.setCoreStatusId([demiReveStatusEffect]);
StatusEffects.setCoreStatusId(rddStatusEffects);
StatusEffects.setMandatoryRdd();

View File

@ -1,3 +1,4 @@
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.png" alt="préparation alchimique" height="32" width="32" />
<h4>
{{alias}} essaye de réaliser sa recette Alchimique : {{recette.name}}
</h4>
@ -5,8 +6,8 @@
<hr>
<div>
{{#if rolled.isSuccess}}
{{alias}} a réussi son opération alchimiue ! Il/Elle peut passer à l'étape suivante de sa recette.
{{alias}} a réussi son opération alchimique ! Il/Elle peut passer à l'étape suivante de sa recette.
{{else}}
{{alias}} a raté son opération Alchimique ! Sa recette est un echec.
{{alias}} a raté son opération alchimique ! Sa recette est un echec.
{{/if}}
</div>

View File

@ -21,22 +21,24 @@
{{/unless}}, total: <span class="rdd-roll-echec">{{total}}</span>
<br>
{{alias}} subit
{{#if (gt eraflures 0)}}une contusion
{{#if (eq dmg.mortalite 'cauchemar')}}le coup
{{else if (gt eraflures 0)}}une contusion
{{else if (gt legeres 0)}}une blessure légère
{{else if (gt graves 0)}}une blessure grave
{{else if (gt critiques 0)}}une blessure critique
{{else}}Rien du tout
{{/if}}
({{dmg.loc.label}})
{{#if (gt endurance 0)}}
{{#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance
{{#if (ne vie 0)}}, <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
{{/if}}
{{#if (gt endurance 1)}}
et {{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}
{{#if (ne dmg.mortalite 'cauchemar')}}
{{#if (gt endurance 1)}}et
{{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}
({{jetEndurance}} / {{resteEndurance}})!
{{/if}}
{{/if}}
{{/if}}
</div>
{{/if}}