{{!-- 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}} {{!-- !-- Three 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 "customTemporalUnit"}} {{> unit unitNames=config.i18n.customTemporalUnits unitAbbrs=config.i18n.customTemporalUnitsAbbr 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 bonus --}}
    {{localize 'DS4.SpellBonusAbbr'}}
    {{!-- 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 bonus --}} {{!-- max. distance --}} {{> distanceUnit titleKey='DS4.SpellMaxDistance' unitDatum=itemData.data.maxDistance config=../../config}} {{!-- duration --}} {{> customTemporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=../../config}} {{!-- cooldown duration --}} {{> temporalUnit titleKey='DS4.SpellCooldownDuration' unitDatum=itemData.data.cooldownDuration config=../../config}} {{/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'}}