mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-24 11:29:54 +02:00
Compare commits
3 commits
329d820aab
...
958eaa310c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
958eaa310c | ||
|
|
f5fa59b3bd | ||
|
|
9f29229c94 |
4 changed files with 33 additions and 27 deletions
|
|
@ -2010,7 +2010,8 @@
|
||||||
"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": {
|
||||||
|
|
|
||||||
|
|
@ -348,29 +348,31 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
'system.bonuses.roll.spellcast.bonus'
|
'system.bonuses.roll.spellcast.bonus'
|
||||||
];
|
];
|
||||||
|
|
||||||
return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).reduce(
|
const results = [];
|
||||||
(acc, effect) => {
|
const applicableEffects = await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true });
|
||||||
const effectData = effect.toObject();
|
for (const effect of [...applicableEffects].filter(e => !e.isSuppressed)) {
|
||||||
/* Effects on weapons only ever apply for the weapon itself, with a few defined exceptions */
|
if (effect.parent.type === 'weapon') {
|
||||||
if (effect.parent.type === 'weapon') {
|
// Effects on weapons only ever apply for the weapon itself (with a few exceptions)
|
||||||
/* Unless they're secondary - then they apply only to other primary weapons */
|
const restricted =
|
||||||
if (effect.parent.system.secondary) {
|
effect.parent.system.secondary
|
||||||
if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) {
|
// Secondary applies only to other primary weapons
|
||||||
effectData.system.changes =
|
? effectParent?.type !== 'weapon' || effectParent?.system.secondary
|
||||||
effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
|
// Primary only applies to itself
|
||||||
}
|
: effectParent?.id !== effect.parent.id;
|
||||||
} else if (effectParent?.id !== effect.parent.id) {
|
if (restricted) {
|
||||||
effectData.system.changes =
|
const sourceChanges = effect._source.system.changes;
|
||||||
effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
|
const changes = sourceChanges.filter(x => weaponTransferredEffectKeys.includes(x.key));
|
||||||
|
if (changes.length) {
|
||||||
|
results.push(effect.clone({ 'system.changes': changes }));
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
results.push(effect);
|
||||||
|
}
|
||||||
|
|
||||||
if (!effect.isSuppressed) {
|
return results;
|
||||||
acc.push(effectData);
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
}, []);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -224,12 +224,13 @@ 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 = [];
|
||||||
`${game.i18n.localize(this.parent.system.metadata.label)}: ${this.parent.name}`,
|
const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin), Actor);
|
||||||
game.i18n.localize(
|
if (originActor && originActor !== this.actor) {
|
||||||
this.isTemporary ? 'DAGGERHEART.EFFECTS.Duration.temporary' : 'DAGGERHEART.EFFECTS.Duration.passive'
|
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}`);
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
.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%;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue