diff --git a/daggerheart.mjs b/daggerheart.mjs index 4f411b0f..5a6d8193 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -41,10 +41,14 @@ Hooks.once('init', () => { ] ); - CONFIG.statusEffects = Object.values(SYSTEM.GENERAL.conditions).map(x => ({ - ...x, - name: game.i18n.localize(x.name) - })); + CONFIG.statusEffects = [ + ...CONFIG.statusEffects, + ...Object.values(SYSTEM.GENERAL.conditions).map(x => ({ + ...x, + name: game.i18n.localize(x.name), + systemEffect: true + })) + ]; CONFIG.Dice.daggerheart = { DualityDie: DualityDie, @@ -108,6 +112,8 @@ Hooks.once('init', () => { } ); + CONFIG.Token.hudClass = applications.hud.DHTokenHUD; + CONFIG.Combat.dataModels = { base: models.DhCombat }; diff --git a/lang/en.json b/lang/en.json index 985c1d8d..ee7964cb 100755 --- a/lang/en.json +++ b/lang/en.json @@ -292,6 +292,11 @@ } } }, + "HUD": { + "tokenHUD": { + "genericEffects": "Foundry Effects" + } + }, "Levelup": { "actions": { "creatureComfort": { @@ -981,6 +986,10 @@ "singular": "Character", "plural": "Characters" }, + "Cost": { + "single": "Cost", + "plural": "Costs" + }, "Damage": { "severe": "Severe", "major": "Major", @@ -1086,6 +1095,7 @@ "specialization": "Specialization", "mastery": "Mastery", "optional": "Optional", + "recovery": "Recovery", "setup": "Setup", "equipment": "Equipment" }, @@ -1107,6 +1117,8 @@ "burden": "Burden", "check": "{check} Check", "criticalSuccess": "Critical Success", + "damage": "Damage", + "damageType": "Damage Type", "description": "Description", "duality": "Duality", "dualityRoll": "Duality Roll", @@ -1119,17 +1131,25 @@ "inactiveEffects": "Inactive Effects", "inventory": "Inventory", "level": "Level", + "max": "Max", "modifier": "Modifier", "multiclass": "Multiclass", + "none": "None", "quantity": "Quantity", "range": "Range", + "recovery": "Recovery", + "scalable": "Scalable", "stress": "Stress", "take": "Take", "target": "Target", "title": "Title", + "true": "True", "type": "Type", "unarmored": "Unarmored", - "use": "Use" + "use": "Use", + "used": "Used", + "uses": "Uses", + "value": "Value" }, "ITEMS": { "Ancestry": { @@ -1190,6 +1210,7 @@ "spellcastingTrait": "Spellcasting Trait" }, "Weapon": { + "weaponType": "Weapon Type", "primaryWeapon": "Primary Weapon", "secondaryWeapon": "Secondary Weapon" } @@ -1197,7 +1218,8 @@ "SETTINGS": { "Appearance": { "FIELDS": { - "displayFear": { "label": "Fear Display" } + "displayFear": { "label": "Fear Display" }, + "showGenericStatusEffects": { "label": "Show Foundry Status Effects" } }, "fearDisplay": { "token": "Tokens", @@ -1398,7 +1420,8 @@ "unequip": "Unequip", "sendToVault": "Send to Vault", "sendToLoadout": "Send to Loadout", - "makeDeathMove": "Make a Death Move" + "makeDeathMove": "Make a Death Move", + "rangeAndTarget": "Range & Target" } } } diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index 82c2866c..d4ceb229 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -1,5 +1,6 @@ export * as characterCreation from './characterCreation/_module.mjs'; export * as dialogs from './dialogs/_module.mjs'; +export * as hud from './hud/_module.mjs'; export * as levelup from './levelup/_module.mjs'; export * as settings from './settings/_module.mjs'; export * as sheets from './sheets/_module.mjs'; diff --git a/module/applications/hud/_module.mjs b/module/applications/hud/_module.mjs new file mode 100644 index 00000000..70edaf8f --- /dev/null +++ b/module/applications/hud/_module.mjs @@ -0,0 +1 @@ +export { default as DHTokenHUD } from './tokenHud.mjs'; diff --git a/module/applications/hud/tokenHUD.mjs b/module/applications/hud/tokenHUD.mjs new file mode 100644 index 00000000..9a58bab2 --- /dev/null +++ b/module/applications/hud/tokenHUD.mjs @@ -0,0 +1,84 @@ +export default class DHTokenHUD extends TokenHUD { + static DEFAULT_OPTIONS = { + classes: ['daggerheart'] + }; + + /** @override */ + static PARTS = { + hud: { + root: true, + template: 'systems/daggerheart/templates/hud/tokenHUD.hbs' + } + }; + + async _prepareContext(options) { + const context = await super._prepareContext(options); + context.systemStatusEffects = Object.keys(context.statusEffects).reduce((acc, key) => { + const effect = context.statusEffects[key]; + if (effect.systemEffect) acc[key] = effect; + + return acc; + }, {}); + + const useGeneric = game.settings.get( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.appearance + ).showGenericStatusEffects; + context.genericStatusEffects = useGeneric + ? Object.keys(context.statusEffects).reduce((acc, key) => { + const effect = context.statusEffects[key]; + if (!effect.systemEffect) acc[key] = effect; + + return acc; + }, {}) + : null; + + return context; + } + + _getStatusEffectChoices() { + // Include all HUD-enabled status effects + const choices = {}; + for (const status of CONFIG.statusEffects) { + if ( + status.hud === false || + (foundry.utils.getType(status.hud) === 'Object' && + status.hud.actorTypes?.includes(this.document.actor.type) === false) + ) { + continue; + } + choices[status.id] = { + _id: status._id, + id: status.id, + systemEffect: status.systemEffect, + title: game.i18n.localize(status.name ?? /** @deprecated since v12 */ status.label), + src: status.img ?? /** @deprecated since v12 */ status.icon, + isActive: false, + isOverlay: false + }; + } + + // Update the status of effects which are active for the token actor + const activeEffects = this.actor?.effects || []; + for (const effect of activeEffects) { + for (const statusId of effect.statuses) { + const status = choices[statusId]; + if (!status) continue; + if (status._id) { + if (status._id !== effect.id) continue; + } else { + if (effect.statuses.size !== 1) continue; + } + status.isActive = true; + if (effect.getFlag('core', 'overlay')) status.isOverlay = true; + break; + } + } + + // Flag status CSS class + for (const status of Object.values(choices)) { + status.cssClass = [status.isActive ? 'active' : null, status.isOverlay ? 'overlay' : null].filterJoin(' '); + } + return choices; + } +} diff --git a/module/applications/sheets/actors/adversary.mjs b/module/applications/sheets/actors/adversary.mjs index 67f57781..0b01ebee 100644 --- a/module/applications/sheets/actors/adversary.mjs +++ b/module/applications/sheets/actors/adversary.mjs @@ -10,6 +10,7 @@ export default class AdversarySheet extends DHBaseActorSheet { actions: { reactionRoll: AdversarySheet.#reactionRoll, useItem: this.useItem, + useAction: this.useItem, toChat: this.toChat }, window: { diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index e70774f5..ae7ffbf9 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -24,6 +24,7 @@ export default class CharacterSheet extends DHBaseActorSheet { levelManagement: CharacterSheet.#levelManagement, toggleEquipItem: CharacterSheet.#toggleEquipItem, useItem: this.useItem, //TODO Fix this + useAction: this.useAction, toChat: this.toChat }, window: { @@ -620,6 +621,20 @@ export default class CharacterSheet extends DHBaseActorSheet { } } + /** + * Use an action + * @type {ApplicationClickAction} + */ + static async useAction(event, button) { + const item = this.getItem(button); + if (!item) return; + + const action = item.system.actions.find(x => x.id === button.dataset.actionId); + if (!action) return; + + action.use(event); + } + /** * Send item to Chat * @type {ApplicationClickAction} diff --git a/module/applications/sheets/actors/environment.mjs b/module/applications/sheets/actors/environment.mjs index 188d24b4..05958cf5 100644 --- a/module/applications/sheets/actors/environment.mjs +++ b/module/applications/sheets/actors/environment.mjs @@ -11,6 +11,7 @@ export default class DhpEnvironment extends DHBaseActorSheet { }, actions: { useItem: this.useItem, + useAction: this.useItem, toChat: this.toChat }, dragDrop: [{ dragSelector: '.action-section .inventory-item', dropSelector: null }] diff --git a/module/config/actorConfig.mjs b/module/config/actorConfig.mjs index 7a179308..02cfd4a9 100644 --- a/module/config/actorConfig.mjs +++ b/module/config/actorConfig.mjs @@ -113,7 +113,7 @@ export const adversaryTypes = { }, social: { id: 'social', - label: 'DAGGERHEART.CONFIG.AdversaryTypee.social.label', + label: 'DAGGERHEART.CONFIG.AdversaryType.social.label', description: 'DAGGERHEART.ACTORS.Adversary.social.description' }, solo: { diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index e193aefe..e2eafbf2 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -180,8 +180,8 @@ export default class DHBaseAction extends foundry.abstract.DataModel { const actorData = this.actor.getRollData(false); // Remove when included directly in Actor getRollData - actorData.prof = actorData.proficiency?.value ?? 1; - actorData.cast = actorData.spellcast?.value ?? 1; + actorData.prof = actorData.proficiency?.total ?? 1; + actorData.cast = actorData.spellcast?.total ?? 1; actorData.result = data.roll?.total ?? 1; /* actorData.scale = data.costs?.length ? data.costs.reduce((a, c) => { diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index 1203cc96..88b149e3 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -66,10 +66,9 @@ export default class DhCompanion extends BaseDataActor { damage: { parts: [ { - multiplier: 'flat', value: { dice: 'd6', - multiplier: 'flat' + multiplier: 'prof' } } ] @@ -87,6 +86,12 @@ export default class DhCompanion extends BaseDataActor { }; } + get proficiency() { + return { + total: this.partner?.system?.proficiency?.total ?? 1 + }; + } + prepareBaseData() { const partnerSpellcastingModifier = this.partner?.system?.spellcastingModifiers?.main; const spellcastingModifier = this.partner?.system?.traits?.[partnerSpellcastingModifier]?.total; diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs index 696a95a2..bf2bf73e 100644 --- a/module/data/item/armor.mjs +++ b/module/data/item/armor.mjs @@ -44,6 +44,12 @@ export default class DHArmor extends BaseDataItem { }; } + get customActions() { + return this.actions.filter( + action => !this.armorFeatures.some(feature => feature.actionIds.includes(action.id)) + ); + } + async _preUpdate(changes, options, user) { const allowed = await super._preUpdate(changes, options, user); if (allowed === false) return false; diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index e1370395..80c8271d 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -73,6 +73,12 @@ export default class DHWeapon extends BaseDataItem { return [this.attack, ...this.actions]; } + get customActions() { + return this.actions.filter( + action => !this.weaponFeatures.some(feature => feature.actionIds.includes(action.id)) + ); + } + async _preUpdate(changes, options, user) { const allowed = await super._preUpdate(changes, options, user); if (allowed === false) return false; diff --git a/module/data/settings/Appearance.mjs b/module/data/settings/Appearance.mjs index 8b04f558..d8b4c687 100644 --- a/module/data/settings/Appearance.mjs +++ b/module/data/settings/Appearance.mjs @@ -40,6 +40,10 @@ export default class DhAppearance extends foundry.abstract.DataModel { outline: new fields.ColorField({ required: true, initial: '#ffffff' }), edge: new fields.ColorField({ required: true, initial: '#000000' }) }) + }), + showGenericStatusEffects: new fields.BooleanField({ + initial: true, + label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.showGenericStatusEffects.label' }) }; } diff --git a/module/data/settings/RangeMeasurement.mjs b/module/data/settings/RangeMeasurement.mjs index 71fb7787..552963f0 100644 --- a/module/data/settings/RangeMeasurement.mjs +++ b/module/data/settings/RangeMeasurement.mjs @@ -2,7 +2,7 @@ export default class DhRangeMeasurement extends foundry.abstract.DataModel { static defineSchema() { const fields = foundry.data.fields; return { - enabled: new fields.BooleanField({ required: true, initial: false, label: 'DAGGERHEART.GENERAL.enabled' }), + enabled: new fields.BooleanField({ required: true, initial: true, label: 'DAGGERHEART.GENERAL.enabled' }), melee: new fields.NumberField({ required: true, initial: 5, label: 'DAGGERHEART.CONFIG.Range.melee.name' }), veryClose: new fields.NumberField({ required: true, diff --git a/module/documents/tooltipManager.mjs b/module/documents/tooltipManager.mjs index 2e660cff..d9444207 100644 --- a/module/documents/tooltipManager.mjs +++ b/module/documents/tooltipManager.mjs @@ -2,15 +2,33 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti async activate(element, options = {}) { let html = options.html; if (element.dataset.tooltip?.startsWith('#item#')) { - const item = await foundry.utils.fromUuid(element.dataset.tooltip.slice(6)); + const splitValues = element.dataset.tooltip.slice(6).split('#action#'); + const itemUuid = splitValues[0]; + const actionId = splitValues.length > 1 ? splitValues[1] : null; + + const baseItem = await foundry.utils.fromUuid(itemUuid); + const item = actionId ? baseItem.system.actions.find(x => x.id === actionId) : baseItem; if (item) { + const type = actionId ? 'action' : item.type; html = await foundry.applications.handlebars.renderTemplate( - `systems/daggerheart/templates/ui/tooltip/${item.type}.hbs`, - item + `systems/daggerheart/templates/ui/tooltip/${type}.hbs`, + { + item: item, + config: CONFIG.DH + } ); + + this.tooltip.innerHTML = html; + options.direction = this._determineItemTooltipDirection(element); } } super.activate(element, { ...options, html: html }); } + + _determineItemTooltipDirection(element) { + const pos = element.getBoundingClientRect(); + const dirs = this.constructor.TOOLTIP_DIRECTIONS; + return dirs[pos.x - this.tooltip.offsetWidth < 0 ? 'DOWN' : 'LEFT']; + } } diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index 6db51225..feeebbd2 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -1,47 +1,49 @@ -import { getWidthOfText } from './utils.mjs'; - export default class RegisterHandlebarsHelpers { static registerHelpers() { Handlebars.registerHelper({ - times: this.times, - join: this.join, add: this.add, - subtract: this.subtract, includes: this.includes, - case: this.case + times: this.times, + damageFormula: this.damageFormula, + damageSymbols: this.damageSymbols, + tertiary: this.tertiary, + signedNumber: this.signedNumber }); } - static times(nr, block) { - var accum = ''; - for (var i = 0; i < nr; ++i) accum += block.fn(i); - return accum; - } - - static join(...options) { - return options.slice(0, options.length - 1); - } - static add(a, b) { const aNum = Number.parseInt(a); const bNum = Number.parseInt(b); return (Number.isNaN(aNum) ? 0 : aNum) + (Number.isNaN(bNum) ? 0 : bNum); } - static subtract(a, b) { - const aNum = Number.parseInt(a); - const bNum = Number.parseInt(b); - return (Number.isNaN(aNum) ? 0 : aNum) - (Number.isNaN(bNum) ? 0 : bNum); - } - static includes(list, item) { return list.includes(item); } - static case(value, options) { - if (value == this.switch_value) { - this.switch_break = true; - return options.fn(this); - } + static times(nr, block) { + var accum = ''; + for (var i = 0; i < nr; ++i) accum += block.fn(i); + return accum; + } + + static damageFormula(attack, actor) { + const traitTotal = actor.system.traits?.[attack.roll.trait]?.total; + const instances = [ + attack.damage.parts.map(x => Roll.replaceFormulaData(x.value.getFormula(), actor)).join(' + '), + traitTotal + ].filter(x => x); + + return instances.join(traitTotal > 0 ? ' + ' : ' - '); + } + + static damageSymbols(damageParts) { + const symbols = new Set(); + damageParts.forEach(part => symbols.add(...CONFIG.DH.GENERAL.damageTypes[part.type].icon)); + return new Handlebars.SafeString(Array.from(symbols).map(symbol => ``)); + } + + static tertiary(a, b) { + return a ?? b; } } diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index 75a5aff6..e4cc1a2c 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -22,6 +22,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/actionTypes/beastform.hbs', 'systems/daggerheart/templates/settings/components/settings-item-line.hbs', 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs', - 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs' + 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs', + 'systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs' ]); }; diff --git a/module/systemRegistration/settings.mjs b/module/systemRegistration/settings.mjs index a4ed05c8..fea12acd 100644 --- a/module/systemRegistration/settings.mjs +++ b/module/systemRegistration/settings.mjs @@ -60,7 +60,7 @@ const registerMenuSettings = () => { }); game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement, { - scope: 'client', + scope: 'world', config: false, type: DhRangeMeasurement }); diff --git a/styles/daggerheart.less b/styles/daggerheart.less index 86b504b2..c2127681 100755 --- a/styles/daggerheart.less +++ b/styles/daggerheart.less @@ -3,6 +3,8 @@ @import './less/dialog/index.less'; +@import './less//hud/index.less'; + @import './less/utils/colors.less'; @import './less/utils/fonts.less'; @@ -10,4 +12,6 @@ @import './less/ui/index.less'; +@import './less/ux/index.less'; + @import '../node_modules/@yaireo/tagify/dist/tagify.css'; diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index 03772bfb..7466ae8b 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -319,6 +319,17 @@ transform: translateY(-20px); transform-origin: top; } + + .item-buttons { + grid-column: span 3; + display: flex; + gap: 8px; + flex-wrap: wrap; + + button { + white-space: nowrap; + } + } } .application.setting.dh-style { diff --git a/styles/less/hud/index.less b/styles/less/hud/index.less new file mode 100644 index 00000000..459f8fd7 --- /dev/null +++ b/styles/less/hud/index.less @@ -0,0 +1 @@ +@import './token-hud/token-hud.less'; diff --git a/styles/less/hud/token-hud/token-hud.less b/styles/less/hud/token-hud/token-hud.less new file mode 100644 index 00000000..7d231e8c --- /dev/null +++ b/styles/less/hud/token-hud/token-hud.less @@ -0,0 +1,10 @@ +.daggerheart.placeable-hud { + .col.right { + .palette { + .palette-category-title { + grid-column: span var(--effect-columns); + font-weight: bold; + } + } + } +} diff --git a/styles/less/ux/index.less b/styles/less/ux/index.less new file mode 100644 index 00000000..ff645288 --- /dev/null +++ b/styles/less/ux/index.less @@ -0,0 +1 @@ +@import './tooltip/tooltip.less'; diff --git a/styles/less/ux/tooltip/tooltip.less b/styles/less/ux/tooltip/tooltip.less new file mode 100644 index 00000000..38502d09 --- /dev/null +++ b/styles/less/ux/tooltip/tooltip.less @@ -0,0 +1,106 @@ +.daggerheart.dh-style.tooltip { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; + + .tooltip-title { + margin: 0; + text-align: center; + } + + .tooltip-image { + height: 180px; + width: 180px; + } + + .tooltip-description { + font-style: italic; + } + + .tooltip-sub-title { + margin: 0; + color: light-dark(@dark-blue, @beige); + } + + .tooltip-information-section { + width: 100%; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 4px; + + &.triple { + grid-template-columns: 1fr 1fr 1fr; + } + + &.border { + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + padding: 2px; + } + + .tooltip-information { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + + &.full-width { + grid-column: span 2; + } + + label { + font-weight: bold; + } + + label, + div { + white-space: nowrap; + } + } + } + + .tooltip-tags { + width: 100%; + display: flex; + flex-direction: column; + gap: 4px; + + .tooltip-tag { + width: 100%; + display: grid; + grid-template-columns: 80px 1fr; + align-items: start; + gap: 8px; + padding: 4px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + + .tooltip-tag-label-container { + display: flex; + align-items: center; + flex-direction: column; + gap: 2px; + + .tooltip-tag-image { + width: 40px; + height: 40px; + } + } + + .tooltip-tag-label { + font-weight: bold; + text-align: center; + } + + .tooltip-tag-description { + display: flex; + flex-wrap: wrap; + } + } + } + + .spaced { + margin-bottom: 4px; + } +} diff --git a/templates/hud/tokenHUD.hbs b/templates/hud/tokenHUD.hbs new file mode 100644 index 00000000..58d13267 --- /dev/null +++ b/templates/hud/tokenHUD.hbs @@ -0,0 +1,78 @@ +
+
+ + +
+ + + + + + {{#if canConfigure}} + + {{/if}} +
+ +
+
+ {{#if displayBar2}} + + {{/if}} +
+ +
+ {{#if displayBar1}} + + {{/if}} +
+
+ +
+ {{#if isGM}} + + {{/if}} + + +
+ {{#each systemStatusEffects as |status|}} + + {{/each}} + {{#if genericStatusEffects}} + + {{#each genericStatusEffects as |status|}} + + {{/each}} + {{/if}} +
+ + +
+ {{#each movementActions as |action|}} + + {{#if action.icon}}{{/if}} {{action.label}} + + {{/each}} +
+ + + + {{#if canToggleCombat}} + + {{/if}} +
diff --git a/templates/settings/appearance-settings.hbs b/templates/settings/appearance-settings.hbs index 5aa6d28d..da435c75 100644 --- a/templates/settings/appearance-settings.hbs +++ b/templates/settings/appearance-settings.hbs @@ -1,5 +1,6 @@
{{formGroup settingFields.schema.fields.displayFear value=settingFields._source.displayFear localize=true}} + {{formGroup settingFields.schema.fields.showGenericStatusEffects value=settingFields._source.showGenericStatusEffects localize=true}}
{{localize "DAGGERHEART.SETTINGS.Menu.appearance.duality"}} diff --git a/templates/sheets/global/partials/inventory-fieldset-items.hbs b/templates/sheets/global/partials/inventory-fieldset-items.hbs index 92d3a8a6..65c52736 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items.hbs @@ -17,7 +17,7 @@ {{/each}} {{else}} {{#each values}} - {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=this type=../type hideControls=../hideControls }} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=this type=../type hideControls=../hideControls featureType=true }} {{/each}} {{#each adversaries as |adversary|}} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index 135c3e3c..eae3dd5f 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -171,4 +171,12 @@ {{/unless}}
{{#unless isSidebar}}{{{item.system.description}}}{{/unless}}
+ + {{#if featureType}} +
+ {{#each item.system.actions as | action |}} + + {{/each}} +
+ {{/if}} \ No newline at end of file diff --git a/templates/sheets/global/tabs/tab-actions.hbs b/templates/sheets/global/tabs/tab-actions.hbs index 54345bed..ed71c45f 100644 --- a/templates/sheets/global/tabs/tab-actions.hbs +++ b/templates/sheets/global/tabs/tab-actions.hbs @@ -10,6 +10,7 @@
{{action.name}} diff --git a/templates/sheets/global/tabs/tab-features.hbs b/templates/sheets/global/tabs/tab-features.hbs index 71f6f1f1..eced83d7 100644 --- a/templates/sheets/global/tabs/tab-features.hbs +++ b/templates/sheets/global/tabs/tab-features.hbs @@ -11,7 +11,7 @@ data-action="editFeature" id="{{feature.id}}" > - + {{feature.name}}
diff --git a/templates/sheets/items/feature/header.hbs b/templates/sheets/items/feature/header.hbs index e6a11503..e603c0f7 100755 --- a/templates/sheets/items/feature/header.hbs +++ b/templates/sheets/items/feature/header.hbs @@ -4,7 +4,7 @@

-

{{localize (concat 'TYPES.Item.feature' source.system.type)}}

+

{{localize 'TYPES.Item.feature'}}

\ No newline at end of file diff --git a/templates/ui/tooltip/action.hbs b/templates/ui/tooltip/action.hbs new file mode 100644 index 00000000..c101ee68 --- /dev/null +++ b/templates/ui/tooltip/action.hbs @@ -0,0 +1,83 @@ +
+

{{item.name}}

+ +
{{{item.description}}}
+ + {{#if item.uses.max}} +

{{localize "DAGGERHEART.GENERAL.uses"}}

+
+
+ +
{{item.uses.value}}
+
+
+ +
{{item.uses.max}}
+
+
+ + {{#with (lookup config.GENERAL.refreshTypes item.uses.recovery) as | type |}} +
{{localize type.label}}
+ {{/with}} +
+
+ {{/if}} + + {{#if (gt item.cost.length 0)}} +

{{localize "DAGGERHEART.GENERAL.Cost.plural"}}

+ {{#each item.cost as | cost |}} +
+
+ + {{#with (lookup @root.config.GENERAL.abilityCosts cost.type) as | type |}} +
{{localize type.label}}
+ {{/with}} +
+
+ +
{{cost.value}}
+
+ {{#if cost.scalable}} +
+ +
{{localize "DAGGERHEART.GENERAL.true"}}
+
+
+ +
{{cost.step}}
+
+ {{/if}} +
+ {{/each}} + {{/if}} + + {{#if (or item.range item.target)}} +

{{localize "DAGGERHEART.UI.Tooltip.rangeAndTarget"}}

+
+
+ +
+ {{#if item.range}} + {{#with (lookup @root.config.GENERAL.range item.range) as | range |}} +
{{localize range.label}}
+ {{/with}} + {{else}} +
{{localize "DAGGERHEART.GENERAL.none"}}
+ {{/if}} +
+
+
+ +
+ {{#if item.target.type}} + {{#with (lookup @root.config.ACTIONS.targetTypes item.target.type) as | target |}} +
{{@root.item.target.amount}} {{localize target.label}}
+ {{/with}} + {{else}} +
{{localize "DAGGERHEART.GENERAL.none"}}
+ {{/if}} +
+
+
+ {{/if}} +
\ No newline at end of file diff --git a/templates/ui/tooltip/adversary.hbs b/templates/ui/tooltip/adversary.hbs new file mode 100644 index 00000000..5fa559ff --- /dev/null +++ b/templates/ui/tooltip/adversary.hbs @@ -0,0 +1,64 @@ +
+

{{item.name}}

+ +
{{{item.system.description}}}
+ +
+
+ + {{#with (lookup config.GENERAL.tiers item.system.tier) as | tier |}} +
{{localize tier.label}}
+ {{/with}} +
+
+ + {{#with (lookup config.ACTOR.adversaryTypes item.system.type) as | type |}} +
{{localize type.label}}
+ {{/with}} +
+
+ +
{{item.system.difficulty}}
+
+
+
+
+ +
{{item.system.resources.hitPoints.max}}
+
+
+ +
{{item.system.resources.stress.max}}
+
+
+ +
{{item.system.damageThresholds.major}}
+
+
+ +
{{item.system.damageThresholds.severe}}
+
+
+ +
{{numberFormat item.system.attack.roll.bonus sign=true}}
+
+
+ +
{{damageFormula item.system.attack item}}
+
+
+ + {{localize "DAGGERHEART.GENERAL.Experience.plural"}} + {{#each item.system.experiences as | experience |}} +
{{experience.name}} {{numberFormat experience.total sign=true}}
+ {{/each}} + +
+
+ +
{{item.system.motivesAndTactics}}
+
+
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.features }} +
\ No newline at end of file diff --git a/templates/ui/tooltip/armor.hbs b/templates/ui/tooltip/armor.hbs index c2972700..456fb226 100644 --- a/templates/ui/tooltip/armor.hbs +++ b/templates/ui/tooltip/armor.hbs @@ -1,5 +1,37 @@ -
-
{{name}}
- -
{{{system.description}}}
+
+

{{item.name}}

+ +
{{{item.system.description}}}
+ +
+
+ +
{{item.system.baseScore}}
+
+ +
+ +
{{item.system.baseThresholds.major}}
+
+
+ +
{{item.system.baseThresholds.severe}}
+
+
+ + {{#if (gt item.system.armorFeatures.length 0)}}

{{localize "DAGGERHEART.GENERAL.features"}}

{{/if}} +
+ {{#each item.system.armorFeatures}} + {{#with (lookup ../config.ITEM.armorFeatures this.value) as | feature | }} +
+
+
{{localize feature.label}}
+
+
{{{localize feature.description}}}
+
+ {{/with}} + {{/each}} +
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions label=(localize "DAGGERHEART.GENERAL.Action.plural")}}
\ No newline at end of file diff --git a/templates/ui/tooltip/beastform.hbs b/templates/ui/tooltip/beastform.hbs deleted file mode 100644 index 3af49969..00000000 --- a/templates/ui/tooltip/beastform.hbs +++ /dev/null @@ -1,6 +0,0 @@ -
-
{{name}}
- -
{{{system.examples}}}
-
{{system.advantageOn}}
-
\ No newline at end of file diff --git a/templates/ui/tooltip/consumable.hbs b/templates/ui/tooltip/consumable.hbs new file mode 100644 index 00000000..2c998b1d --- /dev/null +++ b/templates/ui/tooltip/consumable.hbs @@ -0,0 +1,14 @@ +
+

{{item.name}}

+ +
{{{item.system.description}}}
+ +
+
+ +
{{item.system.quantity}}
+
+
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }} +
\ No newline at end of file diff --git a/templates/ui/tooltip/domainCard.hbs b/templates/ui/tooltip/domainCard.hbs index c2972700..dad00b1b 100644 --- a/templates/ui/tooltip/domainCard.hbs +++ b/templates/ui/tooltip/domainCard.hbs @@ -1,5 +1,31 @@ -
-
{{name}}
- -
{{{system.description}}}
+
+

{{item.name}}

+ +
{{{item.system.description}}}
+ +
+
+ + {{#with (lookup config.DOMAIN.domains item.system.domain) as | domain |}} +
{{localize domain.label}}
+ {{/with}} +
+ +
+ + {{#with (lookup config.DOMAIN.cardTypes item.system.type) as | type |}} +
{{localize type.label}}
+ {{/with}} +
+
+ +
{{item.system.level}}
+
+
+ +
{{item.system.recallCost}}
+
+
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
\ No newline at end of file diff --git a/templates/ui/tooltip/feature.hbs b/templates/ui/tooltip/feature.hbs new file mode 100644 index 00000000..17ff2db6 --- /dev/null +++ b/templates/ui/tooltip/feature.hbs @@ -0,0 +1,8 @@ +
+

{{item.name}}

+ +
{{{item.system.description}}}
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }} + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.effects label=(localize "DAGGERHEART.GENERAL.Effect.plural") }} +
\ No newline at end of file diff --git a/templates/ui/tooltip/miscellaneous.hbs b/templates/ui/tooltip/miscellaneous.hbs new file mode 100644 index 00000000..83014a88 --- /dev/null +++ b/templates/ui/tooltip/miscellaneous.hbs @@ -0,0 +1,7 @@ +
+

{{item.name}}

+ +
{{{item.system.description}}}
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }} +
\ No newline at end of file diff --git a/templates/ui/tooltip/parts/tooltipTags.hbs b/templates/ui/tooltip/parts/tooltipTags.hbs new file mode 100644 index 00000000..a02a729a --- /dev/null +++ b/templates/ui/tooltip/parts/tooltipTags.hbs @@ -0,0 +1,12 @@ +{{#if (gt features.length 0)}}

{{label}}

{{/if}} +
+ {{#each features as | feature |}} +
+
+
{{localize feature.name}}
+ {{#if feature.img}}{{/if}} +
+
{{{localize (tertiary feature.description feature.system.description)}}}
+
+ {{/each}} +
\ No newline at end of file diff --git a/templates/ui/tooltip/weapon.hbs b/templates/ui/tooltip/weapon.hbs index c2972700..963b0714 100644 --- a/templates/ui/tooltip/weapon.hbs +++ b/templates/ui/tooltip/weapon.hbs @@ -1,5 +1,56 @@ -
-
{{name}}
- -
{{{system.description}}}
+
+

{{item.name}}

+ +
{{{item.system.description}}}
+ +
+
+ +
{{#if item.system.secondaryWeapon}}{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}{{else}}{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}{{/if}}
+
+
+ + {{#with (lookup config.GENERAL.burden item.system.burden) as | burden |}} +
{{localize burden.label}}
+ {{/with}} +
+ {{#if item.system.attack.roll.trait}} +
+ + {{#with (lookup config.ACTOR.abilities item.system.attack.roll.trait) as | trait |}} +
{{localize trait.label}}
+ {{/with}} +
+ {{/if}} +
+ + {{#with (lookup config.GENERAL.range item.system.attack.range) as | range |}} +
{{localize range.label}}
+ {{/with}} +
+
+ +
{{{damageFormula item.system.attack item.parent}}}
+
+
+ +
{{{damageSymbols item.system.attack.damage.parts}}}
+
+
+ + {{#if (gt item.system.weaponFeatures.length 0)}}

{{localize "DAGGERHEART.GENERAL.features"}}

{{/if}} +
+ {{#each item.system.weaponFeatures}} + {{#with (lookup ../config.ITEM.weaponFeatures this.value) as | feature | }} +
+
+
{{localize feature.label}}
+
+
{{{localize feature.description}}}
+
+ {{/with}} + {{/each}} +
+ + {{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
\ No newline at end of file