Compare commits

..

No commits in common. "958eaa310c2b33414527b68afbe6b4ecc64f02c3" and "329d820aab0ce538ab4c1696afa27b1e4c827ad4" have entirely different histories.

4 changed files with 27 additions and 33 deletions

View file

@ -2010,8 +2010,7 @@
"Attachments": {
"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."
},
"OriginTag": "Origin: {name}"
}
},
"GENERAL": {
"Ability": {

View file

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

View file

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

View file

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