Push initial structure

This commit is contained in:
2020-05-22 00:48:43 +02:00
parent b385993422
commit 29054cd395
7 changed files with 243 additions and 205 deletions

View File

@ -2,12 +2,43 @@
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class SimpleActor extends Actor {
export class RdDActor extends Actor {
prepareData() {
super.prepareData();
const actorData = this.data;
const data = actorData.data;
const flags = actorData.flags;
const comp = { "base": [],
"mêlée": [],
"tir": [],
"particulières": [],
"spécialisées": [],
"connaissances": [],
"draconic": []
}
// Make separate methods for each Actor type (character, npc, etc.) to keep
// things organized.
if (actorData.type === 'personnage') this._prepareCharacterData(actorData);
}
/**
* Prepare Character type specific data
*/
_prepareCharacterData(actorData) {
for (let i of actorData.items)
{
if (i.type === "compétence") {
comp[i.catégorie].push( i );
}
}
}
/** @override */
getRollData() {
const data = super.getRollData();
const shorthand = game.settings.get("worldbuilding", "macroShorthand");
const shorthand = game.settings.get("foundryvtt-reve-de-dragon", "macroShorthand");
// Re-map all attributes onto the base roll data
if ( !!shorthand ) {