Compendium updaetes

This commit is contained in:
WBHarry 2026-02-26 20:30:34 +01:00
parent 26e650e8f6
commit 0f334232d8
6 changed files with 112 additions and 200 deletions

View file

@ -1,97 +1,4 @@
/**
* @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 {
/**
* @param {HTMLElement|jQuery} container - The HTML element that contains the context menu targets.
* @param {string} selector - A CSS selector which activates the context menu.
* @param {ContextMenuEntry[]} menuItems - An Array of entries to display in the menu
* @param {ContextMenuOptions} [options] - Additional options to configure the context menu.
*/
constructor(container, selector, menuItems, options) {
super(container, selector, menuItems, options);
/** @deprecated since v13 until v15 */
this.#jQuery = options.jQuery;
}
/**
* Whether to pass jQuery objects or HTMLElement instances to callback.
* @type {boolean}
*/
#jQuery;
/**@inheritdoc */
activateListeners(menu) {
menu.addEventListener('click', this.#onClickItem.bind(this));
}
/**
* Handle click events on context menu items.
* @param {PointerEvent} event The click event
*/
#onClickItem(event) {
event.preventDefault();
event.stopPropagation();
const element = event.target.closest('.context-item');
if (!element) return;
const item = this.menuItems.find(i => i.element === element);
item?.callback(this.#jQuery ? $(this.target) : this.target, event);
this.close();
}
/* -------------------------------------------- */
/** /**
* 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.
* @param {PointerEvent} event * @param {PointerEvent} event

View file

@ -48,7 +48,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
/**@inheritdoc */ /**@inheritdoc */
async _drawEffect(src, tint, effect) { async _drawEffect(src, tint, effect) {
if (!src) return; if (!src) return;
const tex = await loadTexture(src, { fallback: 'icons/svg/hazard.svg' }); const tex = await foundry.canvas.loadTexture(src, { fallback: 'icons/svg/hazard.svg' });
const icon = new PIXI.Sprite(tex); const icon = new PIXI.Sprite(tex);
icon.tint = tint ?? 0xffffff; icon.tint = tint ?? 0xffffff;
@ -62,7 +62,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
const nrDigits = Math.floor(Math.log10(effect.system.stacking.value)) + 1; const nrDigits = Math.floor(Math.log10(effect.system.stacking.value)) + 1;
stackOverlay.y = -8; 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 */ /* 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 + (lastDigitIsOne ? 16 : 0); stackOverlay.x = icon.width - 8 - nrDigits * 56;
stackOverlay.anchor.set(0, 0); stackOverlay.anchor.set(0, 0);
icon.addChild(stackOverlay); icon.addChild(stackOverlay);

View file

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

View file

@ -69,14 +69,19 @@
"changes": [ "changes": [
{ {
"key": "system.evasion", "key": "system.evasion",
"value": 2, "type": "add",
"value": "2 * @stacks",
"priority": null, "priority": null,
"type": "add" "phase": "initial"
} }
], ],
"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": {
"enabled": true,
"max": null
} }
}, },
"disabled": false, "disabled": false,

View file

@ -127,7 +127,7 @@
"sort": 3400000, "sort": 3400000,
"effects": [ "effects": [
{ {
"name": "Corroded (1 stack)", "name": "Corroded",
"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,27 +139,32 @@
"type": "withinRange", "type": "withinRange",
"target": "hostile", "target": "hostile",
"range": "melee" "range": "melee"
}
}, },
"changes": [ "changes": [
{ {
"key": "system.difficulty", "key": "system.difficulty",
"mode": 2, "type": "add",
"value": "-1", "value": "-@stack",
"priority": null "priority": null,
"phase": "initial"
} }
], ],
"stacking": {
"enabled": true,
"max": null
},
"duration": {
"type": ""
}
},
"disabled": false, "disabled": false,
"duration": { "duration": {
"startTime": null, "value": null,
"combat": null, "units": "seconds",
"seconds": null, "expiry": null,
"rounds": null, "expired": false
"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 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>", "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>",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [ "statuses": [
"corrode" "corrode"
@ -169,6 +174,16 @@
"_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,44 +42,8 @@
"type": "self", "type": "self",
"amount": null "amount": null
}, },
"name": "Mark 1 Stress", "name": "Mark Stress",
"img": "icons/magic/control/silhouette-aura-energy.webp", "img": "icons/skills/wounds/injury-face-impact-orange.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"
} }
}, },
@ -94,8 +58,8 @@
"sort": 3400000, "sort": 3400000,
"effects": [ "effects": [
{ {
"name": "Rage Up (1)", "name": "Rage Up",
"img": "systems/daggerheart/assets/icons/domains/domain-card/blade.png", "img": "icons/skills/wounds/injury-face-impact-orange.webp",
"origin": "Compendium.daggerheart.domains.Item.GRL0cvs96vrTDckZ", "origin": "Compendium.daggerheart.domains.Item.GRL0cvs96vrTDckZ",
"transfer": false, "transfer": false,
"_id": "bq1MhcmoP6Wo5CXF", "_id": "bq1MhcmoP6Wo5CXF",
@ -106,33 +70,39 @@
"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, "type": "add",
"value": "2*@system.traits.strength.value", "value": "2*@system.traits.strength.value*@stacks",
"priority": 21 "priority": 21,
"phase": "initial"
}, },
{ {
"key": "system.bonuses.damage.physical.bonus", "key": "system.bonuses.damage.physical.bonus",
"mode": 2, "type": "add",
"value": "2*@system.traits.strength.value", "value": "2*@system.traits.strength.value*@stacks",
"priority": 21 "priority": 21,
"phase": "initial"
} }
], ],
"stacking": {
"enabled": true,
"max": 2
},
"duration": {
"type": ""
}
},
"disabled": false, "disabled": false,
"duration": { "duration": {
"startTime": null, "value": null,
"combat": null, "units": "seconds",
"seconds": null, "expiry": null,
"rounds": null, "expired": false
"turns": null,
"startRound": null,
"startTurn": null
}, },
"description": "", "description": "<p>For your next attack you have a bonus to your damage roll equal to twice your Strength.</p>",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [], "statuses": [],
"sort": 0, "sort": 0,
@ -140,6 +110,16 @@
"_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"
}, },
{ {
@ -155,31 +135,28 @@
"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": {
"startTime": null, "value": null,
"combat": null, "units": "seconds",
"seconds": null, "expiry": null,
"rounds": null, "expired": false
"turns": null,
"startRound": null,
"startTurn": null
}, },
"description": "", "description": "",
"tint": "#ffffff", "tint": "#ffffff",
@ -189,6 +166,9 @@
"_stats": { "_stats": {
"compendiumSource": null "compendiumSource": null
}, },
"start": null,
"showIcon": 1,
"folder": null,
"_key": "!items.effects!GRL0cvs96vrTDckZ.t6SIjQxB6UBUJ98f" "_key": "!items.effects!GRL0cvs96vrTDckZ.t6SIjQxB6UBUJ98f"
} }
], ],