Move the data that should not be stored in the DB into the Actor's prepareBaseData method
This commit is contained in:
parent
91c95da639
commit
718bd8398d
2 changed files with 12 additions and 13 deletions
|
|
@ -2,6 +2,17 @@ import { DotDungeonActor } from "./GenericActor.mjs";
|
||||||
|
|
||||||
export class Player extends DotDungeonActor {
|
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() {
|
applyActiveEffects() {
|
||||||
super.applyActiveEffects();
|
super.applyActiveEffects();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,6 @@ export class PlayerData extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
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({
|
bytes: new fields.NumberField({
|
||||||
initial: 0,
|
initial: 0,
|
||||||
min: 0,
|
min: 0,
|
||||||
|
|
@ -77,11 +69,7 @@ export class PlayerData extends foundry.abstract.TypeDataModel {
|
||||||
min: 0,
|
min: 0,
|
||||||
integer: true
|
integer: true
|
||||||
}),
|
}),
|
||||||
respawns: new fields.SchemaField({
|
respawns: new fields.NumberField({ initial: 0, }),
|
||||||
r1: new fields.BooleanField(),
|
|
||||||
r2: new fields.BooleanField(),
|
|
||||||
r3: new fields.BooleanField(),
|
|
||||||
}),
|
|
||||||
syncDelta: new fields.NumberField({
|
syncDelta: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue