Compare commits

...

27 commits
1.4.0 ... main

Author SHA1 Message Date
WBHarry
0b343c9f52
Fixed a lot of cases where we expected a combatant to have an attached actor (#1520) 2026-01-10 00:21:44 +01:00
Carlos Fernandez
e6973fabd0
Add view party button to character sheet (#1508) 2026-01-09 17:41:35 +01:00
WBHarry
4e18ed8270
Fixed so that chatMessages always get actor data available (#1519) 2026-01-09 17:35:00 +01:00
Nikhil Nagarajan
e7cf6594b6
[PR] Rolltables Compendium Added (#1516)
* Initial Setup

* Updated Consumables RollTable

* Placed the rolltable compendium in the SRD folder

* updated Journal with fixed links

* Re-added descriptions in rolltable

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>
2026-01-09 17:34:11 +01:00
WBHarry
bbe8fb953e
Fixed so that tagify tooltip descriptions cannot end up with raw HTML that breaks it (#1504) 2026-01-09 15:57:57 +01:00
Nikhil Nagarajan
6cebccd958
Template removed from Stardrop JSON (#1513) 2026-01-09 15:56:48 +01:00
Chris Ryan
248f7b41e7
Safety check for experiences (#1515)
Co-authored-by: Chris Ryan <chrisr@blackhole>
2026-01-09 15:55:16 +01:00
WBHarry
c6bdc846ab
[Fix] SRD Effect Priorities (#1505)
* Increased priority on effects in srd domain cards that depend on character data

* Increased priority on effects in srd classes/subclasses that depend on character data

* Increased priority on effects in srd ancestries that depend on character data

* Increased priority on effects in srd beastforms that depend on character data

* Increased priority on effects in remaining SRD items that depend on character data

* Adversaries

* Raised system version
2026-01-09 15:50:56 +01:00
Carlos Fernandez
6deadea437
Fix detection of range dependencies (#1497) 2026-01-08 19:52:25 -05:00
WBHarry
9564edb244 . 2026-01-05 13:45:03 +01:00
WBHarry
bca7e0d3c9
[Fix] Beastforms Getting Stuck (#1495)
* Fixed beastforms getting stuck

* Raised version
2025-12-31 04:52:19 +01:00
Nick Salyzyn
3b7b6258a1
[PR] Adding the ability to target downtime actions. (#1475)
* Adding the ability to target downtime actions.

* No longer using an arbitrary 100 healing. Changing the action's parent
2025-12-29 21:55:13 +01:00
WBHarry
e8c541c002
Added damage reduction rules (#1491) 2025-12-29 14:00:40 +01:00
WBHarry
f6bd1430e3
Fixed drag/drop of features for environments (#1488) 2025-12-29 13:02:22 +01:00
WBHarry
c070c6cc2d
[Fix] Evolved Beastform Wildcard (#1486)
* Fixed so picking an evolved beastform will properly handle wildcard images

* .
2025-12-29 04:44:49 +01:00
WBHarry
d0e55aeb8d
Resource Generation Fix 2025-12-28 21:16:24 +01:00
Carlos Fernandez
f11b018bd7
Support drag/drop resorting of adversary features (#1469) 2025-12-28 19:07:12 +01:00
Nick Salyzyn
c83fe25a47
Using the same drag-drop approach in environments and adversaries as in the character sheet (#1481) 2025-12-28 18:50:26 +01:00
Nick Salyzyn
3405b53900
[PR] Adding recall functionality to the loadout tab (#1482)
* Adding a Recall button that doesn't yet show a popup

* Adding an action with a cost dialog for stress - if there is a stress cost
2025-12-28 18:31:48 +01:00
Nick Salyzyn
5f001a9f83
Adding scrollable to various tabs in the homebrew settings (#1483) 2025-12-28 17:26:39 +01:00
WBHarry
87dfebec2f Raised version 2025-12-27 18:17:05 +01:00
WBHarry
ab7ea03d84
[Fix] Actor Roll Data (#1477)
* .

* .
2025-12-27 18:15:56 +01:00
Nikhil Nagarajan
09aafd0999
Icon for Action Changed (#1478) 2025-12-27 17:02:24 +01:00
Nick Salyzyn
52b32a4d12
Adding myself as a contributor (#1476) 2025-12-27 10:38:29 +10:00
WBHarry
fa21baf8bf
Fixed rollData for actions and fallback for lookup enricher (#1472) 2025-12-25 13:12:25 +01:00
WBHarry
50a307b271
[Feature] TokenConfig Actor Size Edit (#1470)
* Added the select and handliing

* Fixed so tokenPreview works with tokenSize

* Correction for prototypeToken

* Extracted common logic to token-config-mixin.mjs

* Update templates/sheets-settings/token-config/appearance.hbs

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
2025-12-25 02:12:36 +01:00
WBHarry
c63ba3b41d
[Fix] Action Source Handling (#1468)
* Fixed so that action context.source can be assigned to

* .

* .
2025-12-24 03:05:27 +01:00
78 changed files with 4131 additions and 295 deletions

View file

@ -316,7 +316,7 @@ const updateActorsRangeDependentEffects = async token => {
CONFIG.DH.SETTINGS.gameSettings.variantRules CONFIG.DH.SETTINGS.gameSettings.variantRules
).rangeMeasurement; ).rangeMeasurement;
for (let effect of token.actor.allApplicableEffects()) { for (let effect of token.actor?.allApplicableEffects() ?? []) {
if (!effect.system.rangeDependence?.enabled) continue; if (!effect.system.rangeDependence?.enabled) continue;
const { target, range, type } = effect.system.rangeDependence; const { target, range, type } = effect.system.rangeDependence;
@ -330,14 +330,14 @@ const updateActorsRangeDependentEffects = async token => {
break; break;
} }
const distanceBetween = canvas.grid.measurePath([ // Get required distance and special case 5 feet to test adjacency
userTarget.document.movement.destination, const required = rangeMeasurement[range];
token.movement.destination
]).distance;
const distance = rangeMeasurement[range];
const reverse = type === CONFIG.DH.GENERAL.rangeInclusion.outsideRange.id; const reverse = type === CONFIG.DH.GENERAL.rangeInclusion.outsideRange.id;
if (reverse ? distanceBetween <= distance : distanceBetween > distance) { const inRange =
required === 5
? userTarget.isAdjacentWith(token.object)
: userTarget.distanceTo(token.object) <= required;
if (reverse ? inRange : !inRange) {
enabledEffect = false; enabledEffect = false;
break; break;
} }
@ -351,16 +351,15 @@ const updateAllRangeDependentEffects = async () => {
const effectsAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).effects; const effectsAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).effects;
if (!effectsAutomation.rangeDependent) return; if (!effectsAutomation.rangeDependent) return;
// Only consider tokens on the active scene const tokens = canvas.scene.tokens;
const tokens = game.scenes.find(x => x.active).tokens;
if (game.user.character) { if (game.user.character) {
// The character updates their character's token. There can be only one token. // The character updates their character's token. There can be only one token.
const characterToken = tokens.find(x => x.actor === game.user.character); const characterToken = tokens.find(x => x.actor === game.user.character);
updateActorsRangeDependentEffects(characterToken); updateActorsRangeDependentEffects(characterToken);
} else if (game.user.isGM) { } else if (game.user.isActiveGM) {
// The GM is responsible for all other tokens. // The GM is responsible for all other tokens.
const playerCharacters = game.users.players.filter(x => x.active).map(x => x.character); const playerCharacters = game.users.players.filter(x => x.active).map(x => x.character);
for (let token of tokens.filter(x => !playerCharacters.includes(x.actor))) { for (const token of tokens.filter(x => !playerCharacters.includes(x.actor))) {
updateActorsRangeDependentEffects(token); updateActorsRangeDependentEffects(token);
} }
} }
@ -368,12 +367,14 @@ const updateAllRangeDependentEffects = async () => {
const debouncedRangeEffectCall = foundry.utils.debounce(updateAllRangeDependentEffects, 50); const debouncedRangeEffectCall = foundry.utils.debounce(updateAllRangeDependentEffects, 50);
Hooks.on('targetToken', async (user, token, targeted) => { Hooks.on('targetToken', () => {
debouncedRangeEffectCall(); debouncedRangeEffectCall();
}); });
Hooks.on('moveToken', async (movedToken, data) => { Hooks.on('refreshToken', (_, options) => {
debouncedRangeEffectCall(); if (options.refreshPosition) {
debouncedRangeEffectCall();
}
}); });
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html)); Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));

View file

@ -226,6 +226,7 @@
"confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)" "confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)"
}, },
"viewLevelups": "View Levelups", "viewLevelups": "View Levelups",
"viewParty": "View Party",
"InvalidOldCharacterImportTitle": "Old Character Import", "InvalidOldCharacterImportTitle": "Old Character Import",
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?", "InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
"cancelBeastform": "Cancel Beastform" "cancelBeastform": "Cancel Beastform"
@ -326,6 +327,7 @@
"equip": "Equip", "equip": "Equip",
"sendToChat": "Send To Chat", "sendToChat": "Send To Chat",
"toLoadout": "Send to Loadout", "toLoadout": "Send to Loadout",
"recall": "Recall",
"toVault": "Send to Vault", "toVault": "Send to Vault",
"unequip": "Unequip", "unequip": "Unequip",
"useItem": "Use Item" "useItem": "Use Item"
@ -1800,7 +1802,9 @@
"label": "Long Rest: Bonus Long Rest Moves", "label": "Long Rest: Bonus Long Rest Moves",
"hint": "The number of extra Long Rest Moves the character can take during a Long Rest." "hint": "The number of extra Long Rest Moves the character can take during a Long Rest."
} }
} },
"target": "Target",
"targetSelf": "Self"
}, },
"maxLoadout": { "maxLoadout": {
"label": "Max Loadout Cards Bonus" "label": "Max Loadout Cards Bonus"
@ -2777,7 +2781,9 @@
"gmRequired": "This action requires an online GM", "gmRequired": "This action requires an online GM",
"gmOnly": "This can only be accessed by the GM", "gmOnly": "This can only be accessed by the GM",
"noActorOwnership": "You do not have permissions for this character", "noActorOwnership": "You do not have permissions for this character",
"documentIsMissing": "The {documentType} is missing from the world." "documentIsMissing": "The {documentType} is missing from the world.",
"tokenActorMissing": "{name} is missing an Actor",
"tokenActorsMissing": "[{names}] missing Actors"
}, },
"Sidebar": { "Sidebar": {
"actorDirectory": { "actorDirectory": {

View file

@ -278,19 +278,26 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
'close', 'close',
async () => { async () => {
const selected = app.selected.toObject(); const selected = app.selected.toObject();
const evolved = app.evolved.form ? app.evolved.form.toObject() : null;
const data = await game.system.api.data.items.DHBeastform.getWildcardImage( const data = await game.system.api.data.items.DHBeastform.getWildcardImage(
app.configData.data.parent, app.configData.data.parent,
app.selected evolved ?? app.selected
); );
if (data) { if (data) {
if (!data.selectedImage) selected = null; if (!data.selectedImage) selected = null;
else { else {
if (data.usesDynamicToken) selected.system.tokenRingImg = data.selectedImage; const imageSource = evolved ?? selected;
else selected.system.tokenImg = data.selectedImage; if (imageSource.usesDynamicToken) imageSource.system.tokenRingImg = data.selectedImage;
else imageSource.system.tokenImg = data.selectedImage;
} }
} }
resolve({ selected: selected, evolved: app.evolved, hybrid: app.hybrid, item: featureItem }); resolve({
selected: selected,
evolved: { ...app.evolved, form: evolved },
hybrid: app.hybrid,
item: featureItem
});
}, },
{ once: true } { once: true }
); );

View file

@ -104,7 +104,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.roll = this.roll; context.roll = this.roll;
context.rollType = this.roll?.constructor.name; context.rollType = this.roll?.constructor.name;
context.rallyDie = this.roll.rallyChoices; context.rallyDie = this.roll.rallyChoices;
const experiences = this.config.data?.system.experiences || {}; const experiences = this.config.data?.system?.experiences || {};
context.experiences = Object.keys(experiences).map(id => ({ context.experiences = Object.keys(experiences).map(id => ({
id, id,
...experiences[id] ...experiences[id]

View file

@ -181,12 +181,17 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
.filter(x => category.moves[x].selected) .filter(x => category.moves[x].selected)
.flatMap(key => { .flatMap(key => {
const move = category.moves[key]; const move = category.moves[key];
const needsTarget = move.actions.filter(x => x.target?.type && x.target.type !== 'self').length > 0;
return [...Array(move.selected).keys()].map(_ => ({ return [...Array(move.selected).keys()].map(_ => ({
...move, ...move,
movePath: `${categoryKey}.moves.${key}` movePath: `${categoryKey}.moves.${key}`,
needsTarget: needsTarget
})); }));
}); });
}); });
const characters = game.actors.filter(x => x.type === 'character')
.filter(x => x.testUserPermission(game.user, 'LIMITED'))
.filter(x => x.uuid !== this.actor.uuid);
const cls = getDocumentClass('ChatMessage'); const cls = getDocumentClass('ChatMessage');
const msg = { const msg = {
@ -206,7 +211,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
`DAGGERHEART.APPLICATIONS.Downtime.${this.shortrest ? 'shortRest' : 'longRest'}.title` `DAGGERHEART.APPLICATIONS.Downtime.${this.shortrest ? 'shortRest' : 'longRest'}.title`
), ),
actor: { name: this.actor.name, img: this.actor.img }, actor: { name: this.actor.name, img: this.actor.img },
moves: moves moves: moves,
characters: characters,
selfId: this.actor.uuid
} }
), ),
flags: { flags: {

View file

@ -77,7 +77,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
cost: this.data.initiator.cost cost: this.data.initiator.cost
}; };
const selectedMember = Object.values(context.members).find(x => x.selected); const selectedMember = Object.values(context.members).find(x => x.selected && x.roll);
const selectedIsCritical = selectedMember?.roll?.system?.isCritical; const selectedIsCritical = selectedMember?.roll?.system?.isCritical;
context.selectedData = { context.selectedData = {
result: selectedMember result: selectedMember

View file

@ -21,6 +21,8 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
async _prepareContext(options) { async _prepareContext(options) {
const context = await super._prepareContext(options); const context = await super._prepareContext(options);
if (!this.actor) return context;
context.partyOnCanvas = context.partyOnCanvas =
this.actor.type === 'party' && this.actor.type === 'party' &&
this.actor.system.partyMembers.some(member => member.getActiveTokens().length > 0); this.actor.system.partyMembers.some(member => member.getActiveTokens().length > 0);
@ -58,14 +60,33 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
} }
static async #onToggleCombat() { static async #onToggleCombat() {
const tokensWithoutActors = canvas.tokens.controlled.filter(t => !t.actor);
const warning =
tokensWithoutActors.length === 1
? game.i18n.format('DAGGERHEART.UI.Notifications.tokenActorMissing', {
name: tokensWithoutActors[0].name
})
: game.i18n.format('DAGGERHEART.UI.Notifications.tokenActorsMissing', {
names: tokensWithoutActors.map(x => x.name).join(', ')
});
const tokens = canvas.tokens.controlled const tokens = canvas.tokens.controlled
.filter(t => !t.actor || !DHTokenHUD.#nonCombatTypes.includes(t.actor.type)) .filter(t => t.actor && !DHTokenHUD.#nonCombatTypes.includes(t.actor.type))
.map(t => t.document); .map(t => t.document);
if (!this.object.controlled) tokens.push(this.document); if (!this.object.controlled && this.document.actor) tokens.push(this.document);
try { try {
if (this.document.inCombat) await TokenDocument.implementation.deleteCombatants(tokens); if (this.document.inCombat) {
else await TokenDocument.implementation.createCombatants(tokens); const tokensInCombat = tokens.filter(t => t.inCombat);
await TokenDocument.implementation.deleteCombatants([...tokensInCombat, ...tokensWithoutActors]);
} else {
if (tokensWithoutActors.length) {
ui.notifications.warn(warning);
}
const tokensOutOfCombat = tokens.filter(t => !t.inCombat);
await TokenDocument.implementation.createCombatants(tokensOutOfCombat);
}
} catch (err) { } catch (err) {
ui.notifications.warn(err.message); ui.notifications.warn(err.message);
} }

View file

@ -98,7 +98,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
async _prepareContext(_options) { async _prepareContext(_options) {
const context = await super._prepareContext(_options, 'action'); const context = await super._prepareContext(_options, 'action');
context.source = this.action._source; context.source = this.action.toObject(true);
context.openSection = this.openSection; context.openSection = this.openSection;
context.tabs = this._getTabs(this.constructor.TABS); context.tabs = this._getTabs(this.constructor.TABS);
context.config = CONFIG.DH; context.config = CONFIG.DH;

View file

@ -51,6 +51,19 @@ export default class DHAdversarySettings extends DHBaseActorSettings {
} }
}; };
async _prepareContext(options) {
const context = await super._prepareContext(options);
const featureForms = ['passive', 'action', 'reaction'];
context.features = context.document.system.features.sort((a, b) =>
a.system.featureForm !== b.system.featureForm
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
: a.sort - b.sort
);
return context;
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/** /**
@ -98,16 +111,16 @@ export default class DHAdversarySettings extends DHBaseActorSettings {
async _onDrop(event) { async _onDrop(event) {
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
const item = await fromUuid(data.uuid); const item = await fromUuid(data.uuid);
if (item?.type === 'feature') { if (item?.type === 'feature') {
if (data.fromInternal && item.parent?.uuid === this.actor.uuid) { if (data.fromInternal && item.parent?.uuid === this.actor.uuid) {
return; return;
} }
const itemData = item.toObject(); const itemData = item.toObject();
delete itemData._id; delete itemData._id;
await this.actor.createEmbeddedDocuments('Item', [itemData]); await this.actor.createEmbeddedDocuments('Item', [itemData]);
} }
} }

View file

@ -49,6 +49,19 @@ export default class DHEnvironmentSettings extends DHBaseActorSettings {
} }
}; };
async _prepareContext(options) {
const context = await super._prepareContext(options);
const featureForms = ['passive', 'action', 'reaction'];
context.features = context.document.system.features.sort((a, b) =>
a.system.featureForm !== b.system.featureForm
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
: a.sort - b.sort
);
return context;
}
/** /**
* Adds a new category entry to the actor. * Adds a new category entry to the actor.
* @type {ApplicationClickAction} * @type {ApplicationClickAction}

View file

@ -1,41 +1,30 @@
export default class DhPrototypeTokenConfig extends foundry.applications.sheets.PrototypeTokenConfig { import DHTokenConfigMixin from './token-config-mixin.mjs';
/** @override */ import { getActorSizeFromForm } from './token-config-mixin.mjs';
static PARTS = {
tabs: super.PARTS.tabs, export default class DhPrototypeTokenConfig extends DHTokenConfigMixin(
identity: super.PARTS.identity, foundry.applications.sheets.PrototypeTokenConfig
appearance: { ) {
template: 'systems/daggerheart/templates/sheets-settings/token-config/appearance.hbs', /** @inheritDoc */
scrollable: [''] static DEFAULT_OPTIONS = {
}, ...super.DEFAULT_OPTIONS,
vision: super.PARTS.vision, form: { handler: DhPrototypeTokenConfig.#onSubmit }
light: super.PARTS.light,
resources: super.PARTS.resources,
footer: super.PARTS.footer
}; };
/** @inheritDoc */ /**
async _prepareResourcesTab() { * Process form submission for the sheet
const token = this.token; * @this {PrototypeTokenConfig}
const usesTrackableAttributes = !foundry.utils.isEmpty(CONFIG.Actor.trackableAttributes); * @type {ApplicationFormSubmission}
const attributeSource = */
this.actor?.system instanceof foundry.abstract.DataModel && usesTrackableAttributes static async #onSubmit(event, form, formData) {
? this.actor?.type const submitData = this._processFormData(event, form, formData);
: this.actor?.system; submitData.detectionModes ??= []; // Clear detection modes array
const TokenDocument = foundry.utils.getDocumentClass('Token'); this._processChanges(submitData);
const attributes = TokenDocument.getTrackedAttributes(attributeSource); const changes = { prototypeToken: submitData };
return {
barAttributes: TokenDocument.getTrackedAttributeChoices(attributes, attributeSource),
bar1: token.getBarAttribute?.('bar1'),
bar2: token.getBarAttribute?.('bar2'),
turnMarkerModes: DhPrototypeTokenConfig.TURN_MARKER_MODES,
turnMarkerAnimations: CONFIG.Combat.settings.turnMarkerAnimations
};
}
async _prepareAppearanceTab() { const changedTokenSizeValue = getActorSizeFromForm(this.element, this.actor);
const context = await super._prepareAppearanceTab(); if (changedTokenSizeValue) changes.system = { size: changedTokenSizeValue };
context.actorSizeUsed = this.token.actor ? Boolean(this.token.actor.system.size) : false;
return context; this.actor.validate({ changes, clean: true, fallback: false });
await this.actor.update(changes);
} }
} }

View file

@ -0,0 +1,114 @@
export default function DHTokenConfigMixin(Base) {
class DHTokenConfigBase extends Base {
/** @override */
static PARTS = {
tabs: super.PARTS.tabs,
identity: super.PARTS.identity,
appearance: {
template: 'systems/daggerheart/templates/sheets-settings/token-config/appearance.hbs',
scrollable: ['']
},
vision: super.PARTS.vision,
light: super.PARTS.light,
resources: super.PARTS.resources,
footer: super.PARTS.footer
};
_attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options);
switch (partId) {
case 'appearance':
htmlElement
.querySelector('#dhTokenSize')
?.addEventListener('change', this.onTokenSizeChange.bind(this));
break;
}
}
/** @inheritDoc */
async _prepareResourcesTab() {
const token = this.token;
const usesTrackableAttributes = !foundry.utils.isEmpty(CONFIG.Actor.trackableAttributes);
const attributeSource =
this.actor?.system instanceof foundry.abstract.DataModel && usesTrackableAttributes
? this.actor?.type
: this.actor?.system;
const TokenDocument = foundry.utils.getDocumentClass('Token');
const attributes = TokenDocument.getTrackedAttributes(attributeSource);
return {
barAttributes: TokenDocument.getTrackedAttributeChoices(attributes, attributeSource),
bar1: token.getBarAttribute?.('bar1'),
bar2: token.getBarAttribute?.('bar2'),
turnMarkerModes: DHTokenConfigBase.TURN_MARKER_MODES,
turnMarkerAnimations: CONFIG.Combat.settings.turnMarkerAnimations
};
}
async _prepareAppearanceTab() {
const context = await super._prepareAppearanceTab();
context.tokenSizes = CONFIG.DH.ACTOR.tokenSize;
context.tokenSize = this.actor?.system?.size;
context.usesActorSize = this.actor?.system?.metadata?.usesSize;
context.actorSizeDisable = context.usesActorSize && this.actor.system.size !== 'custom';
return context;
}
/** @inheritDoc */
_previewChanges(changes) {
if (!changes || !this._preview) return;
const tokenSizeSelect = this.element?.querySelector('#dhTokenSize');
if (this.actor && tokenSizeSelect && tokenSizeSelect.value !== 'custom') {
const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes;
const tokenSize = tokenSizes[tokenSizeSelect.value];
changes.width = tokenSize;
changes.height = tokenSize;
}
const deletions = { '-=actorId': null, '-=actorLink': null };
const mergeOptions = { inplace: false, performDeletions: true };
this._preview.updateSource(mergeObject(changes, deletions, mergeOptions));
if (this._preview?.object?.destroyed === false) {
this._preview.object.initializeSources();
this._preview.object.renderFlags.set({ refresh: true });
}
}
async onTokenSizeChange(event) {
const value = event.target.value;
const tokenSizeDimensions = this.element.querySelector('#tokenSizeDimensions');
if (tokenSizeDimensions) {
const disabled = value !== 'custom';
tokenSizeDimensions.dataset.tooltip = disabled
? game.i18n.localize('DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed')
: '';
const disabledIcon = tokenSizeDimensions.querySelector('i');
if (disabledIcon) {
disabledIcon.style.opacity = disabled ? '' : '0';
}
const dimensionsInputs = tokenSizeDimensions.querySelectorAll('.form-fields input');
for (const input of dimensionsInputs) {
input.disabled = disabled;
}
}
}
}
return DHTokenConfigBase;
}
export function getActorSizeFromForm(element, actor) {
const tokenSizeSelect = element.querySelector('#dhTokenSize');
const isSizeDifferent = tokenSizeSelect?.value !== actor?.system?.size;
if (tokenSizeSelect && actor && isSizeDifferent) {
return tokenSizeSelect.value;
}
return null;
}

View file

@ -1,41 +1,11 @@
export default class DhTokenConfig extends foundry.applications.sheets.TokenConfig { import DHTokenConfigMixin from './token-config-mixin.mjs';
/** @override */ import { getActorSizeFromForm } from './token-config-mixin.mjs';
static PARTS = {
tabs: super.PARTS.tabs,
identity: super.PARTS.identity,
appearance: {
template: 'systems/daggerheart/templates/sheets-settings/token-config/appearance.hbs',
scrollable: ['']
},
vision: super.PARTS.vision,
light: super.PARTS.light,
resources: super.PARTS.resources,
footer: super.PARTS.footer
};
/** @inheritDoc */ export default class DhTokenConfig extends DHTokenConfigMixin(foundry.applications.sheets.TokenConfig) {
async _prepareResourcesTab() { async _processSubmitData(event, form, submitData, options) {
const token = this.token; const changedTokenSizeValue = getActorSizeFromForm(this.element, this.actor);
const usesTrackableAttributes = !foundry.utils.isEmpty(CONFIG.Actor.trackableAttributes); if (changedTokenSizeValue) this.token.actor.update({ 'system.size': changedTokenSizeValue });
const attributeSource =
this.actor?.system instanceof foundry.abstract.DataModel && usesTrackableAttributes
? this.actor?.type
: this.actor?.system;
const TokenDocument = foundry.utils.getDocumentClass('Token');
const attributes = TokenDocument.getTrackedAttributes(attributeSource);
return {
barAttributes: TokenDocument.getTrackedAttributeChoices(attributes, attributeSource),
bar1: token.getBarAttribute?.('bar1'),
bar2: token.getBarAttribute?.('bar2'),
turnMarkerModes: DhTokenConfig.TURN_MARKER_MODES,
turnMarkerAnimations: CONFIG.Combat.settings.turnMarkerAnimations
};
}
async _prepareAppearanceTab() { super._processSubmitData(event, form, submitData, options);
const context = await super._prepareAppearanceTab();
context.actorSizeUsed = this.token.actor ? Boolean(this.token.actor.system.size) : false;
return context;
} }
} }

View file

@ -26,7 +26,12 @@ export default class AdversarySheet extends DHBaseActorSheet {
} }
] ]
}, },
dragDrop: [{ dragSelector: '[data-item-id]', dropSelector: null }] dragDrop: [
{
dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]',
dropSelector: null
}
],
}; };
static PARTS = { static PARTS = {
@ -88,6 +93,13 @@ export default class AdversarySheet extends DHBaseActorSheet {
context.resources.stress.emptyPips = context.resources.stress.emptyPips =
context.resources.stress.max < maxResource ? maxResource - context.resources.stress.max : 0; context.resources.stress.max < maxResource ? maxResource - context.resources.stress.max : 0;
const featureForms = ['passive', 'action', 'reaction'];
context.features = this.document.system.features.sort((a, b) =>
a.system.featureForm !== b.system.featureForm
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
: a.sort - b.sort
);
return context; return context;
} }
@ -164,6 +176,16 @@ export default class AdversarySheet extends DHBaseActorSheet {
}); });
} }
/** @inheritdoc */
async _onDragStart(event) {
const inventoryItem = event.currentTarget.closest('.inventory-item');
if (inventoryItem) {
event.dataTransfer.setDragImage(inventoryItem.querySelector('img'), 60, 0);
}
super._onDragStart(event);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Application Clicks Actions */ /* Application Clicks Actions */
/* -------------------------------------------- */ /* -------------------------------------------- */

View file

@ -32,7 +32,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
handleResourceDice: CharacterSheet.#handleResourceDice, handleResourceDice: CharacterSheet.#handleResourceDice,
advanceResourceDie: CharacterSheet.#advanceResourceDie, advanceResourceDie: CharacterSheet.#advanceResourceDie,
cancelBeastform: CharacterSheet.#cancelBeastform, cancelBeastform: CharacterSheet.#cancelBeastform,
useDowntime: this.useDowntime useDowntime: this.useDowntime,
viewParty: CharacterSheet.#viewParty,
}, },
window: { window: {
resizable: true, resizable: true,
@ -318,6 +319,40 @@ export default class CharacterSheet extends DHBaseActorSheet {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached')); ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
} }
}, },
{
name: 'recall',
icon: 'fa-solid fa-bolt-lightning',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && doc.system.inVault;
},
callback: async (target, event) => {
const doc = await getDocFromElement(target);
const actorLoadout = doc.actor.system.loadoutSlot;
if (!actorLoadout.available) {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
return;
}
if (doc.system.recallCost == 0) {
return doc.update({ 'system.inVault': false });
}
const type = 'effect';
const cls = game.system.api.models.actions.actionsTypes[type];
const action = new cls({
...cls.getSourceConfig(doc.system),
type: type,
chatDisplay: false,
cost: [{
key: 'stress',
value: doc.system.recallCost
}]
}, { parent: doc.system });
const config = await action.use(event);
if (config) {
return doc.update({ 'system.inVault': false });
}
}
},
{ {
name: 'toVault', name: 'toVault',
icon: 'fa-solid fa-arrow-down', icon: 'fa-solid fa-arrow-down',
@ -858,6 +893,41 @@ export default class CharacterSheet extends DHBaseActorSheet {
game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call(item); game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call(item);
} }
static async #viewParty(_, target) {
const parties = this.document.parties;
if (parties.size <= 1) {
parties.first()?.sheet.render({ force: true });
return;
}
const buttons = parties.map((p) => {
const button = document.createElement("button");
button.type = "button";
button.classList.add("plain");
const img = document.createElement("img");
img.src = p.img;
button.append(img);
const name = document.createElement("span");
name.textContent = p.name;
button.append(name);
button.addEventListener("click", () => {
p.sheet?.render({ force: true });
game.tooltip.dismissLockedTooltips();
});
return button;
});
const html = document.createElement("div");
html.classList.add("party-list");
html.append(...buttons);
game.tooltip.dismissLockedTooltips();
game.tooltip.activate(target, {
html,
locked: true,
})
}
/** /**
* Open the downtime application. * Open the downtime application.
* @type {ApplicationClickAction} * @type {ApplicationClickAction}

View file

@ -25,7 +25,12 @@ export default class DhpEnvironment extends DHBaseActorSheet {
toggleResourceDice: DhpEnvironment.#toggleResourceDice, toggleResourceDice: DhpEnvironment.#toggleResourceDice,
handleResourceDice: DhpEnvironment.#handleResourceDice handleResourceDice: DhpEnvironment.#handleResourceDice
}, },
dragDrop: [{ dragSelector: '.inventory-item', dropSelector: null }] dragDrop: [
{
dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]',
dropSelector: null
}
]
}; };
/**@override */ /**@override */
@ -74,6 +79,9 @@ export default class DhpEnvironment extends DHBaseActorSheet {
case 'header': case 'header':
await this._prepareHeaderContext(context, options); await this._prepareHeaderContext(context, options);
break;
case 'features':
await this._prepareFeaturesContext(context, options);
break; break;
case 'notes': case 'notes':
await this._prepareNotesContext(context, options); await this._prepareNotesContext(context, options);
@ -110,6 +118,22 @@ export default class DhpEnvironment extends DHBaseActorSheet {
} }
} }
/**
* Prepare render context for the features part.
* @param {ApplicationRenderContext} context
* @param {ApplicationRenderOptions} options
* @returns {Promise<void>}
* @protected
*/
async _prepareFeaturesContext(context, _options) {
const featureForms = ['passive', 'action', 'reaction'];
context.features = this.document.system.features.sort((a, b) =>
a.system.featureForm !== b.system.featureForm
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
: a.sort - b.sort
);
}
/** /**
* Prepare render context for the Header part. * Prepare render context for the Header part.
* @param {ApplicationRenderContext} context * @param {ApplicationRenderContext} context

View file

@ -134,7 +134,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
async actionUseButton(event, message) { async actionUseButton(event, message) {
const { moveIndex, actionIndex, movePath } = event.currentTarget.dataset; const { moveIndex, actionIndex, movePath } = event.currentTarget.dataset;
const parent = await foundry.utils.fromUuid(message.system.actor); const targetUuid = event.currentTarget.closest('.action-use-button-parent').querySelector('select')?.value;
const parent = await foundry.utils.fromUuid(targetUuid || message.system.actor)
const actionType = message.system.moves[moveIndex].actions[actionIndex]; const actionType = message.system.moves[moveIndex].actions[actionIndex];
const cls = game.system.api.models.actions.actionsTypes[actionType.type]; const cls = game.system.api.models.actions.actionsTypes[actionType.type];
const action = new cls( const action = new cls(
@ -146,7 +148,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
type: CONFIG.DH.ITEM.originItemType.restMove, type: CONFIG.DH.ITEM.originItemType.restMove,
itemPath: movePath, itemPath: movePath,
actionIndex: actionIndex actionIndex: actionIndex
} },
targetUuid: targetUuid
}, },
{ parent: parent.system } { parent: parent.system }
); );

View file

@ -127,7 +127,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
resource, resource,
active: index === combat.turn, active: index === combat.turn,
canPing: combatant.sceneId === canvas.scene?.id && game.user.hasPermission('PING_CANVAS'), canPing: combatant.sceneId === canvas.scene?.id && game.user.hasPermission('PING_CANVAS'),
type: combatant.actor.system.type, type: combatant.actor?.system?.type,
img: await this._getCombatantThumbnail(combatant) img: await this._getCombatantThumbnail(combatant)
}; };
@ -165,7 +165,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
if (this.viewed.turn !== toggleTurn) { if (this.viewed.turn !== toggleTurn) {
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns; const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
if (combatant.actor.type === 'character') { if (combatant.actor?.type === 'character') {
await updateCountdowns( await updateCountdowns(
CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id, CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id,
CONFIG.DH.GENERAL.countdownProgressionTypes.characterSpotlight.id CONFIG.DH.GENERAL.countdownProgressionTypes.characterSpotlight.id

View file

@ -34,6 +34,69 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
this.renderFlags.set({ refreshEffects: true }); this.renderFlags.set({ refreshEffects: true });
} }
/**
* Returns the distance from this token to another token object.
* This value is corrected to handle alternate token sizes and other grid types
* according to the diagonal rules.
*/
distanceTo(target) {
if (!canvas.ready) return NaN;
if (this === target) return 0;
const originPoint = this.center;
const destinationPoint = target.center;
// Compute for gridless. This version returns circular edge to edge + grid distance,
// so that tokens that are touching return 5.
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS) {
const boundsCorrection = canvas.grid.distance / canvas.grid.size;
const originRadius = this.bounds.width * boundsCorrection / 2;
const targetRadius = target.bounds.width * boundsCorrection / 2;
const distance = canvas.grid.measurePath([originPoint, destinationPoint]).distance;
return distance - originRadius - targetRadius + canvas.grid.distance;
}
// Compute what the closest grid space of each token is, then compute that distance
const originEdge = this.#getEdgeBoundary(this.bounds, originPoint, destinationPoint);
const targetEdge = this.#getEdgeBoundary(target.bounds, originPoint, destinationPoint);
const adjustedOriginPoint = canvas.grid.getTopLeftPoint({
x: originEdge.x + Math.sign(originPoint.x - originEdge.x),
y: originEdge.y + Math.sign(originPoint.y - originEdge.y)
});
const adjustDestinationPoint = canvas.grid.getTopLeftPoint({
x: targetEdge.x + Math.sign(destinationPoint.x - targetEdge.x),
y: targetEdge.y + Math.sign(destinationPoint.y - targetEdge.y)
});
return canvas.grid.measurePath([adjustedOriginPoint, adjustDestinationPoint]).distance;
}
/** Returns the point at which a line starting at origin and ending at destination intersects the edge of the bounds */
#getEdgeBoundary(bounds, originPoint, destinationPoint) {
const points = [
{ x: bounds.x, y: bounds.y },
{ x: bounds.x + bounds.width, y: bounds.y },
{ x: bounds.x + bounds.width, y: bounds.y + bounds.height },
{ x: bounds.x, y: bounds.y + bounds.height }
];
const pairsToTest = [
[points[0], points[1]],
[points[1], points[2]],
[points[2], points[3]],
[points[3], points[0]]
];
for (const pair of pairsToTest) {
const result = foundry.utils.lineSegmentIntersection(originPoint, destinationPoint, pair[0], pair[1]);
if (result) return result;
}
return null;
}
/** Tests if the token is at least adjacent with another, with some leeway for diagonals */
isAdjacentWith(token) {
return this.distanceTo(token) <= (canvas.grid.distance * 1.5);
}
/** @inheritDoc */ /** @inheritDoc */
_drawBar(number, bar, data) { _drawBar(number, bar, data) {
const val = Number(data.value); const val = Number(data.value);

View file

@ -2,7 +2,7 @@ export const actionTypes = {
attack: { attack: {
id: 'attack', id: 'attack',
name: 'DAGGERHEART.ACTIONS.TYPES.attack.name', name: 'DAGGERHEART.ACTIONS.TYPES.attack.name',
icon: 'fa-khanda', icon: 'fa-hand-fist',
tooltip: 'DAGGERHEART.ACTIONS.TYPES.attack.tooltip' tooltip: 'DAGGERHEART.ACTIONS.TYPES.attack.tooltip'
}, },
countdown: { countdown: {

View file

@ -9,7 +9,7 @@ export const AdversaryBPPerEncounter = (adversaries, characters) => {
); );
if (existingEntry) { if (existingEntry) {
existingEntry.nr += 1; existingEntry.nr += 1;
} else { } else if (adversary.type) {
acc.push({ adversary, nr: 1 }); acc.push({ adversary, nr: 1 });
} }
return acc; return acc;

View file

@ -232,7 +232,7 @@ export const defaultRestOptions = {
actionType: 'action', actionType: 'action',
chatDisplay: false, chatDisplay: false,
target: { target: {
type: 'self' type: 'friendly'
}, },
damage: { damage: {
parts: [ parts: [
@ -298,7 +298,7 @@ export const defaultRestOptions = {
actionType: 'action', actionType: 'action',
chatDisplay: false, chatDisplay: false,
target: { target: {
type: 'self' type: 'friendly'
}, },
damage: { damage: {
parts: [ parts: [
@ -341,7 +341,7 @@ export const defaultRestOptions = {
actionType: 'action', actionType: 'action',
chatDisplay: false, chatDisplay: false,
target: { target: {
type: 'self' type: 'friendly'
}, },
damage: { damage: {
parts: [ parts: [
@ -407,7 +407,7 @@ export const defaultRestOptions = {
actionType: 'action', actionType: 'action',
chatDisplay: false, chatDisplay: false,
target: { target: {
type: 'self' type: 'friendly'
}, },
damage: { damage: {
parts: [ parts: [

View file

@ -435,7 +435,8 @@ export const armorFeatures = {
{ {
key: 'system.resistance.magical.reduction', key: 'system.resistance.magical.reduction',
mode: 2, mode: 2,
value: '@system.armorScore' value: '@system.armorScore',
priority: 21
} }
] ]
} }
@ -709,7 +710,8 @@ export const weaponFeatures = {
{ {
key: 'system.evasion', key: 'system.evasion',
mode: 2, mode: 2,
value: '@system.armorScore' value: '@system.armorScore',
priority: 21
} }
] ]
} }
@ -1324,7 +1326,8 @@ export const weaponFeatures = {
{ {
key: 'system.bonuses.damage.primaryWeapon.bonus', key: 'system.bonuses.damage.primaryWeapon.bonus',
mode: 2, mode: 2,
value: '@system.traits.agility.value' value: '@system.traits.agility.value',
priority: 21
} }
] ]
} }
@ -1416,9 +1419,9 @@ export const orderedWeaponFeatures = () => {
}; };
export const featureForm = { export const featureForm = {
passive: "DAGGERHEART.CONFIG.FeatureForm.passive", passive: 'DAGGERHEART.CONFIG.FeatureForm.passive',
action: "DAGGERHEART.CONFIG.FeatureForm.action", action: 'DAGGERHEART.CONFIG.FeatureForm.action',
reaction: "DAGGERHEART.CONFIG.FeatureForm.reaction" reaction: 'DAGGERHEART.CONFIG.FeatureForm.reaction'
}; };
export const featureTypes = { export const featureTypes = {

View file

@ -33,7 +33,8 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
initial: 'action', initial: 'action',
nullable: false, nullable: false,
required: true required: true
}) }),
targetUuid: new fields.StringField({ initial: undefined })
}; };
this.extraSchemas.forEach(s => { this.extraSchemas.forEach(s => {
@ -162,12 +163,9 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
* @returns {object} * @returns {object}
*/ */
getRollData(data = {}) { getRollData(data = {}) {
if (!this.actor) return null; const actorData = this.actor ? this.actor.getRollData(false) : {};
const actorData = this.actor.getRollData(false);
// Add Roll results to RollDatas
actorData.result = data.roll?.total ?? 1; actorData.result = data.roll?.total ?? 1;
actorData.scale = data.costs?.length // Right now only return the first scalable cost. actorData.scale = data.costs?.length // Right now only return the first scalable cost.
? (data.costs.find(c => c.scalable)?.total ?? 1) ? (data.costs.find(c => c.scalable)?.total ?? 1)
: 1; : 1;
@ -244,7 +242,8 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
selectedRollMode: game.settings.get('core', 'rollMode'), selectedRollMode: game.settings.get('core', 'rollMode'),
data: this.getRollData(), data: this.getRollData(),
evaluate: this.hasRoll, evaluate: this.hasRoll,
resourceUpdates: new ResourceUpdateMap(this.actor) resourceUpdates: new ResourceUpdateMap(this.actor),
targetUuid: this.targetUuid
}; };
DHBaseAction.applyKeybindings(config); DHBaseAction.applyKeybindings(config);

View file

@ -1,3 +1,17 @@
/** -- Changes Type Priorities --
* - Base Number -
* Custom: 0
* Multiply: 10
* Add: 20
* Downgrade: 30
* Upgrade: 40
* Override: 50
*
* - Changes Value Priorities -
* Standard: +0
* "Anything that uses another data model value as its value": +1 - Effects that increase traits have to be calculated first at Base priority. (EX: Raise evasion by half your agility)
*/
export default class BaseEffect extends foundry.abstract.TypeDataModel { export default class BaseEffect extends foundry.abstract.TypeDataModel {
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields; const fields = foundry.data.fields;

View file

@ -66,12 +66,20 @@ export default class BeastformEffect extends BaseEffect {
}; };
const updateToken = token => { const updateToken = token => {
const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid( let x = null,
token.object.scene.grid, y = null;
{ x: token.x, y: token.y, elevation: token.elevation }, if (token.object?.scene?.grid) {
baseUpdate.width, const positionData = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
baseUpdate.height token.object.scene.grid,
); { x: token.x, y: token.y, elevation: token.elevation },
baseUpdate.width,
baseUpdate.height
);
x = positionData.x;
y = positionData.y;
}
return { return {
...baseUpdate, ...baseUpdate,
x, x,

View file

@ -1,6 +1,6 @@
import DHAdversarySettings from '../../applications/sheets-configs/adversary-settings.mjs'; import DHAdversarySettings from '../../applications/sheets-configs/adversary-settings.mjs';
import { ActionField } from '../fields/actionField.mjs'; import { ActionField } from '../fields/actionField.mjs';
import BaseDataActor from './base.mjs'; import BaseDataActor, { commonActorRules } from './base.mjs';
import { resourceField, bonusField } from '../fields/actorField.mjs'; import { resourceField, bonusField } from '../fields/actorField.mjs';
export default class DhpAdversary extends BaseDataActor { export default class DhpAdversary extends BaseDataActor {
@ -56,25 +56,11 @@ export default class DhpAdversary extends BaseDataActor {
}) })
}), }),
resources: new fields.SchemaField({ resources: new fields.SchemaField({
hitPoints: resourceField( hitPoints: resourceField(0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', true),
0, stress: resourceField(0, 0, 'DAGGERHEART.GENERAL.stress', true)
0,
'DAGGERHEART.GENERAL.HitPoints.plural',
true
),
stress: resourceField(
0,
0,
'DAGGERHEART.GENERAL.stress',
true
)
}), }),
rules: new fields.SchemaField({ rules: new fields.SchemaField({
conditionImmunities: new fields.SchemaField({ ...commonActorRules()
hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
})
}), }),
attack: new ActionField({ attack: new ActionField({
initial: { initial: {

View file

@ -2,21 +2,23 @@ import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs
import DHItem from '../../documents/item.mjs'; import DHItem from '../../documents/item.mjs';
import { getScrollTextData } from '../../helpers/utils.mjs'; import { getScrollTextData } from '../../helpers/utils.mjs';
const fields = foundry.data.fields;
const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) => const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) =>
new foundry.data.fields.SchemaField({ new fields.SchemaField({
resistance: new foundry.data.fields.BooleanField({ resistance: new fields.BooleanField({
initial: false, initial: false,
label: `${resistanceLabel}.label`, label: `${resistanceLabel}.label`,
hint: `${resistanceLabel}.hint`, hint: `${resistanceLabel}.hint`,
isAttributeChoice: true isAttributeChoice: true
}), }),
immunity: new foundry.data.fields.BooleanField({ immunity: new fields.BooleanField({
initial: false, initial: false,
label: `${immunityLabel}.label`, label: `${immunityLabel}.label`,
hint: `${immunityLabel}.hint`, hint: `${immunityLabel}.hint`,
isAttributeChoice: true isAttributeChoice: true
}), }),
reduction: new foundry.data.fields.NumberField({ reduction: new fields.NumberField({
integer: true, integer: true,
initial: 0, initial: 0,
label: `${reductionLabel}.label`, label: `${reductionLabel}.label`,
@ -24,6 +26,25 @@ const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) =>
}) })
}); });
/* Common rules applying to Characters and Adversaries */
export const commonActorRules = (extendedData = { damageReduction: {} }) => ({
conditionImmunities: new fields.SchemaField({
hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
}),
damageReduction: new fields.SchemaField({
thresholdImmunities: new fields.SchemaField({
minor: new fields.BooleanField({ initial: false })
}),
reduceSeverity: new fields.SchemaField({
magical: new fields.NumberField({ initial: 0, min: 0 }),
physical: new fields.NumberField({ initial: 0, min: 0 })
}),
...extendedData.damageReduction
})
});
/** /**
* Describes metadata about the actor data model type * Describes metadata about the actor data model type
* @typedef {Object} ActorDataModelMetadata * @typedef {Object} ActorDataModelMetadata
@ -54,7 +75,6 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
/** @inheritDoc */ /** @inheritDoc */
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields;
const schema = {}; const schema = {};
if (this.metadata.hasAttribution) { if (this.metadata.hasAttribution) {

View file

@ -1,7 +1,7 @@
import { burden } from '../../config/generalConfig.mjs'; import { burden } from '../../config/generalConfig.mjs';
import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
import DhLevelData from '../levelData.mjs'; import DhLevelData from '../levelData.mjs';
import BaseDataActor from './base.mjs'; import BaseDataActor, { commonActorRules } from './base.mjs';
import { attributeField, resourceField, stressDamageReductionRule, bonusField } from '../fields/actorField.mjs'; import { attributeField, resourceField, stressDamageReductionRule, bonusField } from '../fields/actorField.mjs';
import { ActionField } from '../fields/actionField.mjs'; import { ActionField } from '../fields/actionField.mjs';
import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs'; import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs';
@ -217,44 +217,41 @@ export default class DhCharacter extends BaseDataActor {
}), }),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }), companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
rules: new fields.SchemaField({ rules: new fields.SchemaField({
damageReduction: new fields.SchemaField({ ...commonActorRules({
maxArmorMarked: new fields.SchemaField({ damageReduction: {
value: new fields.NumberField({ magical: new fields.BooleanField({ initial: false }),
required: true, physical: new fields.BooleanField({ initial: false }),
maxArmorMarked: new fields.SchemaField({
value: new fields.NumberField({
required: true,
integer: true,
initial: 1,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedBonus'
}),
stressExtra: new fields.NumberField({
required: true,
integer: true,
initial: 0,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.hint'
})
}),
stressDamageReduction: new fields.SchemaField({
severe: stressDamageReductionRule(
'DAGGERHEART.GENERAL.Rules.damageReduction.stress.severe'
),
major: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.major'),
minor: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.minor'),
any: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.any')
}),
increasePerArmorMark: new fields.NumberField({
integer: true, integer: true,
initial: 1, initial: 1,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedBonus' label: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.hint'
}), }),
stressExtra: new fields.NumberField({ disabledArmor: new fields.BooleanField({ intial: false })
required: true, }
integer: true,
initial: 0,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.hint'
})
}),
stressDamageReduction: new fields.SchemaField({
severe: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.severe'),
major: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.major'),
minor: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.minor'),
any: stressDamageReductionRule('DAGGERHEART.GENERAL.Rules.damageReduction.stress.any')
}),
increasePerArmorMark: new fields.NumberField({
integer: true,
initial: 1,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.hint'
}),
magical: new fields.BooleanField({ initial: false }),
physical: new fields.BooleanField({ initial: false }),
thresholdImmunities: new fields.SchemaField({
minor: new fields.BooleanField({ initial: false })
}),
reduceSeverity: new fields.SchemaField({
magical: new fields.NumberField({ initial: 0, min: 0 }),
physical: new fields.NumberField({ initial: 0, min: 0 })
}),
disabledArmor: new fields.BooleanField({ intial: false })
}), }),
attack: new fields.SchemaField({ attack: new fields.SchemaField({
damage: new fields.SchemaField({ damage: new fields.SchemaField({
@ -283,11 +280,6 @@ export default class DhCharacter extends BaseDataActor {
}) })
}) })
}), }),
conditionImmunities: new fields.SchemaField({
hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
}),
runeWard: new fields.BooleanField({ initial: false }), runeWard: new fields.BooleanField({ initial: false }),
burden: new fields.SchemaField({ burden: new fields.SchemaField({
ignore: new fields.BooleanField() ignore: new fields.BooleanField()
@ -453,8 +445,7 @@ export default class DhCharacter extends BaseDataActor {
if ( if (
item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.foundation || item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.foundation ||
(item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.specialization && (item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.specialization && subclassState >= 2) ||
subclassState >= 2) ||
(item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.mastery && subclassState >= 3) (item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.mastery && subclassState >= 3)
) { ) {
return true; return true;

View file

@ -15,8 +15,9 @@ export default class DhCombat extends foundry.abstract.TypeDataModel {
get extendedBattleToggles() { get extendedBattleToggles() {
const modifiers = CONFIG.DH.ENCOUNTER.BPModifiers; const modifiers = CONFIG.DH.ENCOUNTER.BPModifiers;
const adversaries = const adversaries =
this.parent.turns?.filter(x => x.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? []; this.parent.turns?.filter(x => x.actor && x.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ??
const characters = this.parent.turns?.filter(x => !x.isNPC) ?? []; [];
const characters = this.parent.turns?.filter(x => x.actor && !x.isNPC) ?? [];
const activeAutomatic = Object.keys(modifiers).reduce((acc, categoryKey) => { const activeAutomatic = Object.keys(modifiers).reduce((acc, categoryKey) => {
const category = modifiers[categoryKey]; const category = modifiers[categoryKey];

View file

@ -76,7 +76,7 @@ export default class BeastformField extends fields.SchemaField {
* @returns * @returns
*/ */
static async transform(selectedForm, evolvedData, hybridData) { static async transform(selectedForm, evolvedData, hybridData) {
const formData = evolvedData?.form ? evolvedData.form.toObject() : selectedForm; const formData = evolvedData?.form ?? selectedForm;
const beastformEffect = formData.effects.find(x => x.type === 'beastform'); const beastformEffect = formData.effects.find(x => x.type === 'beastform');
if (!beastformEffect) { if (!beastformEffect) {
ui.notifications.error('DAGGERHEART.UI.Notifications.beastformMissingEffect'); ui.notifications.error('DAGGERHEART.UI.Notifications.beastformMissingEffect');

View file

@ -25,9 +25,12 @@ export default class TargetField extends fields.SchemaField {
config.hasTarget = true; config.hasTarget = true;
let targets; let targets;
// If the Action is configured as self-targeted, set targets as the owner. Probably better way than to fallback to getDependentTokens // If the Action is configured as self-targeted, set targets as the owner. Probably better way than to fallback to getDependentTokens
if (this.target?.type === CONFIG.DH.GENERAL.targetTypes.self.id) if (this.target?.type === CONFIG.DH.GENERAL.targetTypes.self.id) {
targets = [this.actor.token ?? this.actor.prototypeToken]; targets = [this.actor.token ?? this.actor.prototypeToken];
else { } else if (config.targetUuid) {
const actor = fromUuidSync(config.targetUuid);
targets = [actor.token ?? actor.prototypeToken];
} else {
targets = Array.from(game.user.targets); targets = Array.from(game.user.targets);
if (this.target.type !== CONFIG.DH.GENERAL.targetTypes.any.id) { if (this.target.type !== CONFIG.DH.GENERAL.targetTypes.any.id) {
targets = targets.filter(target => TargetField.isTargetFriendly(this.actor, target, this.target.type)); targets = targets.filter(target => TargetField.isTargetFriendly(this.actor, target, this.target.type));

View file

@ -272,12 +272,17 @@ export function ActionMixin(Base) {
itemOrigin: this.item, itemOrigin: this.item,
description: this.description || (this.item instanceof Item ? this.item.system.description : '') description: this.description || (this.item instanceof Item ? this.item.system.description : '')
}; };
const speaker = cls.getSpeaker();
const msg = { const msg = {
type: 'abilityUse', type: 'abilityUse',
user: game.user.id, user: game.user.id,
actor: { name: this.actor.name, img: this.actor.img }, actor: { name: this.actor.name, img: this.actor.img },
author: this.author, author: this.author,
speaker: cls.getSpeaker(), speaker: {
speaker,
actor: speaker.actor ?? this.actor
},
title: game.i18n.localize('DAGGERHEART.UI.Chat.action.title'), title: game.i18n.localize('DAGGERHEART.UI.Chat.action.title'),
system: systemData, system: systemData,
content: await foundry.applications.handlebars.renderTemplate( content: await foundry.applications.handlebars.renderTemplate(

View file

@ -218,12 +218,20 @@ export default class DHBeastform extends BaseDataItem {
} }
}; };
const tokenUpdate = token => { const tokenUpdate = token => {
const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid( let x = null,
token.object.scene.grid, y = null;
{ x: token.x, y: token.y, elevation: token.elevation }, if (token.object?.scene?.grid) {
width ?? token.width, const positionData = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
height ?? token.height token.object.scene.grid,
); { x: token.x, y: token.y, elevation: token.elevation },
width ?? token.width,
height ?? token.height
);
x = positionData.x;
y = positionData.y;
}
return { return {
...prototypeTokenUpdate, ...prototypeTokenUpdate,
x, x,

View file

@ -298,7 +298,7 @@ export default class DualityRoll extends D20Roll {
if (looseSpotlight && game.combat?.active) { if (looseSpotlight && game.combat?.active) {
const currentCombatant = game.combat.combatants.get(game.combat.current?.combatantId); const currentCombatant = game.combat.combatants.get(game.combat.current?.combatantId);
if (currentCombatant?.actorId == actor.id) ui.combat.setCombatantSpotlight(currentCombatant.id); if (currentCombatant?.actorId == config.data.id) ui.combat.setCombatantSpotlight(currentCombatant.id);
} }
} }

View file

@ -1,7 +1,7 @@
import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs'; import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs';
import { LevelOptionType } from '../data/levelTier.mjs'; import { LevelOptionType } from '../data/levelTier.mjs';
import DHFeature from '../data/item/feature.mjs'; import DHFeature from '../data/item/feature.mjs';
import { createScrollText, damageKeyToNumber } from '../helpers/utils.mjs'; import { createScrollText, damageKeyToNumber, getDamageKey } from '../helpers/utils.mjs';
import DhCompanionLevelUp from '../applications/levelup/companionLevelup.mjs'; import DhCompanionLevelUp from '../applications/levelup/companionLevelup.mjs';
import { ResourceUpdateMap } from '../data/action/baseAction.mjs'; import { ResourceUpdateMap } from '../data/action/baseAction.mjs';
@ -539,7 +539,11 @@ export default class DhpActor extends Actor {
/**@inheritdoc */ /**@inheritdoc */
getRollData() { getRollData() {
const rollData = super.getRollData().clone(); const rollData = foundry.utils.deepClone(super.getRollData());
/* system gets repeated infinately which causes issues when trying to use the data for document creation */
delete rollData.system;
rollData.id = this.id;
rollData.name = this.name; rollData.name = this.name;
rollData.system = this.system.getRollData(); rollData.system = this.system.getRollData();
rollData.prof = this.system.proficiency ?? 1; rollData.prof = this.system.proficiency ?? 1;
@ -627,6 +631,19 @@ export default class DhpActor extends Actor {
} }
} }
} }
if (this.type === 'adversary') {
const reducedSeverity = hpDamage.damageTypes.reduce((value, curr) => {
return Math.max(this.system.rules.damageReduction.reduceSeverity[curr], value);
}, 0);
hpDamage.value = Math.max(hpDamage.value - reducedSeverity, 0);
if (
hpDamage.value &&
this.system.rules.damageReduction.thresholdImmunities[getDamageKey(hpDamage.value)]
) {
hpDamage.value -= 1;
}
}
} }
updates.forEach( updates.forEach(

View file

@ -83,7 +83,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
if (combat?.system?.battleToggles?.length) { if (combat?.system?.battleToggles?.length) {
await combat.toggleModifierEffects( await combat.toggleModifierEffects(
true, true,
tokens.map(x => x.actor) tokens.filter(x => x.actor).map(x => x.actor)
); );
} }
super.createCombatants(tokens, combat ?? {}); super.createCombatants(tokens, combat ?? {});
@ -95,7 +95,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
if (combat?.system?.battleToggles?.length) { if (combat?.system?.battleToggles?.length) {
await combat.toggleModifierEffects( await combat.toggleModifierEffects(
false, false,
tokens.map(x => x.actor) tokens.filter(x => x.actor).map(x => x.actor)
); );
} }
super.deleteCombatants(tokens, combat ?? {}); super.deleteCombatants(tokens, combat ?? {});

View file

@ -262,7 +262,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
const combat = game.combats.get(combatId); const combat = game.combats.get(combatId);
const adversaries = const adversaries =
combat.turns?.filter(x => x.actor?.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? []; combat.turns?.filter(x => x.actor?.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? [];
const characters = combat.turns?.filter(x => !x.isNPC) ?? []; const characters = combat.turns?.filter(x => !x.isNPC && x.actor) ?? [];
const nrCharacters = characters.length; const nrCharacters = characters.length;
const currentBP = AdversaryBPPerEncounter(adversaries, characters); const currentBP = AdversaryBPPerEncounter(adversaries, characters);
@ -272,7 +272,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
); );
const categories = combat.combatants.reduce((acc, combatant) => { const categories = combat.combatants.reduce((acc, combatant) => {
if (combatant.actor.type === 'adversary') { if (combatant.actor?.type === 'adversary') {
const keyData = Object.keys(acc).reduce((identifiers, categoryKey) => { const keyData = Object.keys(acc).reduce((identifiers, categoryKey) => {
if (identifiers) return identifiers; if (identifiers) return identifiers;
const category = acc[categoryKey]; const category = acc[categoryKey];
@ -352,7 +352,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
await combat.toggleModifierEffects( await combat.toggleModifierEffects(
event.target.checked, event.target.checked,
combat.combatants.filter(x => x.actor.type === 'adversary').map(x => x.actor), combat.combatants.filter(x => x.actor?.type === 'adversary').map(x => x.actor),
category, category,
grouping grouping
); );

View file

@ -3,6 +3,11 @@ import { parseInlineParams } from './parser.mjs';
export default function DhLookupEnricher(match, { rollData }) { export default function DhLookupEnricher(match, { rollData }) {
const results = parseInlineParams(match[1], { first: 'formula' }); const results = parseInlineParams(match[1], { first: 'formula' });
const element = document.createElement('span'); const element = document.createElement('span');
element.textContent = Roll.replaceFormulaData(String(results.formula), rollData);
const lookupCommand = match[0];
const lookupParam = match[1];
const lookupText = Roll.replaceFormulaData(String(results.formula), rollData);
element.textContent = lookupText === lookupParam ? lookupCommand : lookupText;
return element; return element;
} }

View file

@ -119,7 +119,7 @@ export const tagifyElement = (element, baseOptions, onChange, tagifyOptions = {}
spellcheck='false' spellcheck='false'
tabIndex="${this.settings.a11y.focusableTags ? 0 : -1}" tabIndex="${this.settings.a11y.focusableTags ? 0 : -1}"
class="${this.settings.classNames.tag} ${tagData.class ? tagData.class : ''}" class="${this.settings.classNames.tag} ${tagData.class ? tagData.class : ''}"
data-tooltip="${tagData.description || tagData.name}" data-tooltip="${tagData.description ? htmlToText(tagData.description) : tagData.name}"
${this.getAttributes(tagData)}> ${this.getAttributes(tagData)}>
<x class="${this.settings.classNames.tagX}" role='button' aria-label='remove tag'></x> <x class="${this.settings.classNames.tagX}" role='button' aria-label='remove tag'></x>
<div> <div>
@ -198,7 +198,7 @@ foundry.dice.terms.Die.prototype.selfCorrecting = function (modifier) {
}; };
export const getDamageKey = damage => { export const getDamageKey = damage => {
return ['none', 'minor', 'major', 'severe', 'massive','any'][damage]; return ['none', 'minor', 'major', 'severe', 'massive', 'any'][damage];
}; };
export const getDamageLabel = damage => { export const getDamageLabel = damage => {
@ -474,3 +474,10 @@ export async function getCritDamageBonus(formula) {
const critRoll = new Roll(formula); const critRoll = new Roll(formula);
return critRoll.dice.reduce((acc, dice) => acc + dice.faces * dice.number, 0); return critRoll.dice.reduce((acc, dice) => acc + dice.faces * dice.number, 0);
} }
export function htmlToText(html) {
var tempDivElement = document.createElement('div');
tempDivElement.innerHTML = html;
return tempDivElement.textContent || tempDivElement.innerText || '';
}

View file

@ -284,7 +284,7 @@
"key": "system.bonuses.roll.attack.bonus", "key": "system.bonuses.roll.attack.bonus",
"mode": 2, "mode": 2,
"value": "ITEM.@system.resource.value", "value": "ITEM.@system.resource.value",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -36,13 +36,13 @@
"key": "system.damageThresholds.major", "key": "system.damageThresholds.major",
"mode": 2, "mode": 2,
"value": "@prof", "value": "@prof",
"priority": null "priority": 21
}, },
{ {
"key": "system.damageThresholds.severe", "key": "system.damageThresholds.severe",
"mode": 2, "mode": 2,
"value": "@prof", "value": "@prof",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -100,7 +100,7 @@
"key": "system.resistance.physical.reduction", "key": "system.resistance.physical.reduction",
"mode": 2, "mode": 2,
"value": "@system.armorScore", "value": "@system.armorScore",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -38,13 +38,13 @@
"key": "system.bonuses.damage.primaryWeapon.bonus", "key": "system.bonuses.damage.primaryWeapon.bonus",
"mode": 2, "mode": 2,
"value": "@system.traits.strength.value", "value": "@system.traits.strength.value",
"priority": null "priority": 21
}, },
{ {
"key": "system.bonuses.damage.secondaryWeapon.bonus", "key": "system.bonuses.damage.secondaryWeapon.bonus",
"mode": 2, "mode": 2,
"value": "@system.traits.strength.value", "value": "@system.traits.strength.value",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,
@ -57,7 +57,7 @@
"startRound": null, "startRound": null,
"startTurn": null "startTurn": null
}, },
"description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">On a successful attack using a weapon with a </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Melee</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\"> range, gain a bonus to your damage roll equal to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Strength</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">.</p>", "description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">On a successful attack using a weapon with a </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Melee</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\"> range, gain a bonus to your damage roll equal to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Strength</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">.</span></p>",
"origin": null, "origin": null,
"tint": "#ffffff", "tint": "#ffffff",
"transfer": true, "transfer": true,

View file

@ -37,13 +37,13 @@
"key": "system.bonuses.damage.primaryWeapon.bonus", "key": "system.bonuses.damage.primaryWeapon.bonus",
"mode": 2, "mode": 2,
"value": "@system.traits.agility.value", "value": "@system.traits.agility.value",
"priority": null "priority": 21
}, },
{ {
"key": "system.bonuses.damage.secondaryWeapon.bonus", "key": "system.bonuses.damage.secondaryWeapon.bonus",
"mode": 2, "mode": 2,
"value": "@system.traits.agility.value", "value": "@system.traits.agility.value",
"priority": null "priority": 21
} }
], ],
"disabled": true, "disabled": true,

View file

@ -101,7 +101,7 @@
"key": "system.traits.presence.value", "key": "system.traits.presence.value",
"mode": 5, "mode": 5,
"value": "@cast", "value": "@cast",
"priority": null "priority": 51
} }
], ],
"disabled": false, "disabled": false,

View file

@ -113,13 +113,13 @@
"key": "system.bonuses.damage.magical.bonus", "key": "system.bonuses.damage.magical.bonus",
"mode": 2, "mode": 2,
"value": "2*@system.traits.strength.value", "value": "2*@system.traits.strength.value",
"priority": null "priority": 21
}, },
{ {
"key": "system.bonuses.damage.physical.bonus", "key": "system.bonuses.damage.physical.bonus",
"mode": 2, "mode": 2,
"value": "2*@system.traits.strength.value", "value": "2*@system.traits.strength.value",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,
@ -162,13 +162,13 @@
"key": "system.bonuses.damage.magical.bonus", "key": "system.bonuses.damage.magical.bonus",
"mode": 2, "mode": 2,
"value": "4*@system.traits.strength.value", "value": "4*@system.traits.strength.value",
"priority": null "priority": 21
}, },
{ {
"key": "system.bonuses.damage.physical.bonus", "key": "system.bonuses.damage.physical.bonus",
"mode": 2, "mode": 2,
"value": "4*@system.traits.strength.value", "value": "4*@system.traits.strength.value",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -106,7 +106,7 @@
"key": "system.damageThresholds.severe", "key": "system.damageThresholds.severe",
"mode": 2, "mode": 2,
"value": "@system.proficiency", "value": "@system.proficiency",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,
@ -119,7 +119,7 @@
"startRound": null, "startRound": null,
"startTurn": null "startTurn": null
}, },
"description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Gain a bonus to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Severe </span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">threshold equal to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Proficiency</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">.</p>", "description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Gain a bonus to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Severe </span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">threshold equal to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Proficiency</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">.</span></p>",
"origin": null, "origin": null,
"tint": "#ffffff", "tint": "#ffffff",
"transfer": true, "transfer": true,

View file

@ -37,7 +37,7 @@
"key": "system.evasion", "key": "system.evasion",
"mode": 2, "mode": 2,
"value": "ceil(@system.traits.agility.value / 2)", "value": "ceil(@system.traits.agility.value / 2)",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -4,7 +4,7 @@
"type": "domainCard", "type": "domainCard",
"folder": "OwsbTSWzKq2WJmQN", "folder": "OwsbTSWzKq2WJmQN",
"system": { "system": {
"description": "<p class=\"Body-Foundation\">Make a <strong>Spellcast Roll (16)</strong>. Once per long rest on a success, choose a point within Far range and create a visible zone of protection there for all allies within Very Close range of that point. When you do, place a <strong>d6</strong> on this card with the 1 value facing up. When an ally in this zone takes damage, they reduce it by the dies value. You then increase the dies value by one. When the dies value would exceed 6, this effect ends.</p><p><span style=\"color:oklab(0.952331 0.000418991 -0.00125992);font-family:'gg mono', 'Source Code Pro', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;font-size:13.6px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:left;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:pre-wrap;background-color:oklab(0.57738 0.0140701 -0.208587 / 0.0784314);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">@Template[type:emanation|range:vc]</p>", "description": "<p class=\"Body-Foundation\">Make a <strong>Spellcast Roll (16)</strong>. Once per long rest on a success, choose a point within Far range and create a visible zone of protection there for all allies within Very Close range of that point. When you do, place a <strong>d6</strong> on this card with the 1 value facing up. When an ally in this zone takes damage, they reduce it by the dies value. You then increase the dies value by one. When the dies value would exceed 6, this effect ends.</p><p>@Template[type:emanation|range:vc]</p>",
"domain": "splendor", "domain": "splendor",
"recallCost": 2, "recallCost": 2,
"level": 6, "level": 6,

View file

@ -39,7 +39,7 @@
"key": "system.armorScore", "key": "system.armorScore",
"mode": 2, "mode": 2,
"value": "@system.traits.strength.value", "value": "@system.traits.strength.value",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -42,7 +42,8 @@
{ {
"key": "system.resistance.magical.reduction", "key": "system.resistance.magical.reduction",
"mode": 2, "mode": 2,
"value": "@system.armorScore" "value": "@system.armorScore",
"priority": 21
} }
], ],
"_id": "xGxqTCO8MjNq5Cw6", "_id": "xGxqTCO8MjNq5Cw6",

View file

@ -4,7 +4,7 @@
"_id": "y4c1jrlHrf0wBWOq", "_id": "y4c1jrlHrf0wBWOq",
"img": "icons/magic/light/projectiles-star-purple.webp", "img": "icons/magic/light/projectiles-star-purple.webp",
"system": { "system": {
"description": "<p>You can use this stardrop to summon a hailstorm of comets that deals 8d20 physical damage to all targets within Very Far range.</p><p>@Template[type:emanation|range:vf]</p>", "description": "<p>You can use this stardrop to summon a hailstorm of comets that deals 8d20 physical damage to all targets within Very Far range.</p>",
"quantity": 1, "quantity": 1,
"actions": { "actions": {
"pt5U6hlyx4T7MUOa": { "pt5U6hlyx4T7MUOa": {

View file

@ -155,7 +155,8 @@
{ {
"key": "system.evasion", "key": "system.evasion",
"mode": 2, "mode": 2,
"value": "@system.armorScore" "value": "@system.armorScore",
"priority": 21
} }
], ],
"transfer": false, "transfer": false,

View file

@ -117,7 +117,8 @@
{ {
"key": "system.bonuses.damage.primaryWeapon.bonus", "key": "system.bonuses.damage.primaryWeapon.bonus",
"mode": 2, "mode": 2,
"value": "@system.traits.agility.value" "value": "@system.traits.agility.value",
"priority": 21
} }
], ],
"_id": "jMIrOhpPUncn7dWg", "_id": "jMIrOhpPUncn7dWg",

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,319 @@
{
"name": "Table of Random Objectives",
"img": "icons/sundries/documents/document-torn-diagram-tan.webp",
"description": "<p>Layering Goals Other than Attrition into Combat</p>",
"results": [
{
"type": "text",
"weight": 1,
"range": [
1,
1
],
"_id": "LDuVbmdvhJiEOe7U",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Acquire (obtain or steal) an important item or items.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.LDuVbmdvhJiEOe7U"
},
{
"type": "text",
"weight": 1,
"range": [
2,
2
],
"_id": "FxYpST4nQUTBp1mN",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Capture one or more of the opponents.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.FxYpST4nQUTBp1mN"
},
{
"type": "text",
"weight": 1,
"range": [
3,
3
],
"_id": "bTkZgxqEr4lNxzeK",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Activate a magical device.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.bTkZgxqEr4lNxzeK"
},
{
"type": "text",
"weight": 1,
"range": [
4,
4
],
"_id": "T39LgOL1cw5AIY59",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Frame a character or tarnish their reputation.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.T39LgOL1cw5AIY59"
},
{
"type": "text",
"weight": 1,
"range": [
5,
5
],
"_id": "MHgv8dlrwA3ZmBKq",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Drive the opponent into a corner or ambush point.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.MHgv8dlrwA3ZmBKq"
},
{
"type": "text",
"weight": 1,
"range": [
6,
6
],
"_id": "4USCNNavzVvBqldn",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Stop a magical ritual, legal ceremony, or time-sensitive spell.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.4USCNNavzVvBqldn"
},
{
"type": "text",
"weight": 1,
"range": [
7,
7
],
"_id": "gwZnWTauHsbb6rsr",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Hold the line—keep the enemy from reaching a specific area or group.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.gwZnWTauHsbb6rsr"
},
{
"type": "text",
"weight": 1,
"range": [
8,
8
],
"_id": "beDIxxPyCCVa8nlE",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Plant evidence or a tracking device on a target.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.beDIxxPyCCVa8nlE"
},
{
"type": "text",
"weight": 1,
"range": [
9,
9
],
"_id": "C70V6prVmZd5VRV8",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Secure a specific location ahead of another groups arrival.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.C70V6prVmZd5VRV8"
},
{
"type": "text",
"weight": 1,
"range": [
10,
10
],
"_id": "i02rh05CvhHlKJCN",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Harass the opponent to deplete their resources or keep them occupied.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.i02rh05CvhHlKJCN"
},
{
"type": "text",
"weight": 1,
"range": [
11,
11
],
"_id": "AbNgD5GCbWuui9oP",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Destroy a piece of architecture, a statue, a shrine, or a weapon.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.AbNgD5GCbWuui9oP"
},
{
"type": "text",
"weight": 1,
"range": [
12,
12
],
"_id": "TCrdyh3qhl2vtQxO",
"name": "",
"img": "icons/svg/d12-grey.svg",
"description": "<p>Investigate a situation to confirm or deny existing information.</p>",
"drawn": false,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.4.4",
"lastModifiedBy": null
},
"documentUuid": null,
"_key": "!tables.results!I5L1dlgxXTNrCCkL.TCrdyh3qhl2vtQxO"
}
],
"replacement": true,
"displayRoll": true,
"folder": null,
"ownership": {
"default": 0,
"Bgvu4A6AMkRFOTGR": 3
},
"flags": {},
"formula": "1d12",
"_id": "I5L1dlgxXTNrCCkL",
"sort": 400000,
"_key": "!tables!I5L1dlgxXTNrCCkL"
}

View file

@ -35,7 +35,7 @@
"key": "system.evasion", "key": "system.evasion",
"mode": 2, "mode": 2,
"value": "@system.proficiency", "value": "@system.proficiency",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -255,13 +255,13 @@
"key": "system.damageThresholds.major", "key": "system.damageThresholds.major",
"mode": 2, "mode": 2,
"value": "@system.proficiency", "value": "@system.proficiency",
"priority": null "priority": 21
}, },
{ {
"key": "system.damageThresholds.severe", "key": "system.damageThresholds.severe",
"mode": 2, "mode": 2,
"value": "@system.proficiency", "value": "@system.proficiency",
"priority": null "priority": 21
} }
], ],
"disabled": false, "disabled": false,

View file

@ -145,6 +145,11 @@
button { button {
flex: 1; flex: 1;
padding: 0 0.375rem;
}
button[data-action=viewParty] {
margin-right: 6px;
} }
} }

View file

@ -99,12 +99,35 @@
} }
} }
.action-use-button-parent {
width: 100%;
.action-use-target {
display:flex;
align-items: center;
justify-content: space-between;
gap: 4px;
width: 100%;
padding: 4px 8px 10px 40px;
font-size: var(--font-size-12);
label {
font-weight: bold;
}
select {
flex: 1;
}
}
}
.action-use-button { .action-use-button {
width: -webkit-fill-available; width: -webkit-fill-available;
margin: 0 8px; margin: 0 8px;
font-weight: 600; font-weight: 600;
height: 40px; height: 40px;
} }
} }
} }
} }

View file

@ -344,4 +344,20 @@ aside[role='tooltip'].locked-tooltip:has(div.daggerheart.dh-style.tooltip.card-s
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
.party-list {
display: flex;
flex-direction: column;
button {
width: 100%;
align-items: center;
justify-content: start;
img {
border: none;
width: 1rem;
height: 1rem;
object-fit: contain;
}
}
}
} }

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "1.4.0", "version": "1.4.6",
"compatibility": { "compatibility": {
"minimum": "13.346", "minimum": "13.346",
"verified": "13.351", "verified": "13.351",
@ -54,6 +54,12 @@
{ {
"name": "chrisryan10", "name": "chrisryan10",
"discord": "lazjen" "discord": "lazjen"
},
{
"name": "nsalyzyn",
"url": "https://github.com/nsalyzyn",
"email": "nsalyzyn@gmail.com",
"discord": "nsalyzyn"
} }
], ],
"esmodules": ["build/daggerheart.js"], "esmodules": ["build/daggerheart.js"],
@ -167,6 +173,15 @@
"private": false, "private": false,
"flags": {} "flags": {}
}, },
{
"name": "rolltables",
"label": "Rolltables",
"system": "daggerheart",
"path": "packs/rolltables.db",
"type": "RollTable",
"private": false,
"flags": {}
},
{ {
"name": "beastforms", "name": "beastforms",
"label": "Beastforms", "label": "Beastforms",
@ -182,7 +197,7 @@
"name": "Daggerheart SRD", "name": "Daggerheart SRD",
"sorting": "m", "sorting": "m",
"color": "#08718c", "color": "#08718c",
"packs": ["adversaries", "environments", "journals"], "packs": ["adversaries", "environments", "journals", "rolltables"],
"folders": [ "folders": [
{ {
"name": "Character Options", "name": "Character Options",

View file

@ -1,5 +1,5 @@
<section <section
class="tab {{tabs.domains.cssClass}} {{tabs.domains.id}}" class="tab {{tabs.domains.cssClass}} {{tabs.domains.id}} scrollable"
data-tab="{{tabs.domains.id}}" data-tab="{{tabs.domains.id}}"
data-group="{{tabs.domains.group}}" data-group="{{tabs.domains.group}}"
> >

View file

@ -1,5 +1,5 @@
<section <section
class="tab {{tabs.downtime.cssClass}} {{tabs.downtime.id}}" class="tab {{tabs.downtime.cssClass}} {{tabs.downtime.id}} scrollable"
data-tab="{{tabs.downtime.id}}" data-tab="{{tabs.downtime.id}}"
data-group="{{tabs.downtime.group}}" data-group="{{tabs.downtime.group}}"
> >

View file

@ -1,5 +1,5 @@
<section <section
class="tab {{tabs.itemFeatures.cssClass}} {{tabs.itemFeatures.id}}" class="tab {{tabs.itemFeatures.cssClass}} {{tabs.itemFeatures.id}} scrollable"
data-tab="{{tabs.itemFeatures.id}}" data-tab="{{tabs.itemFeatures.id}}"
data-group="{{tabs.itemFeatures.group}}" data-group="{{tabs.itemFeatures.group}}"
> >

View file

@ -1,5 +1,5 @@
<section <section
class="tab {{tabs.settings.cssClass}} {{tabs.settings.id}}" class="tab {{tabs.settings.cssClass}} {{tabs.settings.id}} scrollable"
data-tab="{{tabs.settings.id}}" data-tab="{{tabs.settings.id}}"
data-group="{{tabs.settings.group}}" data-group="{{tabs.settings.group}}"
> >

View file

@ -1,5 +1,5 @@
<section <section
class="tab {{tabs.types.cssClass}} {{tabs.types.id}}" class="tab {{tabs.types.cssClass}} {{tabs.types.id}} scrollable"
data-tab="{{tabs.types.id}}" data-tab="{{tabs.types.id}}"
data-group="{{tabs.types.group}}" data-group="{{tabs.types.group}}"
> >

View file

@ -9,7 +9,7 @@
<fieldset> <fieldset>
<legend>{{localize tabs.features.label}}</legend> <legend>{{localize tabs.features.label}}</legend>
<ul class="feature-list"> <ul class="feature-list">
{{#each document.system.features as |feature|}} {{#each @root.features as |feature|}}
<li class="feature-item" id="{{feature.id}}" draggable="true"> <li class="feature-item" id="{{feature.id}}" draggable="true">
<img src="{{feature.img}}" alt=""> <img src="{{feature.img}}" alt="">
<div class="label"> <div class="label">

View file

@ -9,7 +9,7 @@
<fieldset> <fieldset>
<legend>{{localize tabs.features.label}}</legend> <legend>{{localize tabs.features.label}}</legend>
<ul class="feature-list"> <ul class="feature-list">
{{#each document.system.features as |feature|}} {{#each @root.features as |feature|}}
<li class="feature-item" id="{{feature.id}}"> <li class="feature-item" id="{{feature.id}}">
<img src="{{feature.img}}" alt=""> <img src="{{feature.img}}" alt="">
<div class="label"> <div class="label">

View file

@ -10,22 +10,31 @@
</select> </select>
</div> </div>
{{/if}} {{/if}}
<fieldset>
<legend>{{localize "Token Size"}}</legend>
{{#if usesActorSize}}
<div class="form-group lim">
<label>{{localize "Size Category"}}</label>
<select id="dhTokenSize">
{{selectOptions tokenSizes selected=tokenSize valueAttr="id" labelAttr="label" localize=true}}
</select>
</div>
{{/if}}
<div class="form-group slim" {{#if actorSizeUsed}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}> <div id="tokenSizeDimensions" class="form-group slim" {{#if actorSizeDisable}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}>
<label> <label>
{{localize "TOKEN.Dimensions"}} <span class="units">({{localize "GridSpaces"}})</span> {{localize "TOKEN.Dimensions"}} <span class="units">({{localize "GridSpaces"}})</span>
{{#if actorSizeUsed}} <i class="fa-solid fa-lock" {{#unless actorSizeDisable}}style="opacity: 0%;"{{/unless}}></i>
<i class="fa-solid fa-lock"></i> </label>
{{/if}} <div class="form-fields">
</label> <label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label>
<div class="form-fields"> {{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeDisable}}
<label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label> <label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label>
{{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeUsed}} {{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeDisable}}
<label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label> </div>
{{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeUsed}}
</div> </div>
</div> </fieldset>
{{#if shapes}} {{#if shapes}}
{{formGroup fields.shape value=source.shape choices=shapes classes="slim" rootId=rootId}} {{formGroup fields.shape value=source.shape choices=shapes classes="slim" rootId=rootId}}

View file

@ -4,7 +4,7 @@
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title=tabs.features.label title=tabs.features.label
type='feature' type='feature'
collection=document.system.features collection=@root.features
hideContextMenu=true hideContextMenu=true
canCreate=true canCreate=true
showActions=true showActions=true

View file

@ -87,11 +87,16 @@
</div> </div>
{{/if}} {{/if}}
<div class="downtime-section"> <div class="downtime-section">
<button type="button" data-action="useDowntime" data-type="shortRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}"> {{#if document.parties.size}}
<i class="fa-solid fa-utensils"></i> <button type="button" data-action="viewParty" data-tooltip="DAGGERHEART.ACTORS.Character.viewParty">
<i class="fa-solid fa-fw fa-users"></i>
</button>
{{/if}}
<button type="button" data-action="useDowntime" data-type="shortRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.shortRest.title">
<i class="fa-solid fa-fw fa-utensils"></i>
</button> </button>
<button type="button" data-action="useDowntime" data-type="longRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}"> <button type="button" data-action="useDowntime" data-type="longRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.longRest.title">
<i class="fa-solid fa-bed"></i> <i class="fa-solid fa-fw fa-bed"></i>
</button> </button>
</div> </div>
</div> </div>

View file

@ -7,7 +7,7 @@
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title=tabs.features.label title=tabs.features.label
type='feature' type='feature'
collection=document.system.features collection=@root.features
hideContextMenu=true hideContextMenu=true
canCreate=true canCreate=true
showActions=true showActions=true

View file

@ -3,12 +3,10 @@
data-tab='{{tabs.settings.id}}' data-tab='{{tabs.settings.id}}'
data-group='{{tabs.settings.group}}' data-group='{{tabs.settings.group}}'
> >
{{#if (or (eq document.parent.type "adversary") (eq document.parent.type "environment"))}} <fieldset class="two-columns">
<fieldset class="two-columns"> <legend>{{localize "DAGGERHEART.GENERAL.general"}}</legend>
<legend>{{localize "DAGGERHEART.GENERAL.general"}}</legend> <span>{{localize "DAGGERHEART.CONFIG.FeatureForm.label"}}</span>
<span>{{localize "DAGGERHEART.CONFIG.FeatureForm.label"}}</span> {{formInput document.system.schema.fields.featureForm value=document.system.featureForm choices=featureFormChoices localize=true}}
{{formInput document.system.schema.fields.featureForm value=document.system.featureForm choices=featureFormChoices localize=true}} </fieldset>
</fieldset>
{{/if}}
{{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }} {{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }}
</section> </section>

View file

@ -15,9 +15,22 @@
</div> </div>
</details> </details>
{{#each move.actions as | action index |}} {{#each move.actions as | action index |}}
<button class="action-use-button" data-move-index="{{@../key}}" data-action-index="{{index}}" data-move-path="{{../movePath}}" > <div class="action-use-button-parent">
<span>{{localize action.name}}</span> <button class="action-use-button" data-move-index="{{@../key}}" data-action-index="{{index}}" data-move-path="{{../movePath}}" >
</button> <span>{{localize action.name}}</span>
</button>
{{#if move.needsTarget}}
<div class="action-use-target">
<label>{{localize "DAGGERHEART.GENERAL.Bonuses.rest.target"}}:</label>
<select>
<option value="{{../../selfId}}">{{localize "DAGGERHEART.GENERAL.Bonuses.rest.targetSelf"}}</option>
{{#each ../../characters as | character |}}
<option value="{{character.uuid}}">{{character.name}}</option>
{{/each}}
</select>
</div>
{{/if}}
</div>
{{/each}} {{/each}}
{{/each}} {{/each}}
</ul> </ul>