Compare commits

..

No commits in common. "e3e1395de6f088613dc71472b18e937e9f8e4115" and "64ce6151162d7856f3d920ff034835b32a4b9eb7" have entirely different histories.

24 changed files with 215 additions and 362 deletions

View file

@ -153,8 +153,7 @@
"Config": { "Config": {
"rangeDependence": { "rangeDependence": {
"title": "Range Dependence" "title": "Range Dependence"
}, }
"stacking": { "title": "Stacking" }
}, },
"RangeDependance": { "RangeDependance": {
"hint": "Settings for an optional distance at which this effect should activate", "hint": "Settings for an optional distance at which this effect should activate",
@ -2988,8 +2987,6 @@
}, },
"EffectsDisplay": { "EffectsDisplay": {
"removeThing": "[Right Click] Remove {thing}", "removeThing": "[Right Click] Remove {thing}",
"increaseStacks": "[Left Click] Increment Stacks",
"decreaseStacks": "[Right Click] Decrement Stacks",
"appliedBy": "Applied By: {by}" "appliedBy": "Applied By: {by}"
}, },
"ItemBrowser": { "ItemBrowser": {

View file

@ -318,9 +318,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
const type = choices[button.form.elements.type.value].value; const type = choices[button.form.elements.type.value].value;
const part = this.action.schema.fields.damage.fields.parts.element.getInitialValue(); const part = this.action.schema.fields.damage.fields.parts.element.getInitialValue();
part.applyTo = type; part.applyTo = type;
if (type === CONFIG.DH.GENERAL.healingTypes.hitPoints.id)
part.type = this.action.schema.fields.damage.fields.parts.element.fields.type.element.initial;
data.damage.parts[type] = part; data.damage.parts[type] = part;
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
}; };

View file

@ -24,13 +24,15 @@ export default class DHActionConfig extends DHActionBaseConfig {
const effectData = this._addEffectData.bind(this)(); const effectData = this._addEffectData.bind(this)();
const data = this.action.toObject(); const data = this.action.toObject();
const created = await this.action.item.createEmbeddedDocuments('ActiveEffect', [ const created = await game.system.api.documents.DhActiveEffect.createDialog(effectData, {
game.system.api.data.activeEffects.BaseEffect.getDefaultObject() parent: this.action.item,
]); render: false
});
if (!created) return;
data.effects.push({ _id: created[0]._id }); data.effects.push({ _id: created._id });
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
this.action.item.effects.get(created[0]._id).sheet.render(true); this.action.item.effects.get(created._id).sheet.render(true);
} }
/** /**

View file

@ -151,10 +151,6 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
}); });
}); });
htmlElement
.querySelector('.stacking-change-checkbox')
?.addEventListener('change', this.stackingChangeToggle.bind(this));
htmlElement htmlElement
.querySelector('.armor-change-checkbox') .querySelector('.armor-change-checkbox')
?.addEventListener('change', this.armorChangeToggle.bind(this)); ?.addEventListener('change', this.armorChangeToggle.bind(this));
@ -213,16 +209,6 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
return partContext; return partContext;
} }
stackingChangeToggle(event) {
const stackingFields = this.document.system.schema.fields.stacking.fields;
const systemData = {
stacking: event.target.checked
? { value: stackingFields.value.initial, max: stackingFields.max.initial }
: null
};
return this.submit({ updateData: { system: systemData } });
}
armorChangeToggle(event) { armorChangeToggle(event) {
if (event.target.checked) { if (event.target.checked) {
this.addArmorChange(); this.addArmorChange();

View file

@ -49,9 +49,11 @@ export default class DhEffectsDisplay extends HandlebarsApplicationMixin(Applica
_attachPartListeners(partId, htmlElement, options) { _attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options); super._attachPartListeners(partId, htmlElement, options);
for (const element of this.element?.querySelectorAll('.effect-container a') ?? []) {
element.addEventListener('click', e => this.#onClickEffect(e)); if (this.element) {
element.addEventListener('contextmenu', e => this.#onClickEffect(e, -1)); this.element.querySelectorAll('.effect-container a').forEach(element => {
element.addEventListener('contextmenu', this.removeEffect.bind(this));
});
} }
} }
@ -85,21 +87,11 @@ export default class DhEffectsDisplay extends HandlebarsApplicationMixin(Applica
this.render(); this.render();
} }
async #onClickEffect(event, delta = 1) { async removeEffect(event) {
const element = event.target.closest('.effect-container'); const element = event.target.closest('.effect-container');
const effects = DhEffectsDisplay.getTokenEffects(); const effects = DhEffectsDisplay.getTokenEffects();
const effect = effects.find(x => x.id === element.dataset.effectId); const effect = effects.find(x => x.id === element.dataset.effectId);
if (!effect || (delta >= 0 && !effect.system.stacking)) {
return;
}
const maxValue = effect.system.stacking?.max ?? Infinity;
const newValue = Math.clamp((effect.system.stacking?.value ?? 1) + delta, 0, maxValue);
if (newValue > 0) {
await effect.update({ 'system.stacking.value': newValue });
} else {
await effect.delete(); await effect.delete();
}
this.render(); this.render();
} }

View file

@ -1,3 +1,56 @@
/**
* @typedef ContextMenuEntry
* @property {string} name The context menu label. Can be localized.
* @property {string} [icon] A string containing an HTML icon element for the menu item.
* @property {string} [classes] Additional CSS classes to apply to this menu item.
* @property {string} [group] An identifier for a group this entry belongs to.
* @property {ContextMenuJQueryCallback} callback The function to call when the menu item is clicked.
* @property {ContextMenuCondition|boolean} [condition] A function to call or boolean value to determine if this entry
* appears in the menu.
*/
/**
* @callback ContextMenuCondition
* @param {jQuery|HTMLElement} html The element of the context menu entry.
* @returns {boolean} Whether the entry should be rendered in the context menu.
*/
/**
* @callback ContextMenuCallback
* @param {HTMLElement} target The element that the context menu has been triggered for.
* @returns {unknown}
*/
/**
* @callback ContextMenuJQueryCallback
* @param {HTMLElement|jQuery} target The element that the context menu has been triggered for. Will
* either be a jQuery object or an HTMLElement instance, depending
* on how the ContextMenu was configured.
* @returns {unknown}
*/
/**
* @typedef ContextMenuOptions
* @property {string} [eventName="contextmenu"] Optionally override the triggering event which can spawn the menu. If
* the menu is using fixed positioning, this event must be a MouseEvent.
* @property {ContextMenuCallback} [onOpen] A function to call when the context menu is opened.
* @property {ContextMenuCallback} [onClose] A function to call when the context menu is closed.
* @property {boolean} [fixed=false] If true, the context menu is given a fixed position rather than being
* injected into the target.
* @property {boolean} [jQuery=true] If true, callbacks will be passed jQuery objects instead of HTMLElement
* instances.
*/
/**
* @typedef ContextMenuRenderOptions
* @property {Event} [event] The event that triggered the context menu opening.
* @property {boolean} [animate=true] Animate the context menu opening.
*/
/**
* A subclass of ContextMenu.
* @extends {foundry.applications.ux.ContextMenu}
*/
export default class DHContextMenu extends foundry.applications.ux.ContextMenu { export default class DHContextMenu extends foundry.applications.ux.ContextMenu {
/** /**
* Trigger a context menu event in response to a normal click on a additional options button. * Trigger a context menu event in response to a normal click on a additional options button.

View file

@ -30,8 +30,8 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
if (!effect.img) continue; if (!effect.img) continue;
const promise = const promise =
effect === overlayEffect effect === overlayEffect
? this._drawOverlay(effect.img, effect.tint, effect) ? this._drawOverlay(effect.img, effect.tint)
: this._drawEffect(effect.img, effect.tint, effect); : this._drawEffect(effect.img, effect.tint);
promises.push( promises.push(
promise.then(e => { promise.then(e => {
if (e) e.zIndex = i; if (e) e.zIndex = i;
@ -45,39 +45,6 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
this.renderFlags.set({ refreshEffects: true }); this.renderFlags.set({ refreshEffects: true });
} }
/**@inheritdoc */
async _drawEffect(src, tint, effect) {
if (!src) return;
const tex = await foundry.canvas.loadTexture(src, { fallback: 'icons/svg/hazard.svg' });
const icon = new PIXI.Sprite(tex);
icon.tint = tint ?? 0xffffff;
if (effect.system.stacking?.value > 1) {
const stackOverlay = new PIXI.Text(effect.system.stacking.value, {
fill: '#f3c267',
stroke: '#000000',
fontSize: 96,
strokeThickness: 4
});
const nrDigits = Math.floor(Math.log10(effect.system.stacking.value)) + 1;
stackOverlay.y = -8;
/* This does not account for 1:s being much less wide than other digits. I don't think it's desired however as it makes it look jumpy */
stackOverlay.x = icon.width - 8 - nrDigits * 56;
stackOverlay.anchor.set(0, 0);
icon.addChild(stackOverlay);
}
return this.effects.addChild(icon);
}
async _drawOverlay(src, tint, effect) {
const icon = await this._drawEffect(src, tint, effect);
if (icon) icon.alpha = 0.8;
this.effects.overlay = icon ?? null;
return icon;
}
/** /**
* Returns the distance from this token to another token object. * Returns the distance from this token to another token object.
* This value is corrected to handle alternate token sizes and other grid types * This value is corrected to handle alternate token sizes and other grid types

View file

@ -80,20 +80,7 @@ export default class BaseEffect extends foundry.data.ActiveEffectTypeDataModel {
initial: CONFIG.DH.GENERAL.range.melee.id, initial: CONFIG.DH.GENERAL.range.melee.id,
label: 'DAGGERHEART.GENERAL.range' label: 'DAGGERHEART.GENERAL.range'
}) })
}), })
stacking: new fields.SchemaField(
{
value: new fields.NumberField({
initial: 1,
min: 1,
integer: true,
nullable: false,
label: 'DAGGERHEART.GENERAL.value'
}),
max: new fields.NumberField({ integer: true, label: 'DAGGERHEART.GENERAL.max' })
},
{ nullable: true, initial: null }
)
}; };
} }
@ -166,12 +153,10 @@ export default class BaseEffect extends foundry.data.ActiveEffectTypeDataModel {
return acc; return acc;
}, this.parent.actor.system.armor?.system?.armor?.current ?? 0); }, this.parent.actor.system.armor?.system?.armor?.current ?? 0);
if (newArmorTotal !== this.parent.actor.system.armorScore.value) {
const armorData = getScrollTextData(this.parent.actor, { value: newArmorTotal }, 'armor'); const armorData = getScrollTextData(this.parent.actor, { value: newArmorTotal }, 'armor');
options.scrollingTextData = [armorData]; options.scrollingTextData = [armorData];
} }
} }
}
_onUpdate(changed, options, userId) { _onUpdate(changed, options, userId) {
super._onUpdate(changed, options, userId); super._onUpdate(changed, options, userId);

View file

@ -106,11 +106,22 @@ export default class EffectsField extends fields.ArrayField {
} }
/** /**
* Apply an Effect to a target * Apply an Effect to a target or enable it if already on it
* @param {object} effect Effect object containing ActiveEffect UUID * @param {object} effect Effect object containing ActiveEffect UUID
* @param {object} actor Actor Document * @param {object} actor Actor Document
*/ */
static async applyEffect(effect, actor) { static async applyEffect(effect, actor) {
const existingEffect = actor.effects.find(e => e.origin === effect.uuid);
if (existingEffect) {
return effect.update(
foundry.utils.mergeObject({
...effect.constructor.getInitialDuration(),
disabled: false
})
);
}
// Otherwise, create a new effect on the target
const effectData = foundry.utils.mergeObject({ const effectData = foundry.utils.mergeObject({
...(effect.toObject?.() ?? effect), ...(effect.toObject?.() ?? effect),
disabled: false, disabled: false,

View file

@ -108,18 +108,6 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
update.img = 'icons/magic/life/heart-cross-blue.webp'; update.img = 'icons/magic/life/heart-cross-blue.webp';
} }
const existingEffect = this.actor.effects.find(x => x.origin === data.origin);
const stacks = Boolean(data.system?.stacking);
if (existingEffect && !stacks) return false;
if (existingEffect && stacks) {
const incrementedValue = existingEffect.system.stacking.value + 1;
await existingEffect.update({
'system.stacking.value': Math.min(incrementedValue, existingEffect.system.stacking.max ?? Infinity)
});
return false;
}
const statuses = Object.keys(data.statuses ?? {}); const statuses = Object.keys(data.statuses ?? {});
const immuneStatuses = const immuneStatuses =
statuses.filter( statuses.filter(
@ -196,10 +184,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
} catch (_) {} } catch (_) {}
} }
const stackingParsedValue = effect.system.stacking const evalValue = this.effectSafeEval(itemAbleRollParse(key, parseModel, effect.parent));
? Roll.replaceFormulaData(key, { stacks: effect.system.stacking.value })
: key;
const evalValue = itemAbleRollParse(stackingParsedValue, parseModel, effect.parent);
return evalValue ?? key; return evalValue ?? key;
} }

View file

@ -122,14 +122,6 @@ export default class DhpActor extends Actor {
} }
} }
_onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId) {
if (collection === 'effects') {
ui.effectsDisplay.render();
}
super._onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId);
}
async updateLevel(newLevel) { async updateLevel(newLevel) {
if (!['character', 'companion'].includes(this.type) || newLevel === this.system.levelData.level.changed) return; if (!['character', 'companion'].includes(this.type) || newLevel === this.system.levelData.level.changed) return;

View file

@ -752,7 +752,8 @@ export function getArmorSources(actor) {
const data = rawArmorSources.map(doc => { const data = rawArmorSources.map(doc => {
// Get the origin item. Since the actor is already loaded, it should already be cached // Get the origin item. Since the actor is already loaded, it should already be cached
// Consider the relative function versions if this causes an issue // Consider the relative function versions if this causes an issue
const origin = doc.origin ? foundry.utils.fromUuidSync(doc.origin) : doc; const isItem = doc instanceof Item;
const origin = isItem ? doc : doc.origin ? foundry.utils.fromUuidSync(doc.origin) : doc.parent;
return { return {
origin, origin,
name: origin.name, name: origin.name,

View file

@ -71,17 +71,13 @@
"changes": [ "changes": [
{ {
"key": "system.bonuses.roll.attack.bonus", "key": "system.bonuses.roll.attack.bonus",
"type": "add", "value": 1,
"value": "@stacks",
"priority": null, "priority": null,
"phase": "initial" "type": "add"
} }
], ],
"duration": { "duration": {
"type": "shortRest" "type": "shortRest"
},
"stacking": {
"max": null
} }
}, },
"disabled": false, "disabled": false,

View file

@ -69,18 +69,14 @@
"changes": [ "changes": [
{ {
"key": "system.evasion", "key": "system.evasion",
"type": "add", "value": 2,
"value": "2 * @stacks",
"priority": null, "priority": null,
"phase": "initial" "type": "add"
} }
], ],
"duration": { "duration": {
"type": "temporary", "type": "temporary",
"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.565); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;\">Until the next time an attack succeeds against you.</span></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.565); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;\">Until the next time an attack succeeds against you.</span></p>"
},
"stacking": {
"max": null
} }
}, },
"disabled": false, "disabled": false,

View file

@ -127,7 +127,7 @@
"sort": 3400000, "sort": 3400000,
"effects": [ "effects": [
{ {
"name": "Corroded", "name": "Corroded (1 stack)",
"img": "icons/magic/acid/dissolve-bone-white.webp", "img": "icons/magic/acid/dissolve-bone-white.webp",
"origin": "Compendium.daggerheart.domains.Item.qJaSNTuDfbPVr8Lb", "origin": "Compendium.daggerheart.domains.Item.qJaSNTuDfbPVr8Lb",
"transfer": false, "transfer": false,
@ -139,31 +139,27 @@
"type": "withinRange", "type": "withinRange",
"target": "hostile", "target": "hostile",
"range": "melee" "range": "melee"
}
}, },
"changes": [ "changes": [
{ {
"key": "system.difficulty", "key": "system.difficulty",
"type": "add", "mode": 2,
"value": "-@stack", "value": "-1",
"priority": null, "priority": null
"phase": "initial"
} }
], ],
"stacking": {
"max": null
},
"duration": {
"type": ""
}
},
"disabled": false, "disabled": false,
"duration": { "duration": {
"value": null, "startTime": null,
"units": "seconds", "combat": null,
"expiry": null, "seconds": null,
"expired": false "rounds": null,
"turns": null,
"startRound": 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\">While a target is </span><span 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-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\">Corroded</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\">, they gain a 1 penalty to their </span><span 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\" class=\"tooltip-convert\">Difficulty</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\"> for every 2 Stress you spent. This </span><span 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\" class=\"tooltip-convert\">condition</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\"> can stack.</span></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\">While a target is </span><span 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-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\">Corroded</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\">, they gain a 1 penalty to their </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\">Difficulty</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\"> for every 2 Stress you spent. This </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\">condition</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\"> can stack.</p>",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [ "statuses": [
"corrode" "corrode"
@ -173,16 +169,6 @@
"_stats": { "_stats": {
"compendiumSource": null "compendiumSource": null
}, },
"start": {
"time": 0,
"combat": null,
"combatant": null,
"initiative": null,
"round": null,
"turn": null
},
"showIcon": 1,
"folder": null,
"_key": "!items.effects!qJaSNTuDfbPVr8Lb.zB95bjSSdVlApQnR" "_key": "!items.effects!qJaSNTuDfbPVr8Lb.zB95bjSSdVlApQnR"
} }
], ],

View file

@ -42,8 +42,44 @@
"type": "self", "type": "self",
"amount": null "amount": null
}, },
"name": "Mark Stress", "name": "Mark 1 Stress",
"img": "icons/skills/wounds/injury-face-impact-orange.webp", "img": "icons/magic/control/silhouette-aura-energy.webp",
"range": "self"
},
"fKY9NcYBwCFwMsgV": {
"type": "effect",
"_id": "fKY9NcYBwCFwMsgV",
"systemPath": "actions",
"description": "<p>You can <strong>mark a Stress</strong> to gain a bonus to your damage roll equal to twice your Strength.</p>",
"chatDisplay": true,
"actionType": "action",
"cost": [
{
"scalable": false,
"key": "stress",
"value": 2,
"step": null,
"consumeOnSuccess": false
}
],
"uses": {
"value": null,
"max": "",
"recovery": null,
"consumeOnSuccess": false
},
"effects": [
{
"_id": "t6SIjQxB6UBUJ98f",
"onSave": false
}
],
"target": {
"type": "self",
"amount": null
},
"name": "Mark 2 Stress",
"img": "icons/magic/control/silhouette-aura-energy.webp",
"range": "self" "range": "self"
} }
}, },
@ -58,8 +94,8 @@
"sort": 3400000, "sort": 3400000,
"effects": [ "effects": [
{ {
"name": "Rage Up", "name": "Rage Up (1)",
"img": "icons/skills/wounds/injury-face-impact-orange.webp", "img": "systems/daggerheart/assets/icons/domains/domain-card/blade.png",
"origin": "Compendium.daggerheart.domains.Item.GRL0cvs96vrTDckZ", "origin": "Compendium.daggerheart.domains.Item.GRL0cvs96vrTDckZ",
"transfer": false, "transfer": false,
"_id": "bq1MhcmoP6Wo5CXF", "_id": "bq1MhcmoP6Wo5CXF",
@ -70,38 +106,33 @@
"type": "withinRange", "type": "withinRange",
"target": "hostile", "target": "hostile",
"range": "melee" "range": "melee"
}
}, },
"changes": [ "changes": [
{ {
"key": "system.bonuses.damage.magical.bonus", "key": "system.bonuses.damage.magical.bonus",
"type": "add", "mode": 2,
"value": "2*@system.traits.strength.value*@stacks", "value": "2*@system.traits.strength.value",
"priority": 21, "priority": 21
"phase": "initial"
}, },
{ {
"key": "system.bonuses.damage.physical.bonus", "key": "system.bonuses.damage.physical.bonus",
"type": "add", "mode": 2,
"value": "2*@system.traits.strength.value*@stacks", "value": "2*@system.traits.strength.value",
"priority": 21, "priority": 21
"phase": "initial"
} }
], ],
"stacking": {
"max": 2
},
"duration": {
"type": ""
}
},
"disabled": false, "disabled": false,
"duration": { "duration": {
"value": null, "startTime": null,
"units": "seconds", "combat": null,
"expiry": null, "seconds": null,
"expired": false "rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
}, },
"description": "<p>For your next attack you have a bonus to your damage roll equal to twice your Strength.</p>", "description": "",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [], "statuses": [],
"sort": 0, "sort": 0,
@ -109,16 +140,6 @@
"_stats": { "_stats": {
"compendiumSource": null "compendiumSource": null
}, },
"start": {
"time": 0,
"combat": null,
"combatant": null,
"initiative": null,
"round": null,
"turn": null
},
"showIcon": 1,
"folder": null,
"_key": "!items.effects!GRL0cvs96vrTDckZ.bq1MhcmoP6Wo5CXF" "_key": "!items.effects!GRL0cvs96vrTDckZ.bq1MhcmoP6Wo5CXF"
}, },
{ {
@ -134,28 +155,31 @@
"type": "withinRange", "type": "withinRange",
"target": "hostile", "target": "hostile",
"range": "melee" "range": "melee"
}
}, },
"changes": [ "changes": [
{ {
"key": "system.bonuses.damage.magical.bonus", "key": "system.bonuses.damage.magical.bonus",
"mode": 2,
"value": "4*@system.traits.strength.value", "value": "4*@system.traits.strength.value",
"priority": 21, "priority": 21
"type": "add"
}, },
{ {
"key": "system.bonuses.damage.physical.bonus", "key": "system.bonuses.damage.physical.bonus",
"mode": 2,
"value": "4*@system.traits.strength.value", "value": "4*@system.traits.strength.value",
"priority": 21, "priority": 21
"type": "add"
} }
] ],
},
"disabled": false, "disabled": false,
"duration": { "duration": {
"value": null, "startTime": null,
"units": "seconds", "combat": null,
"expiry": null, "seconds": null,
"expired": false "rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
}, },
"description": "", "description": "",
"tint": "#ffffff", "tint": "#ffffff",
@ -165,9 +189,6 @@
"_stats": { "_stats": {
"compendiumSource": null "compendiumSource": null
}, },
"start": null,
"showIcon": 1,
"folder": null,
"_key": "!items.effects!GRL0cvs96vrTDckZ.t6SIjQxB6UBUJ98f" "_key": "!items.effects!GRL0cvs96vrTDckZ.t6SIjQxB6UBUJ98f"
} }
], ],

View file

@ -293,20 +293,6 @@
} }
} }
&.optional,
&.one-column.optional {
padding-top: 0;
padding-bottom: 4px;
min-height: auto;
row-gap: 0;
legend {
display: flex;
align-items: center;
padding-left: 3px;
}
}
.list-w-img { .list-w-img {
padding: 5px; padding: 5px;
label { label {
@ -483,10 +469,6 @@
&.even { &.even {
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
} }
&.full-width {
width: 100%;
}
} }
.three-columns { .three-columns {

View file

@ -33,6 +33,16 @@
} }
.armor-change-container { .armor-change-container {
padding-top: 0;
padding-bottom: 4px;
row-gap: 0;
legend {
display: flex;
align-items: center;
padding-left: 3px;
}
header { header {
padding: 0; padding: 0;
left: -0.25rem; // TODO: Find why this header is offset 0.25rem to the right so this can be removed. left: -0.25rem; // TODO: Find why this header is offset 0.25rem to the right so this can be removed.

View file

@ -35,21 +35,6 @@
color: @golden; color: @golden;
filter: drop-shadow(0 0 3px black); filter: drop-shadow(0 0 3px black);
} }
.stacking-value {
position: absolute;
top: 4px;
right: 4px;
font-size: 16px;
font-weight: bold;
font-variant-numeric: tabular-nums;
color: @golden;
background: black;
padding: 1px;
border-radius: 6px;
border: 1px solid @golden;
pointer-events: none;
}
} }
} }
} }

View file

@ -6,7 +6,6 @@
.daggerheart.dh-style.tooltip { .daggerheart.dh-style.tooltip {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: start;
text-align: start; text-align: start;
width: 100%; width: 100%;
gap: 5px; gap: 5px;
@ -14,7 +13,6 @@
border-radius: 3px; border-radius: 3px;
.tooltip-header { .tooltip-header {
width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -37,48 +35,12 @@
} }
} }
.effect-stacks-outer-container {
display: flex;
flex-direction: column;
gap: 4px;
width: 100%;
.effect-stacks-title {
font-size: var(--font-size-20);
font-weight: bold;
text-align: center;
}
.effect-stacks-container {
display: flex;
justify-content: space-between;
.effect-stacks-inner-container {
display: flex;
flex-direction: column;
gap: 2px;
.effect-stack-title {
font-weight: bold;
}
}
}
}
.close-hints {
margin-top: 0.5rem;
display: flex;
flex-direction: column;
gap: 4px;
.close-hint { .close-hint {
border-radius: 3px; border-radius: 3px;
padding: 3px; padding: 3px;
background: @rustic-brown-80; background: @rustic-brown-80;
color: @golden; color: @golden;
font-size: 12px; font-size: 12px;
margin: 0;
}
} }
.duration-container { .duration-container {

View file

@ -14,12 +14,8 @@
{{/each}} {{/each}}
</ol> </ol>
<fieldset class="armor-change-container optional"> <fieldset class="armor-change-container">
<legend> <legend>{{localize "DAGGERHEART.GENERAL.armor"}} <input type="checkbox" class="armor-change-checkbox" data-index="{{typedChanges.armor.index}}" {{checked typedChanges.armor}} /></legend>
{{localize "DAGGERHEART.GENERAL.armor"}}
<input type="checkbox" class="armor-change-checkbox" data-index="{{typedChanges.armor.index}}" {{checked typedChanges.armor}} />
</legend>
{{#if typedChanges.armor}} {{#if typedChanges.armor}}
{{> "systems/daggerheart/templates/sheets/activeEffect/typeChanges/armorChange.hbs" typedChanges.armor fields=@root.systemFields.changes.element.types.armor.fields}} {{> "systems/daggerheart/templates/sheets/activeEffect/typeChanges/armorChange.hbs" typedChanges.armor fields=@root.systemFields.changes.element.types.armor.fields}}
{{/if}} {{/if}}

View file

@ -1,18 +1,4 @@
<section class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}"> <section class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
<fieldset class="one-column optional">
<legend>
{{localize "DAGGERHEART.ACTIVEEFFECT.Config.stacking.title"}}
<input type="checkbox" class="stacking-change-checkbox" {{checked source.system.stacking}} />
</legend>
{{#if source.system.stacking}}
<div class="two-columns even full-width">
{{formGroup systemFields.stacking.fields.value value=source.system.stacking.value localize=true }}
{{formGroup systemFields.stacking.fields.max value=source.system.stacking.max localize=true }}
</div>
{{/if}}
</fieldset>
<fieldset class="one-column"> <fieldset class="one-column">
<legend>{{localize "DAGGERHEART.ACTIVEEFFECT.Config.rangeDependence.title"}}</legend> <legend>{{localize "DAGGERHEART.ACTIVEEFFECT.Config.rangeDependence.title"}}</legend>

View file

@ -8,9 +8,6 @@
<a {{#if effect.condition}}disabled{{/if}}> <a {{#if effect.condition}}disabled{{/if}}>
<img src="{{effect.img}}" /> <img src="{{effect.img}}" />
</a> </a>
{{#if (gt effect.system.stacking.value 1)}}
<span class="stacking-value">{{effect.system.stacking.value}}</span>
{{/if}}
{{#if effect.condition}}<i class="effect-locked fa-solid fa-lock"></i>{{/if}} {{#if effect.condition}}<i class="effect-locked fa-solid fa-lock"></i>{{/if}}
</span> </span>
{{/each}} {{/each}}

View file

@ -17,6 +17,7 @@
{{/if}} {{/if}}
{{#if effect.system.duration.type}} {{#if effect.system.duration.type}}
<div class="duration-container"> <div class="duration-container">
<div class="duration-inner-container"> <div class="duration-inner-container">
<span>{{localize "EFFECT.DURATION.Label"}}:</span> <span>{{localize "EFFECT.DURATION.Label"}}:</span>
@ -25,42 +26,9 @@
</div> </div>
{{/if}} {{/if}}
{{#if effect.system.stacking}}
<div class="effect-stacks-outer-container">
<div class="effect-stacks-title">{{localize "Stacks"}}</div>
<div class="effect-stacks-container">
<div class="effect-stacks-inner-container">
<span class="effect-stack-title">{{localize "Current"}}</span>
<span>{{effect.system.stacking.value}}</span>
</div>
<div class="effect-stacks-inner-container">
<span class="effect-stack-title">{{localize "Max"}}</span>
<span>{{effect.system.stacking.max}}</span>
</div>
</div>
</div>
{{/if}}
{{#unless effect.isLockedCondition}} {{#unless effect.isLockedCondition}}
<div class="close-hints">
{{#if effect.system.stacking}}
<p class="close-hint">
<i class="fa-solid fa-computer-mouse"></i> {{localize "DAGGERHEART.UI.EffectsDisplay.increaseStacks"}}
</p>
{{#if (gt effect.system.stacking.value 1)}}
<p class="close-hint">
<i class="fa-solid fa-computer-mouse"></i> {{localize "DAGGERHEART.UI.EffectsDisplay.decreaseStacks"}}
</p>
{{else}}
<p class="close-hint"> <p class="close-hint">
<i class="fa-solid fa-computer-mouse"></i> {{localize "DAGGERHEART.UI.EffectsDisplay.removeThing" thing=(localize "DAGGERHEART.GENERAL.Effect.single")}} <i class="fa-solid fa-computer-mouse"></i> {{localize "DAGGERHEART.UI.EffectsDisplay.removeThing" thing=(localize "DAGGERHEART.GENERAL.Effect.single")}}
</p> </p>
{{/if}}
{{else}}
<p class="close-hint">
<i class="fa-solid fa-computer-mouse"></i> {{localize "DAGGERHEART.UI.EffectsDisplay.removeThing" thing=(localize "DAGGERHEART.GENERAL.Effect.single")}}
</p>
{{/if}}
</div>
{{/unless}} {{/unless}}
</div> </div>