mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[PR][Feature] 798 - Attribution (#986)
* Added attribution for items, adversary and environment * Added Attribution to all adversaries * Added attribution to environments * Added attribution for class and subclass * Added Attribution to Ancestry/Community * Added Attribution for Beastforms * Added Attribution to DomainCards * Added Attribution for wepaons * Attribution for Armor/Loot/Consumables * Added a setting to hide attribution
This commit is contained in:
parent
495575fba4
commit
8c84edddad
982 changed files with 9082 additions and 3996 deletions
|
|
@ -10,7 +10,8 @@ export default class DhpAdversary extends BaseDataActor {
|
|||
return foundry.utils.mergeObject(super.metadata, {
|
||||
label: 'TYPES.Actor.adversary',
|
||||
type: 'adversary',
|
||||
settingSheet: DHAdversarySettings
|
||||
settingSheet: DHAdversarySettings,
|
||||
hasAttribution: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
type: 'base',
|
||||
isNPC: true,
|
||||
settingSheet: null,
|
||||
hasResistances: true
|
||||
hasResistances: true,
|
||||
hasAttribution: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -53,6 +54,13 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
if (this.metadata.hasAttribution) {
|
||||
schema.attribution = new fields.SchemaField({
|
||||
source: new fields.StringField(),
|
||||
page: new fields.NumberField(),
|
||||
artist: new fields.StringField()
|
||||
});
|
||||
}
|
||||
if (this.metadata.isNPC) schema.description = new fields.HTMLField({ required: true, nullable: true });
|
||||
if (this.metadata.hasResistances)
|
||||
schema.resistance = new fields.SchemaField({
|
||||
|
|
@ -78,6 +86,13 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
*/
|
||||
static DEFAULT_ICON = null;
|
||||
|
||||
get attributionLabel() {
|
||||
if (!this.attribution) return;
|
||||
|
||||
const { source, page } = this.attribution;
|
||||
return [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ export default class DhEnvironment extends BaseDataActor {
|
|||
label: 'TYPES.Actor.environment',
|
||||
type: 'environment',
|
||||
settingSheet: DHEnvironmentSettings,
|
||||
hasResistances: false
|
||||
hasResistances: false,
|
||||
hasAttribution: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
hasResource: false,
|
||||
isQuantifiable: false,
|
||||
isInventoryItem: false,
|
||||
hasActions: false
|
||||
hasActions: false,
|
||||
hasAttribution: true
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +38,13 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
|
||||
/** @inheritDoc */
|
||||
static defineSchema() {
|
||||
const schema = {};
|
||||
const schema = {
|
||||
attribution: new fields.SchemaField({
|
||||
source: new fields.StringField(),
|
||||
page: new fields.NumberField(),
|
||||
artist: new fields.StringField()
|
||||
})
|
||||
};
|
||||
|
||||
if (this.metadata.hasDescription) schema.description = new fields.HTMLField({ required: true, nullable: true });
|
||||
|
||||
|
|
@ -110,6 +117,13 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
return [];
|
||||
}
|
||||
|
||||
get attributionLabel() {
|
||||
if (!this.attribution) return;
|
||||
|
||||
const { source, page } = this.attribution;
|
||||
return [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
|
||||
* @param {object} [options] - Options which modify the getRollData method.
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ export default class DhAppearance extends foundry.abstract.DataModel {
|
|||
initial: false,
|
||||
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.expandRollMessageTarget.label'
|
||||
})
|
||||
}),
|
||||
hideAttribution: new fields.BooleanField({
|
||||
required: true,
|
||||
initial: false,
|
||||
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.hideAttribution.label'
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue