mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-24 11:29:54 +02:00
Compare commits
8 commits
a1d3124321
...
8abc94a7da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8abc94a7da | ||
|
|
1430deae7c | ||
|
|
2c1f52413d | ||
|
|
ca82cbcf66 | ||
|
|
07b7c82094 | ||
|
|
958eaa310c | ||
|
|
f5fa59b3bd | ||
|
|
9f29229c94 |
10 changed files with 62 additions and 44 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": {
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ export default function DHApplicationMixin(Base) {
|
||||||
const doc = await fromUuid(itemUuid);
|
const doc = await fromUuid(itemUuid);
|
||||||
|
|
||||||
//get inventory-item description element
|
//get inventory-item description element
|
||||||
const descriptionElement = el.querySelector('.invetory-description');
|
const descriptionElement = el.querySelector('.inventory-description');
|
||||||
if (!doc || !descriptionElement) continue;
|
if (!doc || !descriptionElement) continue;
|
||||||
|
|
||||||
// localize the description (idk if it's still necessary)
|
// localize the description (idk if it's still necessary)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,10 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasDescription() {
|
||||||
|
return Boolean(this.description);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Map containing each Action step based on fields define in schema. Ordered by Fields order property.
|
* Create a Map containing each Action step based on fields define in schema. Ordered by Fields order property.
|
||||||
*
|
*
|
||||||
|
|
@ -348,29 +352,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') {
|
||||||
/* Unless they're secondary - then they apply only to other primary weapons */
|
// Effects on weapons only ever apply for the weapon itself (with a few exceptions)
|
||||||
if (effect.parent.system.secondary) {
|
const restricted =
|
||||||
if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) {
|
effect.parent.system.secondary
|
||||||
effectData.system.changes =
|
// Secondary applies only to other primary weapons
|
||||||
effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
|
? 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 }));
|
||||||
}
|
}
|
||||||
} else if (effectParent?.id !== effect.parent.id) {
|
continue;
|
||||||
effectData.system.changes =
|
|
||||||
effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!effect.isSuppressed) {
|
results.push(effect);
|
||||||
acc.push(effectData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc;
|
return results;
|
||||||
}, []);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,10 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasDescription() {
|
||||||
|
return Boolean(this.description);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Event Handlers */
|
/* Event Handlers */
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
@ -224,12 +228,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, { strict: false }), 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);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ 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.filter(x => x.effectTargetTypes.includes(actor.type))
|
effects
|
||||||
|
.filter(x => x.effectTargetTypes.includes(actor.type))
|
||||||
|
.map(x => foundry.utils.deepClone(x))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,10 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
return !pack?.locked && this.isOwner && isValidType && hasActions;
|
return !pack?.locked && this.isOwner && isValidType && hasActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasDescription() {
|
||||||
|
return Boolean(this.system.description);
|
||||||
|
}
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
static async createDialog(data = {}, createOptions = {}, options = {}) {
|
static async createDialog(data = {}, createOptions = {}, options = {}) {
|
||||||
const { folders, types, template, context = {}, ...dialogOptions } = options;
|
const { folders, types, template, context = {}, ...dialogOptions } = options;
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,9 @@
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
&:has(.inventory-item-content.extensible) {
|
|
||||||
.item-main {
|
.item-main {
|
||||||
background: light-dark(@dark-blue-40, @golden-40);
|
background: light-dark(@dark-blue-40, @golden-40);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
&:has(.inventory-item-content.extended) {
|
&:has(.inventory-item-content.extended) {
|
||||||
.inventory-item-header .item-label .item-name .expanded-icon {
|
.inventory-item-header .item-label .item-name .expanded-icon {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
@ -163,7 +161,7 @@
|
||||||
grid-template-rows: 1fr;
|
grid-template-rows: 1fr;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
}
|
}
|
||||||
.invetory-description {
|
.inventory-description {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
|
|
|
||||||
|
|
@ -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%;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.0",
|
"version": "2.4.1",
|
||||||
"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.0/system.zip",
|
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.1/system.zip",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "WBHarry"
|
"name": "WBHarry"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Parameters:
|
||||||
data-item-uuid="{{item.uuid}}" data-no-compendium-edit="{{noCompendiumEdit}}"
|
data-item-uuid="{{item.uuid}}" data-no-compendium-edit="{{noCompendiumEdit}}"
|
||||||
>
|
>
|
||||||
<div class="item-main">
|
<div class="item-main">
|
||||||
<div class="inventory-item-header{{#if hideContextMenu}} padded{{/if}}" {{#unless (or noExtensible (not item.system.description))}}data-action="toggleExtended" {{/unless}}>
|
<div class="inventory-item-header{{#if hideContextMenu}} padded{{/if}}" {{#unless (or noExtensible (not item.hasDescription))}}data-action="toggleExtended" {{/unless}}>
|
||||||
{{!-- Image --}}
|
{{!-- Image --}}
|
||||||
<div class="img-portait" draggable="true"
|
<div class="img-portait" draggable="true"
|
||||||
{{#unless (eq showActions false)}}data-action='{{ifThen item.usable "useItem" (ifThen (hasProperty item "toChat" ) "toChat" "editDoc" ) }}'{{/unless}}
|
{{#unless (eq showActions false)}}data-action='{{ifThen item.usable "useItem" (ifThen (hasProperty item "toChat" ) "toChat" "editDoc" ) }}'{{/unless}}
|
||||||
|
|
@ -44,7 +44,7 @@ Parameters:
|
||||||
{{!-- Name & Tags --}}
|
{{!-- Name & Tags --}}
|
||||||
<div class="item-label" draggable="true">
|
<div class="item-label" draggable="true">
|
||||||
{{!-- Item Name --}}
|
{{!-- Item Name --}}
|
||||||
<span class="item-name">{{localize item.name}} {{#unless (or noExtensible (not item.system.description))}}<span class="expanded-icon"><i class="fa-solid fa-expand"></i></span>{{/unless}}</span>
|
<span class="item-name">{{localize item.name}} {{#unless (or noExtensible (not item.hasDescription))}}<span class="expanded-icon"><i class="fa-solid fa-expand"></i></span>{{/unless}}</span>
|
||||||
|
|
||||||
{{!-- Tags Start --}}
|
{{!-- Tags Start --}}
|
||||||
{{#if (not hideTags)}}
|
{{#if (not hideTags)}}
|
||||||
|
|
@ -130,12 +130,12 @@ Parameters:
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
<div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}">
|
|
||||||
{{!-- Description --}}
|
|
||||||
{{#unless hideDescription}}
|
{{#unless hideDescription}}
|
||||||
<div class="invetory-description"></div>
|
<div class="inventory-item-content{{#unless (or noExtensible (not item.hasDescription))}} extensible{{/unless}}">
|
||||||
{{/unless}}
|
{{!-- Description --}}
|
||||||
|
<div class="inventory-description"></div>
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
{{!-- Dice Resource --}}
|
{{!-- Dice Resource --}}
|
||||||
{{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}
|
{{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue