diff --git a/daggerheart.mjs b/daggerheart.mjs index 26662804..bf511153 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -43,6 +43,7 @@ CONFIG.Item.dataModels = models.items.config; CONFIG.ActiveEffect.documentClass = documents.DhActiveEffect; CONFIG.ActiveEffect.dataModels = models.activeEffects.config; +CONFIG.ActiveEffect.changeTypes = { ...CONFIG.ActiveEffect.changeTypes, ...models.activeEffects.changeTypes }; CONFIG.Combat.documentClass = documents.DhpCombat; CONFIG.Combat.dataModels = { base: models.DhCombat }; @@ -211,10 +212,22 @@ Hooks.once('init', () => { SYSTEM.id, applications.sheetConfigs.ActiveEffectConfig, { + types: ['base', 'beastform', 'horde'], makeDefault: true, label: sheetLabel('DOCUMENT.ActiveEffect') } ); + DocumentSheetConfig.registerSheet( + CONFIG.ActiveEffect.documentClass, + SYSTEM.id, + applications.sheetConfigs.ArmorActiveEffectConfig, + { + types: ['armor'], + makeDefault: true, + label: () => + `${game.i18n.localize('TYPES.ActiveEffect.armor')} ${game.i18n.localize('DAGGERHEART.GENERAL.effect')}` + } + ); game.socket.on(`system.${SYSTEM.id}`, socketRegistration.handleSocketEvent); diff --git a/lang/en.json b/lang/en.json index 1aa43b5b..df419b07 100755 --- a/lang/en.json +++ b/lang/en.json @@ -16,7 +16,8 @@ "ActiveEffect": { "base": "Standard", "beastform": "Beastform", - "horde": "Horde" + "horde": "Horde", + "armor": "Armor" }, "Actor": { "character": "Character", @@ -436,7 +437,7 @@ "text": "Are you sure you want to delete {name}?" }, "DamageReduction": { - "armorMarks": "Armor Marks", + "maxUseableArmor": "Useable Armor Slots", "armorWithStress": "Spend 1 stress to use an extra mark", "thresholdImmunities": "Threshold Immunities", "stress": "Stress", @@ -760,6 +761,11 @@ "bruiser": "for each Bruiser adversary.", "solo": "for each Solo adversary." }, + "ArmorInteraction": { + "none": { "label": "Ignores Armor" }, + "active": { "label": "Only Active With Armor" }, + "inactive": { "label": "Only Active Without Armor" } + }, "ArmorFeature": { "burning": { "name": "Burning", @@ -1860,6 +1866,15 @@ "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." + }, + "Armor": { + "newArmorEffect": "Armor Effect", + "FIELDS": { + "armorInteraction": { + "label": "Armor Interaction", + "hint": "Does the character wearing armor suppress this effect?" + } + } } }, "GENERAL": { @@ -2244,6 +2259,7 @@ "duality": "Duality", "dualityDice": "Duality Dice", "dualityRoll": "Duality Roll", + "effect": "Effect", "enabled": "Enabled", "evasion": "Evasion", "equipment": "Equipment", @@ -3008,7 +3024,13 @@ "tokenActorsMissing": "[{names}] missing Actors", "domainTouchRequirement": "This domain card requires {nr} {domain} cards in the loadout to be used", "knowTheTide": "Know The Tide gained a token", - "lackingItemTransferPermission": "User {user} lacks owner permission needed to transfer items to {target}" + "lackingItemTransferPermission": "User {user} lacks owner permission needed to transfer items to {target}", + "cannotAlterArmorEffectChanges": "You cannot alter the changes length of an armor effect", + "cannotAlterArmorEffectType": "You cannot alter the type of armor effect changes", + "cannotAlterArmorEffectKey": "You cannot alter they key of armor effect changes" + }, + "Progress": { + "migrationLabel": "Performing system migration. Please wait and do not close Foundry." }, "Sidebar": { "actorDirectory": { diff --git a/module/applications/dialogs/damageReductionDialog.mjs b/module/applications/dialogs/damageReductionDialog.mjs index cd0a5cf7..31e4f72d 100644 --- a/module/applications/dialogs/damageReductionDialog.mjs +++ b/module/applications/dialogs/damageReductionDialog.mjs @@ -10,7 +10,8 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap this.reject = reject; this.actor = actor; this.damage = damage; - this.damageType = damageType; + // this.damageType = damageType; + this.damageType = ['physical']; this.rulesDefault = game.settings.get( CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation @@ -20,14 +21,25 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap this.rulesDefault ); - const canApplyArmor = damageType.every(t => actor.system.armorApplicableDamageTypes[t] === true); - const availableArmor = actor.system.armorScore - actor.system.armor.system.marks.value; - const maxArmorMarks = canApplyArmor ? availableArmor : 0; + const allArmorEffects = Array.from(actor.allApplicableEffects()).filter(x => x.type === 'armor'); + const orderedArmorEffects = game.system.api.data.activeEffects.ArmorEffect.orderEffectsForAutoChange( + allArmorEffects, + true + ); + const armor = orderedArmorEffects.reduce((acc, effect) => { + if (effect.type !== 'armor') return acc; + const { value, max } = effect.system.armorData; + acc.push({ + effect: effect, + marks: [...Array(max).keys()].reduce((acc, _, index) => { + const spent = index < value; + acc[foundry.utils.randomID()] = { selected: false, disabled: spent, spent }; + return acc; + }, {}) + }); - const armor = [...Array(maxArmorMarks).keys()].reduce((acc, _) => { - acc[foundry.utils.randomID()] = { selected: false }; return acc; - }, {}); + }, []); const stress = [...Array(actor.system.rules.damageReduction.maxArmorMarked.stressExtra ?? 0).keys()].reduce( (acc, _) => { acc[foundry.utils.randomID()] = { selected: false }; @@ -121,13 +133,11 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap context.thresholdImmunities = Object.keys(this.thresholdImmunities).length > 0 ? this.thresholdImmunities : null; - const { selectedArmorMarks, selectedStressMarks, stressReductions, currentMarks, currentDamage } = + const { selectedStressMarks, stressReductions, currentMarks, currentDamage, maxArmorUsed, availableArmor } = this.getDamageInfo(); - context.armorScore = this.actor.system.armorScore; + context.armorScore = this.actor.system.armorScore.max; context.armorMarks = currentMarks; - context.basicMarksUsed = - selectedArmorMarks.length === this.actor.system.rules.damageReduction.maxArmorMarked.value; const stressReductionStress = this.availableStressReductions ? stressReductions.reduce((acc, red) => acc + red.cost, 0) @@ -141,16 +151,27 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } : null; - const maxArmor = this.actor.system.rules.damageReduction.maxArmorMarked.value; - context.marks = { - armor: Object.keys(this.marks.armor).reduce((acc, key, index) => { - const mark = this.marks.armor[key]; - if (!this.rulesOn || index + 1 <= maxArmor) acc[key] = mark; + context.maxArmorUsed = maxArmorUsed; + context.availableArmor = availableArmor; + context.basicMarksUsed = availableArmor === 0 || selectedStressMarks.length; - return acc; - }, {}), + const armorSources = []; + for (const source of this.marks.armor) { + const parent = source.effect.origin + ? await foundry.utils.fromUuid(source.effect.origin) + : source.effect.parent; + armorSources.push({ + label: parent.name, + uuid: source.effect.uuid, + marks: source.marks + }); + } + context.marks = { + armor: armorSources, stress: this.marks.stress }; + + context.usesStressArmor = Object.keys(context.marks.stress).length; context.availableStressReductions = this.availableStressReductions; context.damage = getDamageLabel(this.damage); @@ -167,27 +188,31 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } getDamageInfo = () => { - const selectedArmorMarks = Object.values(this.marks.armor).filter(x => x.selected); + const selectedArmorMarks = this.marks.armor.flatMap(x => Object.values(x.marks).filter(x => x.selected)); const selectedStressMarks = Object.values(this.marks.stress).filter(x => x.selected); const stressReductions = this.availableStressReductions ? Object.values(this.availableStressReductions).filter(red => red.selected) : []; - const currentMarks = - this.actor.system.armor.system.marks.value + selectedArmorMarks.length + selectedStressMarks.length; + const currentMarks = this.actor.system.armorScore.value + selectedArmorMarks.length; + + const maxArmorUsed = this.actor.system.rules.damageReduction.maxArmorMarked.value + selectedStressMarks.length; + const availableArmor = + maxArmorUsed - + this.marks.armor.reduce((acc, source) => { + acc += Object.values(source.marks).filter(x => x.selected).length; + return acc; + }, 0); const armorMarkReduction = selectedArmorMarks.length * this.actor.system.rules.damageReduction.increasePerArmorMark; - let currentDamage = Math.max( - this.damage - armorMarkReduction - selectedStressMarks.length - stressReductions.length, - 0 - ); + let currentDamage = Math.max(this.damage - armorMarkReduction - stressReductions.length, 0); if (this.reduceSeverity) { currentDamage = Math.max(currentDamage - this.reduceSeverity, 0); } if (this.thresholdImmunities[currentDamage]) currentDamage = 0; - return { selectedArmorMarks, selectedStressMarks, stressReductions, currentMarks, currentDamage }; + return { selectedStressMarks, stressReductions, currentMarks, currentDamage, maxArmorUsed, availableArmor }; }; static toggleRules() { @@ -209,8 +234,8 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } static setMarks(_, target) { - const currentMark = this.marks[target.dataset.type][target.dataset.key]; - const { selectedStressMarks, stressReductions, currentMarks, currentDamage } = this.getDamageInfo(); + const currentMark = foundry.utils.getProperty(this.marks, target.dataset.path); + const { selectedStressMarks, stressReductions, currentDamage, availableArmor } = this.getDamageInfo(); if (!currentMark.selected && currentDamage === 0) { ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.damageAlreadyNone')); @@ -218,12 +243,18 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } if (this.rulesOn) { - if (!currentMark.selected && currentMarks === this.actor.system.armorScore) { + if (target.dataset.type === 'armor' && !currentMark.selected && !availableArmor) { ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noAvailableArmorMarks')); return; } } + const stressUsed = selectedStressMarks.length; + if (target.dataset.type === 'armor' && stressUsed) { + const updateResult = this.updateStressArmor(target.dataset.id, !currentMark.selected); + if (updateResult === false) return; + } + if (currentMark.selected) { const currentDamageLabel = getDamageLabel(currentDamage); for (let reduction of stressReductions) { @@ -232,8 +263,16 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } } - if (target.dataset.type === 'armor' && selectedStressMarks.length > 0) { - selectedStressMarks.forEach(mark => (mark.selected = false)); + if (target.dataset.type === 'stress' && currentMark.armorMarkId) { + for (const source of this.marks.armor) { + const match = Object.keys(source.marks).find(key => key === currentMark.armorMarkId); + if (match) { + source.marks[match].selected = false; + break; + } + } + + currentMark.armorMarkId = null; } } @@ -241,6 +280,25 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap this.render(); } + updateStressArmor(armorMarkId, select) { + let stressMarkKey = null; + if (select) { + stressMarkKey = Object.keys(this.marks.stress).find( + key => this.marks.stress[key].selected && !this.marks.stress[key].armorMarkId + ); + } else { + stressMarkKey = Object.keys(this.marks.stress).find( + key => this.marks.stress[key].armorMarkId === armorMarkId + ); + if (!stressMarkKey) + stressMarkKey = Object.keys(this.marks.stress).find(key => this.marks.stress[key].selected); + } + + if (!stressMarkKey) return false; + + this.marks.stress[stressMarkKey].armorMarkId = select ? armorMarkId : null; + } + static useStressReduction(_, target) { const damageValue = Number(target.dataset.reduction); const stressReduction = this.availableStressReductions[damageValue]; @@ -279,11 +337,19 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap } static async takeDamage() { - const { selectedArmorMarks, selectedStressMarks, stressReductions, currentDamage } = this.getDamageInfo(); - const armorSpent = selectedArmorMarks.length + selectedStressMarks.length; - const stressSpent = selectedStressMarks.length + stressReductions.reduce((acc, red) => acc + red.cost, 0); + const { selectedStressMarks, stressReductions, currentDamage } = this.getDamageInfo(); + const armorChanges = this.marks.armor.reduce((acc, source) => { + const amount = Object.values(source.marks).filter(x => x.selected).length; + if (!amount) return acc; - this.resolve({ modifiedDamage: currentDamage, armorSpent, stressSpent }); + acc.push({ uuid: source.effect.uuid, amount }); + return acc; + }, []); + const stressSpent = + selectedStressMarks.filter(x => x.armorMarkId).length + + stressReductions.reduce((acc, red) => acc + red.cost, 0); + + this.resolve({ modifiedDamage: currentDamage, armorChanges, stressSpent }); await this.close(true); } diff --git a/module/applications/sheets-configs/_module.mjs b/module/applications/sheets-configs/_module.mjs index d3fb3c39..8b09dc29 100644 --- a/module/applications/sheets-configs/_module.mjs +++ b/module/applications/sheets-configs/_module.mjs @@ -6,6 +6,7 @@ export { default as CompanionSettings } from './companion-settings.mjs'; export { default as SettingActiveEffectConfig } from './setting-active-effect-config.mjs'; export { default as SettingFeatureConfig } from './setting-feature-config.mjs'; export { default as EnvironmentSettings } from './environment-settings.mjs'; +export { default as ArmorActiveEffectConfig } from './armorActiveEffectConfig.mjs'; export { default as ActiveEffectConfig } from './activeEffectConfig.mjs'; export { default as DhTokenConfig } from './token-config.mjs'; export { default as DhPrototypeTokenConfig } from './prototype-token-config.mjs'; diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index 0dbc377a..e75e16ab 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -24,9 +24,12 @@ export default class DHActionConfig extends DHActionBaseConfig { const effectData = this._addEffectData.bind(this)(); const data = this.action.toObject(); - const [created] = await this.action.item.createEmbeddedDocuments('ActiveEffect', [effectData], { + const created = await game.system.api.documents.DhActiveEffect.createDialog(effectData, { + parent: this.action.item, render: false }); + if (!created) return; + data.effects.push({ _id: created._id }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.action.item.effects.get(created._id).sheet.render(true); diff --git a/module/applications/sheets-configs/armorActiveEffectConfig.mjs b/module/applications/sheets-configs/armorActiveEffectConfig.mjs new file mode 100644 index 00000000..3dca8ef1 --- /dev/null +++ b/module/applications/sheets-configs/armorActiveEffectConfig.mjs @@ -0,0 +1,67 @@ +const { HandlebarsApplicationMixin, DocumentSheetV2 } = foundry.applications.api; + +export default class ArmorActiveEffectConfig extends HandlebarsApplicationMixin(DocumentSheetV2) { + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'sheet', 'dh-style', 'active-effect-config', 'armor-effect-config'], + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + }, + position: { width: 560 }, + actions: { + finish: ArmorActiveEffectConfig.#finish + } + }; + + static PARTS = { + header: { template: 'systems/daggerheart/templates/sheets/activeEffect/header.hbs' }, + tabs: { template: 'templates/generic/tab-navigation.hbs' }, + details: { template: 'systems/daggerheart/templates/sheets/activeEffect/armor/details.hbs' }, + settings: { template: 'systems/daggerheart/templates/sheets/activeEffect/armor/settings.hbs' }, + footer: { template: 'systems/daggerheart/templates/sheets/activeEffect/armor/footer.hbs' } + }; + + static TABS = { + sheet: { + tabs: [ + { id: 'details', icon: 'fa-solid fa-book' }, + { id: 'settings', icon: 'fa-solid fa-bars', label: 'DAGGERHEART.GENERAL.Tabs.settings' } + ], + initial: 'details', + labelPrefix: 'EFFECT.TABS' + } + }; + + async _prepareContext(options) { + const context = await super._prepareContext(options); + context.systemFields = context.document.system.schema.fields; + + return context; + } + + /** @inheritDoc */ + async _preparePartContext(partId, context) { + const partContext = await super._preparePartContext(partId, context); + if (partId in partContext.tabs) partContext.tab = partContext.tabs[partId]; + + switch (partId) { + case 'details': + partContext.isActorEffect = this.document.parent?.documentName === 'Actor'; + partContext.isItemEffect = this.document.parent?.documentName === 'Item'; + break; + } + + return partContext; + } + + static async updateForm(_event, _form, formData) { + await this.document.update(formData.object); + this.render(); + } + + static #finish() { + this.close(); + } +} diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 4ecaeb06..b9b6a123 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -34,7 +34,8 @@ export default class CharacterSheet extends DHBaseActorSheet { advanceResourceDie: CharacterSheet.#advanceResourceDie, cancelBeastform: CharacterSheet.#cancelBeastform, useDowntime: this.useDowntime, - viewParty: CharacterSheet.#viewParty + viewParty: CharacterSheet.#viewParty, + toggleArmorMangement: CharacterSheet.#toggleArmorManagement }, window: { resizable: true, @@ -629,12 +630,12 @@ export default class CharacterSheet extends DHBaseActorSheet { } async updateArmorMarks(event) { - const armor = this.document.system.armor; - if (!armor) return; + const inputValue = Number(event.currentTarget.value); + const { value, max } = this.document.system.armorScore; + const changeValue = Math.min(inputValue - value, max - value); - const maxMarks = this.document.system.armorScore; - const value = Math.min(Math.max(Number(event.currentTarget.value), 0), maxMarks); - await armor.update({ 'system.marks.value': value }); + event.currentTarget.value = inputValue < 0 ? 0 : value + changeValue; + this.document.system.updateArmorValue({ value: changeValue }); } /* -------------------------------------------- */ @@ -813,10 +814,13 @@ export default class CharacterSheet extends DHBaseActorSheet { * Toggles ArmorScore resource value. * @type {ApplicationClickAction} */ - static async #toggleArmor(_, button, element) { - const ArmorValue = Number.parseInt(button.dataset.value); - const newValue = this.document.system.armor.system.marks.value >= ArmorValue ? ArmorValue - 1 : ArmorValue; - await this.document.system.armor.update({ 'system.marks.value': newValue }); + static async #toggleArmor(_, button, _element) { + const { value, max } = this.document.system.armorScore; + const inputValue = Number.parseInt(button.dataset.value); + const newValue = value >= inputValue ? inputValue - 1 : inputValue; + const changeValue = Math.min(newValue - value, max - value); + + this.document.system.updateArmorValue({ value: changeValue }); } /** @@ -942,6 +946,117 @@ export default class CharacterSheet extends DHBaseActorSheet { }); } + static async #toggleArmorManagement(_event, target) { + const existingTooltip = document.body.querySelector('.locked-tooltip .armor-management-container'); + if (existingTooltip) { + game.tooltip.dismissLockedTooltips(); + return; + } + + const armorSources = []; + for (var effect of Array.from(this.document.allApplicableEffects())) { + const origin = effect.origin ? await foundry.utils.fromUuid(effect.origin) : effect.parent; + if (effect.type !== 'armor' || effect.disabled || effect.isSuppressed) continue; + armorSources.push({ + uuid: effect.uuid, + name: origin.name, + ...effect.system.armorData + }); + } + + if (armorSources.length <= 1) return; + + const useResourcePips = game.settings.get( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.appearance + ).useResourcePips; + const html = document.createElement('div'); + html.innerHTML = await foundry.applications.handlebars.renderTemplate( + `systems/daggerheart/templates/ui/tooltip/armorManagement.hbs`, + { + sources: armorSources, + useResourcePips + } + ); + + game.tooltip.dismissLockedTooltips(); + game.tooltip.activate(target, { + html, + locked: true, + cssClass: 'bordered-tooltip', + direction: 'DOWN' + }); + + html.querySelectorAll('.armor-marks-input').forEach(element => { + element.addEventListener('blur', CharacterSheet.armorSourceUpdate); + element.addEventListener('input', CharacterSheet.armorSourceInput); + }); + + html.querySelectorAll('.armor-slot').forEach(element => { + element.addEventListener('click', CharacterSheet.armorSourcePipUpdate); + }); + } + + static async armorSourceInput(event) { + const effect = await foundry.utils.fromUuid(event.target.dataset.uuid); + const value = Math.max(Math.min(Number.parseInt(event.target.value), effect.system.armorData.max), 0); + event.target.value = value; + const progressBar = event.target.closest('.status-bar.armor-slots').querySelector('progress'); + progressBar.value = value; + } + + /** Update specific armor source */ + static async armorSourceUpdate(event) { + const effect = await foundry.utils.fromUuid(event.target.dataset.uuid); + if (effect.system.changes.length !== 1) return; + const value = Math.max(Math.min(Number.parseInt(event.target.value), effect.system.armorData.max), 0); + + const newChanges = [ + { + ...effect.system.changes[0], + value + } + ]; + + event.target.value = value; + const progressBar = event.target.closest('.status-bar.armor-slots').querySelector('progress'); + progressBar.value = value; + + await effect.update({ 'system.changes': newChanges }); + } + + static async armorSourcePipUpdate(event) { + const target = event.target.closest('.armor-slot'); + const effect = await foundry.utils.fromUuid(target.dataset.uuid); + if (effect.system.changes.length !== 1) return; + const { value, max } = effect.system.armorData; + + const inputValue = Number.parseInt(target.dataset.value); + const decreasing = value >= inputValue; + const newValue = decreasing ? inputValue - 1 : inputValue; + + const newChanges = [ + { + ...effect.system.changes[0], + value: newValue + } + ]; + + const container = target.closest('.slot-bar'); + for (const armorSlot of container.querySelectorAll('.armor-slot i')) { + const index = Number.parseInt(armorSlot.dataset.index); + if (decreasing && index >= newValue) { + armorSlot.classList.remove('fa-shield'); + armorSlot.classList.add('fa-shield-halved'); + } else if (!decreasing && index < newValue) { + armorSlot.classList.add('fa-shield'); + armorSlot.classList.remove('fa-shield-halved'); + } + } + + await effect.update({ 'system.changes': newChanges }); + } + /** * Open the downtime application. * @type {ApplicationClickAction} diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index eb53f073..2217a231 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -712,17 +712,23 @@ export default function DHApplicationMixin(Base) { const cls = type === 'action' ? game.system.api.models.actions.actionsTypes.base : getDocumentClass(documentClass); + const data = { name: cls.defaultName({ type, parent }), type, system: systemData }; + if (inVault) data['system.inVault'] = true; if (disabled) data.disabled = true; if (type === 'domainCard' && parent?.system.domains?.length) { data.system.domain = parent.system.domains[0]; } + if (documentClass === 'ActiveEffect') { + return cls.createDialog(data, { parent: this.document }); + } + const doc = await cls.create(data, { parent, renderSheet: !event.shiftKey }); if (parentIsItem && type === 'feature') { await this.document.update({ diff --git a/module/applications/sheets/api/base-actor.mjs b/module/applications/sheets/api/base-actor.mjs index 6f994faf..4b0fd7d9 100644 --- a/module/applications/sheets/api/base-actor.mjs +++ b/module/applications/sheets/api/base-actor.mjs @@ -160,7 +160,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) { inactives: [] }; - for (const effect of this.actor.allApplicableEffects()) { + for (const effect of this.actor.allApplicableEffects({ noTransferArmor: true })) { const list = effect.active ? context.effects.actives : context.effects.inactives; list.push(effect); } diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index 2550b415..4c69c822 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -34,6 +34,13 @@ export default class ArmorSheet extends ItemAttachmentSheet(DHBaseItemSheet) { ...super.PARTS }; + _attachPartListeners(partId, htmlElement, options) { + super._attachPartListeners(partId, htmlElement, options); + + for (const element of htmlElement.querySelectorAll('.base-score-input')) + element.addEventListener('change', this.updateArmorEffect.bind(this)); + } + /**@inheritdoc */ async _preparePartContext(partId, context) { await super._preparePartContext(partId, context); @@ -41,12 +48,26 @@ export default class ArmorSheet extends ItemAttachmentSheet(DHBaseItemSheet) { switch (partId) { case 'settings': context.features = this.document.system.armorFeatures.map(x => x.value); + context.armorScore = this.document.system.armorData.max; + break; + case 'effects': + context.effects.actives = context.effects.actives.filter(x => x.type !== 'armor'); + context.effects.inactives = context.effects.actives.filter(x => x.type !== 'armor'); break; } return context; } + async updateArmorEffect(event) { + const value = Number.parseInt(event.target.value); + const armorEffect = this.document.system.armorEffect; + if (Number.isNaN(value) || !armorEffect) return; + + await armorEffect.system.updateArmorMax(value); + this.render(); + } + /** * Callback function used by `tagifyElement`. * @param {Array} selectedOptions - The currently selected tag objects. diff --git a/module/applications/ui/_module.mjs b/module/applications/ui/_module.mjs index 8c5c020e..80d3ebe4 100644 --- a/module/applications/ui/_module.mjs +++ b/module/applications/ui/_module.mjs @@ -7,3 +7,4 @@ export { default as DhFearTracker } from './fearTracker.mjs'; export { default as DhHotbar } from './hotbar.mjs'; export { default as DhSceneNavigation } from './sceneNavigation.mjs'; export { ItemBrowser } from './itemBrowser.mjs'; +export { default as DhProgress } from './progress.mjs'; diff --git a/module/applications/ui/progress.mjs b/module/applications/ui/progress.mjs new file mode 100644 index 00000000..2fb1b445 --- /dev/null +++ b/module/applications/ui/progress.mjs @@ -0,0 +1,27 @@ +export default class DhProgress { + #notification; + + constructor({ max, label = '' }) { + this.max = max; + this.label = label; + this.#notification = ui.notifications.info(this.label, { progress: true }); + } + + updateMax(newMax) { + this.max = newMax; + } + + advance({ by = 1, label = this.label } = {}) { + if (this.value === this.max) return; + this.value = (this.value ?? 0) + Math.abs(by); + this.#notification.update({ message: label, pct: this.value / this.max }); + } + + close({ label = '' } = {}) { + this.#notification.update({ message: label, pct: 1 }); + } + + static createMigrationProgress(max = 0) { + return new DhProgress({ max, label: game.i18n.localize('DAGGERHEART.UI.Progress.migrationLabel') }); + } +} diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 8ec7034a..ea72132c 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -855,6 +855,11 @@ export const sceneRangeMeasurementSetting = { }; export const activeEffectModes = { + armor: { + id: 'armor', + priority: 20, + label: 'TYPES.ActiveEffect.armor' + }, custom: { id: 'custom', priority: 0, @@ -887,6 +892,12 @@ export const activeEffectModes = { } }; +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' } +}; + export const activeEffectDurations = { temporary: { id: 'temporary', diff --git a/module/config/itemConfig.mjs b/module/config/itemConfig.mjs index 77328987..ad332951 100644 --- a/module/config/itemConfig.mjs +++ b/module/config/itemConfig.mjs @@ -489,17 +489,24 @@ export const weaponFeatures = { description: 'DAGGERHEART.CONFIG.WeaponFeature.barrier.effects.barrier.description', img: 'icons/skills/melee/shield-block-bash-blue.webp', changes: [ - { - key: 'system.armorScore', - mode: 2, - value: 'ITEM.@system.tier + 1' - }, { key: 'system.evasion', mode: 2, value: '-1' } ] + }, + { + type: 'armor', + name: 'DAGGERHEART.CONFIG.WeaponFeature.barrier.effects.barrier.name', + description: 'DAGGERHEART.CONFIG.WeaponFeature.barrier.effects.barrier.description', + img: 'icons/skills/melee/shield-block-bash-blue.webp', + changes: [ + { + type: 'armor', + max: 'ITEM.@system.tier + 1' + } + ] } ] }, @@ -789,11 +796,6 @@ export const weaponFeatures = { description: 'DAGGERHEART.CONFIG.WeaponFeature.doubleDuty.effects.doubleDuty.description', img: 'icons/skills/melee/sword-shield-stylized-white.webp', changes: [ - { - key: 'system.armorScore', - mode: 2, - value: '1' - }, { key: 'system.bonuses.damage.primaryWeapon.bonus', mode: 2, @@ -808,6 +810,26 @@ export const weaponFeatures = { type: 'withinRange' } } + }, + { + type: 'armor', + name: 'DAGGERHEART.CONFIG.WeaponFeature.doubleDuty.effects.doubleDuty.name', + description: 'DAGGERHEART.CONFIG.WeaponFeature.doubleDuty.effects.doubleDuty.description', + img: 'icons/skills/melee/sword-shield-stylized-white.webp', + changes: [ + { + type: 'armor', + max: 1 + } + ], + system: { + rangeDependence: { + enabled: true, + range: 'melee', + target: 'hostile', + type: 'withinRange' + } + } } ] }, @@ -1186,14 +1208,14 @@ export const weaponFeatures = { description: 'DAGGERHEART.CONFIG.WeaponFeature.protective.description', effects: [ { + type: 'armor', name: 'DAGGERHEART.CONFIG.WeaponFeature.protective.effects.protective.name', description: 'DAGGERHEART.CONFIG.WeaponFeature.protective.effects.protective.description', img: 'icons/skills/melee/shield-block-gray-orange.webp', changes: [ { - key: 'system.armorScore', - mode: 2, - value: 'ITEM.@system.tier' + type: 'armor', + max: 'ITEM.@system.tier' } ] } diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index f6ffe75f..23d30cb2 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -295,17 +295,19 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel static async getEffects(actor, effectParent) { if (!actor) return []; - return Array.from(await actor.allApplicableEffects()).filter(effect => { - /* Effects on weapons only ever apply for the weapon itself */ - if (effect.parent.type === 'weapon') { - /* Unless they're secondary - then they apply only to other primary weapons */ - if (effect.parent.system.secondary) { - if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false; - } else if (effectParent?.id !== effect.parent.id) return false; - } + return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).filter( + effect => { + /* Effects on weapons only ever apply for the weapon itself */ + if (effect.parent.type === 'weapon') { + /* Unless they're secondary - then they apply only to other primary weapons */ + if (effect.parent.system.secondary) { + if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false; + } else if (effectParent?.id !== effect.parent.id) return false; + } - return !effect.isSuppressed; - }); + return !effect.isSuppressed; + } + ); } /** diff --git a/module/data/activeEffect/_module.mjs b/module/data/activeEffect/_module.mjs index 1a50088a..62f10e3e 100644 --- a/module/data/activeEffect/_module.mjs +++ b/module/data/activeEffect/_module.mjs @@ -1,11 +1,17 @@ import BaseEffect from './baseEffect.mjs'; import BeastformEffect from './beastformEffect.mjs'; import HordeEffect from './hordeEffect.mjs'; +import ArmorEffect from './armorEffect.mjs'; -export { BaseEffect, BeastformEffect, HordeEffect }; +export { BaseEffect, BeastformEffect, HordeEffect, ArmorEffect }; export const config = { base: BaseEffect, beastform: BeastformEffect, - horde: HordeEffect + horde: HordeEffect, + armor: ArmorEffect +}; + +export const changeTypes = { + armor: ArmorEffect.armorChangeEffect }; diff --git a/module/data/activeEffect/armorEffect.mjs b/module/data/activeEffect/armorEffect.mjs new file mode 100644 index 00000000..894bf3ff --- /dev/null +++ b/module/data/activeEffect/armorEffect.mjs @@ -0,0 +1,244 @@ +import { getScrollTextData, itemAbleRollParse } from '../../helpers/utils.mjs'; + +/** + * ArmorEffects are ActiveEffects that have a static changes field of length 1. It includes current and maximum armor. + * When applied to a character, it adds to their currently marked and maximum armor. + */ +export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel { + static defineSchema() { + const fields = foundry.data.fields; + + return { + ...super.defineSchema(), + changes: new fields.ArrayField( + new fields.SchemaField({ + key: new fields.StringField({ + required: true, + nullable: false, + initial: 'system.armorScore' + }), + type: new fields.StringField({ + required: true, + blank: false, + initial: CONFIG.DH.GENERAL.activeEffectModes.armor.id, + validate: ArmorEffect.#validateType + }), + phase: new fields.StringField({ required: true, blank: false, initial: 'initial' }), + priority: new fields.NumberField({ integer: true, initial: 20 }), + value: new fields.NumberField({ + required: true, + integer: true, + initial: 0, + min: 0, + label: 'DAGGERHEART.GENERAL.value' + }), + max: new fields.StringField({ + required: true, + nullable: false, + initial: '1', + label: 'DAGGERHEART.GENERAL.max' + }) + }), + { + initial: [ + { + key: 'system.armorScore', + type: CONFIG.DH.GENERAL.activeEffectModes.armor.id, + phase: 'initial', + priority: 20, + value: 0, + max: '1' + } + ] + } + ), + 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 */ + + /** + * Validate that an {@link EffectChangeData#type} string is well-formed. + * @param {string} type The string to be validated + * @returns {true} + * @throws {Error} An error if the type string is malformed + */ + static #validateType(type) { + if (type !== CONFIG.DH.GENERAL.activeEffectModes.armor.id) + throw new Error('An armor effect must have change.type "armor"'); + + return true; + } + + static armorChangeEffect = { + label: 'Armor', + defaultPriortiy: 20, + handler: (actor, change, _options, _field, replacementData) => { + game.system.api.documents.DhActiveEffect.applyChange( + actor, + { + ...change, + key: 'system.armorScore.value', + type: CONFIG.DH.GENERAL.activeEffectModes.add.id, + value: change.value + }, + replacementData + ); + game.system.api.documents.DhActiveEffect.applyChange( + actor, + { + ...change, + key: 'system.armorScore.max', + type: CONFIG.DH.GENERAL.activeEffectModes.add.id, + value: change.max + }, + replacementData + ); + return {}; + }, + render: null + }; + + /* Helpers */ + + get armorChange() { + if (this.changes.length !== 1) + throw new Error('Unexpected error. An armor effect should have a changes field of length 1.'); + + const actor = this.parent.actor?.type === 'character' ? this.parent.actor : null; + const changeData = this.changes[0]; + const maxParse = actor ? itemAbleRollParse(changeData.max, actor, this.parent.parent) : null; + const maxRoll = maxParse ? new Roll(maxParse).evaluateSync() : null; + const maxEvaluated = maxRoll ? (maxRoll.isDeterministic ? maxRoll.total : null) : null; + + return { + ...changeData, + max: maxEvaluated ?? changeData.max + }; + } + + get armorData() { + return { value: this.armorChange.value, max: this.armorChange.max }; + } + + async updateArmorMax(newMax) { + const { effect, ...baseChange } = this.armorChange; + const newChanges = [ + { + ...baseChange, + max: newMax, + value: Math.min(this.armorChange.value, newMax) + } + ]; + await this.parent.update({ 'system.changes': newChanges }); + } + + static orderEffectsForAutoChange(armorEffects, increasing) { + const getEffectWeight = effect => { + switch (effect.parent.type) { + case 'class': + case 'subclass': + case 'ancestry': + case 'community': + case 'feature': + case 'domainCard': + return 2; + case 'armor': + return 3; + case 'loot': + case 'consumable': + return 4; + case 'weapon': + return 5; + case 'character': + return 6; + default: + return 1; + } + }; + + return armorEffects + .filter(x => !x.disabled && !x.isSuppressed) + .sort((a, b) => + increasing ? getEffectWeight(b) - getEffectWeight(a) : getEffectWeight(a) - getEffectWeight(b) + ); + } + + /* Overrides */ + + static getDefaultObject() { + return { + key: 'system.armorScore', + type: 'armor', + name: game.i18n.localize('DAGGERHEART.EFFECTS.Armor.newArmorEffect'), + img: 'icons/equipment/chest/breastplate-helmet-metal.webp' + }; + } + + async _preUpdate(changes, options, user) { + const allowed = await super._preUpdate(changes, options, user); + if (allowed === false) return false; + + if (changes.system?.changes) { + const changesChanged = changes.system.changes.length !== this.changes.length; + if (changesChanged) { + ui.notifications.error( + game.i18n.localize('DAGGERHEART.UI.Notifications.cannotAlterArmorEffectChanges') + ); + return false; + } + + if (changes.system.changes.length === 1) { + if (changes.system.changes[0].type !== CONFIG.DH.GENERAL.activeEffectModes.armor.id) { + ui.notifications.error( + game.i18n.localize('DAGGERHEART.UI.Notifications.cannotAlterArmorEffectType') + ); + return false; + } + + if (changes.system.changes[0].key !== 'system.armorScore') { + ui.notifications.error( + game.i18n.localize('DAGGERHEART.UI.Notifications.cannotAlterArmorEffectKey') + ); + return false; + } + + if ( + changes.system.changes[0].value !== this.armorChange.value && + this.parent.actor?.type === 'character' + ) { + const increased = changes.system.changes[0].value > this.armorChange.value; + const value = -1 * (this.armorChange.value - changes.system.changes[0].value); + options.scrollingTextData = [getScrollTextData(increased, value, 'armor')]; + } + } + } + } + + _onUpdate(changes, options, userId) { + super._onUpdate(changes, options, userId); + + if (options.scrollingTextData && this.parent.actor?.type === 'character') + this.parent.actor.queueScrollText(options.scrollingTextData); + } +} diff --git a/module/data/actor/base.mjs b/module/data/actor/base.mjs index 3b4de08d..14bc4fe8 100644 --- a/module/data/actor/base.mjs +++ b/module/data/actor/base.mjs @@ -1,6 +1,6 @@ import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs'; import DHItem from '../../documents/item.mjs'; -import { getScrollTextData } from '../../helpers/utils.mjs'; +import { getResourceScrollTextData } from '../../helpers/utils.mjs'; const fields = foundry.data.fields; @@ -211,7 +211,7 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel { const textData = Object.keys(changes.system.resources).reduce((acc, key) => { const resource = changes.system.resources[key]; if (resource.value !== undefined && resource.value !== this.resources[key].value) { - acc.push(getScrollTextData(this.resources, resource, key)); + acc.push(getResourceScrollTextData(this.resources, resource, key)); } return acc; diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 10fba63c..bebc40cf 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -63,7 +63,20 @@ export default class DhCharacter extends DhCreature { label: 'DAGGERHEART.GENERAL.proficiency' }), evasion: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.evasion' }), - armorScore: new fields.NumberField({ integer: true, initial: 0, label: 'DAGGERHEART.GENERAL.armorScore' }), + armorScore: new fields.SchemaField({ + value: new fields.NumberField({ + integer: true, + initial: 0, + min: 0, + label: 'DAGGERHEART.GENERAL.armorScore' + }), + max: new fields.NumberField({ + integer: true, + initial: 0, + min: 0, + label: 'DAGGERHEART.GENERAL.armorScore' + }) + }), damageThresholds: new fields.SchemaField({ severe: new fields.NumberField({ integer: true, @@ -487,6 +500,70 @@ export default class DhCharacter extends DhCreature { } } + async updateArmorValue({ value: armorChange = 0, clear = false }) { + if (armorChange === 0 && !clear) return; + + const increasing = armorChange >= 0; + let remainingChange = Math.abs(armorChange); + const armorEffects = Array.from(this.parent.allApplicableEffects()).filter(x => x.type === 'armor'); + const orderedEffects = game.system.api.data.activeEffects.ArmorEffect.orderEffectsForAutoChange( + armorEffects, + increasing + ); + + const embeddedUpdates = []; + for (const armorEffect of orderedEffects) { + let usedArmorChange = 0; + if (clear) { + usedArmorChange -= armorEffect.system.armorChange.value; + } else { + if (increasing) { + const remainingArmor = armorEffect.system.armorChange.max - armorEffect.system.armorChange.value; + usedArmorChange = Math.min(remainingChange, remainingArmor); + remainingChange -= usedArmorChange; + } else { + const changeChange = Math.min(armorEffect.system.armorChange.value, remainingChange); + usedArmorChange -= changeChange; + remainingChange -= changeChange; + } + } + + if (!usedArmorChange) continue; + else { + if (!embeddedUpdates[armorEffect.parent.id]) + embeddedUpdates[armorEffect.parent.id] = { doc: armorEffect.parent, updates: [] }; + + embeddedUpdates[armorEffect.parent.id].updates.push({ + '_id': armorEffect.id, + 'system.changes': [ + { + ...armorEffect.system.armorChange, + value: armorEffect.system.armorChange.value + usedArmorChange + } + ] + }); + } + + if (remainingChange === 0 && !clear) break; + } + + const updateValues = Object.values(embeddedUpdates); + for (const [index, { doc, updates }] of updateValues.entries()) + doc.updateEmbeddedDocuments('ActiveEffect', updates, { render: index === updateValues.length - 1 }); + } + + async updateArmorEffectValue({ uuid, value }) { + const effect = await foundry.utils.fromUuid(uuid); + await effect.update({ + 'system.changes': [ + { + ...effect.system.armorChange, + value: effect.system.armorChange.value + value + } + ] + }); + } + get sheetLists() { const ancestryFeatures = [], communityFeatures = [], @@ -658,14 +735,12 @@ export default class DhCharacter extends DhCreature { } } - const armor = this.armor; - this.armorScore = armor ? armor.system.baseScore : 0; this.damageThresholds = { - major: armor - ? armor.system.baseThresholds.major + this.levelData.level.current + major: this.armor + ? this.armor.system.baseThresholds.major + this.levelData.level.current : this.levelData.level.current, - severe: armor - ? armor.system.baseThresholds.severe + this.levelData.level.current + severe: this.armor + ? this.armor.system.baseThresholds.severe + this.levelData.level.current : this.levelData.level.current * 2 }; @@ -699,8 +774,7 @@ export default class DhCharacter extends DhCreature { this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait; this.resources.armor = { - value: this.armor?.system?.marks?.value ?? 0, - max: this.armorScore, + ...this.armorScore, isReversed: true }; diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs index 264d7f93..76f05859 100644 --- a/module/data/item/armor.mjs +++ b/module/data/item/armor.mjs @@ -19,7 +19,6 @@ export default class DHArmor extends AttachableItem { ...super.defineSchema(), tier: new fields.NumberField({ required: true, integer: true, initial: 1, min: 1 }), equipped: new fields.BooleanField({ initial: false }), - baseScore: new fields.NumberField({ integer: true, initial: 0 }), armorFeatures: new fields.ArrayField( new fields.SchemaField({ value: new fields.StringField({ @@ -52,6 +51,17 @@ export default class DHArmor extends AttachableItem { ); } + get armorEffect() { + return this.parent.effects.find(x => x.type === 'armor'); + } + + get armorData() { + const armorEffect = this.armorEffect; + if (!armorEffect) return { value: 0, max: 0 }; + + return armorEffect.system.armorData; + } + /**@inheritdoc */ async getDescriptionData() { const baseDescription = this.description; @@ -66,6 +76,17 @@ export default class DHArmor extends AttachableItem { return { prefix, value: baseDescription, suffix: null }; } + /**@inheritdoc */ + async _onCreate(_data, _options, userId) { + if (userId !== game.user.id) return; + + if (!this.parent.effects.some(x => x.type === 'armor')) { + this.parent.createEmbeddedDocuments('ActiveEffect', [ + game.system.api.data.activeEffects.ArmorEffect.getDefaultObject() + ]); + } + } + /**@inheritdoc */ async _preUpdate(changes, options, user) { const allowed = await super._preUpdate(changes, options, user); @@ -151,13 +172,22 @@ export default class DHArmor extends AttachableItem { } } + /** @inheritDoc */ + static migrateDocumentData(source) { + if (source.system.baseScore !== undefined && !source.effects.some(x => x.type === 'armor')) { + if (!source.flags) source.flags = {}; + if (!source.flags.daggerheart) source.flags.daggerheart = {}; + source.flags.daggerheart.baseScoreMigrationValue = source.system.baseScore; + } + } + /** * Generates a list of localized tags based on this item's type-specific properties. * @returns {string[]} An array of localized tag strings. */ _getTags() { const tags = [ - `${game.i18n.localize('DAGGERHEART.ITEMS.Armor.baseScore')}: ${this.baseScore}`, + `${game.i18n.localize('DAGGERHEART.ITEMS.Armor.baseScore')}: ${this.armorData.max}`, `${game.i18n.localize('DAGGERHEART.ITEMS.Armor.baseThresholds.base')}: ${this.baseThresholds.major} / ${this.baseThresholds.severe}` ]; @@ -169,9 +199,7 @@ export default class DHArmor extends AttachableItem { * @returns {(string | { value: string, icons: string[] })[]} An array of localized strings and damage label objects. */ _getLabels() { - const labels = []; - if (this.baseScore) - labels.push(`${game.i18n.localize('DAGGERHEART.ITEMS.Armor.baseScore')}: ${this.baseScore}`); + const labels = [`${game.i18n.localize('DAGGERHEART.ITEMS.Armor.baseScore')}: ${this.armorData.max}`]; return labels; } diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 447da3bf..334b0c5e 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -8,7 +8,7 @@ * @property {boolean} isInventoryItem- Indicates whether items of this type is a Inventory Item */ -import { addLinkedItemsDiff, getScrollTextData, updateLinkedItemApps } from '../../helpers/utils.mjs'; +import { addLinkedItemsDiff, getResourceScrollTextData, updateLinkedItemApps } from '../../helpers/utils.mjs'; import { ActionsField } from '../fields/actionField.mjs'; import FormulaField from '../fields/formulaField.mjs'; @@ -224,7 +224,11 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { const armorChanged = changed.system?.marks?.value !== undefined && changed.system.marks.value !== this.marks.value; if (armorChanged && autoSettings.resourceScrollTexts && this.parent.parent?.type === 'character') { - const armorData = getScrollTextData(this.parent.parent.system.resources, changed.system.marks, 'armor'); + const armorData = getResourceScrollTextData( + this.parent.parent.system.resources, + changed.system.marks, + 'armor' + ); options.scrollingTextData = [armorData]; } diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index f8b19a3a..0fa84255 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -8,6 +8,8 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { /**@override */ get isSuppressed() { + if (this.system.isSuppressed === true) return true; + // If this is a copied effect from an attachment, never suppress it // (These effects have attachmentSource metadata) if (this.flags?.daggerheart?.attachmentSource) { @@ -15,7 +17,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { } // Then apply the standard suppression rules - if (['weapon', 'armor'].includes(this.parent?.type)) { + if (['weapon', 'armor'].includes(this.parent?.type) && this.transfer) { return !this.parent.system.equipped; } @@ -76,7 +78,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { throw new Error('The array of sub-types to restrict to must not be empty.'); } - const creatableEffects = ['base']; + const creatableEffects = types || ['base', 'armor']; const documentTypes = this.TYPES.filter(type => creatableEffects.includes(type)).map(type => { const labelKey = `TYPES.ActiveEffect.${type}`; const label = game.i18n.has(labelKey) ? game.i18n.localize(labelKey) : type; @@ -153,6 +155,11 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { /* Methods */ /* -------------------------------------------- */ + /**@inheritdoc */ + static applyChange(actor, change, options) { + super.applyChange(actor, change, options); + } + /**@inheritdoc*/ static applyChangeField(model, change, field) { change.value = Number.isNumeric(change.value) @@ -161,9 +168,9 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { super.applyChangeField(model, change, field); } - _applyLegacy(actor, change, changes) { + _applyChangeUnguided(actor, change, changes, options) { change.value = DhActiveEffect.getChangeValue(actor, change, change.effect); - super._applyLegacy(actor, change, changes); + super._applyChangeUnguided(actor, change, changes, options); } static getChangeValue(model, change, effect) { diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index f0538bff..7326995f 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -573,8 +573,7 @@ export default class DhpActor extends Actor { const availableStress = this.system.resources.stress.max - this.system.resources.stress.value; const canUseArmor = - this.system.armor && - this.system.armor.system.marks.value < this.system.armorScore && + this.system.armorScore.value < this.system.armorScore.max && type.every(t => this.system.armorApplicableDamageTypes[t] === true); const canUseStress = Object.keys(stressDamageReduction).reduce((acc, x) => { const rule = stressDamageReduction[x]; @@ -614,12 +613,7 @@ export default class DhpActor extends Actor { const hpDamage = updates.find(u => u.key === CONFIG.DH.GENERAL.healingTypes.hitPoints.id); if (hpDamage?.value) { hpDamage.value = this.convertDamageToThreshold(hpDamage.value); - if ( - this.type === 'character' && - !isDirect && - this.system.armor && - this.#canReduceDamage(hpDamage.value, hpDamage.damageTypes) - ) { + if (this.type === 'character' && !isDirect && this.#canReduceDamage(hpDamage.value, hpDamage.damageTypes)) { const armorSlotResult = await this.owner.query( 'armorSlot', { @@ -632,12 +626,10 @@ export default class DhpActor extends Actor { } ); if (armorSlotResult) { - const { modifiedDamage, armorSpent, stressSpent } = armorSlotResult; + const { modifiedDamage, armorChanges, stressSpent } = armorSlotResult; updates.find(u => u.key === 'hitPoints').value = modifiedDamage; - if (armorSpent) { - const armorUpdate = updates.find(u => u.key === 'armor'); - if (armorUpdate) armorUpdate.value += armorSpent; - else updates.push({ value: armorSpent, key: 'armor' }); + for (const armorChange of armorChanges) { + updates.push({ value: armorChange.amount, key: 'armor', uuid: armorChange.uuid }); } if (stressSpent) { const stressUpdate = updates.find(u => u.key === 'stress'); @@ -784,12 +776,8 @@ export default class DhpActor extends Actor { ); break; case 'armor': - if (this.system.armor?.system?.marks) { - updates.armor.resources['system.marks.value'] = Math.max( - Math.min(valueFunc(this.system.armor.system.marks, r), this.system.armorScore), - 0 - ); - } + if (!r.uuid) this.system.updateArmorValue(r); + else this.system.updateArmorEffectValue(r); break; default: if (this.system.resources?.[r.key]) { @@ -1005,4 +993,20 @@ export default class DhpActor extends Actor { return allTokens; } + + /**@inheritdoc */ + *allApplicableEffects({ noSelfArmor, noTransferArmor } = {}) { + for (const effect of this.effects) { + if (!noSelfArmor || effect.type !== 'armor') yield effect; + } + for (const item of this.items) { + for (const effect of item.effects) { + if (effect.transfer && (!noTransferArmor || effect.type !== 'armor')) yield effect; + } + } + } + + applyActiveEffects(phase) { + super.applyActiveEffects(phase); + } } diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 67f7d253..56048a81 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -230,4 +230,14 @@ export default class DHItem extends foundry.documents.Item { async _preDelete() { this.deleteTriggers(); } + + /** @inheritDoc */ + static migrateData(source) { + const documentClass = game.system.api.data.items[`DH${source.type?.capitalize()}`]; + if (documentClass?.migrateDocumentData) { + documentClass.migrateDocumentData(source); + } + + return super.migrateData(source); + } } diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 7e4d794b..bc8d0f88 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -378,14 +378,18 @@ export const arraysEqual = (a, b) => export const setsEqual = (a, b) => a.size === b.size && [...a].every(value => b.has(value)); -export function getScrollTextData(resources, resource, key) { - const { reversed, label } = CONFIG.DH.ACTOR.scrollingTextResource[key]; - const { BOTTOM, TOP } = CONST.TEXT_ANCHOR_POINTS; +export function getResourceScrollTextData(resources, resource, key) { const increased = resources[key].value < resource.value; const value = -1 * (resources[key].value - resource.value); - const text = `${game.i18n.localize(label)} ${value.signedString()}`; + return getScrollTextData(increased, value, key); +} +export function getScrollTextData(increased, value, key) { + const { reversed, label } = CONFIG.DH.ACTOR.scrollingTextResource[key]; + const { BOTTOM, TOP } = CONST.TEXT_ANCHOR_POINTS; + + const text = `${game.i18n.localize(label)} ${value.signedString()}`; const stroke = increased ? (reversed ? 0xffffff : 0x000000) : reversed ? 0x000000 : 0xffffff; const fill = increased ? (reversed ? 0x0032b1 : 0xffe760) : reversed ? 0xffe760 : 0x0032b1; const direction = increased ? (reversed ? BOTTOM : TOP) : reversed ? TOP : BOTTOM; diff --git a/module/systemRegistration/migrations.mjs b/module/systemRegistration/migrations.mjs index 4216c38f..dff85fef 100644 --- a/module/systemRegistration/migrations.mjs +++ b/module/systemRegistration/migrations.mjs @@ -246,6 +246,171 @@ export async function runMigrations() { lastMigrationVersion = '1.6.0'; } + + if (foundry.utils.isNewerVersion('2.0.0', lastMigrationVersion)) { + const progress = game.system.api.applications.ui.DhProgress.createMigrationProgress(0); + const progressBuffer = 50; + + //#region Data Setup + const lockedPacks = []; + const itemPacks = game.packs.filter(x => x.metadata.type === 'Item'); + const actorPacks = game.packs.filter(x => x.metadata.type === 'Actor'); + + const getIndexes = async (packs, type) => { + const indexes = []; + for (const pack of packs) { + const indexValues = pack.index.values().reduce((acc, index) => { + if (!type || index.type === type) acc.push(index.uuid); + return acc; + }, []); + + if (indexValues.length && pack.locked) { + lockedPacks.push(pack.collection); + await pack.configure({ locked: false }); + } + + indexes.push(...indexValues); + } + + return indexes; + }; + + const itemEntries = await getIndexes(itemPacks); + const characterEntries = await getIndexes(actorPacks, 'character'); + + const worldItems = game.items; + const worldCharacters = game.actors.filter(x => x.type === 'character'); + + /* The async fetches are the mainstay of time. Leaving 1 progress for the sync logic */ + const newMax = itemEntries.length + characterEntries.length + progressBuffer; + progress.updateMax(newMax); + + const compendiumItems = []; + for (const entry of itemEntries) { + const item = await foundry.utils.fromUuid(entry); + compendiumItems.push(item); + progress.advance(); + } + + const compendiumCharacters = []; + for (const entry of characterEntries) { + const character = await foundry.utils.fromUuid(entry); + compendiumCharacters.push(character); + progress.advance(); + } + //#endregion + + /* Migrate existing effects modifying armor, creating new Armor Effects instead */ + const migrateEffects = async entity => { + const effectChangeData = []; + for (const effect of entity.effects) { + const oldArmorChanges = effect.system.changes.filter(x => x.key === 'system.armorScore'); + if (!oldArmorChanges.length) continue; + + const changeData = {}; + const newChanges = effect.system.changes.filter(x => x.key !== 'system.armorScore'); + if (newChanges.length) { + await effect.update({ 'system.changes': newChanges }); + } else { + changeData.deleteId = effect.id; + } + + const oldEffectData = effect.toObject(); + changeData.createData = { + ...oldEffectData, + type: 'armor', + system: { + ...oldEffectData.sytem, + changes: oldArmorChanges.map(change => ({ + key: 'system.armorScore', + type: CONFIG.DH.GENERAL.activeEffectModes.armor.id, + phase: 'initial', + priority: 20, + value: 0, + max: change.value + })) + } + }; + effectChangeData.push(changeData); + } + + for (const changeData of effectChangeData) { + const relatedActions = Array.from(entity.system.actions ?? []).filter(x => + x.effects.some(effect => effect._id === changeData.deleteId) + ); + const [newEffect] = await entity.createEmbeddedDocuments('ActiveEffect', [ + { + ...changeData.createData, + transfer: relatedActions.length ? false : true + } + ]); + for (const action of relatedActions) { + await action.update({ + effects: action.effects.map(effect => ({ + ...effect, + _id: effect._id === changeData.deleteId ? newEffect.id : effect._id + })) + }); + } + } + + await entity.deleteEmbeddedDocuments( + 'ActiveEffect', + effectChangeData.reduce((acc, data) => { + if (data.deleteId) acc.push(data.deleteId); + return acc; + }, []) + ); + }; + + /* Migrate existing armors to the new Armor Effects */ + const migrateItems = async items => { + for (const item of items) { + await migrateEffects(item); + + if (item instanceof game.system.api.documents.DHItem && item.type === 'armor') { + const hasArmorEffect = item.effects.some(x => x.type === 'armor'); + const migrationArmorScore = item.flags.daggerheart?.baseScoreMigrationValue; + if (migrationArmorScore !== undefined && !hasArmorEffect) { + await item.createEmbeddedDocuments('ActiveEffect', [ + { + ...game.system.api.data.activeEffects.ArmorEffect.getDefaultObject(), + changes: [ + { + key: 'system.armorScore', + type: CONFIG.DH.GENERAL.activeEffectModes.armor.id, + phase: 'initial', + priority: 20, + value: 0, + max: migrationArmorScore.toString() + } + ] + } + ]); + } + } + } + }; + + await migrateItems([...compendiumItems, ...worldItems]); + progress.advance({ by: progressBuffer / 2 }); + + for (const actor of [...compendiumCharacters, ...worldCharacters]) { + await migrateEffects(actor); + await migrateItems(actor.items); + } + + progress.advance({ by: progressBuffer / 2 }); + + for (let packId of lockedPacks) { + const pack = game.packs.get(packId); + await pack.configure({ locked: true }); + } + + progress.close(); + + lastMigrationVersion = '2.0.0'; + } //#endregion await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion); diff --git a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json index aa9910dc..096be253 100644 --- a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json +++ b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json @@ -90,36 +90,30 @@ "effects": [ { "name": "Armorer", - "type": "base", + "type": "armor", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ], + "armorInteraction": "active" }, - "_id": "cED730OjuMW5haJR", + "_id": "tJw2JIPcT9hEMRXg", "img": "icons/tools/hand/hammer-and-nail.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1", - "priority": null - } - ], "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, - "description": "

While you’re wearing armor, gain a +1 bonus to your Armor Score.

", + "description": "

While you’re wearing armor, gain a +1 bonus to your Armor Score.

", "origin": null, "tint": "#ffffff", "transfer": true, @@ -129,7 +123,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!cy8GjBPGc9w9RaGO.cED730OjuMW5haJR" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!cy8GjBPGc9w9RaGO.tJw2JIPcT9hEMRXg" } ], "ownership": { diff --git a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json index 3b1ea76a..40af13a7 100644 --- a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json +++ b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json @@ -19,7 +19,99 @@ } }, "flags": {}, - "effects": [], + "effects": [ + { + "name": "Bare Bones Armor", + "type": "armor", + "system": { + "changes": [ + { + "value": 0, + "max": "3 + @system.traits.strength.value", + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20 + } + ], + "armorInteraction": "inactive" + }, + "_id": "FCsgz7Tdsw6QUzBs", + "img": "icons/magic/control/buff-strength-muscle-damage-orange.webp", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "

You have a base Armor Score of 3 + your Strength.

", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!l5D9kq901JDESaXw.FCsgz7Tdsw6QUzBs" + }, + { + "name": "Bare Bones", + "type": "base", + "system": { + "changes": [ + { + "key": "system.damageThresholds.major", + "type": "add", + "value": "9 + (@tier - 1) * 5 + max(0, (@tier -2) * 2 )", + "priority": null, + "phase": "initial" + }, + { + "key": "system.damageThresholds.severe", + "type": "add", + "value": "19 + (@tier - 1) * 5 + max(0, (@tier -2) * 2 )", + "priority": null, + "phase": "initial" + } + ], + "rangeDependence": { + "enabled": false, + "type": "withinRange", + "target": "hostile", + "range": "melee" + } + }, + "_id": "8flPpWNoBeuFPFTK", + "img": "icons/magic/control/buff-strength-muscle-damage-orange.webp", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "

You use the following as your base damage thresholds:

", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!l5D9kq901JDESaXw.8flPpWNoBeuFPFTK" + } + ], "ownership": { "default": 0, "MQSznptE5yLT7kj8": 3 diff --git a/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json b/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json index 8c531bcd..790249be 100644 --- a/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json +++ b/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json @@ -105,7 +105,7 @@ }, "effects": [ { - "_id": "LdcT1nrkd5ORCU4n", + "_id": "ptYT10JZ2WJHvFMd", "onSave": false } ], @@ -252,8 +252,8 @@ "img": "icons/magic/defensive/shield-barrier-glowing-triangle-blue.webp", "origin": "Compendium.daggerheart.domains.Item.YtZzYBtR0yLPPA93", "transfer": false, - "_id": "LdcT1nrkd5ORCU4n", - "type": "base", + "_id": "ptYT10JZ2WJHvFMd", + "type": "armor", "system": { "rangeDependence": { "enabled": false, @@ -264,9 +264,11 @@ "changes": [ { "key": "system.armorScore", - "value": 1, - "priority": null, - "type": "add" + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" } ], "duration": { @@ -298,7 +300,7 @@ }, "showIcon": 1, "folder": null, - "_key": "!items.effects!YtZzYBtR0yLPPA93.LdcT1nrkd5ORCU4n" + "_key": "!items.effects!YtZzYBtR0yLPPA93.ptYT10JZ2WJHvFMd" } ], "ownership": { diff --git a/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json b/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json index 20fe18ea..7df5e095 100644 --- a/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json +++ b/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json @@ -91,34 +91,27 @@ "effects": [ { "name": "Valor-Touched", - "type": "base", + "type": "armor", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ] }, - "_id": "H9lgIqqp1imSNOv9", + "_id": "Ma8Zp005QYKPWIEN", "img": "icons/magic/control/control-influence-rally-purple.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1", - "priority": null - } - ], "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "description": "", "origin": null, @@ -130,7 +123,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!k1AtYd3lSchIymBr.H9lgIqqp1imSNOv9" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!k1AtYd3lSchIymBr.Ma8Zp005QYKPWIEN" } ], "ownership": { diff --git a/src/packs/items/armors/armor_Advanced_Chainmail_Armor_LzLOJ9EVaHWAjoq9.json b/src/packs/items/armors/armor_Advanced_Chainmail_Armor_LzLOJ9EVaHWAjoq9.json index 174f20c8..91b1f890 100644 --- a/src/packs/items/armors/armor_Advanced_Chainmail_Armor_LzLOJ9EVaHWAjoq9.json +++ b/src/packs/items/armors/armor_Advanced_Chainmail_Armor_LzLOJ9EVaHWAjoq9.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!LzLOJ9EVaHWAjoq9.qlzHOAnpBYzosQxK" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "YehcKtTeJ18q0THd", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!LzLOJ9EVaHWAjoq9.YehcKtTeJ18q0THd" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Advanced_Full_Plate_Armor_crIbCb9NZ4K0VpoU.json b/src/packs/items/armors/armor_Advanced_Full_Plate_Armor_crIbCb9NZ4K0VpoU.json index dbc9d29f..f1dd3086 100644 --- a/src/packs/items/armors/armor_Advanced_Full_Plate_Armor_crIbCb9NZ4K0VpoU.json +++ b/src/packs/items/armors/armor_Advanced_Full_Plate_Armor_crIbCb9NZ4K0VpoU.json @@ -68,6 +68,45 @@ "compendiumSource": null }, "_key": "!items.effects!crIbCb9NZ4K0VpoU.awdHgEaM54G3emOU" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "Xp0MlTLdCe2oP36X", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!crIbCb9NZ4K0VpoU.Xp0MlTLdCe2oP36X" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Advanced_Gambeson_Armor_epkAmlZVk7HOfUUT.json b/src/packs/items/armors/armor_Advanced_Gambeson_Armor_epkAmlZVk7HOfUUT.json index c9ffc8a3..1618fe85 100644 --- a/src/packs/items/armors/armor_Advanced_Gambeson_Armor_epkAmlZVk7HOfUUT.json +++ b/src/packs/items/armors/armor_Advanced_Gambeson_Armor_epkAmlZVk7HOfUUT.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!epkAmlZVk7HOfUUT.Fq9Q93IHCchhfSss" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "GyPhsm7zLznZDfN2", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!epkAmlZVk7HOfUUT.GyPhsm7zLznZDfN2" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Advanced_Leather_Armor_itSOp2GCyem0f7oM.json b/src/packs/items/armors/armor_Advanced_Leather_Armor_itSOp2GCyem0f7oM.json index 4e1927e3..b7a63b40 100644 --- a/src/packs/items/armors/armor_Advanced_Leather_Armor_itSOp2GCyem0f7oM.json +++ b/src/packs/items/armors/armor_Advanced_Leather_Armor_itSOp2GCyem0f7oM.json @@ -25,7 +25,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "XJueICAnl5vu2q2U", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!itSOp2GCyem0f7oM.XJueICAnl5vu2q2U" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json b/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json index 5158b100..a0b2aae3 100644 --- a/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json +++ b/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json @@ -23,34 +23,27 @@ "effects": [ { "name": "Bare Bones", - "type": "base", + "type": "armor", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "@system.traits.strength.value" + } + ] }, - "_id": "8ze88zUwdkQSKKJq", + "_id": "C7as6q5bx3S0Xxfn", "img": "icons/magic/control/buff-strength-muscle-damage.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "@system.traits.strength.value", - "priority": 21 - } - ], "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "description": "

When you choose not to equip armor, you have a base Armor Score of 3 + your Strength and use the following as your base damage thresholds:

", "origin": null, @@ -62,7 +55,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!ITAjcigTcUw5pMCN.8ze88zUwdkQSKKJq" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!ITAjcigTcUw5pMCN.C7as6q5bx3S0Xxfn" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Bellamoi_Fine_Armor_WuoVwZA53XRAIt6d.json b/src/packs/items/armors/armor_Bellamoi_Fine_Armor_WuoVwZA53XRAIt6d.json index ce4e35fd..9242aed9 100644 --- a/src/packs/items/armors/armor_Bellamoi_Fine_Armor_WuoVwZA53XRAIt6d.json +++ b/src/packs/items/armors/armor_Bellamoi_Fine_Armor_WuoVwZA53XRAIt6d.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!WuoVwZA53XRAIt6d.Hy0sNtFS1JAXxgwC" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "2OMciFns3bSETeH9", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!WuoVwZA53XRAIt6d.2OMciFns3bSETeH9" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Bladefare_Armor_mNN6pvcsS10ChrWF.json b/src/packs/items/armors/armor_Bladefare_Armor_mNN6pvcsS10ChrWF.json index 8b276d5f..cc245d50 100644 --- a/src/packs/items/armors/armor_Bladefare_Armor_mNN6pvcsS10ChrWF.json +++ b/src/packs/items/armors/armor_Bladefare_Armor_mNN6pvcsS10ChrWF.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!mNN6pvcsS10ChrWF.s8KtTIngTjnOlaTP" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "dIb9PWvzyS3jYDUj", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!mNN6pvcsS10ChrWF.dIb9PWvzyS3jYDUj" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Chainmail_Armor_haULhuEg37zUUvhb.json b/src/packs/items/armors/armor_Chainmail_Armor_haULhuEg37zUUvhb.json index f7526e96..a45cfa04 100644 --- a/src/packs/items/armors/armor_Chainmail_Armor_haULhuEg37zUUvhb.json +++ b/src/packs/items/armors/armor_Chainmail_Armor_haULhuEg37zUUvhb.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!haULhuEg37zUUvhb.ZfO5NjpqEIzZVlPq" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "hA0EcaykFiIpg4ZH", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!haULhuEg37zUUvhb.hA0EcaykFiIpg4ZH" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Channeling_Armor_vMJxEWz1srfwMsoj.json b/src/packs/items/armors/armor_Channeling_Armor_vMJxEWz1srfwMsoj.json index a4bd0fea..6f8ec29d 100644 --- a/src/packs/items/armors/armor_Channeling_Armor_vMJxEWz1srfwMsoj.json +++ b/src/packs/items/armors/armor_Channeling_Armor_vMJxEWz1srfwMsoj.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!vMJxEWz1srfwMsoj.8bwf1Ri3jYkjphEv" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "Wejd1c4e8VtnFoc4", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!vMJxEWz1srfwMsoj.Wejd1c4e8VtnFoc4" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Dragonscale_Armor_mdQ69eFHyAQUDmE7.json b/src/packs/items/armors/armor_Dragonscale_Armor_mdQ69eFHyAQUDmE7.json index 5b39e41d..335ab56f 100644 --- a/src/packs/items/armors/armor_Dragonscale_Armor_mdQ69eFHyAQUDmE7.json +++ b/src/packs/items/armors/armor_Dragonscale_Armor_mdQ69eFHyAQUDmE7.json @@ -62,7 +62,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "FgjNYkbghYSz8gwW", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!mdQ69eFHyAQUDmE7.FgjNYkbghYSz8gwW" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Dunamis_Silkchain_hAY6UgdGT7dj22Pr.json b/src/packs/items/armors/armor_Dunamis_Silkchain_hAY6UgdGT7dj22Pr.json index df692143..2a1e8c83 100644 --- a/src/packs/items/armors/armor_Dunamis_Silkchain_hAY6UgdGT7dj22Pr.json +++ b/src/packs/items/armors/armor_Dunamis_Silkchain_hAY6UgdGT7dj22Pr.json @@ -88,7 +88,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "7" + } + ] + }, + "_id": "n4wyEBHbHIuYNBzt", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!hAY6UgdGT7dj22Pr.n4wyEBHbHIuYNBzt" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Elundrian_Chain_Armor_Q6LxmtFetDDkoZVZ.json b/src/packs/items/armors/armor_Elundrian_Chain_Armor_Q6LxmtFetDDkoZVZ.json index d63ce4df..e19c363b 100644 --- a/src/packs/items/armors/armor_Elundrian_Chain_Armor_Q6LxmtFetDDkoZVZ.json +++ b/src/packs/items/armors/armor_Elundrian_Chain_Armor_Q6LxmtFetDDkoZVZ.json @@ -64,6 +64,45 @@ "compendiumSource": null }, "_key": "!items.effects!Q6LxmtFetDDkoZVZ.xGxqTCO8MjNq5Cw6" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "gZfuMqjYTYLspQop", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!Q6LxmtFetDDkoZVZ.gZfuMqjYTYLspQop" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Emberwoven_Armor_bcQUh4QG3qFX0Vx6.json b/src/packs/items/armors/armor_Emberwoven_Armor_bcQUh4QG3qFX0Vx6.json index 8ccc27e3..5be30445 100644 --- a/src/packs/items/armors/armor_Emberwoven_Armor_bcQUh4QG3qFX0Vx6.json +++ b/src/packs/items/armors/armor_Emberwoven_Armor_bcQUh4QG3qFX0Vx6.json @@ -86,7 +86,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "5t3jCX3AGiWBB4DN", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!bcQUh4QG3qFX0Vx6.5t3jCX3AGiWBB4DN" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Full_Fortified_Armor_7emTSt6nhZuTlvt5.json b/src/packs/items/armors/armor_Full_Fortified_Armor_7emTSt6nhZuTlvt5.json index 8eb964cc..52aa784b 100644 --- a/src/packs/items/armors/armor_Full_Fortified_Armor_7emTSt6nhZuTlvt5.json +++ b/src/packs/items/armors/armor_Full_Fortified_Armor_7emTSt6nhZuTlvt5.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!7emTSt6nhZuTlvt5.QIefVb73cm9gYju8" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "9jCrg3Acd75jVclW", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!7emTSt6nhZuTlvt5.9jCrg3Acd75jVclW" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Full_Plate_Armor_UdUJNa31WxFW2noa.json b/src/packs/items/armors/armor_Full_Plate_Armor_UdUJNa31WxFW2noa.json index 1ea120ed..c603305b 100644 --- a/src/packs/items/armors/armor_Full_Plate_Armor_UdUJNa31WxFW2noa.json +++ b/src/packs/items/armors/armor_Full_Plate_Armor_UdUJNa31WxFW2noa.json @@ -68,6 +68,45 @@ "compendiumSource": null }, "_key": "!items.effects!UdUJNa31WxFW2noa.mfKMW9SX3Mnos1nY" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "OmGtjOMcTHNN6OsH", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!UdUJNa31WxFW2noa.OmGtjOMcTHNN6OsH" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Gambeson_Armor_yJFp1bfpecDcStVK.json b/src/packs/items/armors/armor_Gambeson_Armor_yJFp1bfpecDcStVK.json index 1c775402..36484785 100644 --- a/src/packs/items/armors/armor_Gambeson_Armor_yJFp1bfpecDcStVK.json +++ b/src/packs/items/armors/armor_Gambeson_Armor_yJFp1bfpecDcStVK.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!yJFp1bfpecDcStVK.v1FNEsypRF5W6vVc" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "3" + } + ] + }, + "_id": "ySw8mkws8rxzxsg4", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!yJFp1bfpecDcStVK.ySw8mkws8rxzxsg4" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Harrowbone_Armor_dvyQeUVRLc9y6rnt.json b/src/packs/items/armors/armor_Harrowbone_Armor_dvyQeUVRLc9y6rnt.json index 61d1fed7..7f69317b 100644 --- a/src/packs/items/armors/armor_Harrowbone_Armor_dvyQeUVRLc9y6rnt.json +++ b/src/packs/items/armors/armor_Harrowbone_Armor_dvyQeUVRLc9y6rnt.json @@ -79,7 +79,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "nyoNusMuukJt1MJw", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!dvyQeUVRLc9y6rnt.nyoNusMuukJt1MJw" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Improved_Chainmail_Armor_K5WkjS0NGqHYmhU3.json b/src/packs/items/armors/armor_Improved_Chainmail_Armor_K5WkjS0NGqHYmhU3.json index 96e320d1..dd674a8b 100644 --- a/src/packs/items/armors/armor_Improved_Chainmail_Armor_K5WkjS0NGqHYmhU3.json +++ b/src/packs/items/armors/armor_Improved_Chainmail_Armor_K5WkjS0NGqHYmhU3.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!K5WkjS0NGqHYmhU3.JHupzYULxdQzFzuj" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "7FdWcilv74zKcXWk", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!K5WkjS0NGqHYmhU3.7FdWcilv74zKcXWk" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Improved_Full_Plate_Armor_9f7RozpPTqrzJS1m.json b/src/packs/items/armors/armor_Improved_Full_Plate_Armor_9f7RozpPTqrzJS1m.json index ee63a774..00b2afa9 100644 --- a/src/packs/items/armors/armor_Improved_Full_Plate_Armor_9f7RozpPTqrzJS1m.json +++ b/src/packs/items/armors/armor_Improved_Full_Plate_Armor_9f7RozpPTqrzJS1m.json @@ -68,6 +68,45 @@ "compendiumSource": null }, "_key": "!items.effects!9f7RozpPTqrzJS1m.wstJ1aKKtmXgCwxB" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "qgA4nbITVOp2WTpl", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!9f7RozpPTqrzJS1m.qgA4nbITVOp2WTpl" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Improved_Gambeson_Armor_jphnMZjnS2FkOH3s.json b/src/packs/items/armors/armor_Improved_Gambeson_Armor_jphnMZjnS2FkOH3s.json index 6f4ea1c3..3e2a52ba 100644 --- a/src/packs/items/armors/armor_Improved_Gambeson_Armor_jphnMZjnS2FkOH3s.json +++ b/src/packs/items/armors/armor_Improved_Gambeson_Armor_jphnMZjnS2FkOH3s.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!jphnMZjnS2FkOH3s.BFwU3ErPaajUSMUz" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "dtkOq7rUKj5nLGJP", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!jphnMZjnS2FkOH3s.dtkOq7rUKj5nLGJP" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Improved_Leather_Armor_t91M61pSCMKStTNt.json b/src/packs/items/armors/armor_Improved_Leather_Armor_t91M61pSCMKStTNt.json index a4f38cc6..7dfe14e7 100644 --- a/src/packs/items/armors/armor_Improved_Leather_Armor_t91M61pSCMKStTNt.json +++ b/src/packs/items/armors/armor_Improved_Leather_Armor_t91M61pSCMKStTNt.json @@ -25,7 +25,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "JqnUKeUDbH4YJbVb", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!t91M61pSCMKStTNt.JqnUKeUDbH4YJbVb" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Irontree_Breastplate_Armor_tzZntboNtHL5C6VM.json b/src/packs/items/armors/armor_Irontree_Breastplate_Armor_tzZntboNtHL5C6VM.json index a9e9eaca..8b978654 100644 --- a/src/packs/items/armors/armor_Irontree_Breastplate_Armor_tzZntboNtHL5C6VM.json +++ b/src/packs/items/armors/armor_Irontree_Breastplate_Armor_tzZntboNtHL5C6VM.json @@ -75,6 +75,45 @@ "compendiumSource": null }, "_key": "!items.effects!tzZntboNtHL5C6VM.P3aCN8PQgPXP4C9M" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "6Mh24zh1c3aK60wZ", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!tzZntboNtHL5C6VM.6Mh24zh1c3aK60wZ" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Leather_Armor_nibfdNtp2PtxvbVz.json b/src/packs/items/armors/armor_Leather_Armor_nibfdNtp2PtxvbVz.json index 37a13f2b..1b3cae95 100644 --- a/src/packs/items/armors/armor_Leather_Armor_nibfdNtp2PtxvbVz.json +++ b/src/packs/items/armors/armor_Leather_Armor_nibfdNtp2PtxvbVz.json @@ -25,7 +25,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "3" + } + ] + }, + "_id": "2enPnnikOoG0oIZP", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!nibfdNtp2PtxvbVz.2enPnnikOoG0oIZP" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Legendary_Chainmail_Armor_EsIN5OLKe9ZYFNXZ.json b/src/packs/items/armors/armor_Legendary_Chainmail_Armor_EsIN5OLKe9ZYFNXZ.json index 4bee5e4f..fd3d1f9f 100644 --- a/src/packs/items/armors/armor_Legendary_Chainmail_Armor_EsIN5OLKe9ZYFNXZ.json +++ b/src/packs/items/armors/armor_Legendary_Chainmail_Armor_EsIN5OLKe9ZYFNXZ.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!EsIN5OLKe9ZYFNXZ.8Oa6Y375X8UpcPph" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "7" + } + ] + }, + "_id": "kqNdkD1d4FOQloMV", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!EsIN5OLKe9ZYFNXZ.kqNdkD1d4FOQloMV" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Legendary_Full_Plate_Armor_SXWjUR2aUR6bYvdl.json b/src/packs/items/armors/armor_Legendary_Full_Plate_Armor_SXWjUR2aUR6bYvdl.json index baf544c2..a32a6be5 100644 --- a/src/packs/items/armors/armor_Legendary_Full_Plate_Armor_SXWjUR2aUR6bYvdl.json +++ b/src/packs/items/armors/armor_Legendary_Full_Plate_Armor_SXWjUR2aUR6bYvdl.json @@ -68,6 +68,45 @@ "compendiumSource": null }, "_key": "!items.effects!SXWjUR2aUR6bYvdl.zvzkRX2Uevemmbz4" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "7" + } + ] + }, + "_id": "kFxM3Et2bPzghJWm", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!SXWjUR2aUR6bYvdl.kFxM3Et2bPzghJWm" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Legendary_Gambeson_Armor_c6tMXz4rPf9ioQrf.json b/src/packs/items/armors/armor_Legendary_Gambeson_Armor_c6tMXz4rPf9ioQrf.json index 338c85e8..85fdb01b 100644 --- a/src/packs/items/armors/armor_Legendary_Gambeson_Armor_c6tMXz4rPf9ioQrf.json +++ b/src/packs/items/armors/armor_Legendary_Gambeson_Armor_c6tMXz4rPf9ioQrf.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!c6tMXz4rPf9ioQrf.3AUNxBoj7mp1ziJQ" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "jdD0dJoh8gdGdh6W", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!c6tMXz4rPf9ioQrf.jdD0dJoh8gdGdh6W" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Legendary_Leather_Armor_Tptgl5WOj76TyFn7.json b/src/packs/items/armors/armor_Legendary_Leather_Armor_Tptgl5WOj76TyFn7.json index 42334dc4..7019a908 100644 --- a/src/packs/items/armors/armor_Legendary_Leather_Armor_Tptgl5WOj76TyFn7.json +++ b/src/packs/items/armors/armor_Legendary_Leather_Armor_Tptgl5WOj76TyFn7.json @@ -25,7 +25,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "gP4PsefQLSTcBAQm", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!Tptgl5WOj76TyFn7.gP4PsefQLSTcBAQm" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Monett_s_Cloak_AQzU2RsqS5V5bd1v.json b/src/packs/items/armors/armor_Monett_s_Cloak_AQzU2RsqS5V5bd1v.json index 9a8e1f22..464d6505 100644 --- a/src/packs/items/armors/armor_Monett_s_Cloak_AQzU2RsqS5V5bd1v.json +++ b/src/packs/items/armors/armor_Monett_s_Cloak_AQzU2RsqS5V5bd1v.json @@ -63,6 +63,45 @@ "compendiumSource": null }, "_key": "!items.effects!AQzU2RsqS5V5bd1v.3n4O7PyAWMEFdr5p" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "xMJr6Zj9zZd7v5uD", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!AQzU2RsqS5V5bd1v.xMJr6Zj9zZd7v5uD" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Rosewild_Armor_tN8kAeBvNKM3EBFo.json b/src/packs/items/armors/armor_Rosewild_Armor_tN8kAeBvNKM3EBFo.json index 0f0f6430..172e100b 100644 --- a/src/packs/items/armors/armor_Rosewild_Armor_tN8kAeBvNKM3EBFo.json +++ b/src/packs/items/armors/armor_Rosewild_Armor_tN8kAeBvNKM3EBFo.json @@ -55,7 +55,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "ebhSsuWrFYUVkGXC", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!tN8kAeBvNKM3EBFo.ebhSsuWrFYUVkGXC" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Runes_of_Fortification_P4qAEDJUoNLgVRsA.json b/src/packs/items/armors/armor_Runes_of_Fortification_P4qAEDJUoNLgVRsA.json index 240a4f3e..66a88157 100644 --- a/src/packs/items/armors/armor_Runes_of_Fortification_P4qAEDJUoNLgVRsA.json +++ b/src/packs/items/armors/armor_Runes_of_Fortification_P4qAEDJUoNLgVRsA.json @@ -62,7 +62,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "pw8CD3IFNqb7530v", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!P4qAEDJUoNLgVRsA.pw8CD3IFNqb7530v" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Runetan_Floating_Armor_tHlBUDQC24YMZqd6.json b/src/packs/items/armors/armor_Runetan_Floating_Armor_tHlBUDQC24YMZqd6.json index 8d4af425..3039c375 100644 --- a/src/packs/items/armors/armor_Runetan_Floating_Armor_tHlBUDQC24YMZqd6.json +++ b/src/packs/items/armors/armor_Runetan_Floating_Armor_tHlBUDQC24YMZqd6.json @@ -62,7 +62,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "4" + } + ] + }, + "_id": "Y4ZSoO0iGxLiNr80", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!tHlBUDQC24YMZqd6.Y4ZSoO0iGxLiNr80" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Savior_Chainmail_8X16lJQ3xltTwynm.json b/src/packs/items/armors/armor_Savior_Chainmail_8X16lJQ3xltTwynm.json index 714e8592..739f15d9 100644 --- a/src/packs/items/armors/armor_Savior_Chainmail_8X16lJQ3xltTwynm.json +++ b/src/packs/items/armors/armor_Savior_Chainmail_8X16lJQ3xltTwynm.json @@ -93,6 +93,45 @@ "compendiumSource": null }, "_key": "!items.effects!8X16lJQ3xltTwynm.rkrqlwqtR9REgRx7" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "8" + } + ] + }, + "_id": "vNGSiFtcEBCz6jFQ", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!8X16lJQ3xltTwynm.vNGSiFtcEBCz6jFQ" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Spiked_Plate_Armor_QjwsIhXKqnlvRBMv.json b/src/packs/items/armors/armor_Spiked_Plate_Armor_QjwsIhXKqnlvRBMv.json index cb5fc720..b8b12bc3 100644 --- a/src/packs/items/armors/armor_Spiked_Plate_Armor_QjwsIhXKqnlvRBMv.json +++ b/src/packs/items/armors/armor_Spiked_Plate_Armor_QjwsIhXKqnlvRBMv.json @@ -68,6 +68,45 @@ "compendiumSource": null }, "_key": "!items.effects!QjwsIhXKqnlvRBMv.V8CcTcVAIxHq8KNd" + }, + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "jfcv9NL2RtlfpECz", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!QjwsIhXKqnlvRBMv.jfcv9NL2RtlfpECz" } ], "sort": 0, diff --git a/src/packs/items/armors/armor_Tyris_Soft_Armor_PSW3BxCGmtLeWOxM.json b/src/packs/items/armors/armor_Tyris_Soft_Armor_PSW3BxCGmtLeWOxM.json index da640830..8be5ce42 100644 --- a/src/packs/items/armors/armor_Tyris_Soft_Armor_PSW3BxCGmtLeWOxM.json +++ b/src/packs/items/armors/armor_Tyris_Soft_Armor_PSW3BxCGmtLeWOxM.json @@ -55,7 +55,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "5" + } + ] + }, + "_id": "E8iCCJSpPbCMostx", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!PSW3BxCGmtLeWOxM.E8iCCJSpPbCMostx" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/armors/armor_Veritas_Opal_Armor_OvzgUTYy2RCN85vV.json b/src/packs/items/armors/armor_Veritas_Opal_Armor_OvzgUTYy2RCN85vV.json index 08a1b573..301c1d25 100644 --- a/src/packs/items/armors/armor_Veritas_Opal_Armor_OvzgUTYy2RCN85vV.json +++ b/src/packs/items/armors/armor_Veritas_Opal_Armor_OvzgUTYy2RCN85vV.json @@ -55,7 +55,47 @@ "artist": "" } }, - "effects": [], + "effects": [ + { + "type": "armor", + "name": "Armor Effect", + "img": "icons/equipment/chest/breastplate-helmet-metal.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "6" + } + ] + }, + "_id": "avGWSRMFFLbdJaYC", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!OvzgUTYy2RCN85vV.avGWSRMFFLbdJaYC" + } + ], "sort": 0, "ownership": { "default": 0, diff --git a/src/packs/items/weapons/weapon_Advanced_Round_Shield_hiEOGF2reabGLUoi.json b/src/packs/items/weapons/weapon_Advanced_Round_Shield_hiEOGF2reabGLUoi.json index c1c4fba5..549df4d8 100644 --- a/src/packs/items/weapons/weapon_Advanced_Round_Shield_hiEOGF2reabGLUoi.json +++ b/src/packs/items/weapons/weapon_Advanced_Round_Shield_hiEOGF2reabGLUoi.json @@ -113,26 +113,26 @@ "name": "Protective", "description": "

Add the item's Tier to your Armor Score

", "img": "icons/skills/melee/shield-block-gray-orange.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier", - "priority": null - } - ], - "_id": "i5HfkF5aKQuUCTEG", - "type": "base", - "system": {}, + "_id": "7285CRGdZfHCEtT2", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier" + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -143,7 +143,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!hiEOGF2reabGLUoi.i5HfkF5aKQuUCTEG" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!hiEOGF2reabGLUoi.7285CRGdZfHCEtT2" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Advanced_Tower_Shield_OfOzQbs4hg6QbfTG.json b/src/packs/items/weapons/weapon_Advanced_Tower_Shield_OfOzQbs4hg6QbfTG.json index b2fb16d8..96ac78cb 100644 --- a/src/packs/items/weapons/weapon_Advanced_Tower_Shield_OfOzQbs4hg6QbfTG.json +++ b/src/packs/items/weapons/weapon_Advanced_Tower_Shield_OfOzQbs4hg6QbfTG.json @@ -113,25 +113,25 @@ "name": "Barrier", "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", "img": "icons/skills/melee/shield-block-bash-blue.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier + 1" - }, - { - "key": "system.evasion", - "mode": 2, - "value": "-1" - } - ], "_id": "87gedjJZGdFY81Mt", "type": "base", - "system": {}, + "system": { + "changes": [ + { + "key": "system.evasion", + "type": "add", + "value": -1, + "phase": "initial", + "priority": 0 + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -142,7 +142,49 @@ "_stats": { "compendiumSource": null }, + "start": null, + "showIcon": 1, + "folder": null, "_key": "!items.effects!OfOzQbs4hg6QbfTG.87gedjJZGdFY81Mt" + }, + { + "name": "Barrier", + "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", + "img": "icons/skills/melee/shield-block-bash-blue.webp", + "_id": "J0f7zqqOr61ADpdy", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier + 1" + } + ] + }, + "disabled": false, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!OfOzQbs4hg6QbfTG.J0f7zqqOr61ADpdy" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Improved_Round_Shield_DlinEBGZfIlvreO3.json b/src/packs/items/weapons/weapon_Improved_Round_Shield_DlinEBGZfIlvreO3.json index 53a8e9b6..fcd3caed 100644 --- a/src/packs/items/weapons/weapon_Improved_Round_Shield_DlinEBGZfIlvreO3.json +++ b/src/packs/items/weapons/weapon_Improved_Round_Shield_DlinEBGZfIlvreO3.json @@ -113,26 +113,26 @@ "name": "Protective", "description": "

Add the item's Tier to your Armor Score

", "img": "icons/skills/melee/shield-block-gray-orange.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier", - "priority": null - } - ], - "_id": "cXWSV50apzaNQkdA", - "type": "base", - "system": {}, + "_id": "pZCrWd7zLTarvEQK", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier" + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -143,7 +143,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!DlinEBGZfIlvreO3.cXWSV50apzaNQkdA" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!DlinEBGZfIlvreO3.pZCrWd7zLTarvEQK" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Improved_Tower_Shield_bxt3NsbMqTSdI5ab.json b/src/packs/items/weapons/weapon_Improved_Tower_Shield_bxt3NsbMqTSdI5ab.json index 839d4352..b1b4279f 100644 --- a/src/packs/items/weapons/weapon_Improved_Tower_Shield_bxt3NsbMqTSdI5ab.json +++ b/src/packs/items/weapons/weapon_Improved_Tower_Shield_bxt3NsbMqTSdI5ab.json @@ -113,25 +113,25 @@ "name": "Barrier", "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", "img": "icons/skills/melee/shield-block-bash-blue.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier + 1" - }, - { - "key": "system.evasion", - "mode": 2, - "value": "-1" - } - ], "_id": "tkNEA1PO3jEFhKCa", "type": "base", - "system": {}, + "system": { + "changes": [ + { + "key": "system.evasion", + "type": "add", + "value": -1, + "phase": "initial", + "priority": 0 + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -142,7 +142,49 @@ "_stats": { "compendiumSource": null }, + "start": null, + "showIcon": 1, + "folder": null, "_key": "!items.effects!bxt3NsbMqTSdI5ab.tkNEA1PO3jEFhKCa" + }, + { + "name": "Barrier", + "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", + "img": "icons/skills/melee/shield-block-bash-blue.webp", + "_id": "XugJeHJdnC6IymSa", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier + 1" + } + ] + }, + "disabled": false, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!bxt3NsbMqTSdI5ab.XugJeHJdnC6IymSa" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json b/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json index 4958bbe5..2272926c 100644 --- a/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json +++ b/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json @@ -113,20 +113,26 @@ "name": "Protective", "description": "Add your character's Tier to your Armor Score", "img": "icons/skills/melee/shield-block-gray-orange.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier" - } - ], - "_id": "qTxADRsQnKiYfOiQ", - "type": "base", - "system": {}, + "_id": "vnR4Zhnb0rOqwrFw", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier" + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -137,7 +143,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!ijWppQzSOqVCb3rE.qTxADRsQnKiYfOiQ" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!ijWppQzSOqVCb3rE.vnR4Zhnb0rOqwrFw" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Legendary_Round_Shield_A28WL9E2lJ3iLZHW.json b/src/packs/items/weapons/weapon_Legendary_Round_Shield_A28WL9E2lJ3iLZHW.json index c7b18355..81045ea3 100644 --- a/src/packs/items/weapons/weapon_Legendary_Round_Shield_A28WL9E2lJ3iLZHW.json +++ b/src/packs/items/weapons/weapon_Legendary_Round_Shield_A28WL9E2lJ3iLZHW.json @@ -113,26 +113,26 @@ "name": "Protective", "description": "

Add the item's Tier to your Armor Score

", "img": "icons/skills/melee/shield-block-gray-orange.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier", - "priority": null - } - ], - "_id": "Z2p00q5h6x6seXys", - "type": "base", - "system": {}, + "_id": "EixxJrRHyc6kj3Wg", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier" + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -143,7 +143,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!A28WL9E2lJ3iLZHW.Z2p00q5h6x6seXys" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!A28WL9E2lJ3iLZHW.EixxJrRHyc6kj3Wg" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Legendary_Tower_Shield_MaJIROht7A9LxIZx.json b/src/packs/items/weapons/weapon_Legendary_Tower_Shield_MaJIROht7A9LxIZx.json index 47e707d3..6ae5d720 100644 --- a/src/packs/items/weapons/weapon_Legendary_Tower_Shield_MaJIROht7A9LxIZx.json +++ b/src/packs/items/weapons/weapon_Legendary_Tower_Shield_MaJIROht7A9LxIZx.json @@ -113,25 +113,25 @@ "name": "Barrier", "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", "img": "icons/skills/melee/shield-block-bash-blue.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier + 1" - }, - { - "key": "system.evasion", - "mode": 2, - "value": "-1" - } - ], "_id": "lBJMzxdGO2nJdTQS", "type": "base", - "system": {}, + "system": { + "changes": [ + { + "key": "system.evasion", + "type": "add", + "value": -1, + "phase": "initial", + "priority": 0 + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -142,7 +142,49 @@ "_stats": { "compendiumSource": null }, + "start": null, + "showIcon": 1, + "folder": null, "_key": "!items.effects!MaJIROht7A9LxIZx.lBJMzxdGO2nJdTQS" + }, + { + "name": "Barrier", + "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", + "img": "icons/skills/melee/shield-block-bash-blue.webp", + "_id": "1fgUIaXl6VQrhP7j", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier + 1" + } + ] + }, + "disabled": false, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!MaJIROht7A9LxIZx.1fgUIaXl6VQrhP7j" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Round_Shield_mxwWKDujgsRcZWPT.json b/src/packs/items/weapons/weapon_Round_Shield_mxwWKDujgsRcZWPT.json index 47b096af..d16c550c 100644 --- a/src/packs/items/weapons/weapon_Round_Shield_mxwWKDujgsRcZWPT.json +++ b/src/packs/items/weapons/weapon_Round_Shield_mxwWKDujgsRcZWPT.json @@ -113,26 +113,26 @@ "name": "Protective", "description": "

Add the item's Tier to your Armor Score

", "img": "icons/skills/melee/shield-block-gray-orange.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier", - "priority": null - } - ], - "_id": "M70a81e0Mg66jHRL", - "type": "base", - "system": {}, + "_id": "eV4lFIpQMiKERj4U", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier" + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -143,7 +143,10 @@ "_stats": { "compendiumSource": null }, - "_key": "!items.effects!mxwWKDujgsRcZWPT.M70a81e0Mg66jHRL" + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!mxwWKDujgsRcZWPT.eV4lFIpQMiKERj4U" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Spiked_Shield_vzyzFwLUniWZV1rt.json b/src/packs/items/weapons/weapon_Spiked_Shield_vzyzFwLUniWZV1rt.json index edadecf9..40e451bd 100644 --- a/src/packs/items/weapons/weapon_Spiked_Shield_vzyzFwLUniWZV1rt.json +++ b/src/packs/items/weapons/weapon_Spiked_Shield_vzyzFwLUniWZV1rt.json @@ -113,32 +113,31 @@ "name": "Double Duty", "description": "+1 to Armor Score; +1 to primary weapon damage within Melee range", "img": "icons/skills/melee/sword-shield-stylized-white.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1" - }, - { - "key": "system.bonuses.damage.primaryWeapon.bonus", - "mode": 2, - "value": "1" - } - ], "system": { "rangeDependence": { "enabled": true, "range": "melee", "target": "hostile", "type": "withinRange" - } + }, + "changes": [ + { + "key": "system.bonuses.damage.primaryWeapon.bonus", + "type": "add", + "value": 1, + "phase": "initial", + "priority": 0 + } + ] }, "_id": "d3TJtlpoHBCztbom", "type": "base", "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -149,7 +148,49 @@ "_stats": { "compendiumSource": null }, + "start": null, + "showIcon": 1, + "folder": null, "_key": "!items.effects!vzyzFwLUniWZV1rt.d3TJtlpoHBCztbom" + }, + { + "name": "Double Duty", + "description": "+1 to Armor Score; +1 to primary weapon damage within Melee range", + "img": "icons/skills/melee/sword-shield-stylized-white.webp", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ] + }, + "_id": "mvUY9LGfwICak7cE", + "type": "armor", + "disabled": false, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!vzyzFwLUniWZV1rt.mvUY9LGfwICak7cE" } ], "sort": 0, diff --git a/src/packs/items/weapons/weapon_Tower_Shield_C9aWpK1shVMWP4m5.json b/src/packs/items/weapons/weapon_Tower_Shield_C9aWpK1shVMWP4m5.json index d49b7de7..9e3e9968 100644 --- a/src/packs/items/weapons/weapon_Tower_Shield_C9aWpK1shVMWP4m5.json +++ b/src/packs/items/weapons/weapon_Tower_Shield_C9aWpK1shVMWP4m5.json @@ -113,25 +113,25 @@ "name": "Barrier", "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", "img": "icons/skills/melee/shield-block-bash-blue.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "ITEM.@system.tier + 1" - }, - { - "key": "system.evasion", - "mode": 2, - "value": "-1" - } - ], "_id": "8r0TcKWXboFV0eqS", "type": "base", - "system": {}, + "system": { + "changes": [ + { + "key": "system.evasion", + "type": "add", + "value": -1, + "phase": "initial", + "priority": 0 + } + ] + }, "disabled": false, "duration": { - "startTime": null, - "combat": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, "origin": null, "tint": "#ffffff", @@ -142,7 +142,49 @@ "_stats": { "compendiumSource": null }, + "start": null, + "showIcon": 1, + "folder": null, "_key": "!items.effects!C9aWpK1shVMWP4m5.8r0TcKWXboFV0eqS" + }, + { + "name": "Barrier", + "description": "Gain Weapon Tier + 1 to Armor Score; -1 to Evasion", + "img": "icons/skills/melee/shield-block-bash-blue.webp", + "_id": "tLRc4UAnGuIq7er3", + "type": "armor", + "system": { + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "ITEM.@system.tier + 1" + } + ] + }, + "disabled": false, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "start": null, + "showIcon": 1, + "folder": null, + "_key": "!items.effects!C9aWpK1shVMWP4m5.tLRc4UAnGuIq7er3" } ], "sort": 0, diff --git a/styles/less/dialog/damage-reduction/damage-reduction-container.less b/styles/less/dialog/damage-reduction/damage-reduction-container.less index 2f343fb3..e8242bdd 100644 --- a/styles/less/dialog/damage-reduction/damage-reduction-container.less +++ b/styles/less/dialog/damage-reduction/damage-reduction-container.less @@ -35,7 +35,10 @@ display: flex; flex-direction: column; align-items: center; - width: 100%; + + &.full-width { + width: 100%; + } } .padded { @@ -45,6 +48,7 @@ .armor-title { margin: 0; white-space: nowrap; + width: 100%; } .resources-container { @@ -62,12 +66,17 @@ .mark-selection { display: flex; - align-items: center; + flex-direction: column; width: 100%; margin: 0; + h4 { + margin: 0; + } + .mark-selection-inner { display: flex; + justify-content: center; gap: 8px; .mark-container { @@ -91,6 +100,19 @@ opacity: 0.2; } + &.spent { + ::after { + position: absolute; + content: '/'; + color: red; + font-weight: 700; + font-size: 1.8em; + left: -1px; + top: -7px; + rotate: 13deg; + } + } + .fa-shield { position: relative; right: 0.5px; diff --git a/styles/less/sheets/activeEffects/armorEffects.less b/styles/less/sheets/activeEffects/armorEffects.less new file mode 100644 index 00000000..fd5c89b1 --- /dev/null +++ b/styles/less/sheets/activeEffects/armorEffects.less @@ -0,0 +1,5 @@ +.application.sheet.daggerheart.dh-style.armor-effect-config { + .tab-form-footer { + margin-top: 8px; + } +} diff --git a/styles/less/sheets/actors/character/sidebar.less b/styles/less/sheets/actors/character/sidebar.less index 04baf2b9..ddd3a348 100644 --- a/styles/less/sheets/actors/character/sidebar.less +++ b/styles/less/sheets/actors/character/sidebar.less @@ -276,6 +276,23 @@ } } + .slot-label { + .slot-value-container { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + + i { + position: absolute; + right: 0; + font-size: 12px; + color: light-dark(@beige, @dark-blue); + } + } + } + .status-value { padding: 0 5px; } @@ -298,6 +315,10 @@ border-radius: 3px; background: light-dark(@dark-blue, @golden); clip-path: none; + cursor: pointer; + display: flex; + align-items: center; + gap: 4px; h4 { font-weight: bold; @@ -306,6 +327,11 @@ color: light-dark(@beige, @dark-blue); font-size: var(--font-size-12); } + + i { + font-size: 12px; + color: light-dark(@beige, @dark-blue); + } } .slot-value { position: absolute; diff --git a/styles/less/sheets/index.less b/styles/less/sheets/index.less index e5ffbf3e..25ec6fc3 100644 --- a/styles/less/sheets/index.less +++ b/styles/less/sheets/index.less @@ -44,3 +44,4 @@ @import './actions/actions.less'; @import './activeEffects/activeEffects.less'; +@import './activeEffects/armorEffects.less'; diff --git a/styles/less/ux/index.less b/styles/less/ux/index.less index 0bd1b71e..abdb9bc6 100644 --- a/styles/less/ux/index.less +++ b/styles/less/ux/index.less @@ -1,4 +1,5 @@ @import './tooltip/tooltip.less'; +@import './tooltip/armorManagement.less'; @import './tooltip/battlepoints.less'; @import './tooltip/bordered-tooltip.less'; @import './tooltip/domain-cards.less'; diff --git a/styles/less/ux/tooltip/armorManagement.less b/styles/less/ux/tooltip/armorManagement.less index bc716fa0..390c0a00 100644 --- a/styles/less/ux/tooltip/armorManagement.less +++ b/styles/less/ux/tooltip/armorManagement.less @@ -97,4 +97,27 @@ } } } + + .slot-bar { + display: flex; + flex-wrap: wrap; + gap: 4px; + padding: 5px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + z-index: 1; + background: @dark-blue; + justify-content: center; + color: light-dark(@dark-blue, @golden); + + .armor-slot { + cursor: pointer; + transition: all 0.3s ease; + font-size: var(--font-size-12); + + .fa-shield-halved { + color: light-dark(@dark-blue-40, @golden-40); + } + } + } } diff --git a/system.json b/system.json index 14d61851..5f872ed6 100644 --- a/system.json +++ b/system.json @@ -278,7 +278,8 @@ }, "ActiveEffect": { "beastform": {}, - "horde": {} + "horde": {}, + "armor": {} }, "Combat": { "combat": {} diff --git a/templates/dialogs/damageReduction.hbs b/templates/dialogs/damageReduction.hbs index 57d7ee61..50fe3422 100644 --- a/templates/dialogs/damageReduction.hbs +++ b/templates/dialogs/damageReduction.hbs @@ -7,53 +7,57 @@
-

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.armorMarks"}}

-
{{armorMarks}}/{{armorScore}}
+

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.maxUseableArmor"}}

+
{{availableArmor}}
- {{#if this.stress}} -
-

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stress"}}

-
{{this.stress.value}}/{{this.stress.max}}
-
- {{/if}}
-
-

-
- {{#each marks.armor}} -
- -
- {{/each}} +
+ {{#each marks.armor as |source|}} +
+

{{source.label}}

+
+ {{#each source.marks}} + + + + {{/each}} +
+
+ {{/each}} + {{#if usesStressArmor}} +
+

{{localize "Stress"}}

+
{{#each marks.stress}}
{{/each}} +
-

-
{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.usedMarks"}}
+ {{/if}}
{{#if availableStressReductions}}
-

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stressReduction"}}

+

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stressReduction"}}

{{/if}} {{#each availableStressReductions}}
-

+

{{#if this.any}} {{localize "DAGGERHEART.GENERAL.any"}} @@ -74,7 +78,7 @@ {{#if reduceSeverity}}
-

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.reduceSeverity" nr=reduceSeverity}}

+

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.reduceSeverity" nr=reduceSeverity}}

{{/if}} @@ -82,7 +86,7 @@ {{#if thresholdImmunities}}
-

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.thresholdImmunities"}}

+

{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.thresholdImmunities"}}

{{/if}} diff --git a/templates/sheets/activeEffect/armor/details.hbs b/templates/sheets/activeEffect/armor/details.hbs new file mode 100644 index 00000000..2b16560e --- /dev/null +++ b/templates/sheets/activeEffect/armor/details.hbs @@ -0,0 +1,20 @@ +
+ {{formGroup fields.tint value=source.tint rootId=rootId placeholder="#ffffff"}} + {{formGroup fields.description value=source.description rootId=rootId}} + {{formGroup fields.disabled value=source.disabled rootId=rootId}} + + {{#if isActorEffect}} +
+ +
+ +
+
+ {{/if}} + + {{#if isItemEffect}} + {{formGroup fields.transfer value=source.transfer rootId=rootId label=legacyTransfer.label hint=(localize "DAGGERHEART.EFFECTS.Attachments.transferHint")}} + {{/if}} + + {{formGroup fields.showIcon value=source.showIcon options=showIconOptions rootId=rootId}} +
\ No newline at end of file diff --git a/templates/sheets/activeEffect/armor/footer.hbs b/templates/sheets/activeEffect/armor/footer.hbs new file mode 100644 index 00000000..761189ff --- /dev/null +++ b/templates/sheets/activeEffect/armor/footer.hbs @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/templates/sheets/activeEffect/armor/settings.hbs b/templates/sheets/activeEffect/armor/settings.hbs new file mode 100644 index 00000000..12ca2154 --- /dev/null +++ b/templates/sheets/activeEffect/armor/settings.hbs @@ -0,0 +1,17 @@ +
+
+ {{localize "Armor"}} +
+ {{#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.max name=(concat 'system.changes.' index '.max') value=change.max localize=true}} + {{/each}} +
+
+ +
+ {{localize "DAGGERHEART.GENERAL.general"}} + + {{formGroup @root.systemFields.armorInteraction name="system.armorInteraction" value=source.system.armorInteraction localize=true}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/character/effects.hbs b/templates/sheets/actors/character/effects.hbs index 30fb31f4..3355d575 100644 --- a/templates/sheets/actors/character/effects.hbs +++ b/templates/sheets/actors/character/effects.hbs @@ -18,6 +18,7 @@ collection=effects.inactives canCreate=true hideResources=true + disabled=true }}
\ No newline at end of file diff --git a/templates/sheets/actors/character/sidebar.hbs b/templates/sheets/actors/character/sidebar.hbs index b2757b55..d3be4983 100644 --- a/templates/sheets/actors/character/sidebar.hbs +++ b/templates/sheets/actors/character/sidebar.hbs @@ -30,14 +30,14 @@

- {{#if document.system.armor.system.marks}} + {{#if document.system.armorScore.max}}
{{#if useResourcePips}} {{else}}
- + / - {{document.system.armorScore}} + {{document.system.armorScore.max}}
- + + {{/if}}
{{else}} diff --git a/templates/sheets/global/tabs/tab-effects.hbs b/templates/sheets/global/tabs/tab-effects.hbs index 1f0967b8..bca7f326 100644 --- a/templates/sheets/global/tabs/tab-effects.hbs +++ b/templates/sheets/global/tabs/tab-effects.hbs @@ -18,5 +18,6 @@ collection=effects.inactives canCreate=true hideResources=true + disabled=true }} \ No newline at end of file diff --git a/templates/sheets/items/armor/settings.hbs b/templates/sheets/items/armor/settings.hbs index e7bde6fe..11cd2b8b 100644 --- a/templates/sheets/items/armor/settings.hbs +++ b/templates/sheets/items/armor/settings.hbs @@ -7,8 +7,12 @@ {{localize tabs.settings.label}} {{localize "DAGGERHEART.GENERAL.Tiers.singular"}} {{formField systemFields.tier value=source.system.tier}} - {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}} - {{formField systemFields.baseScore value=source.system.baseScore}} + {{#if this.armorScore includeZero=true}} + {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}} +
+ +
+ {{/if}} {{localize "TYPES.Item.feature"}} diff --git a/templates/ui/tooltip/armorManagement.hbs b/templates/ui/tooltip/armorManagement.hbs index aa8c9878..f5cf0d32 100644 --- a/templates/ui/tooltip/armorManagement.hbs +++ b/templates/ui/tooltip/armorManagement.hbs @@ -1,19 +1,36 @@
{{#each sources as |source|}} -
- -
-
- - / - {{source.max}} + {{#if ../useResourcePips}} +
+ + -
-
+ {{else}} +
+ +
+
+ + / + {{source.max}} +
+ +
+
+ {{/if}} {{/each}}
\ No newline at end of file