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:
2021-01-22 09:08:47 +00:00
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,39 +2550,28 @@ 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 myArray;
return this._buildActorLinksList(this.data.data.subacteurs?.montures ?? []);
}
_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);
}
/* -------------------------------------------- */
async pushSubacteur( actor, dataArray, dataPath, dataName ) {
let alreadyPresent = dataArray.find( attached => attached.id == actor.data._id);

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();
});
/* -------------------------------------------- */
@ -233,13 +232,16 @@ function messageDeBienvenue() {
<br>Vous trouverez quelques informations pour démarrer dans ce document : @Compendium[foundryvtt-reve-de-dragon.rappel-des-regles.7uGrUHGdPu0EmIu2]{Documentation MJ/Joueurs}
<br>La commande <code>/aide</code> dans le chat permet de voir les commandes spécifiques à Rêve de Dragon.</div>
` });
}
}
}
/* -------------------------------------------- */
/* 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();