diff --git a/README.md b/README.md index 9b502a47..bf43ab43 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To install and use the Dungeonslayers 4 system for Foundry Virtual Tabletop, simply paste the following URL into the **Install System** dialog on the Setup menu of the application. -https://git.f3l.de/dungeonslayers/ds4/-/raw/master/src/system.json?inline=false +https://git.f3l.de/dungeonslayers/ds4/-/raw/latest/src/system.json?inline=false ## Development diff --git a/src/lang/de.json b/src/lang/de.json index 50c3ff9e..59146324 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -145,10 +145,14 @@ "DS4.CharacterProfileBirthplace": "Geburtsort", "DS4.CharacterProfileAge": "Alter", "DS4.CharacterProfileHeight": "Größe", - "DS4.ProfileHairColor": "Haarfarbe", + "DS4.CharacterProfileHairColor": "Haarfarbe", "DS4.CharacterProfileWeight": "Gewicht", "DS4.CharacterProfileEyeColor": "Augenfarbe", "DS4.CharacterProfileSpecialCharacteristics": "Besondere Eigenschaften", + "DS4.CharacterCurrencyGold": "Gold", + "DS4.CharacterCurrencySilver": "Silber", + "DS4.CharacterCurrencyCopper": "Kupfer", + "DS4.CharacterCurrency": "Währung", "DS4.CreatureTypeAnimal": "Tier", "DS4.CreatureTypeConstruct": "Konstrukt", "DS4.CreatureTypeHumanoid": "Humanoid", diff --git a/src/lang/en.json b/src/lang/en.json index 42e267aa..c28b165f 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -145,10 +145,14 @@ "DS4.CharacterProfileBirthplace": "Birthplace", "DS4.CharacterProfileAge": "Age", "DS4.CharacterProfileHeight": "Height", - "DS4.ProfileHairColor": "Hair Color", + "DS4.CharacterProfileHairColor": "Hair Color", "DS4.CharacterProfileWeight": "Weight", "DS4.CharacterProfileEyeColor": "Eye Color", "DS4.CharacterProfileSpecialCharacteristics": "Special Characteristics", + "DS4.CharacterCurrencyGold": "Gold", + "DS4.CharacterCurrencySilver": "Silver", + "DS4.CharacterCurrencyCopper": "Copper", + "DS4.CharacterCurrency": "Currency", "DS4.CreatureTypeAnimal": "Animal", "DS4.CreatureTypeConstruct": "Construct", "DS4.CreatureTypeHumanoid": "Humanoid", diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index 883b6f5d..dba57d9f 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -39,6 +39,7 @@ interface DS4ActorDataCharacter extends DS4ActorDataBase { progression: DS4ActorDataCharacterProgression; language: DS4ActorDataCharacterLanguage; profile: DS4ActorDataCharacterProfile; + currency: DS4ActorDataCharacterCurrency; } interface DS4ActorDataCharacterBaseInfo { @@ -73,6 +74,12 @@ interface DS4ActorDataCharacterProfile { specialCharacteristics: string; } +interface DS4ActorDataCharacterCurrency { + gold: number; + silver: number; + copper: number; +} + interface DS4ActorDataCreature extends DS4ActorDataBase { baseInfo: DS4ActorDataCreatureBaseInfo; } diff --git a/src/module/config.ts b/src/module/config.ts index 1d5740a6..106a791f 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -204,7 +204,7 @@ export const DS4 = { birthplace: "DS4.CharacterProfileBirthplace", age: "DS4.CharacterProfileAge", height: "DS4.CharacterProfileHeight", - hairColor: "DS4.ProfileHairColor", + hairColor: "DS4.CharacterProfileHairColor", weight: "DS4.CharacterProfileWeight", eyeColor: "DS4.CharacterProfileEyeColor", specialCharacteristics: "DS4.CharacterProfileSpecialCharacteristics", @@ -226,6 +226,15 @@ export const DS4 = { specialCharacteristics: "String", }, + /** + * Define currency elements of a character + */ + characterCurrency: { + gold: "DS4.CharacterCurrencyGold", + silver: "DS4.CharacterCurrencySilver", + copper: "DS4.CharacterCurrencyCopper", + }, + /** * Define the different creature types a creature can be */ diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 94d33271..131e6675 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -64,6 +64,8 @@ async function registerHandlebarsPartials() { "systems/ds4/templates/actor/partials/profile.hbs", "systems/ds4/templates/actor/partials/character-progression.hbs", "systems/ds4/templates/actor/partials/special-creature-abilites-overview.hbs", + "systems/ds4/templates/actor/partials/character-inventory.hbs", + "systems/ds4/templates/actor/partials/creature-inventory.hbs", ]; return loadTemplates(templatePaths); } @@ -95,6 +97,7 @@ Hooks.once("setup", function () { "characterProgression", "characterLanguage", "characterProfile", + "characterCurrency", "creatureTypes", "creatureSizeCategories", "creatureBaseInfo", diff --git a/src/template.json b/src/template.json index ca9b4ee5..726d0a56 100644 --- a/src/template.json +++ b/src/template.json @@ -122,6 +122,11 @@ "weight": 0, "eyeColor": "", "specialCharacteristics": "" + }, + "currency": { + "gold": 0, + "silver": 0, + "copper": 0 } } }, diff --git a/src/templates/actor/character-sheet.hbs b/src/templates/actor/character-sheet.hbs index 5c0b4358..b1008c7a 100644 --- a/src/templates/actor/character-sheet.hbs +++ b/src/templates/actor/character-sheet.hbs @@ -71,7 +71,7 @@ {{!-- Sheet Body --}}
{{!-- Items Tab --}} - {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + {{> systems/ds4/templates/actor/partials/character-inventory.hbs}} {{!-- Spells Tab --}} {{> systems/ds4/templates/actor/partials/spells-overview.hbs}} diff --git a/src/templates/actor/creature-sheet.hbs b/src/templates/actor/creature-sheet.hbs index 2ebf5977..7571eaba 100644 --- a/src/templates/actor/creature-sheet.hbs +++ b/src/templates/actor/creature-sheet.hbs @@ -61,7 +61,7 @@ {{!-- Sheet Body --}}
{{!-- Items Tab --}} - {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + {{> systems/ds4/templates/actor/partials/creature-inventory.hbs}} {{!-- Special Creature Abilities Tab --}} {{> systems/ds4/templates/actor/partials/special-creature-abilites-overview.hbs}} diff --git a/src/templates/actor/partials/character-inventory.hbs b/src/templates/actor/partials/character-inventory.hbs new file mode 100644 index 00000000..19a4009d --- /dev/null +++ b/src/templates/actor/partials/character-inventory.hbs @@ -0,0 +1,21 @@ +
+ + {{!-- Money--}} +

{{localize 'DS4.CharacterCurrency'}}

+
    +
  1. + + + + + + +
  2. +
+ + {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + +
\ No newline at end of file diff --git a/src/templates/actor/partials/creature-inventory.hbs b/src/templates/actor/partials/creature-inventory.hbs new file mode 100644 index 00000000..b9b8acd6 --- /dev/null +++ b/src/templates/actor/partials/creature-inventory.hbs @@ -0,0 +1,5 @@ +
+ + {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + +
\ No newline at end of file diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index 4d7135aa..55b34411 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -14,9 +14,9 @@ --}} {{#*inline "ifHasItemOfType"}} {{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}} - {{> @partial-block}} +{{> @partial-block}} {{else}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} +{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} {{/if}} {{/inline}} @@ -33,24 +33,24 @@ !-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "itemListHeader" }} -
  • - {{!-- equipped --}} - {{#if (ne dataType 'equipment')}} -
    {{localize 'DS4.ItemEquippedAbbr'}}
    - {{/if}} - {{!-- image --}} -
    - {{!-- amount --}} -
    #
    - {{!-- name --}} -
    {{localize 'DS4.ItemName'}}
    - {{!-- item type specifics --}} - {{> @partial-block }} - {{!-- description --}} -
    {{localize 'DS4.Description'}}
    - {{!-- add button --}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} -
  • +
  • + {{!-- equipped --}} + {{#if (ne dataType 'equipment')}} +
    {{localize 'DS4.ItemEquippedAbbr'}}
    + {{/if}} + {{!-- image --}} +
    + {{!-- amount --}} +
    #
    + {{!-- name --}} +
    {{localize 'DS4.ItemName'}}
    + {{!-- item type specifics --}} + {{> @partial-block }} + {{!-- description --}} +
    {{localize 'DS4.Description'}}
    + {{!-- add button --}} + {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} +
  • {{/inline}} {{!-- @@ -58,145 +58,141 @@ !-- It is a flexbox with a child for each item value of interest. !-- An equipped checkbox is rendered if item.data.data.equipped is defined. !-- The partial assumes a variable item to be given in the context. -!-- If the partial is called with a partial block, the partial block +!-- If the partial is called with a partial block, the partial block !-- content is inserted before the description. !-- @param item: hand over the item to the partial as hash parameter !-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "itemListEntry"}} -
  • - {{!-- equipped --}} - {{#if (ne item.data.data.equipped undefined)}} - - {{/if}} - {{!-- image --}} -
    - -
    - {{!-- amount --}} - - {{!-- name --}} - - {{!-- item type specifics --}} - {{> @partial-block}} - {{!-- description --}} -
    {{{item.data.data.description}}}
    - {{!-- control buttons --}} - {{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }} -
  • +
  • + {{!-- equipped --}} + {{#if (ne item.data.data.equipped undefined)}} + + {{/if}} + {{!-- image --}} +
    + +
    + {{!-- amount --}} + + {{!-- name --}} + + {{!-- item type specifics --}} + {{> @partial-block}} + {{!-- description --}} +
    {{{item.data.data.description}}}
    + {{!-- control buttons --}} + {{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }} +
  • {{/inline}} {{!-- ======================================================================== --}} +{{!-- WEAPONS --}} +

    {{localize 'DS4.ItemTypeWeaponPlural'}}

    +{{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} +{{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }} +
      + {{#> itemListHeader dataType='weapon'}} +
      {{localize 'DS4.AttackTypeAbbr'}}
      +
      + {{localize 'DS4.WeaponBonusAbbr'}} +
      +
      + {{localize 'DS4.OpponentDefenseAbbr'}} +
      + {{/itemListHeader}} + {{#each itemsByType.weapon as |item id|}} + {{#> itemListEntry item=item}} +
      + +
      +
      {{ item.data.data.weaponBonus}}
      +
      {{ item.data.data.opponentDefense}}
      + {{/itemListEntry}} + {{/each}} +
    +{{!-- {{else}} +{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='weapon' }} --}} +{{/ifHasItemOfType}} -
    - - {{!-- WEAPONS --}} -

    {{localize 'DS4.ItemTypeWeaponPlural'}}

    - {{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} - {{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }} -
      - {{#> itemListHeader dataType='weapon'}} -
      {{localize 'DS4.AttackTypeAbbr'}}
      -
      - {{localize 'DS4.WeaponBonusAbbr'}} -
      -
      - {{localize 'DS4.OpponentDefenseAbbr'}} -
      - {{/itemListHeader}} - {{#each itemsByType.weapon as |item id|}} - {{#> itemListEntry item=item}} -
      - -
      -
      {{ item.data.data.weaponBonus}}
      -
      {{ item.data.data.opponentDefense}}
      - {{/itemListEntry}} - {{/each}} -
    - {{!-- {{else}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='weapon' }} --}} - {{/ifHasItemOfType}} - - {{!-- ARMOR --}} -

    {{localize 'DS4.ItemTypeArmorPlural'}}

    - {{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }} -
      - {{#> itemListHeader dataType='armor'}} -
      {{localize 'DS4.ArmorMaterialTypeAbbr'}}
      -
      {{localize 'DS4.ArmorTypeAbbr'}}
      -
      - {{localize 'DS4.ArmorValueAbbr'}} -
      - {{/itemListHeader}} - {{#each itemsByType.armor as |item id|}} - {{#> itemListEntry item=item }} -
      - {{lookup ../../config.armorMaterialTypesAbbr item.data.data.armorMaterialType}} -
      -
      - {{lookup ../../config.armorTypesAbbr item.data.data.armorType}} -
      -
      {{ item.data.data.armorValue}}
      - {{/itemListEntry}} - {{/each}} -
    - {{/ifHasItemOfType}} +{{!-- ARMOR --}} +

    {{localize 'DS4.ItemTypeArmorPlural'}}

    +{{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }} +
      + {{#> itemListHeader dataType='armor'}} +
      {{localize 'DS4.ArmorMaterialTypeAbbr'}}
      +
      {{localize 'DS4.ArmorTypeAbbr'}}
      +
      + {{localize 'DS4.ArmorValueAbbr'}} +
      + {{/itemListHeader}} + {{#each itemsByType.armor as |item id|}} + {{#> itemListEntry item=item }} +
      + {{lookup ../../config.armorMaterialTypesAbbr item.data.data.armorMaterialType}} +
      +
      + {{lookup ../../config.armorTypesAbbr item.data.data.armorType}} +
      +
      {{ item.data.data.armorValue}}
      + {{/itemListEntry}} + {{/each}} +
    +{{/ifHasItemOfType}} - {{!-- SHIELD --}} -

    {{localize 'DS4.ItemTypeShieldPlural'}}

    {{!-- SPECIFIC --}} - {{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }} -
      - {{#> itemListHeader dataType='shield' }} -
      - {{localize 'DS4.ArmorValueAbbr'}} -
      - {{/itemListHeader}} - {{#each itemsByType.shield as |item id|}} - {{#> itemListEntry item=item }} -
      {{item.data.data.armorValue}}
      {{!-- SPECIFIC --}} - {{/itemListEntry}} - {{/each}} -
    - {{/ifHasItemOfType}} +{{!-- SHIELD --}} +

    {{localize 'DS4.ItemTypeShieldPlural'}}

    {{!-- SPECIFIC --}} +{{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }} +
      + {{#> itemListHeader dataType='shield' }} +
      + {{localize 'DS4.ArmorValueAbbr'}} +
      + {{/itemListHeader}} + {{#each itemsByType.shield as |item id|}} + {{#> itemListEntry item=item }} +
      {{item.data.data.armorValue}}
      {{!-- SPECIFIC --}} + {{/itemListEntry}} + {{/each}} +
    +{{/ifHasItemOfType}} - {{!-- TRINKET --}} -

    {{localize 'DS4.ItemTypeTrinketPlural'}}

    - {{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }} -
      - {{#> itemListHeader dataType='trinket'}} -
      {{localize 'DS4.StorageLocation'}}
      - {{/itemListHeader}} - {{#each itemsByType.trinket as |item id|}} - {{#> itemListEntry item=item }} - - {{/itemListEntry}} - {{/each}} -
    - {{/ifHasItemOfType}} +{{!-- TRINKET --}} +

    {{localize 'DS4.ItemTypeTrinketPlural'}}

    +{{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }} +
      + {{#> itemListHeader dataType='trinket'}} +
      {{localize 'DS4.StorageLocation'}}
      + {{/itemListHeader}} + {{#each itemsByType.trinket as |item id|}} + {{#> itemListEntry item=item }} + + {{/itemListEntry}} + {{/each}} +
    +{{/ifHasItemOfType}} - {{!-- EQUIPMENT --}} -

    {{localize 'DS4.ItemTypeEquipmentPlural'}}

    - {{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }} -
      - {{#> itemListHeader dataType='equipment'}} -
      {{localize 'DS4.StorageLocation'}}
      - {{/itemListHeader}} - {{#each itemsByType.equipment as |item id|}} - {{#> itemListEntry item=item }} - - {{/itemListEntry}} - {{/each}} -
    - {{/ifHasItemOfType}} -
    \ No newline at end of file +{{!-- EQUIPMENT --}} +

    {{localize 'DS4.ItemTypeEquipmentPlural'}}

    +{{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }} +
      + {{#> itemListHeader dataType='equipment'}} +
      {{localize 'DS4.StorageLocation'}}
      + {{/itemListHeader}} + {{#each itemsByType.equipment as |item id|}} + {{#> itemListEntry item=item }} + + {{/itemListEntry}} + {{/each}} +
    +{{/ifHasItemOfType}} \ No newline at end of file