Compare commits

..

No commits in common. "2c1f52413d60004c8d4933caf586258ff4baf1cd" and "329d820aab0ce538ab4c1696afa27b1e4c827ad4" have entirely different histories.

6 changed files with 30 additions and 38 deletions

View file

@ -2010,8 +2010,7 @@
"Attachments": { "Attachments": {
"attachHint": "Drop items here to attach them", "attachHint": "Drop items here to attach them",
"transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one." "transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one."
}, }
"OriginTag": "Origin: {name}"
}, },
"GENERAL": { "GENERAL": {
"Ability": { "Ability": {

View file

@ -348,31 +348,29 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
'system.bonuses.roll.spellcast.bonus' 'system.bonuses.roll.spellcast.bonus'
]; ];
const results = []; return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).reduce(
const applicableEffects = await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true }); (acc, effect) => {
for (const effect of [...applicableEffects].filter(e => !e.isSuppressed)) { const effectData = effect.toObject();
if (effect.parent.type === 'weapon') { /* Effects on weapons only ever apply for the weapon itself, with a few defined exceptions */
// Effects on weapons only ever apply for the weapon itself (with a few exceptions) if (effect.parent.type === 'weapon') {
const restricted = /* Unless they're secondary - then they apply only to other primary weapons */
effect.parent.system.secondary if (effect.parent.system.secondary) {
// Secondary applies only to other primary weapons if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) {
? effectParent?.type !== 'weapon' || effectParent?.system.secondary effectData.system.changes =
// Primary only applies to itself effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
: effectParent?.id !== effect.parent.id; }
if (restricted) { } else if (effectParent?.id !== effect.parent.id) {
const sourceChanges = effect._source.system.changes; effectData.system.changes =
const changes = sourceChanges.filter(x => weaponTransferredEffectKeys.includes(x.key)); effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
if (changes.length) {
results.push(effect.clone({ 'system.changes': changes }));
} }
continue;
} }
}
results.push(effect);
}
return results; if (!effect.isSuppressed) {
acc.push(effectData);
}
return acc;
}, []);
} }
/** /**

View file

@ -224,13 +224,12 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
* @returns {string[]} An array of localized tag strings. * @returns {string[]} An array of localized tag strings.
*/ */
_getTags() { _getTags() {
const tags = []; const tags = [
const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin, { strict: false }), Actor); `${game.i18n.localize(this.parent.system.metadata.label)}: ${this.parent.name}`,
if (originActor && originActor !== this.actor) { game.i18n.localize(
tags.push(_loc('DAGGERHEART.EFFECTS.OriginTag', { name: originActor.name })); this.isTemporary ? 'DAGGERHEART.EFFECTS.Duration.temporary' : 'DAGGERHEART.EFFECTS.Duration.passive'
} else if (!(this.parent instanceof Actor)) { )
tags.push(`${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`); ];
}
for (const statusId of this.statuses) { for (const statusId of this.statuses) {
const status = CONFIG.statusEffects.find(s => s.id === statusId); const status = CONFIG.statusEffects.find(s => s.id === statusId);

View file

@ -46,9 +46,7 @@ export default class DhpCombat extends Combat {
for (let actor of actors) { for (let actor of actors) {
await actor.createEmbeddedDocuments( await actor.createEmbeddedDocuments(
'ActiveEffect', 'ActiveEffect',
effects effects.filter(x => x.effectTargetTypes.includes(actor.type))
.filter(x => x.effectTargetTypes.includes(actor.type))
.map(x => foundry.utils.deepClone(x))
); );
} }
} else { } else {

View file

@ -3,8 +3,6 @@
.application.daggerheart { .application.daggerheart {
prose-mirror { prose-mirror {
--menu-padding: 4px 0px;
--menu-height: calc(var(--menu-button-height) + 8px);
height: 100% !important; height: 100% !important;
width: 100%; width: 100%;

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": "2.4.1", "version": "2.4.0",
"compatibility": { "compatibility": {
"minimum": "14.364", "minimum": "14.364",
"verified": "14.364", "verified": "14.364",
@ -10,7 +10,7 @@
}, },
"url": "https://github.com/Foundryborne/daggerheart", "url": "https://github.com/Foundryborne/daggerheart",
"manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json", "manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json",
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.1/system.zip", "download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.0/system.zip",
"authors": [ "authors": [
{ {
"name": "WBHarry" "name": "WBHarry"