mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Added ArmoreEffect.armorInteraction option
This commit is contained in:
parent
c067fd0e10
commit
10baf0ba10
9 changed files with 62 additions and 24 deletions
13
lang/en.json
13
lang/en.json
|
|
@ -751,6 +751,11 @@
|
||||||
"bruiser": "for each Bruiser adversary.",
|
"bruiser": "for each Bruiser adversary.",
|
||||||
"solo": "for each Solo adversary."
|
"solo": "for each Solo adversary."
|
||||||
},
|
},
|
||||||
|
"ArmorInteraction": {
|
||||||
|
"none": { "label": "Ignores Armor" },
|
||||||
|
"active": { "label": "Only Active With Armor" },
|
||||||
|
"inactive": { "label": "Only Active Without Armor" }
|
||||||
|
},
|
||||||
"ArmorFeature": {
|
"ArmorFeature": {
|
||||||
"burning": {
|
"burning": {
|
||||||
"name": "Burning",
|
"name": "Burning",
|
||||||
|
|
@ -1851,7 +1856,13 @@
|
||||||
"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."
|
||||||
},
|
},
|
||||||
"Armor": {
|
"Armor": {
|
||||||
"newArmorEffect": "Armor Effect"
|
"newArmorEffect": "Armor Effect",
|
||||||
|
"FIELDS": {
|
||||||
|
"armorInteraction": {
|
||||||
|
"label": "Armor Interaction",
|
||||||
|
"hint": "Does the character wearing armor suppress this effect?"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GENERAL": {
|
"GENERAL": {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ export default class ArmorActiveEffectConfig extends HandlebarsApplicationMixin(
|
||||||
submitOnChange: true,
|
submitOnChange: true,
|
||||||
closeOnSubmit: false
|
closeOnSubmit: false
|
||||||
},
|
},
|
||||||
|
position: { width: 560 },
|
||||||
actions: {
|
actions: {
|
||||||
finish: ArmorActiveEffectConfig.#finish
|
finish: ArmorActiveEffectConfig.#finish
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -890,3 +890,9 @@ export const activeEffectModes = {
|
||||||
label: 'EFFECT.CHANGES.TYPES.override'
|
label: 'EFFECT.CHANGES.TYPES.override'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const activeEffectArmorInteraction = {
|
||||||
|
none: { id: 'none', label: 'DAGGERHEART.CONFIG.ArmorInteraction.none.label' },
|
||||||
|
active: { id: 'active', label: 'DAGGERHEART.CONFIG.ArmorInteraction.active.label' },
|
||||||
|
inactive: { id: 'inactive', label: 'DAGGERHEART.CONFIG.ArmorInteraction.inactive.label' }
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,30 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
),
|
||||||
|
armorInteraction: new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
choices: CONFIG.DH.GENERAL.activeEffectArmorInteraction,
|
||||||
|
initial: CONFIG.DH.GENERAL.activeEffectArmorInteraction.none.id,
|
||||||
|
label: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.label',
|
||||||
|
hint: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.hint'
|
||||||
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isSuppressed() {
|
||||||
|
if (this.parent.actor?.type !== 'character') return false;
|
||||||
|
|
||||||
|
switch (this.armorInteraction) {
|
||||||
|
case CONFIG.DH.GENERAL.activeEffectArmorInteraction.active.id:
|
||||||
|
return !this.parent.actor.system.armor;
|
||||||
|
case CONFIG.DH.GENERAL.activeEffectArmorInteraction.inactive.id:
|
||||||
|
return Boolean(this.parent.actor.system.armor);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Type Functions */
|
/* Type Functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
|
|
||||||
/**@override */
|
/**@override */
|
||||||
get isSuppressed() {
|
get isSuppressed() {
|
||||||
|
if (this.system.isSuppressed === true) return true;
|
||||||
|
|
||||||
// If this is a copied effect from an attachment, never suppress it
|
// If this is a copied effect from an attachment, never suppress it
|
||||||
// (These effects have attachmentSource metadata)
|
// (These effects have attachmentSource metadata)
|
||||||
if (this.flags?.daggerheart?.attachmentSource) {
|
if (this.flags?.daggerheart?.attachmentSource) {
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,8 @@
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"max": "1"
|
"max": "1"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"armorInteraction": "active"
|
||||||
},
|
},
|
||||||
"_id": "tJw2JIPcT9hEMRXg",
|
"_id": "tJw2JIPcT9hEMRXg",
|
||||||
"img": "icons/tools/hand/hammer-and-nail.webp",
|
"img": "icons/tools/hand/hammer-and-nail.webp",
|
||||||
|
|
@ -112,7 +113,7 @@
|
||||||
"expiry": null,
|
"expiry": null,
|
||||||
"expired": false
|
"expired": false
|
||||||
},
|
},
|
||||||
"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 you’re wearing armor, gain a +1 bonus to your </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\">Armor Score</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\">.</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.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">While you’re wearing armor, gain a +1 bonus to your </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\">Armor Score</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\">.</span></p>",
|
||||||
"origin": null,
|
"origin": null,
|
||||||
"tint": "#ffffff",
|
"tint": "#ffffff",
|
||||||
"transfer": true,
|
"transfer": true,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@
|
||||||
"phase": "initial",
|
"phase": "initial",
|
||||||
"priority": 20
|
"priority": 20
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"armorInteraction": "inactive"
|
||||||
},
|
},
|
||||||
"_id": "FCsgz7Tdsw6QUzBs",
|
"_id": "FCsgz7Tdsw6QUzBs",
|
||||||
"img": "icons/magic/control/buff-strength-muscle-damage-orange.webp",
|
"img": "icons/magic/control/buff-strength-muscle-damage-orange.webp",
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,5 @@
|
||||||
.application.sheet.daggerheart.dh-style.armor-effect-config {
|
.application.sheet.daggerheart.dh-style.armor-effect-config {
|
||||||
.armor-effects-container {
|
.tab-form-footer {
|
||||||
display: flex;
|
margin-top: 8px;
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.armor-effect-container {
|
|
||||||
display: flex;
|
|
||||||
gap: 4px;
|
|
||||||
|
|
||||||
* {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,17 @@
|
||||||
<section class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
|
<section class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
|
||||||
<div class="armor-effects-container">
|
<fieldset>
|
||||||
{{#each source.system.changes as |change index|}}
|
<legend>{{localize "Armor"}}</legend>
|
||||||
<div class="armor-effect-container">
|
<div class="two-columns even">
|
||||||
|
{{#each source.system.changes as |change index|}}
|
||||||
{{formGroup @root.systemFields.changes.element.fields.value name=(concat 'system.changes.' index '.value') value=change.value localize=true}}
|
{{formGroup @root.systemFields.changes.element.fields.value name=(concat 'system.changes.' index '.value') value=change.value localize=true}}
|
||||||
{{formGroup @root.systemFields.changes.element.fields.max name=(concat 'system.changes.' index '.max') value=change.max localize=true}}
|
{{formGroup @root.systemFields.changes.element.fields.max name=(concat 'system.changes.' index '.max') value=change.max localize=true}}
|
||||||
</div>
|
{{/each}}
|
||||||
{{/each}}
|
</div>
|
||||||
</div>
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "DAGGERHEART.GENERAL.general"}}</legend>
|
||||||
|
|
||||||
|
{{formGroup @root.systemFields.armorInteraction name="system.armorInteraction" value=source.system.armorInteraction localize=true}}
|
||||||
|
</fieldset>
|
||||||
</section>
|
</section>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue