Shadowrun6eUltimaniaSys/module/data/npc.mjs

19 lines
572 B
JavaScript
Raw Normal View History

2024-05-20 09:59:52 +00:00
import Shadowrun6ActorBase from "./actor-base.mjs";
export default class Shadowrun6NPC extends Shadowrun6ActorBase {
static defineSchema() {
const fields = foundry.data.fields;
const requiredInteger = { required: true, nullable: false, integer: true };
const schema = super.defineSchema();
schema.cr = new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 });
schema.xp = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 });
return schema
}
prepareDerivedData() {
this.xp = this.cr * this.cr * 100;
}
}