forked from public/foundryvtt-reve-de-dragon
Ajout compétences créatures
This commit is contained in:
@ -31,21 +31,33 @@ export class RdDActor extends Actor {
|
||||
data.items = [];
|
||||
if (data.type == "personnage")
|
||||
{
|
||||
let competences = [];
|
||||
const pack = game.packs.get("foundryvtt-reve-de-dragon.competences");
|
||||
await pack.getIndex().then(index => competences = index);
|
||||
for (let comp of competences)
|
||||
{
|
||||
let compItem = undefined;
|
||||
await pack.getEntity(comp._id).then(skill => compItem = skill);
|
||||
data.items.push(compItem);
|
||||
}
|
||||
this.push_competence( data, "foundryvtt-reve-de-dragon.competences" );
|
||||
}
|
||||
if (data.type == "humanoide")
|
||||
{
|
||||
this.push_competence( data, "foundryvtt-reve-de-dragon.competences-humanoide" );
|
||||
}
|
||||
if (data.type == "creature")
|
||||
{
|
||||
this.push_competence( data, "foundryvtt-reve-de-dragon.competences-creature" );
|
||||
}
|
||||
super.create(data, options);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async push_competence( data, compendiumName ) {
|
||||
let competences = [];
|
||||
const pack = game.packs.get(compendiumName);
|
||||
await pack.getIndex().then(index => competences = index);
|
||||
for (let comp of competences)
|
||||
{
|
||||
let compItem = undefined;
|
||||
await pack.getEntity(comp._id).then(skill => compItem = skill);
|
||||
data.items.push(compItem);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
prepareData() {
|
||||
super.prepareData();
|
||||
|
||||
|
22
module/rdd-calendrier.js
Normal file
22
module/rdd-calendrier.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* -------------------------------------------- */
|
||||
const heures = [ "Vaisseau", "Sirène", "Faucon", "Couronne", "Dragon", "Epées", "Lyre", "Serpent", "Poisson Acrobate", "Araignée", "Roseau", "Château Dormant" ]
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDCalendrier extends Application {
|
||||
data = {
|
||||
saisons: [],
|
||||
};
|
||||
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.template = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||
options.popOut = false;
|
||||
options.resizable = false;
|
||||
return options;
|
||||
}
|
||||
|
||||
/*getData() {
|
||||
return templateData;
|
||||
}*/
|
||||
|
||||
}
|
@ -13,6 +13,7 @@ import { RdDItemSheet } from "./item-sheet.js";
|
||||
import { RdDActorSheet } from "./actor-sheet.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { TMRUtility } from "./tmr-utility.js";
|
||||
import { RdDCalendrier } from "./rdd-calendrier.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
@ -133,7 +134,15 @@ Hooks.once("init", async function() {
|
||||
Hooks.once("ready", function() {
|
||||
ChatMessage.create( { title: "Bienvenu dans le Rêve !", content : "Bienvenu dans le Rêve des Dragons !<br> " +
|
||||
"Vous trouverez quelques infos pour démarrer dans ce document : @Compendium[foundryvtt-reve-de-dragon.rappel-des-regles.7uGrUHGdPu0EmIu2]{Documentation MJ/Joueurs}" } );
|
||||
} );
|
||||
|
||||
/* Affiche le calendrier */
|
||||
let calendrier = new RdDCalendrier();
|
||||
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||
let templateData = {};
|
||||
renderTemplate(templatePath, templateData).then(html => {
|
||||
calendrier.render(true);
|
||||
} );
|
||||
});
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
|
@ -94,6 +94,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
|
||||
//Items
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-arme-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-armure-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-objet-sheet.html',
|
||||
@ -119,7 +120,9 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html'
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html',
|
||||
// Calendrier
|
||||
'systems/foundryvtt-reve-de-dragon/templates/calendar_template.html'
|
||||
];
|
||||
|
||||
return loadTemplates(templatePaths);
|
||||
@ -635,5 +638,4 @@ export class RdDUtility {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user