{{!-- SPDX-FileCopyrightText: 2021 Johannes Loher SPDX-FileCopyrightText: 2021 Gesina Schwalbe SPDX-License-Identifier: MIT --}} {{!-- ======================================================================== --}} {{!-- INLINE PARTIAL DEFINITIONS --}} {{!-- ======================================================================== --}} {{!-- !-- Base template to display a value with unit. !-- @param unitDatum: the object to display; must have a value and a unit attribute !-- @param titleKey: The key of the localized title to use. !-- @param unitNames: mapping of allowed unitDatum.unit values to localized unit name !-- @param unitAbbrs: mapping of allowed unitDatum.unit values to unit abbreviation --}} {{#*inline "unit"}}
{{#if unitDatum.value }} {{unitDatum.value}} {{lookup unitAbbrs unitDatum.unit}} {{else}}-{{/if}}
{{/inline}} {{!-- !-- Two templates based on the "unit" template for displaying values with unit. !-- Both accept a `config` object holding the unitNames and unitAbbr instead of !-- directly handing over the latter two. !-- @param titleKey: The key of the localized title to use. --}} {{#*inline "temporalUnit"}} {{> unit unitNames=config.i18n.temporalUnits unitAbbrs=config.i18n.temporalUnitsAbbr unitDatum=unitDatum titleKey=titleKey}} {{/inline}} {{#*inline "distanceUnit"}} {{> unit unitNames=config.i18n.distanceUnits unitAbbrs=config.i18n.distanceUnitsAbbr unitDatum=unitDatum titleKey=titleKey}} {{/inline}} {{!-- ======================================================================== --}}
{{#unless (isEmpty itemsByType.spell)}}
    {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hideDescription=true type='spell'}} {{!-- spell type --}}
    {{localize 'DS4.SpellTypeAbbr'}}
    {{!-- spell modifier --}}
    {{localize 'DS4.SpellModifierAbbr'}}
    {{!-- max. distance --}}
    {{!-- duration --}}
    {{!-- cooldown duration --}}
    {{/systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{#each itemsByType.spell as |itemData id|}} {{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true hideDescription=true}} {{!-- spell type --}} {{!-- spell modifier --}}
    {{#if (eq itemData.data.spellModifier.complex '')}}{{itemData.data.spellModifier.numerical}}{{else}}{{itemData.data.spellModifier.complex}}{{/if}}
    {{!-- max. distance --}} {{> distanceUnit titleKey='DS4.SpellDistance' unitDatum=itemData.data.maxDistance config=@root/config}} {{!-- duration --}} {{> temporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=@root/config}} {{!-- cooldown duration --}}
    {{lookup @root/config.i18n.cooldownDurations itemData.data.cooldownDuration}}
    {{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}} {{/each}}
{{/unless}} {{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle' documentType='item' type='spell'}}