51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
import ActorGeneral from "./baseActorModel.mjs";
|
|
import {KidsOnBroomsItem, Wand, Broom} from "./itemModel.mjs"
|
|
|
|
/* -------------------------------------------- */
|
|
/* PC Model */
|
|
/* -------------------------------------------- */
|
|
const fields = foundry.data.fields;
|
|
class PlayerCharacter extends ActorGeneral
|
|
{
|
|
static defineSchema(){
|
|
return {
|
|
...super.defineSchema(),
|
|
description: new fields.StringField({required: false, intial: "Enter your characters description here."}),
|
|
broom: new fields.EmbeddedDataField(Broom, {nullable: true}),
|
|
wand: new fields.EmbeddedDataField(Wand, {nullable: true}),
|
|
animalFamiliar: new fields.StringField({required: false, initial: "Describe your companion!"}),
|
|
schoolbag: new fields.ArrayField({type: KidsOnBroomsItem, default: []}),
|
|
strengths: new fields.ArrayField({type: Strength, default: []}),
|
|
adversityTokens: new fields.NumberField({required: true, nullable: false, integer: true, initial: 3, min: 0})
|
|
}
|
|
}
|
|
|
|
prepareBaseData() {
|
|
let effectsToApply = this.gatherEffects();
|
|
|
|
effectsToApply.forEach(element => {
|
|
switch (element.statID) {
|
|
case value:
|
|
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
})
|
|
}
|
|
|
|
gatherEffects() {
|
|
let effectsToApply = new [];
|
|
|
|
this.schoolbag.array.forEach(element => {
|
|
if(element.effects != []) {
|
|
element.effects.forEach(effect => {
|
|
effectsToApply.push(effect);
|
|
})
|
|
}
|
|
});
|
|
|
|
return effectsToApply;
|
|
}
|
|
} |