From 17e8fb4aa6b8a414bc2d1c0455e218f2a0d8311d Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Sun, 22 Jan 2023 10:23:05 +0100 Subject: [PATCH] Add Weapon rolls --- modules/avd12-actor-sheet.js | 10 +- modules/avd12-actor.js | 188 +++++------------- modules/avd12-item-sheet.js | 1 - packs/weapons.db | 15 ++ system.json | 9 + templates/actors/actor-sheet.hbs | 31 ++- templates/chat/chat-damage-result.hbs | 34 ++++ templates/items/item-weapon-sheet.hbs | 2 +- .../items/partial-options-weapon-types.hbs | 1 + 9 files changed, 143 insertions(+), 148 deletions(-) create mode 100644 packs/weapons.db create mode 100644 templates/chat/chat-damage-result.hbs diff --git a/modules/avd12-actor-sheet.js b/modules/avd12-actor-sheet.js index 6db9fc5..a1ce185 100644 --- a/modules/avd12-actor-sheet.js +++ b/modules/avd12-actor-sheet.js @@ -132,8 +132,14 @@ export class Avd12ActorSheet extends ActorSheet { html.find('.roll-weapon').click((event) => { const li = $(event.currentTarget).parents(".item"); - const skillId = li.data("item-id") - this.actor.rollWeapon(skillId) + const weponId = li.data("item-id") + this.actor.rollWeapon(weponId) + }); + html.find('.roll-weapon-damage').click((event) => { + const li = $(event.currentTarget).parents(".item"); + const dmg = $(event.currentTarget).data("damage") + const weaponId = li.data("item-id") + this.actor.rollWeaponDamage(weaponId, dmg) }); diff --git a/modules/avd12-actor.js b/modules/avd12-actor.js index 600b849..68b7fbf 100644 --- a/modules/avd12-actor.js +++ b/modules/avd12-actor.js @@ -199,8 +199,27 @@ export class Avd12Actor extends Actor { return comp; } /* -------------------------------------------- */ + addDamages( damage) { + //console.log(damage) + if ( damage.damagetype != "none" && damage.dice ) { + damage.normal = damage.dice + '+' + damage.bonus + damage.critical = damage.dice + '+' + Number(damage.bonus)*2 + let parser = damage.dice.match(/(\d+)(d\d+)/) + let nbDice = 2 + if (parser && parser[1]) { + nbDice = Number(parser[1]) * 2 + } + damage.brutal = nbDice + parser[2] + "+" + Number(damage.bonus)*2 + } + } + /* -------------------------------------------- */ getWeapons() { - let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []); + let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []) + comp.forEach(item => { + this.addDamages(item.system.damages.primary) + this.addDamages(item.system.damages.secondary) + this.addDamages(item.system.damages.tertiary) + }) Avd12Utility.sortArrayObjectsByName(comp) return comp; } @@ -664,156 +683,41 @@ export class Avd12Actor extends Actor { let weapon = this.items.get(weaponId) if (weapon) { weapon = duplicate(weapon) - let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase()) - if (skill) { - skill = duplicate(skill) - Avd12Utility.updateSkill(skill) - let abilityKey = skill.system.ability - let rollData = this.getCommonRollData(abilityKey) - rollData.mode = "weapon" - rollData.skill = skill - rollData.weapon = weapon - rollData.img = weapon.img - if (!rollData.forceDisadvantage) { // This is an attack, check if disadvantaged - rollData.forceDisadvantage = this.isAttackDisadvantage() - } - /*if (rollData.weapon.system.isranged && rollData.tokensDistance > Avd12Utility.getWeaponMaxRange(rollData.weapon) ) { - ui.notifications.warn(`Your target is out of range of your weapon (max: ${Avd12Utility.getWeaponMaxRange(rollData.weapon)} - current : ${rollData.tokensDistance})` ) - return - }*/ - this.startRoll(rollData) - } else { - ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name) - } + let rollData = this.getCommonRollData() + rollData.modifier = this.system.bonus[weapon.system.weapontype] + rollData.mode = "weapon" + rollData.weapon = weapon + rollData.img = weapon.img + this.startRoll(rollData) + } else { + ui.notifications.warn("Unable to find the relevant weapon ") } } - /* -------------------------------------------- */ - rollDefenseMelee(attackRollData) { - let weapon = this.items.get(attackRollData.defenseWeaponId) + async rollWeaponDamage(weaponId, damageType) { + let weapon = this.items.get(weaponId) if (weapon) { weapon = duplicate(weapon) - let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase()) - if (skill) { - skill = duplicate(skill) - Avd12Utility.updateSkill(skill) - let abilityKey = skill.system.ability - let rollData = this.getCommonRollData(abilityKey) - rollData.defenderTokenId = undefined // Cleanup - rollData.mode = "weapondefense" - rollData.shield = this.getEquippedShield() - rollData.attackRollData = duplicate(attackRollData) - rollData.skill = skill - rollData.weapon = weapon - rollData.img = weapon.img - if (!rollData.forceDisadvantage) { // This is an attack, check if disadvantaged - rollData.forceDisadvantage = this.isDefenseDisadvantage() - } - - this.startRoll(rollData) - } else { - ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name) - } - } else { - ui.notifications.warn("Weapon not found ! ") - } - } - - /* -------------------------------------------- */ - rollDefenseRanged(attackRollData) { - let rollData = this.getCommonRollData() - rollData.defenderTokenId = undefined // Cleanup - rollData.mode = "rangeddefense" - if (attackRollData) { - rollData.attackRollData = duplicate(attackRollData) - rollData.effectiveRange = Avd12Utility.getWeaponRange(attackRollData.weapon) - rollData.tokensDistance = attackRollData.tokensDistance // QoL copy - } - rollData.sizeDice = Avd12Utility.getSizeDice(this.system.biodata.size) - rollData.distanceBonusDice = 0 //Math.max(0, Math.floor((rollData.tokensDistance - rollData.effectiveRange) + 0.5)) - rollData.hasCover = "none" - rollData.situational = "none" - rollData.useshield = false - rollData.shield = this.getEquippedShield() - this.startRoll(rollData) - } - - /* -------------------------------------------- */ - rollShieldDie() { - let shield = this.getEquippedShield() - if (shield) { - shield = duplicate(shield) + this.addDamages(weapon.system.damages.primary) let rollData = this.getCommonRollData() - rollData.mode = "shield" - rollData.shield = shield - rollData.useshield = true - rollData.img = shield.img - this.startRoll(rollData) + rollData.damageFormula = weapon.system.damages.primary[damageType] + rollData.mode = "weapon-damage" + rollData.weapon = weapon + rollData.damageType = damageType + rollData.img = weapon.img + let myRoll = new Roll(rollData.damageFormula).roll({ async: false }) + await Avd12Utility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) + rollData.roll = myRoll + let msg = await Avd12Utility.createChatWithRollMode(rollData.alias, { + content: await renderTemplate(`systems/fvtt-avd12/templates/chat/chat-damage-result.hbs`, rollData) + }) + msg.setFlag("world", "rolldata", rollData) + + } else { + ui.notifications.warn("Unable to find the relevant weapon ") } } - /* -------------------------------------------- */ - async rollArmorDie(rollData = undefined) { - let armor = this.getEquippedArmor() - if (armor) { - armor = duplicate(armor) - let reduce = 0 - let multiply = 1 - let disadvantage = false - let advantage = false - let messages = ["Armor applied"] - - if (rollData) { - if (Avd12Utility.isArmorLight(armor) && Avd12Utility.isWeaponPenetrating(rollData.attackRollData.weapon)) { - return { armorIgnored: true, nbSuccess: 0, messages: ["Armor ignored : Penetrating weapons ignore Light Armors."] } - } - if (Avd12Utility.isWeaponPenetrating(rollData.attackRollData.weapon)) { - messages.push("Armor reduced by 1 (Penetrating weapon)") - reduce = 1 - } - if (Avd12Utility.isWeaponLight(rollData.attackRollData.weapon)) { - messages.push("Armor with advantage (Light weapon)") - advantage = true - } - if (Avd12Utility.isWeaponHeavy(rollData.attackRollData.weapon)) { - messages.push("Armor with disadvantage (Heavy weapon)") - disadvantage = true - } - if (Avd12Utility.isWeaponHack(rollData.attackRollData.weapon)) { - messages.push("Armor reduced by 1 (Hack weapon)") - reduce = 1 - } - if (Avd12Utility.isWeaponUndamaging(rollData.attackRollData.weapon)) { - messages.push("Armor multiplied by 2 (Undamaging weapon)") - multiply = 2 - } - } - let diceColor = armor.system.absorprionroll - let armorResult = await Avd12Utility.getRollTableFromDiceColor(diceColor, false) - console.log("Armor log", armorResult) - let armorValue = Math.max(0, (Number(armorResult.text) + reduce) * multiply) - if (advantage || disadvantage) { - let armorResult2 = await Avd12Utility.getRollTableFromDiceColor(diceColor, false) - let armorValue2 = Math.max(0, (Number(armorResult2.text) + reduce) * multiply) - if (advantage) { - armorValue = (armorValue2 > armorValue) ? armorValue2 : armorValue - messages.push(`Armor advantage - Roll 1 = ${armorValue} - Roll 2 = ${armorValue2}`) - } - if (disadvantage) { - armorValue = (armorValue2 < armorValue) ? armorValue2 : armorValue - messages.push(`Armor disadvantage - Roll 1 = ${armorValue} - Roll 2 = ${armorValue2}`) - } - } - armorResult.armorValue = armorValue - if (!rollData) { - ChatMessage.create({ content: "Armor result : " + armorValue }) - } - messages.push("Armor result : " + armorValue) - return { armorIgnored: false, nbSuccess: armorValue, rawArmor: armorResult.text, messages: messages } - } - return { armorIgnored: true, nbSuccess: 0, messages: ["No armor equipped."] } - } - /* -------------------------------------------- */ async startRoll(rollData) { this.syncRoll(rollData) diff --git a/modules/avd12-item-sheet.js b/modules/avd12-item-sheet.js index c41a6fb..fba0613 100644 --- a/modules/avd12-item-sheet.js +++ b/modules/avd12-item-sheet.js @@ -19,7 +19,6 @@ export class Avd12ItemSheet extends ItemSheet { }); } - /* -------------------------------------------- */ _getHeaderButtons() { let buttons = super._getHeaderButtons(); diff --git a/packs/weapons.db b/packs/weapons.db new file mode 100644 index 0000000..0a32437 --- /dev/null +++ b/packs/weapons.db @@ -0,0 +1,15 @@ +{"name":"Heavy 2-Handed Blunt Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":200,"cost":1200,"health":0,"movespeed":0,"equipped":false,"weapontype":"crush","category":"heavy2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"2d8","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHar0Cqlcw9R","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 1-Handed Blunt Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":50,"cost":350,"health":0,"movespeed":0,"equipped":false,"weapontype":"crush","category":"light1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d10","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHar32dCrCv2","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy 1-Handed Slash Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"slash","category":"heavy1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d12","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHar8Juk5ks7","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 2-Handed Slash Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"slash","category":"light2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"3d4","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarDxHs0eLp","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy Ranged Weapon","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":120,"cost":1200,"health":0,"movespeed":0,"equipped":false,"weapontype":"ranged","category":"heavyranged","minrange":4,"maxrange":30,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"2d6","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarFD3DmT42","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 1-Handed Slash Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":50,"cost":350,"health":0,"movespeed":0,"equipped":false,"weapontype":"slash","category":"light1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d10","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarH20z6Lzc","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 1-Handed Pierce Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":50,"cost":350,"health":0,"movespeed":0,"equipped":false,"weapontype":"pierce","category":"light1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d10","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarHuz9mQH3","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy 2-Handed Slash Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":200,"cost":1200,"health":0,"movespeed":0,"equipped":false,"weapontype":"slash","category":"heavy2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"2d8","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarO3iVLBrZ","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 2-Handed Pierce Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"pierce","category":"light2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"3d4","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarP3WA52j3","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light 2-Handed Blunt Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"crush","category":"light2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"3d4","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarU8V5XbYB","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy 2-Handed Pierce Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":200,"cost":1200,"health":0,"movespeed":0,"equipped":false,"weapontype":"pierce","category":"heavy2h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"2d8","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarV3eCc8Ed","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy 1-Handed Blunt Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"crush","category":"heavy1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d12","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHarc8F58s38","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Ultra-Light Ranged Weapon","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":40,"cost":400,"health":0,"movespeed":0,"equipped":false,"weapontype":"ranged","category":"ulightranged","minrange":0,"maxrange":4,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d6","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHariX73eN1h","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Heavy 1-Handed Pierce Weapon [Iron]","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":100,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"pierce","category":"heavy1h","minrange":0,"maxrange":0,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d12","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHaroH0fihZh","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} +{"name":"Light Ranged Weapon","type":"weapon","img":"systems/fvtt-avd12/images/icons/weapon2.webp","system":{"focuspointsbonus":0,"focusregenbonus":0,"burnchancebonus":0,"mitigation":{"physical":{"value":0},"psychic":{"value":0},"fire":{"value":0},"lightning":{"value":0},"cold":{"value":0},"dark":{"value":0},"divine":{"value":0},"arcane":{"value":0}},"bonus":{"block":{"value":0},"dodge":{"value":0},"resistance":{"value":0}},"focus":{"isfocus":false,"core":"corenone","treatment":"treatmentnone","bond":"bondnone"},"weight":80,"cost":600,"health":0,"movespeed":0,"equipped":false,"weapontype":"ranged","category":"lightranged","minrange":2,"maxrange":10,"throwrange":0,"magical":false,"blackenediron":false,"silvered":false,"damages":{"primary":{"damagetype":"physical","dice":"1d8","bonus":"0"},"secondary":{"damagetype":"none","dice":"","bonus":"0"},"tertiary":{"damagetype":"none","dice":"","bonus":"0"}},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.MOcIlHar8MM7JNm7"}},"_stats":{"systemId":"fvtt-avd12","systemVersion":"10.0.11","coreVersion":"10.288","createdTime":1671358405255,"modifiedTime":1671361680079,"lastModifiedBy":"JgmaAbvFHQvSlowN"},"_id":"MOcIlHaruSwtPJ77","folder":null,"sort":0,"ownership":{"default":0,"JgmaAbvFHQvSlowN":3}} diff --git a/system.json b/system.json index 17db1fd..6beb523 100644 --- a/system.json +++ b/system.json @@ -51,6 +51,15 @@ "system": "fvtt-avd12", "private": false, "flags": {} + }, + { + "type": "Item", + "label": "Weapons", + "name": "weapons", + "path": "packs/weapons.db", + "system": "fvtt-avd12", + "private": false, + "flags": {} } ], "title": "AnyVenture D12 RPG", diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index fe5aed0..801d9f6 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -109,7 +109,7 @@ - {{!-- Combat Tab --}} + {{!-- Modules Tab --}}
@@ -197,6 +197,34 @@
+ +
  • @@ -225,7 +253,6 @@
{{/each}} -
diff --git a/templates/chat/chat-damage-result.hbs b/templates/chat/chat-damage-result.hbs new file mode 100644 index 0000000..f1f0199 --- /dev/null +++ b/templates/chat/chat-damage-result.hbs @@ -0,0 +1,34 @@ +
+ {{#if actorImg}} + {{alias}} + {{/if}} +

{{alias}}

+
+ +
+ + {{#if img}} +
+ {{name}} +
+ {{/if}} + +
+
+ +
+
    + +
  • Weapon : {{weapon.name}} +
  • +
  • Damage formula : {{damageFormula}} ({{upperFirst damageType}}) +
  • +
  • Damage type : {{upperFirst weapon.system.damages.primary.damagetype}} +
  • +
  • Total : {{roll.total}} +
  • + +
+
+ +
diff --git a/templates/items/item-weapon-sheet.hbs b/templates/items/item-weapon-sheet.hbs index 3dfc21d..6e74b39 100644 --- a/templates/items/item-weapon-sheet.hbs +++ b/templates/items/item-weapon-sheet.hbs @@ -98,7 +98,7 @@
- +
diff --git a/templates/items/partial-options-weapon-types.hbs b/templates/items/partial-options-weapon-types.hbs index 0116e0d..b8093ae 100644 --- a/templates/items/partial-options-weapon-types.hbs +++ b/templates/items/partial-options-weapon-types.hbs @@ -3,3 +3,4 @@ +