Move the data that should not be stored in the DB into the Actor's prepareBaseData method

This commit is contained in:
Oliver-Akins 2024-05-05 16:39:25 -06:00
parent 91c95da639
commit 718bd8398d
2 changed files with 12 additions and 13 deletions

View file

@ -2,6 +2,17 @@ import { DotDungeonActor } from "./GenericActor.mjs";
export class Player extends DotDungeonActor {
/*
These are special data properties that will be used by ActiveEffects to modify
certain limits within the actor, allowing for neat hacks that change these and
possible configuration of them.
*/
prepareBaseData() {
this.system.weapon_slots = 2;
this.system.inventory_slots = 0;
this.system.respawn_limit = 3;
};
applyActiveEffects() {
super.applyActiveEffects();

View file

@ -14,14 +14,6 @@ export class PlayerData extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
/*
These are special data properties that will be used by ActiveEffects
to modify certain limits within the actor, allowing for neat hacks
that change these
*/
weapon_slots: new fields.NumberField({ initial: 2 }),
inventory_slots: new fields.NumberField({ initial: 0 }),
bytes: new fields.NumberField({
initial: 0,
min: 0,
@ -77,11 +69,7 @@ export class PlayerData extends foundry.abstract.TypeDataModel {
min: 0,
integer: true
}),
respawns: new fields.SchemaField({
r1: new fields.BooleanField(),
r2: new fields.BooleanField(),
r3: new fields.BooleanField(),
}),
respawns: new fields.NumberField({ initial: 0, }),
syncDelta: new fields.NumberField({
required: true,
integer: true,