diff --git a/lang/en.json b/lang/en.json index 8f6b274..08a01c1 100644 --- a/lang/en.json +++ b/lang/en.json @@ -16,6 +16,7 @@ "TypeReaction": "Reaction", "TypeStance": "Stance", "TypeTrait": "Trait", - "TypeCondition": "Condition" + "TypeCondition": "Condition", + "TypeCraftingskill": "Crafting Skill" } } \ No newline at end of file diff --git a/modules/avd12-actor-sheet.js b/modules/avd12-actor-sheet.js index a1ce185..aca7410 100644 --- a/modules/avd12-actor-sheet.js +++ b/modules/avd12-actor-sheet.js @@ -45,6 +45,7 @@ export class Avd12ActorSheet extends ActorSheet { equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ), equippedArmor: this.actor.getEquippedArmor(), equippedShield: this.actor.getEquippedShield(), + craftingSkills: this.actor.getCraftingSkills(), subActors: duplicate(this.actor.getSubActors()), moneys: duplicate(this.actor.getMoneys()), focusData: this.actor.computeFinalFocusData(), @@ -129,6 +130,11 @@ export class Avd12ActorSheet extends ActorSheet { const li = $(event.currentTarget).parents(".item"); this.actor.rollSpell( li.data("item-id") ) }); + html.find('.roll-crafting').click((event) => { + const li = $(event.currentTarget).parents(".item"); + this.actor.rollCrafting( li.data("item-id") ) + }); + html.find('.roll-weapon').click((event) => { const li = $(event.currentTarget).parents(".item"); diff --git a/modules/avd12-actor.js b/modules/avd12-actor.js index f097d0c..d0a987e 100644 --- a/modules/avd12-actor.js +++ b/modules/avd12-actor.js @@ -176,7 +176,12 @@ export class Avd12Actor extends Actor { Avd12Utility.sortArrayObjectsByName(comp) return comp; } - + /* -------------------------------------------- */ + getCraftingSkills() { + let comp = duplicate(this.items.filter(item => item.type == 'craftingskill') || []) + Avd12Utility.sortArrayObjectsByName(comp) + return comp; + } /* -------------------------------------------- */ getArmors() { let comp = duplicate(this.items.filter(item => item.type == 'armor') || []); @@ -705,7 +710,20 @@ export class Avd12Actor extends Actor { console.log("New fovcus", this.system, focusData) this.update({ 'system.focus': focusData }) } - + /* -------------------------------------------- */ + rollCrafting(craftId) { + let crafting = this.items.get(craftId) + if (crafting) { + crafting = duplicate(crafting) + let rollData = this.getCommonRollData() + rollData.mode = "crafting" + rollData.crafting = crafting + rollData.img = crafting.img + this.startRoll(rollData) + } else { + ui.notifications.warn("Unable to find the relevant weapon ") + } + } /* -------------------------------------------- */ rollWeapon(weaponId) { let weapon = this.items.get(weaponId) @@ -722,6 +740,7 @@ export class Avd12Actor extends Actor { ui.notifications.warn("Unable to find the relevant weapon ") } } + /* -------------------------------------------- */ async rollWeaponDamage(weaponId, damageType) { let weapon = this.items.get(weaponId) diff --git a/modules/avd12-item.js b/modules/avd12-item.js index d56dc62..5583aa3 100644 --- a/modules/avd12-item.js +++ b/modules/avd12-item.js @@ -9,6 +9,7 @@ export const defaultItemImg = { module: "systems/fvtt-avd12/images/icons/focus2.webp", money: "systems/fvtt-avd12/images/icons/focus2.webp", spell: "systems/fvtt-avd12/images/icons/spell1.webp", + craftingskill: "systems/fvtt-avd12/images/icons/cloak2.webp", } /** diff --git a/modules/avd12-utility.js b/modules/avd12-utility.js index 71bb3cd..09e8a40 100644 --- a/modules/avd12-utility.js +++ b/modules/avd12-utility.js @@ -528,6 +528,9 @@ export class Avd12Utility { if (rollData.skill) { diceFormula += "+" + rollData.skill.finalvalue } + if (rollData.crafting) { + diceFormula += "+" + rollData.crafting.system.level + } if (rollData.spellAttack) { diceFormula += "+" + rollData.spellAttack } diff --git a/system.json b/system.json index 602380c..5d2be7a 100644 --- a/system.json +++ b/system.json @@ -64,7 +64,7 @@ ], "title": "AnyVenture D12 RPG", "url": "https://www.uberwald.me/gitea/public/fvtt-avd12", - "version": "10.0.22", - "download": "https://www.uberwald.me/gitea/public/fvtt-avd12/archive/fvtt-avd12-v10.0.22.zip", + "version": "10.0.23", + "download": "https://www.uberwald.me/gitea/public/fvtt-avd12/archive/fvtt-avd12-v10.0.23.zip", "background": "systems/fvtt-avd12/images/ui/avd12_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index d910ffc..9ac0261 100644 --- a/template.json +++ b/template.json @@ -356,6 +356,7 @@ "weapon", "module", "money", + "craftingskill", "condition", "action", "freeaction", @@ -417,6 +418,10 @@ "movespeed": 0 } }, + "craftingskill" : { + "level": 0, + "description": "" + }, "action": { "description": "" }, diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 2c91946..06fbe15 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -493,6 +493,39 @@ + {{!-- Equipement Tab --}} +
+ + + + +
+ {{!-- Biography Tab --}}
diff --git a/templates/chat/chat-generic-result.hbs b/templates/chat/chat-generic-result.hbs index 236ae8e..c967f5d 100644 --- a/templates/chat/chat-generic-result.hbs +++ b/templates/chat/chat-generic-result.hbs @@ -23,6 +23,11 @@ {{/if}} + {{#if crafting}} +
  • Crafting : {{crafting.name}} ({{crafting.system.level}}) +
  • + {{/if}} + {{#if spell}}
  • Spell : {{spell.name}} ({{spell.system.level}})
  • @@ -30,6 +35,7 @@ {{/if}} +
  • Bonus/Malus {{bonusMalusRoll}}
  • Dice Formula {{diceFormula}}
  • Result {{roll.total}}
  • diff --git a/templates/dialogs/roll-dialog-generic.hbs b/templates/dialogs/roll-dialog-generic.hbs index 8daa712..e017c32 100644 --- a/templates/dialogs/roll-dialog-generic.hbs +++ b/templates/dialogs/roll-dialog-generic.hbs @@ -15,6 +15,13 @@
    {{/if}} + {{#if crafting}} +
    + Crafting : + {{crafting.name}} ({{crafting.system.level}}) +
    + {{/if}} + {{#if weapon}}
    Weapon Attack Bonus : diff --git a/templates/items/item-craftingskill-sheet.hbs b/templates/items/item-craftingskill-sheet.hbs new file mode 100644 index 0000000..d7f0352 --- /dev/null +++ b/templates/items/item-craftingskill-sheet.hbs @@ -0,0 +1,32 @@ +
    +
    + +
    +

    +
    +
    + + {{> systems/fvtt-avd12/templates/items/partial-item-nav.hbs}} + + + {{!-- Sheet Body --}} +
    + + {{> systems/fvtt-avd12/templates/items/partial-item-description.hbs}} + +
    + +
    +
      + +
    • + + +
    • + +
    +
    +
    + +
    +