mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Merge branch 'main' into feature/517-action-cost-on-success
This commit is contained in:
commit
382c17a103
33 changed files with 109 additions and 146 deletions
|
|
@ -8,7 +8,6 @@ import RegisterHandlebarsHelpers from './module/helpers/handlebarsHelper.mjs';
|
||||||
import { enricherConfig, enricherRenderSetup } from './module/enrichers/_module.mjs';
|
import { enricherConfig, enricherRenderSetup } from './module/enrichers/_module.mjs';
|
||||||
import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs';
|
import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs';
|
||||||
import { NarrativeCountdowns } from './module/applications/ui/countdowns.mjs';
|
import { NarrativeCountdowns } from './module/applications/ui/countdowns.mjs';
|
||||||
import { DualityRollColor } from './module/data/settings/Appearance.mjs';
|
|
||||||
import { DHRoll, DualityRoll, D20Roll, DamageRoll, DualityDie } from './module/dice/_module.mjs';
|
import { DHRoll, DualityRoll, D20Roll, DamageRoll, DualityDie } from './module/dice/_module.mjs';
|
||||||
import { enrichedDualityRoll } from './module/enrichers/DualityRollEnricher.mjs';
|
import { enrichedDualityRoll } from './module/enrichers/DualityRollEnricher.mjs';
|
||||||
import { registerCountdownHooks } from './module/data/countdowns.mjs';
|
import { registerCountdownHooks } from './module/data/countdowns.mjs';
|
||||||
|
|
@ -56,8 +55,8 @@ Hooks.once('init', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, DHRoll, DualityRoll, D20Roll, DamageRoll];
|
CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, DHRoll, DualityRoll, D20Roll, DamageRoll];
|
||||||
Roll.CHAT_TEMPLATE = "systems/daggerheart/templates/ui/chat/foundryRoll.hbs";
|
Roll.CHAT_TEMPLATE = 'systems/daggerheart/templates/ui/chat/foundryRoll.hbs';
|
||||||
Roll.TOOLTIP_TEMPLATE = "systems/daggerheart/templates/ui/chat/foundryRollTooltip.hbs";
|
Roll.TOOLTIP_TEMPLATE = 'systems/daggerheart/templates/ui/chat/foundryRollTooltip.hbs';
|
||||||
CONFIG.MeasuredTemplate.objectClass = placeables.DhMeasuredTemplate;
|
CONFIG.MeasuredTemplate.objectClass = placeables.DhMeasuredTemplate;
|
||||||
|
|
||||||
const { DocumentSheetConfig } = foundry.applications.apps;
|
const { DocumentSheetConfig } = foundry.applications.apps;
|
||||||
|
|
@ -162,12 +161,6 @@ Hooks.on('ready', () => {
|
||||||
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')
|
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')
|
||||||
ui.resources.render({ force: true });
|
ui.resources.render({ force: true });
|
||||||
|
|
||||||
document.body.classList.toggle(
|
|
||||||
'theme-colorful',
|
|
||||||
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
|
|
||||||
DualityRollColor.colorful.value
|
|
||||||
);
|
|
||||||
|
|
||||||
registerCountdownHooks();
|
registerCountdownHooks();
|
||||||
socketRegistration.registerSocketHooks();
|
socketRegistration.registerSocketHooks();
|
||||||
registerRollDiceHooks();
|
registerRollDiceHooks();
|
||||||
|
|
|
||||||
15
lang/en.json
15
lang/en.json
|
|
@ -2080,12 +2080,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DualityRollColor": {
|
|
||||||
"options": {
|
|
||||||
"colorful": "Colorful",
|
|
||||||
"normal": "Normal"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Homebrew": {
|
"Homebrew": {
|
||||||
"newDowntimeMove": "Downtime Move",
|
"newDowntimeMove": "Downtime Move",
|
||||||
"downtimeMoves": "Downtime Moves",
|
"downtimeMoves": "Downtime Moves",
|
||||||
|
|
@ -2095,7 +2089,11 @@
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"maxFear": { "label": "Max Fear" },
|
"maxFear": { "label": "Max Fear" },
|
||||||
"traitArray": { "label": "Initial Trait Modifiers" },
|
"traitArray": { "label": "Initial Trait Modifiers" },
|
||||||
"maxLoadout": { "label": "Max Cards in Loadout" }
|
"maxLoadout": {
|
||||||
|
"label": "Max Cards in Loadout",
|
||||||
|
"hint": "Set to blank or 0 for unlimited maximum"
|
||||||
|
},
|
||||||
|
"maxDomains": { "label": "Max Class Domains", "hint": "Max domains you can set on a class" }
|
||||||
},
|
},
|
||||||
"currency": {
|
"currency": {
|
||||||
"enabled": "Enable Overrides",
|
"enabled": "Enable Overrides",
|
||||||
|
|
@ -2285,7 +2283,8 @@
|
||||||
"beastformToManyAdvantages": "You cannot select any more advantages.",
|
"beastformToManyAdvantages": "You cannot select any more advantages.",
|
||||||
"beastformToManyFeatures": "You cannot select any more features.",
|
"beastformToManyFeatures": "You cannot select any more features.",
|
||||||
"beastformEquipWeapon": "You cannot use weapons while in a Beastform.",
|
"beastformEquipWeapon": "You cannot use weapons while in a Beastform.",
|
||||||
"loadoutMaxReached": "You already have {max} cards in your loadout. Move atleast one to your vault before adding a new one.",
|
"loadoutMaxReached": "You've reached maximum loadout. Move atleast one domain card to the vault, or increase the limit in homebrew settings if desired.",
|
||||||
|
"domainMaxReached": "You've reached the maximum domains for the class. Increase the limit in homebrew settings if desired.",
|
||||||
"insufficientResources": "You have insufficient resources",
|
"insufficientResources": "You have insufficient resources",
|
||||||
"multiclassAlreadyPresent": "You already have a class and multiclass",
|
"multiclassAlreadyPresent": "You already have a class and multiclass",
|
||||||
"subclassesAlreadyPresent": "You already have a class and multiclass subclass"
|
"subclassesAlreadyPresent": "You already have a class and multiclass subclass"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import DhAppearance, { DualityRollColor } from '../../data/settings/Appearance.mjs';
|
import DhAppearance from '../../data/settings/Appearance.mjs';
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
|
|
@ -96,11 +96,6 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
||||||
|
|
||||||
static async save() {
|
static async save() {
|
||||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, this.settings.toObject());
|
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, this.settings.toObject());
|
||||||
document.body.classList.toggle(
|
|
||||||
'theme-colorful',
|
|
||||||
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).dualityColorScheme ===
|
|
||||||
DualityRollColor.colorful.value
|
|
||||||
);
|
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -266,9 +266,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
const doc = await getDocFromElement(target);
|
const doc = await getDocFromElement(target);
|
||||||
const actorLoadout = doc.actor.system.loadoutSlot;
|
const actorLoadout = doc.actor.system.loadoutSlot;
|
||||||
if (actorLoadout.available) return doc.update({ 'system.inVault': false });
|
if (actorLoadout.available) return doc.update({ 'system.inVault': false });
|
||||||
ui.notifications.warn(
|
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
|
||||||
game.i18n.format('DAGGERHEART.UI.Notifications.loadoutMaxReached', { max: actorLoadout.max })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -686,6 +684,11 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
*/
|
*/
|
||||||
static async #toggleVault(_event, button) {
|
static async #toggleVault(_event, button) {
|
||||||
const doc = await getDocFromElement(button);
|
const doc = await getDocFromElement(button);
|
||||||
|
const { available } = this.document.system.loadoutSlot;
|
||||||
|
if (doc.system.inVault && !available) {
|
||||||
|
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
|
||||||
|
}
|
||||||
|
|
||||||
await doc?.update({ 'system.inVault': !doc.system.inVault });
|
await doc?.update({ 'system.inVault': !doc.system.inVault });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -480,7 +480,7 @@ export default function DHApplicationMixin(Base) {
|
||||||
*/
|
*/
|
||||||
static async #toChat(_event, target) {
|
static async #toChat(_event, target) {
|
||||||
let doc = await getDocFromElement(target);
|
let doc = await getDocFromElement(target);
|
||||||
return doc.toChat(this.document.id);
|
return doc.toChat(doc.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,10 @@ export default class ClassSheet extends DHBaseItemSheet {
|
||||||
{
|
{
|
||||||
selector: '.domain-input',
|
selector: '.domain-input',
|
||||||
options: () => CONFIG.DH.DOMAIN.domains,
|
options: () => CONFIG.DH.DOMAIN.domains,
|
||||||
callback: ClassSheet.#onDomainSelect
|
callback: ClassSheet.#onDomainSelect,
|
||||||
|
tagifyOptions: {
|
||||||
|
maxTags: () => game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxDomains
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
dragDrop: [
|
dragDrop: [
|
||||||
|
|
|
||||||
|
|
@ -117,9 +117,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
async onRollAllSave(event, message) {
|
async onRollAllSave(event, message) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (!game.user.isGM) return;
|
if (!game.user.isGM) return;
|
||||||
const targets = event.target.parentElement.querySelectorAll(
|
const targets = event.target.parentElement.querySelectorAll('[data-token] .target-save');
|
||||||
'[data-token] .target-save'
|
|
||||||
);
|
|
||||||
const actor = await this.getActor(message.system.source.actor),
|
const actor = await this.getActor(message.system.source.actor),
|
||||||
action = this.getAction(actor, message.system.source.item, message.system.source.action);
|
action = this.getAction(actor, message.system.source.item, message.system.source.action);
|
||||||
targets.forEach(async el => {
|
targets.forEach(async el => {
|
||||||
|
|
@ -169,9 +167,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
|
|
||||||
async onRollSimple(event, message) {
|
async onRollSimple(event, message) {
|
||||||
const buttonType = event.target.dataset.type ?? 'damage',
|
const buttonType = event.target.dataset.type ?? 'damage',
|
||||||
total = message.rolls.reduce((a,c) => a + Roll.fromJSON(c).total, 0),
|
total = message.rolls.reduce((a, c) => a + Roll.fromJSON(c).total, 0),
|
||||||
damages = {
|
damages = {
|
||||||
'hitPoints': {
|
hitPoints: {
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
applyTo: 'hitPoints',
|
applyTo: 'hitPoints',
|
||||||
|
|
@ -186,20 +184,18 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
if (targets.length === 0)
|
if (targets.length === 0)
|
||||||
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||||
|
|
||||||
targets.forEach(target => {
|
targets.forEach(target => {
|
||||||
if(buttonType === 'healing')
|
if (buttonType === 'healing') target.actor.takeHealing(damages);
|
||||||
target.actor.takeHealing(damages);
|
else target.actor.takeDamage(damages);
|
||||||
else
|
});
|
||||||
target.actor.takeDamage(damages);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async abilityUseButton(event, message) {
|
async abilityUseButton(event, message) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
const action = message.system.actions[Number.parseInt(event.currentTarget.dataset.index)];
|
const item = await foundry.utils.fromUuid(message.system.origin);
|
||||||
const actor = game.actors.get(message.system.source.actor);
|
const action = item.system.actions.get(event.currentTarget.id);
|
||||||
await actor.use(action);
|
await item.use(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
async actionUseButton(event, message) {
|
async actionUseButton(event, message) {
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,3 @@ export const gameSettings = {
|
||||||
LevelTiers: 'LevelTiers',
|
LevelTiers: 'LevelTiers',
|
||||||
Countdowns: 'Countdowns'
|
Countdowns: 'Countdowns'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DualityRollColor = {
|
|
||||||
colorful: {
|
|
||||||
value: 0,
|
|
||||||
label: 'DAGGERHEART.SETTINGS.DualityRollColor.options.colorful'
|
|
||||||
},
|
|
||||||
normal: {
|
|
||||||
value: 1,
|
|
||||||
label: 'DAGGERHEART.SETTINGS.DualityRollColor.options.normal'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ export default class DhpAdversary extends BaseDataActor {
|
||||||
super._onUpdate(changes, options, userId);
|
super._onUpdate(changes, options, userId);
|
||||||
|
|
||||||
if (game.user.id === userId) {
|
if (game.user.id === userId) {
|
||||||
if (changes.system.type) {
|
if (changes.system?.type) {
|
||||||
const existingHordeEffect = this.parent.effects.find(x => x.type === 'horde');
|
const existingHordeEffect = this.parent.effects.find(x => x.type === 'horde');
|
||||||
if (changes.system.type === CONFIG.DH.ACTOR.adversaryTypes.horde.id) {
|
if (changes.system.type === CONFIG.DH.ACTOR.adversaryTypes.horde.id) {
|
||||||
if (!existingHordeEffect)
|
if (!existingHordeEffect)
|
||||||
|
|
|
||||||
|
|
@ -362,13 +362,12 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
|
|
||||||
get loadoutSlot() {
|
get loadoutSlot() {
|
||||||
const loadoutCount = this.domainCards.loadout?.length ?? 0,
|
const loadoutCount = this.domainCards.loadout?.length ?? 0,
|
||||||
max =
|
worldSetting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxLoadout,
|
||||||
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxLoadout +
|
max = !worldSetting ? null : worldSetting + this.bonuses.maxLoadout;
|
||||||
this.bonuses.maxLoadout;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
current: loadoutCount,
|
current: loadoutCount,
|
||||||
available: Math.max(max - loadoutCount, 0),
|
available: !max ? true : Math.max(max - loadoutCount, 0),
|
||||||
max
|
max
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -579,7 +578,7 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
: this.levelData.level.current * 2
|
: this.levelData.level.current * 2
|
||||||
};
|
};
|
||||||
this.resources.hope.max -= Object.keys(this.scars).length;
|
this.resources.hope.max -= Object.keys(this.scars).length;
|
||||||
this.resources.hitPoints.max = this.class.value?.system?.hitPoints ?? 0;
|
this.resources.hitPoints.max += this.class.value?.system?.hitPoints ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default class DHClass extends BaseDataItem {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
domains: new fields.ArrayField(new fields.StringField(), { max: 2 }),
|
domains: new fields.ArrayField(new fields.StringField()),
|
||||||
classItems: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
classItems: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
||||||
hitPoints: new fields.NumberField({
|
hitPoints: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -123,6 +123,14 @@ export default class DHClass extends BaseDataItem {
|
||||||
const allowed = await super._preUpdate(changed, options, userId);
|
const allowed = await super._preUpdate(changed, options, userId);
|
||||||
if (allowed === false) return false;
|
if (allowed === false) return false;
|
||||||
|
|
||||||
|
if (changed.system?.domains) {
|
||||||
|
const maxDomains = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxDomains;
|
||||||
|
if (changed.system.domains.length > maxDomains) {
|
||||||
|
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.domainMaxReached'));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const paths = [
|
const paths = [
|
||||||
'subclasses',
|
'subclasses',
|
||||||
'characterGuide.suggestedPrimaryWeapon',
|
'characterGuide.suggestedPrimaryWeapon',
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,6 @@ export default class DhAppearance extends foundry.abstract.DataModel {
|
||||||
initial: fearDisplay.token.value,
|
initial: fearDisplay.token.value,
|
||||||
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.displayFear.label'
|
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.displayFear.label'
|
||||||
}),
|
}),
|
||||||
dualityColorScheme: new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
choices: DualityRollColor,
|
|
||||||
initial: DualityRollColor.normal.value,
|
|
||||||
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.dualityColorScheme.label'
|
|
||||||
}),
|
|
||||||
diceSoNice: new fields.SchemaField({
|
diceSoNice: new fields.SchemaField({
|
||||||
hope: new fields.SchemaField({
|
hope: new fields.SchemaField({
|
||||||
foreground: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
foreground: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||||
|
|
@ -65,14 +59,3 @@ export default class DhAppearance extends foundry.abstract.DataModel {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DualityRollColor = {
|
|
||||||
colorful: {
|
|
||||||
value: 'colorful',
|
|
||||||
label: 'DAGGERHEART.SETTINGS.DualityRollColor.options.colorful'
|
|
||||||
},
|
|
||||||
normal: {
|
|
||||||
value: 'normal',
|
|
||||||
label: 'DAGGERHEART.SETTINGS.DualityRollColor.options.normal'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,13 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
||||||
initial: 5,
|
initial: 5,
|
||||||
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.label'
|
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.label'
|
||||||
}),
|
}),
|
||||||
|
maxDomains: new fields.NumberField({
|
||||||
|
required: true,
|
||||||
|
integer: true,
|
||||||
|
min: 1,
|
||||||
|
initial: 2,
|
||||||
|
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxDomains.label'
|
||||||
|
}),
|
||||||
traitArray: new fields.ArrayField(new fields.NumberField({ required: true, integer: true }), {
|
traitArray: new fields.ArrayField(new fields.NumberField({ required: true, integer: true }), {
|
||||||
initial: () => [2, 1, 1, 0, 0, -1]
|
initial: () => [2, 1, 1, 0, 0, -1]
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -318,8 +318,16 @@ export default class DhpActor extends Actor {
|
||||||
|
|
||||||
for (var domainCard of domainCards) {
|
for (var domainCard of domainCards) {
|
||||||
if (levelupAuto) {
|
if (levelupAuto) {
|
||||||
const item = await foundry.utils.fromUuid(domainCard.data[0]);
|
const itemData = (await foundry.utils.fromUuid(domainCard.data[0])).toObject();
|
||||||
const embeddedItem = await this.createEmbeddedDocuments('Item', [item.toObject()]);
|
const embeddedItem = await this.createEmbeddedDocuments('Item', [
|
||||||
|
{
|
||||||
|
...itemData,
|
||||||
|
system: {
|
||||||
|
...itemData.system,
|
||||||
|
inVault: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
selections.push({ ...domainCard, itemUuid: embeddedItem[0].uuid });
|
selections.push({ ...domainCard, itemUuid: embeddedItem[0].uuid });
|
||||||
} else {
|
} else {
|
||||||
selections.push({ ...domainCard });
|
selections.push({ ...domainCard });
|
||||||
|
|
@ -329,8 +337,16 @@ export default class DhpActor extends Actor {
|
||||||
const achievementDomainCards = [];
|
const achievementDomainCards = [];
|
||||||
if (levelupAuto) {
|
if (levelupAuto) {
|
||||||
for (var card of Object.values(level.achievements.domainCards)) {
|
for (var card of Object.values(level.achievements.domainCards)) {
|
||||||
const item = await foundry.utils.fromUuid(card.uuid);
|
const itemData = (await foundry.utils.fromUuid(card.uuid)).toObject();
|
||||||
const embeddedItem = await this.createEmbeddedDocuments('Item', [item.toObject()]);
|
const embeddedItem = await this.createEmbeddedDocuments('Item', [
|
||||||
|
{
|
||||||
|
...itemData,
|
||||||
|
system: {
|
||||||
|
...itemData.system,
|
||||||
|
inVault: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
card.itemUuid = embeddedItem[0].uuid;
|
card.itemUuid = embeddedItem[0].uuid;
|
||||||
achievementDomainCards.push(card);
|
achievementDomainCards.push(card);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,8 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
|
|
||||||
async toChat(origin) {
|
async toChat(origin) {
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
|
const item = await foundry.utils.fromUuid(origin);
|
||||||
|
|
||||||
const systemData = {
|
const systemData = {
|
||||||
title:
|
title:
|
||||||
this.type === 'ancestry'
|
this.type === 'ancestry'
|
||||||
|
|
@ -148,13 +150,14 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
img: this.img,
|
img: this.img,
|
||||||
tags: this._getTags()
|
tags: this._getTags()
|
||||||
},
|
},
|
||||||
description: this.system.description,
|
actions: item.system.actions,
|
||||||
actions: this.system.actions
|
description: this.system.description
|
||||||
};
|
};
|
||||||
|
|
||||||
const msg = {
|
const msg = {
|
||||||
type: 'abilityUse',
|
type: 'abilityUse',
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
actor: game.actors.get(cls.getSpeaker().actor),
|
actor: item.parent,
|
||||||
author: this.author,
|
author: this.author,
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
system: systemData,
|
system: systemData,
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export const tagifyElement = (element, options, onChange, tagifyOptions = {}) =>
|
||||||
description: option.description
|
description: option.description
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
maxTags: maxTags,
|
maxTags: typeof maxTags === 'function' ? maxTags() : maxTags,
|
||||||
dropdown: {
|
dropdown: {
|
||||||
mapValueTo: 'name',
|
mapValueTo: 'name',
|
||||||
searchKeys: ['name'],
|
searchKeys: ['name'],
|
||||||
|
|
|
||||||
|
|
@ -126,4 +126,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-hint {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
|
||||||
|
label {
|
||||||
|
width: 240px;
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
border-width: 0;
|
||||||
|
|
||||||
.tooltip-title-container {
|
.tooltip-title-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -30,6 +31,7 @@
|
||||||
|
|
||||||
.tooltip-description {
|
.tooltip-description {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
text-align: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip-sub-title {
|
.tooltip-sub-title {
|
||||||
|
|
@ -47,12 +49,6 @@
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.border {
|
|
||||||
border: 1px solid light-dark(@dark-blue, @golden);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tooltip-information {
|
.tooltip-information {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
|
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
|
||||||
</header>
|
</header>
|
||||||
{{formGroup settingFields.schema.fields.maxFear value=settingFields._source.maxFear localize=true}}
|
{{formGroup settingFields.schema.fields.maxFear value=settingFields._source.maxFear localize=true}}
|
||||||
|
{{formGroup settingFields.schema.fields.maxDomains value=settingFields._source.maxDomains localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.maxLoadout value=settingFields._source.maxLoadout localize=true}}
|
{{formGroup settingFields.schema.fields.maxLoadout value=settingFields._source.maxLoadout localize=true}}
|
||||||
|
<div class="settings-hint"><label>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.hint"}}</label></div>
|
||||||
|
|
||||||
<h4>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.traitArray.label"}}</h4>
|
<h4>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.traitArray.label"}}</h4>
|
||||||
<div class="trait-array-container">
|
<div class="trait-array-container">
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
data-group='{{tabs.features.group}}'>
|
data-group='{{tabs.features.group}}'>
|
||||||
<div class="feature-section">
|
<div class="feature-section">
|
||||||
{{> 'daggerheart.inventory-items'
|
{{> 'daggerheart.inventory-items'
|
||||||
title=tabs.features.label
|
title=tabs.features.label
|
||||||
type='feature'
|
type='feature'
|
||||||
collection=document.system.features
|
collection=document.system.features
|
||||||
hideControls=true
|
hideContextMenu=true
|
||||||
canCreate=true
|
canCreate=true
|
||||||
showActions=true
|
showActions=true
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
<div class="adversary-navigation">
|
<div class="adversary-navigation">
|
||||||
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||||
<button data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
||||||
<i class="fa-solid fa-wrench"></i>
|
<i class="fa-solid fa-wrench"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,6 @@
|
||||||
</div>
|
</div>
|
||||||
<line-div></line-div>
|
<line-div></line-div>
|
||||||
<div class="reaction-section">
|
<div class="reaction-section">
|
||||||
<button data-action="reactionRoll">{{localize "DAGGERHEART.GENERAL.Roll.reaction"}}</button>
|
<button type="button" data-action="reactionRoll">{{localize "DAGGERHEART.GENERAL.Roll.reaction"}}</button>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
@ -55,6 +55,7 @@ Parameters:
|
||||||
item=item
|
item=item
|
||||||
type=../type
|
type=../type
|
||||||
hideControls=../hideControls
|
hideControls=../hideControls
|
||||||
|
hideContextMenu=../hideContextMenu
|
||||||
isActor=../isActor
|
isActor=../isActor
|
||||||
categoryAdversary=../categoryAdversary
|
categoryAdversary=../categoryAdversary
|
||||||
hideTooltip=../hideTooltip
|
hideTooltip=../hideTooltip
|
||||||
|
|
|
||||||
|
|
@ -123,9 +123,11 @@ Parameters:
|
||||||
<i class="fa-regular fa-message"></i>
|
<i class="fa-regular fa-message"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#unless hideContextMenu}}
|
||||||
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
|
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
|
||||||
<i class="fa-solid fa-ellipsis-vertical"></i>
|
<i class="fa-solid fa-ellipsis-vertical"></i>
|
||||||
</a>
|
</a>
|
||||||
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
<div class="description">{{{description}}}</div>
|
<div class="description">{{{description}}}</div>
|
||||||
</details>
|
</details>
|
||||||
<footer class="ability-card-footer">
|
<footer class="ability-card-footer">
|
||||||
{{#each actions as |action index|}}
|
{{#each actions as |action|}}
|
||||||
<button class="ability-use-button" data-index="{{index}}">
|
<button class="ability-use-button" id="{{action.id}}">
|
||||||
{{action.name}}
|
{{action.name}}
|
||||||
</button>
|
</button>
|
||||||
{{#if action.cost.value}}<div class="ability-card-action-cost">{{action.cost.value}} {{action.cost.type}}</div>{{/if}}
|
{{#if action.cost.value}}<div class="ability-card-action-cost">{{action.cost.value}} {{action.cost.type}}</div>{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="roll-part damage-section dice-roll" data-action="expandRoll">
|
<div class="roll-part damage-section dice-roll" data-action="expandRoll">
|
||||||
<div class="roll-part-header"><div><span>Damage</span></div></div>
|
<div class="roll-part-header"><div><span>{{localize (ifThen hasHealing "DAGGERHEART.ACTIONS.TYPES.healing.name" "DAGGERHEART.ACTIONS.TYPES.damage.name")}}</span></div></div>
|
||||||
<div class="roll-part-extra on-reduced">
|
<div class="roll-part-extra on-reduced">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{{#each damage as | roll index | }}
|
{{#each damage as | roll index | }}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,4 @@
|
||||||
<div>{{item.system.motivesAndTactics}}</div>
|
<div>{{item.system.motivesAndTactics}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.features }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -18,20 +18,4 @@
|
||||||
<div>{{item.system.baseThresholds.severe}}</div>
|
<div>{{item.system.baseThresholds.severe}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if (gt item.system.armorFeatures.length 0)}}<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.features"}}</h4>{{/if}}
|
|
||||||
<div class="tooltip-tags">
|
|
||||||
{{#each item.system.armorFeatures}}
|
|
||||||
{{#with (lookup ../config.ITEM.armorFeatures this.value) as | feature | }}
|
|
||||||
<div class="tooltip-tag">
|
|
||||||
<div class="tooltip-tag-label-container">
|
|
||||||
<div class="tooltip-tag-label">{{localize feature.label}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="tooltip-tag-description">{{{localize feature.description}}}</div>
|
|
||||||
</div>
|
|
||||||
{{/with}}
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions isAction=true label=(localize "DAGGERHEART.GENERAL.Action.plural")}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2,7 +2,4 @@
|
||||||
<h2 class="tooltip-title">{{item.name}}</h2>
|
<h2 class="tooltip-title">{{item.name}}</h2>
|
||||||
<img class="tooltip-image" src="{{item.img}}" />
|
<img class="tooltip-image" src="{{item.img}}" />
|
||||||
<div class="tooltip-description">{{{description}}}</div>
|
<div class="tooltip-description">{{{description}}}</div>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipChips.hbs" chips=item.system.advantageOn label=(localize "DAGGERHEART.ITEMS.Beastform.FIELDS.advantageOn.label")}}
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.features label=(localize "DAGGERHEART.GENERAL.features")}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -9,6 +9,4 @@
|
||||||
<div>{{item.system.quantity}}</div>
|
<div>{{item.system.quantity}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions isAction=true label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -26,6 +26,4 @@
|
||||||
<div>{{item.system.recallCost}}</div>
|
<div>{{item.system.recallCost}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions isAction=true label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2,7 +2,4 @@
|
||||||
<h2 class="tooltip-title">{{item.name}}</h2>
|
<h2 class="tooltip-title">{{item.name}}</h2>
|
||||||
<img class="tooltip-image" src="{{item.img}}" />
|
<img class="tooltip-image" src="{{item.img}}" />
|
||||||
<div class="tooltip-description">{{{description}}}</div>
|
<div class="tooltip-description">{{{description}}}</div>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions isAction=true label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.effects label=(localize "DAGGERHEART.GENERAL.Effect.plural") }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -37,20 +37,4 @@
|
||||||
<div>{{{damageSymbols item.system.attack.damage.parts}}}</div>
|
<div>{{{damageSymbols item.system.attack.damage.parts}}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if (gt item.system.weaponFeatures.length 0)}}<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.features"}}</h4>{{/if}}
|
|
||||||
<div class="tooltip-tags">
|
|
||||||
{{#each item.system.weaponFeatures}}
|
|
||||||
{{#with (lookup ../config.ITEM.weaponFeatures this.value) as | feature | }}
|
|
||||||
<div class="tooltip-tag">
|
|
||||||
<div class="tooltip-tag-label-container">
|
|
||||||
<div class="tooltip-tag-label">{{localize feature.label}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="tooltip-tag-description">{{{localize feature.description}}}</div>
|
|
||||||
</div>
|
|
||||||
{{/with}}
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions isAction=true label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
|
|
||||||
</div>
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue