forked from public/foundryvtt-reve-de-dragon
Push initial structure
This commit is contained in:
@ -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 ) {
|
||||
|
Reference in New Issue
Block a user