fvtt-never-stop-blowing-up/modules/dataModel/playerCharacterModel.mjs
2024-10-02 14:45:44 +02:00

52 lines
1.8 KiB
JavaScript

import ActorGeneral from "./baseActorModel.mjs";
import {Wand, Broom} from "./itemModel.mjs"
import KidsOnBroomsItem from "./itemModel.mjs"
/* -------------------------------------------- */
/* PC Model */
/* -------------------------------------------- */
const fields = foundry.data.fields;
export default 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;
}
}