Item Support #69

Merged
Oliver merged 50 commits from feature/item-support into main 2026-04-15 02:42:54 +00:00
3 changed files with 14 additions and 2 deletions
Showing only changes of commit c6ec60b5bf - Show all commits

View file

@ -7,6 +7,11 @@ export class PlayerData extends foundry.abstract.TypeDataModel {
trim: true,
initial: ``,
}),
carryCapacity: new fields.NumberField({
min: 0,
nullable: true,
initial: null,
}),
attr: new fields.TypedObjectField(
new fields.SchemaField({
name: new fields.StringField({ blank: false, trim: true }),

View file

@ -42,7 +42,14 @@ export class TAFActor extends Actor {
};
getRollData() {
const data = {};
/*
All properties assigned during this phase of the roll data prep can potentially
be overridden by users creating attributes of the same key, if users shouldn't
be able to override, assign the property before the return of this function.
*/
const data = {
carryCapacity: this.system.carryCapacity ?? null,
};
if (`attr` in this.system) {
for (const attrID in this.system.attr) {

View file

@ -5,7 +5,7 @@ import { SingleModePlayerSheet } from "../apps/SingleModePlayerSheet.mjs";
import { GenericItemSheet } from "../apps/GenericItemSheet.mjs";
// Data Models
import { PlayerData } from "../data/Player.mjs";
import { PlayerData } from "../data/Actor/player.mjs";
import { GenericItemData } from "../data/Item/generic.mjs";
// Documents