diff --git a/lang/en.json b/lang/en.json index 57fb7d6..864696a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -36,5 +36,23 @@ "WH.ui.attrbonus": "Attribute (+4/Lvl4, +2/Lvl8)", "WH.ui.weapons": "Weapons", "WH.ui.armors": "Armors", - "WH.ui.shields": "Shields" + "WH.ui.shields": "Shields", + + "WH.ui.Strength": "Strength", + "WH.ui.Instinct": "Instinct", + "WH.ui.Mind": "Mind", + "WH.ui.Type": "Type", + "WH.ui.HitPoints": "Hit Points", + "WH.ui.Defence": "Defence", + "WH.ui.Throw2Hit": "Throw to Hit", + "WH.ui.Mana": "Mana", + "WH.ui.Initiative": "Initiative", + "WH.ui.Movement": "Movement", + + "WH.ui.Qty": "Qty", + "WH.ui.maxslots": "Max slots", + "WH.ui.slotsused": "Slots used", + "WH.ui.Damage": "Damage", + "WH.ui.parrybonus": "Parry bonus", + "WH.ui.damagereduction": "Damage reduction" } \ No newline at end of file diff --git a/modules/warhero-actor-sheet.js b/modules/warhero-actor-sheet.js index 3e187cc..48bf361 100644 --- a/modules/warhero-actor-sheet.js +++ b/modules/warhero-actor-sheet.js @@ -14,7 +14,7 @@ export class WarheroActorSheet extends ActorSheet { return mergeObject(super.defaultOptions, { classes: ["fvtt-warhero", "sheet", "actor"], template: "systems/fvtt-warhero/templates/actor-sheet.html", - width: 960, + width: 720, height: 720, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], @@ -24,8 +24,7 @@ export class WarheroActorSheet extends ActorSheet { /* -------------------------------------------- */ async getData() { - const objectData = this.object.system - let actorData = duplicate(objectData) + const objectData = duplicate(this.object.system) let formData = { title: this.title, @@ -35,25 +34,21 @@ export class WarheroActorSheet extends ActorSheet { name: this.actor.name, editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", - data: actorData, + system: objectData, limited: this.object.limited, skills: this.actor.getSkills( ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())), shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())), - spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())), + powers: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getPowers())), equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ), - equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ), - equippedArmor: this.actor.getEquippedArmor(), - equippedShield: this.actor.getEquippedShield(), + slotEquipments: this.actor.buildEquipmentsSlot(), subActors: duplicate(this.actor.getSubActors()), race: duplicate(this.actor.getRace()), + class: duplicate(this.actor.getClass()), moneys: duplicate(this.actor.getMoneys()), - encCapacity: this.actor.getEncumbranceCapacity(), description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}), notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}), - containersTree: this.actor.containersTree, - encCurrent: this.actor.encCurrent, options: this.options, owner: this.document.isOwner, editScore: this.options.editScore, @@ -136,35 +131,16 @@ export class WarheroActorSheet extends ActorSheet { this.actor.incDecAmmo( li.data("item-id"), +1 ) } ); - html.find('.roll-ability').click((event) => { - const abilityKey = $(event.currentTarget).data("ability-key"); - this.actor.rollAbility(abilityKey); + html.find('.roll-this').click((event) => { + const rollType = $(event.currentTarget).data("type") + const statKey = $(event.currentTarget).data("key") + this.actor.rollFromType(rollType, statKey) }); - html.find('.roll-skill').click((event) => { - const li = $(event.currentTarget).parents(".item") - const skillId = li.data("item-id") - this.actor.rollSkill(skillId) - }); - html.find('.roll-weapon').click((event) => { const li = $(event.currentTarget).parents(".item"); const skillId = li.data("item-id") this.actor.rollWeapon(skillId) }); - html.find('.roll-armor-die').click((event) => { - this.actor.rollArmorDie() - }); - html.find('.roll-shield-die').click((event) => { - this.actor.rollShieldDie() - }); - html.find('.roll-target-die').click((event) => { - this.actor.rollDefenseRanged() - }); - - html.find('.roll-save').click((event) => { - const saveKey = $(event.currentTarget).data("save-key") - this.actor.rollSave(saveKey) - }); html.find('.lock-unlock-sheet').click((event) => { diff --git a/modules/warhero-actor.js b/modules/warhero-actor.js index 5c49b98..f01d47d 100644 --- a/modules/warhero-actor.js +++ b/modules/warhero-actor.js @@ -64,25 +64,6 @@ export class WarheroActor extends Actor { /* -------------------------------------------- */ computeHitPoints() { if (this.type == "character") { - let hp = duplicate(this.system.secondary.hp) - let max = (this.system.abilities.str.value + this.system.abilities.con.value) * 6 - if (max != hp.max || hp.value > max) { - hp.max = max - hp.value = max // Init case - this.update({ 'system.secondary.hp': hp }) - } - } - } - /* -------------------------------------------- */ - computeEffortPoints() { - if (this.type == "character") { - let effort = duplicate(this.system.secondary.effort) - let max = (this.system.abilities.con.value + this.system.abilities.int.value) * 6 - if (max != effort.max || effort.value > max) { - effort.max = max - effort.value = max // Init case - this.update({ 'system.secondary.effort': effort }) - } } } @@ -90,10 +71,7 @@ export class WarheroActor extends Actor { prepareDerivedData() { if (this.type == 'character' || game.user.isGM) { - this.system.encCapacity = this.getEncumbranceCapacity() - this.buildContainerTree() this.computeHitPoints() - this.computeEffortPoints() } super.prepareDerivedData(); @@ -150,12 +128,10 @@ export class WarheroActor extends Actor { WarheroUtility.sortArrayObjectsByName(comp) return comp; } - getEquippedArmor() { - let comp = this.items.find(item => item.type == 'armor' && item.system.equipped) - if (comp) { - return duplicate(comp) - } - return undefined + getPowers() { + let comp = duplicate(this.items.filter(item => item.type == 'power') || []); + WarheroUtility.sortArrayObjectsByName(comp) + return comp; } /* -------------------------------------------- */ getShields() { @@ -163,19 +139,17 @@ export class WarheroActor extends Actor { WarheroUtility.sortArrayObjectsByName(comp) return comp; } - getEquippedShield() { - let comp = this.items.find(item => item.type == 'shield' && item.system.equipped) - if (comp) { - return duplicate(comp) - } - return undefined - } /* -------------------------------------------- */ getRace() { let race = this.items.filter(item => item.type == 'race') return race[0] ?? []; } /* -------------------------------------------- */ + getClass() { + let classWH = this.items.filter(item => item.type == 'class') + return classWH[0] ?? []; + } + /* -------------------------------------------- */ checkAndPrepareEquipment(item) { } @@ -186,7 +160,22 @@ export class WarheroActor extends Actor { } return listItem } - + /* -------------------------------------------- */ + buildEquipmentsSlot() { + let containers = {} + for(let slotName in game.system.warhero.config.slotNames) { + let slotDef = game.system.warhero.config.slotNames[slotName] + containers[slotName] = duplicate(slotDef) + containers[slotName].content = this.items.filter(it => (it.type == 'weapon' || it.type == 'armor' || it.type == 'shield'||it.type == 'equipment') + && it.system.slotlocation == slotName ) + let slotUsed = 0 + for(let item of containers[slotName].content) { + slotUsed += item.system.slotused + } + containers[slotName].slotUsed = slotUsed + } + return containers + } /* -------------------------------------------- */ getConditions() { let comp = duplicate(this.items.filter(item => item.type == 'condition') || []); @@ -533,97 +522,24 @@ export class WarheroActor extends Actor { } /* -------------------------------------------- */ - getCommonRollData(abilityKey = undefined) { - let noAction = this.isNoAction() - if (noAction) { - ui.notifications.warn("You can't do any actions du to the condition : " + noAction.name) - return - } - + getCommonRollData() { let rollData = WarheroUtility.getBasicRollData() rollData.alias = this.name rollData.actorImg = this.img rollData.actorId = this.id rollData.img = this.img - rollData.featsDie = this.getFeatsWithDie() - rollData.featsSL = this.getFeatsWithSL() - rollData.armors = this.getArmors() - rollData.conditions = this.getConditions() - rollData.featDieName = "none" - rollData.featSLName = "none" - rollData.rollAdvantage = "none" - rollData.advantage = "none" - rollData.disadvantage = "none" - rollData.forceAdvantage = this.isForcedAdvantage() - rollData.forceDisadvantage = this.isForcedDisadvantage() - rollData.forceRollAdvantage = this.isForcedRollAdvantage() - rollData.forceRollDisadvantage = this.isForcedRollDisadvantage() - rollData.noAdvantage = this.isNoAdvantage() - if (rollData.defenderTokenId) { - let defenderToken = game.canvas.tokens.get(rollData.defenderTokenId) - let defender = defenderToken.actor - - // Distance management - let token = this.token - if (!token) { - let tokens = this.getActiveTokens() - token = tokens[0] - } - if (token) { - const ray = new Ray(token.object?.center || token.center, defenderToken.center) - rollData.tokensDistance = canvas.grid.measureDistances([{ ray }], { gridSpaces: false })[0] / canvas.grid.grid.options.dimensions.distance - } else { - ui.notifications.info("No token connected to this actor, unable to compute distance.") - return - } - if (defender) { - rollData.forceAdvantage = defender.isAttackerAdvantage() - rollData.advantageFromTarget = true - } - } - - if (abilityKey) { - rollData.ability = this.getAbility(abilityKey) - rollData.selectedKill = undefined - } - console.log("ROLLDATA", rollData) return rollData } /* -------------------------------------------- */ - rollAbility(abilityKey) { - let rollData = this.getCommonRollData(abilityKey) - rollData.mode = "ability" - if (rollData.target) { - ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.") - return - } - WarheroUtility.rollWarhero(rollData) - } - - /* -------------------------------------------- */ - rollSkill(skillId) { - let skill = this.items.get(skillId) - if (skill) { - if (skill.system.islore && skill.system.level == 0) { - ui.notifications.warn("You can't use Lore Skills with a SL of 0.") - return - } - skill = duplicate(skill) - WarheroUtility.updateSkill(skill) - let abilityKey = skill.system.ability - let rollData = this.getCommonRollData(abilityKey) - rollData.mode = "skill" - rollData.skill = skill - rollData.img = skill.img - if (rollData.target) { - ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.") - return - } - this.startRoll(rollData) - } + rollFromType(rollType, rollKey) { + let stat = duplicate(this.system[rollType][rollKey]) + let rollData = this.getCommonRollData() + rollData.mode = rollType + rollData.stat = stat + this.startRoll(rollData) } /* -------------------------------------------- */ @@ -655,149 +571,7 @@ export class WarheroActor extends Actor { } } - /* -------------------------------------------- */ - rollDefenseMelee(attackRollData) { - let weapon = this.items.get(attackRollData.defenseWeaponId) - if (weapon) { - weapon = duplicate(weapon) - let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase()) - if (skill) { - skill = duplicate(skill) - WarheroUtility.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 = WarheroUtility.getWeaponRange(attackRollData.weapon) - rollData.tokensDistance = attackRollData.tokensDistance // QoL copy - } - rollData.sizeDice = WarheroUtility.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) - let rollData = this.getCommonRollData() - rollData.mode = "shield" - rollData.shield = shield - rollData.useshield = true - rollData.img = shield.img - this.startRoll(rollData) - } - } - - /* -------------------------------------------- */ - 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 (WarheroUtility.isArmorLight(armor) && WarheroUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { - return { armorIgnored: true, nbSuccess: 0, messages: ["Armor ignored : Penetrating weapons ignore Light Armors."] } - } - if (WarheroUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { - messages.push("Armor reduced by 1 (Penetrating weapon)") - reduce = 1 - } - if (WarheroUtility.isWeaponLight(rollData.attackRollData.weapon)) { - messages.push("Armor with advantage (Light weapon)") - advantage = true - } - if (WarheroUtility.isWeaponHeavy(rollData.attackRollData.weapon)) { - messages.push("Armor with disadvantage (Heavy weapon)") - disadvantage = true - } - if (WarheroUtility.isWeaponHack(rollData.attackRollData.weapon)) { - messages.push("Armor reduced by 1 (Hack weapon)") - reduce = 1 - } - if (WarheroUtility.isWeaponUndamaging(rollData.attackRollData.weapon)) { - messages.push("Armor multiplied by 2 (Undamaging weapon)") - multiply = 2 - } - } - let diceColor = armor.system.absorprionroll - let armorResult = await WarheroUtility.getRollTableFromDiceColor(diceColor, false) - console.log("Armor log", armorResult) - let armorValue = Math.max(0, (Number(armorResult.text) + reduce) * multiply) - if (advantage || disadvantage) { - let armorResult2 = await WarheroUtility.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."] } - } - - /* -------------------------------------------- */ - rollSave(saveKey) { - let saves = this.getSaveRoll() - let save = saves[saveKey] - if (save) { - save = duplicate(save) - let rollData = this.getCommonRollData() - rollData.mode = "save" - rollData.save = save - if (rollData.target) { - ui.notifications.warn("You are targetting a token with a save roll - Not authorized.") - return - } - this.startRoll(rollData) - } - - } /* -------------------------------------------- */ async startRoll(rollData) { this.syncRoll(rollData) diff --git a/modules/warhero-item-sheet.js b/modules/warhero-item-sheet.js index 85515da..a298a91 100644 --- a/modules/warhero-item-sheet.js +++ b/modules/warhero-item-sheet.js @@ -69,7 +69,6 @@ export class WarheroItemSheet extends ItemSheet { limited: this.object.limited, options: this.options, owner: this.document.isOwner, - abilities: duplicate(game.model.Actor.character.abilities), isGM: game.user.isGM } if ( this.object.type == "power") { diff --git a/modules/warhero-roll-dialog.js b/modules/warhero-roll-dialog.js index 50d350c..047b092 100644 --- a/modules/warhero-roll-dialog.js +++ b/modules/warhero-roll-dialog.js @@ -5,7 +5,7 @@ export class WarheroRollDialog extends Dialog { /* -------------------------------------------- */ static async create(actor, rollData) { - let options = { classes: ["WarheroDialog"], width: 540, height: 340, 'z-index': 99999 }; + let options = { classes: ["WarheroDialog"], width: 320, height: 'fit-content', 'z-index': 99999 }; let html = await renderTemplate('systems/fvtt-warhero/templates/roll-dialog-generic.html', rollData); return new WarheroRollDialog(actor, rollData, html, options); @@ -76,8 +76,8 @@ export class WarheroRollDialog extends Dialog { html.find('#situational').change((event) => { this.rollData.situational = event.currentTarget.value }) - html.find('#distanceBonusDice').change((event) => { - this.rollData.distanceBonusDice = Number(event.currentTarget.value) + html.find('#bonusMalus').change((event) => { + this.rollData.bonusMalus = Number(event.currentTarget.value) }) } diff --git a/modules/warhero-utility.js b/modules/warhero-utility.js index eca3735..ccfc988 100644 --- a/modules/warhero-utility.js +++ b/modules/warhero-utility.js @@ -234,7 +234,7 @@ export class WarheroUtility { const templatePaths = [ 'systems/fvtt-warhero/templates/editor-notes-gm.html', 'systems/fvtt-warhero/templates/partial-roll-select.html', - 'systems/fvtt-warhero/templates/partial-actor-ability-block.html', + 'systems/fvtt-warhero/templates/partial-actor-stat-block.html', 'systems/fvtt-warhero/templates/partial-actor-status.html', 'systems/fvtt-warhero/templates/partial-options-abilities.html', 'systems/fvtt-warhero/templates/partial-item-nav.html', @@ -541,94 +541,12 @@ export class WarheroUtility { let actor = game.actors.get(rollData.actorId) // ability/save/size => 0 - let diceFormula - let startFormula = "0d6cs>=5[blue]" - if (rollData.ability) { - startFormula = String(rollData.ability.value) + "d6cs>=5[blue]" - } - if (rollData.save) { - startFormula = String(rollData.save.value) + "d6cs>=5[blue]" - } - if (rollData.sizeDice) { - let nb = rollData.sizeDice.nb + rollData.distanceBonusDice + this.getDiceFromCover(rollData.hasCover) + this.getDiceFromSituational(rollData.situational) - startFormula = String(nb) + String(rollData.sizeDice.dice) + "cs>=5[blue]" - } - diceFormula = startFormula - - // skill => 2 - // feat => 4 - // bonus => 6 - if (rollData.skill) { - let level = rollData.skill.system.level - if (rollData.skill.system.issl2) { - rollData.hasSLBonus = true - level += 2 - if (level > 7) { level = 7 } - } - rollData.skill.system.skilldice = __skillLevel2Dice[level] - diceFormula += "+" + String(rollData.skill.system.skilldice) + "cs>=5[black]" - - if (rollData.skill.system.skilltype == "complex" && rollData.skill.system.level == 0) { - rollData.complexSkillDisadvantage = true - rollData.rollAdvantage = "roll-disadvantage" - } - - if (rollData.skill.system.isfeatdie) { - rollData.hasFeatDie = true - diceFormula += "+ 1d10cs>=5[warhero-purple]" - } else { - diceFormula += `+ 0d10cs>=5[warhero-purple]` - } - if (rollData.skill.system.bonusdice != "none") { - rollData.hasBonusDice = rollData.skill.system.bonusdice - diceFormula += `+ ${rollData.hasBonusDice}cs>=5[black]` - } else { - diceFormula += `+ 0d6cs>=5[black]` - } - } else { - diceFormula += `+ 0d8cs=>5 + 0d10cs>=5 + 0d6cs>=5` - } - - // advantage => 8 - let advFormula = "+ 0d8cs>=5" - if (rollData.advantage == "advantage1" || rollData.forceAdvantage) { - advFormula = "+ 1d8cs>=5[warhero-darkgreen]" - } - if (rollData.advantage == "advantage2") { - advFormula = "+ 2d8cs>=5[warhero-darkgreen]" - } - diceFormula += advFormula - - // disadvantage => 10 - let disFormula = "- 0d8cs>=5" - if (rollData.disadvantage == "disadvantage1" || rollData.forceDisadvantage) { - disFormula = "- 1d8cs>=5[red]" - } - if (rollData.disadvantage == "disadvantage2") { - disFormula = "- 2d8cs>=5[red]" - } - diceFormula += disFormula - - // armor => 12 - let skillArmorPenalty = 0 - for (let armor of rollData.armors) { - if (armor.system.equipped) { - skillArmorPenalty += armor.system.skillpenalty - } - } - if (rollData.skill && rollData.skill.system.armorpenalty && skillArmorPenalty > 0) { - rollData.skillArmorPenalty = skillArmorPenalty - diceFormula += `- ${skillArmorPenalty}d8cs>=5` - } else { - diceFormula += `- 0d8cs>=5` - } - - // shield => 14 - if (rollData.useshield && rollData.shield) { - diceFormula += "+ 1" + String(rollData.shield.system.shielddie) + "cs>=5[yellow]" - } else { - diceFormula += " + 0d6cs>=5" + let diceFormula = "1d20" + if ( rollData.stat) { + diceFormula += "+" + rollData.stat.value } + diceFormula += "+" + rollData.bonusMalus + rollData.diceFormula = diceFormula // Performs roll console.log("Roll formula", diceFormula) @@ -637,74 +555,16 @@ export class WarheroUtility { myRoll = new Roll(diceFormula).roll({ async: false }) await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) } - rollData.rollOrder = 0 rollData.roll = myRoll - rollData.nbSuccess = myRoll.total - if (rollData.rollAdvantage == "none" && rollData.forceRollAdvantage) { - rollData.rollAdvantage = "roll-advantage" - } - if (rollData.rollAdvantage == "none" && rollData.forceRollDisadvantage) { - rollData.rollAdvantage = "roll-disadvantage" - } - if (rollData.rollAdvantage != "none") { - - rollData.rollOrder = 1 - rollData.rollType = (rollData.rollAdvantage == "roll-advantage") ? "Advantage" : "Disadvantage" - this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) - }) - - rollData.rollOrder = 2 - let myRoll2 = new Roll(diceFormula).roll({ async: false }) - await this.showDiceSoNice(myRoll2, game.settings.get("core", "rollMode")) - - rollData.roll = myRoll2 // Tmp switch to display the proper results - rollData.nbSuccess = myRoll2.total - this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) - }) - rollData.roll = myRoll // Revert the tmp switch - rollData.nbSuccess = myRoll.total - - if (rollData.rollAdvantage == "roll-advantage") { - if (myRoll2.total > rollData.nbSuccess) { - hasChanged = true - rollData.roll = myRoll2 - rollData.nbSuccess = myRoll2.total - } - } else { - if (myRoll2.total < rollData.nbSuccess) { - rollData.roll = myRoll2 - rollData.nbSuccess = myRoll2.total - } - } - rollData.rollOrder = 3 - } - rollData.nbSuccess = Math.max(0, rollData.nbSuccess) - - rollData.isFirstRollAdvantage = false - // Manage exp - if (rollData.skill && rollData.skill.system.level > 0) { - let nbSkillSuccess = rollData.roll.terms[2].total - if (nbSkillSuccess == 0 || nbSkillSuccess == rollData.skill.system.level) { - actor.incrementSkillExp(rollData.skill.id, 1) - } - } - - this.saveRollData(rollData) actor.lastRoll = rollData - this.createChatWithRollMode(rollData.alias, { + let msg = await this.createChatWithRollMode(rollData.alias, { content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) }) + msg.setFlag("world", "rolldata", rollData) console.log("Rolldata result", rollData) - // Message response - this.displayDefenseMessage(rollData) - - // Manage defense result - this.processAttackDefense(rollData) } /* -------------------------------------------- */ @@ -798,7 +658,7 @@ export class WarheroUtility { break; } chatOptions.alias = chatOptions.alias || name; - ChatMessage.create(chatOptions); + return ChatMessage.create(chatOptions); } /* -------------------------------------------- */ @@ -806,7 +666,8 @@ export class WarheroUtility { let rollData = { rollId: randomID(16), rollMode: game.settings.get("core", "rollMode"), - advantage: "none" + advantage: "none", + bonusMalus: 0 } WarheroUtility.updateWithTarget(rollData) return rollData @@ -821,8 +682,8 @@ export class WarheroUtility { } /* -------------------------------------------- */ - static createChatWithRollMode(name, chatOptions) { - this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions) + static async createChatWithRollMode(name, chatOptions) { + return this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions) } /* -------------------------------------------- */ diff --git a/packs/ammunitions.db b/packs/ammunitions.db new file mode 100644 index 0000000..8c4fa63 --- /dev/null +++ b/packs/ammunitions.db @@ -0,0 +1 @@ +{"name":"Arrow","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":2,"quantity":20,"equipped":false,"slotused":1,"slotlocation":"quiver","description":"
Arrow for @UUID[Compendium.world.weapons.kkn0H33tCD3594Mx]{Bow} and @UUID[Compendium.world.weapons.koM5TEFPzTlZeuMn]{CrossBow}. The arrows must be contained into a @UUID[Compendium.world.equipments.Fm01Gl7EuqGU9qdr]{Quiver} (or @UUID[Compendium.world.equipments.EuP7AVIoBRWk1wsX]{Quiver of holding}). Each 20 arrows they need one more quiver.
"},"effects":[],"flags":{"core":{"sourceId":"Item.g1U48kW3Uf3LkaeG"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285482221,"modifiedTime":1674288079539,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"f7QTqfFzyTWLFOrY"} diff --git a/packs/armors.db b/packs/armors.db new file mode 100644 index 0000000..7fa8057 --- /dev/null +++ b/packs/armors.db @@ -0,0 +1,3 @@ +{"name":"Scale mail","type":"armor","img":"systems/fvtt-warhero/images/icons/difesa.webp","system":{"armortype":"medium","equipped":false,"damagereduction":4,"cost":140,"slotused":1,"slotlocation":"armor","description":"A medium armor. DR:4 (when weared)
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.lQRGneHKxSt3Z1Aw"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285629119,"modifiedTime":1674287831040,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"QQHtpszvyRmTRvTU"} +{"name":"Plate","type":"armor","img":"systems/fvtt-warhero/images/icons/difesa.webp","system":{"armortype":"heavy","equipped":false,"damagereduction":6,"cost":680,"slotused":1,"slotlocation":"armor","description":"An heavy armor. DR:6 (when weared)
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.lQRGneHKxSt3Z1Aw"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285629119,"modifiedTime":1674287827036,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"VwbtIBqYmLMGJn2e"} +{"name":"Leather","type":"armor","img":"systems/fvtt-warhero/images/icons/difesa.webp","system":{"armortype":"light","equipped":false,"damagereduction":2,"cost":20,"slotused":1,"slotlocation":"armor","description":"A simple armor. DR:2 (when weared)
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.lQRGneHKxSt3Z1Aw"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285629119,"modifiedTime":1674287829053,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"cJnFNx1MpfolTK6j"} diff --git a/packs/classes.db b/packs/classes.db new file mode 100644 index 0000000..150f1b5 --- /dev/null +++ b/packs/classes.db @@ -0,0 +1 @@ +{"name":"Warrior","type":"class","img":"systems/fvtt-warhero/images/icons/classe.webp","system":{"weapons":{"short":false,"long":false,"twohanded":false,"shotgun":false,"throwing":false},"armors":{"light":false,"medium":false,"heavy":false},"shields":{"light":false,"medium":false,"tower":false},"description":""},"effects":[],"flags":{"core":{"sourceId":"Item.jRwz7D2iRTEMOjTL"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674286439186,"modifiedTime":1674287319937,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"FM6VG563q7C5Gdls"} diff --git a/packs/equipments.db b/packs/equipments.db new file mode 100644 index 0000000..5161bfa --- /dev/null +++ b/packs/equipments.db @@ -0,0 +1,8 @@ +{"name":"Quiver of holding","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":8000,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"quiver","description":"Container.
\nSlot provided: infinite (only for @UUID[Item.g1U48kW3Uf3LkaeG]{Arrow})
\nSlot occupied: 1 in Quiver slot
\nA quiver
"},"effects":[],"flags":{"core":{"sourceId":"Item.X627atoHcwnZPFh4"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287883396,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"EuP7AVIoBRWk1wsX"} +{"name":"Quiver","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":1,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"quiver","description":"Container.
\nSlot provided: 20 (only for @UUID[Item.g1U48kW3Uf3LkaeG]{Arrow})
\nSlot occupied: 1 in Quiver slot
\nA quiver
"},"effects":[],"flags":{"core":{"sourceId":"Item.b10F87vD8eX74mE4"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287881900,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"Fm01Gl7EuqGU9qdr"} +{"name":"Belt Pouch","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":1,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"belt","description":"Container.
\nSlot provided: 4
\nSlot occupied: 1 in @UUID[Item.yEsS9y283ll5dPFG]{Belt}
\nA belt pouch. It contains 4 slot of low volume items
"},"effects":[],"flags":{"core":{"sourceId":"Item.PxrsMWHj2gaWErfb"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287880700,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"MUMZLLi6wmhBOy3l"} +{"name":"Backpack","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":2,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"backpack","description":"Container.
\nSlot provided: 12
\nSlot occupied: 1 in Backpack slot
\nA standard backpack
"},"effects":[],"flags":{"core":{"sourceId":"Item.uCaGC3EGQ85BVg2n"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287875283,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"QfnlXUDkxDWqBnb9"} +{"name":"Backpack of holding","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":48000,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"backpack","description":"Container.
\nSlot provided: 90
\nSlot occupied: 1 in Backpack slot
\nA backpack that can contains 90 items
"},"effects":[],"flags":{"core":{"sourceId":"Item.FmiX5vOeuYxlLKXK"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287876806,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"gU2Dg6Yo5K5XnWmB"} +{"name":"Gold","type":"money","img":"systems/fvtt-warhero/images/icons/two-coins.svg","system":{"value":1,"quantity":500,"description":"A pile of coins. Max 1000 coins in each pile. Each 1000 gold you need to occupy 1 slot in a @UUID[Item.PxrsMWHj2gaWErfb]{Belt Pouch}
\nEach PC starts with 500 gold
"},"effects":[],"flags":{"core":{"sourceId":"Item.hbBYKnGLzFIn7KZn"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284013488,"modifiedTime":1674287873177,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"j6fZ2Ru5Np4g0MFp"} +{"name":"Belt","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":1,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"belt","description":"Container.
\nSlot provided:6 in belt slot
\nA belt
"},"effects":[],"flags":{"core":{"sourceId":"Item.yEsS9y283ll5dPFG"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287879339,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"v44gVEKEYLfYoR9i"} +{"name":"Bag of Holding","type":"equipment","img":"systems/fvtt-warhero/images/icons/swap-bag.svg","system":{"equiptype":"","cost":1,"quantity":1,"equipped":false,"slotused":1,"slotlocation":"belt","description":"Container.
\nSlot provided: 30
\nSlot occupied: 1 in Backpack slot or in belt slot
\nA bag of holding
"},"effects":[],"flags":{"core":{"sourceId":"Item.Uzy0T6ZnCzEsyGop"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674284215303,"modifiedTime":1674287878052,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"vCREWenSFdmcWEGd"} diff --git a/packs/powers.db b/packs/powers.db new file mode 100644 index 0000000..87966f7 --- /dev/null +++ b/packs/powers.db @@ -0,0 +1 @@ +{"name":"Ammaliamento","type":"power","img":"systems/fvtt-warhero/images/icons/magia.webp","system":{"level1":"Sleep
","level2":"Charme
il bersaglio considera l'incantatore un alleato per
l'intera giornata CD 15, MEN, negare.
Comando
\nIl bersaglio esegue un ordine impartito alla
creatura che non sia un ordine suicida CD 16, MEN. Negare.
Una volta eseguito il comando l'effetto svanisce o dopo che
sia trascorso 3 giorni
Confusione
Il bersaglio lancia un 1d10 con 6+ può
eseguire il suo turno altrimenti lo perde e non può fare
nessuna mossa, deve ripetere questo tiro all’inizio del suo
turno per la durata di 10 turni, CD 18 MEN per negare
Creature raffinate dalle vaste conoscenze molto affini alla
magia, con aspetti esotici e lunghe orecchie a punta
Razza nata dall’ingegno delle altre razze creata durante
esperimenti, sono dei costrutti con volontà propria
\n
A wooden large shield. Parry +5
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.tK8bPZVbZaKgow7K"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674286037851,"modifiedTime":1674287856939,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"GfIDXBblhVS3VdXN"} +{"name":"Wooden large shield","type":"shield","img":"systems/fvtt-warhero/images/icons/difensiva.webp","system":{"shieldtype":"medium","parrybonus":3,"equipped":false,"cost":38,"slotused":1,"slotlocation":"shield","description":"A wooden large shield. Parry +3
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.tK8bPZVbZaKgow7K"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674286037851,"modifiedTime":1674287860571,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"Xju80dPOF4jqJ5B3"} +{"name":"Buckler","type":"shield","img":"systems/fvtt-warhero/images/icons/difensiva.webp","system":{"shieldtype":"light","parrybonus":1,"equipped":false,"cost":12,"slotused":1,"slotlocation":"shield","description":"A bucker. Parry +1
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.tQEp3JxDQab5yPV5"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674286037851,"modifiedTime":1674287858729,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"ronuYFULqGPjn0ij"} diff --git a/packs/weapons.db b/packs/weapons.db new file mode 100644 index 0000000..279419c --- /dev/null +++ b/packs/weapons.db @@ -0,0 +1,8 @@ +{"name":"Stick (two-hand)","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"long","damage":"1d8","cost":2,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"A Long sword
\nIt can goes into slot weapon1 or when not used in belt slot.
\nIt can be used 1 hand (1d6+STR) or 2 hands (1d8 + STR*1.5)
\n","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.EhoZ1NSTZst09mHE"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287971706,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"4ZL7UAmh9jSs8zbh"} +{"name":"Long sword","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"long","damage":"1d8","cost":12,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"
A Long sword
\nIt can goes into slot weapon1 or when not used in belt slot.
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.EhoZ1NSTZst09mHE"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287968028,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"Jd2a6a6b4wpbDJ3w"} +{"name":"Greatsword","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"twohanded","damage":"3d6","cost":42,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"A Greatsword
\nIt can goes into slot weapon1 or when not used in belt slot.
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.jUtvX6kjiTzQQh59"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287985414,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"YZbg0VJ4Hb2xIXMD"} +{"name":"Stick (one-hand)","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"long","damage":"1d6","cost":2,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"A Long sword
\nIt can goes into slot weapon1 or when not used in belt slot.
\nIt can be used 1 hand (1d6+STR) or 2 hands (1d8 + STR*1.5)
\n","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.EhoZ1NSTZst09mHE"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287970122,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"YgnGOzeuxgprHW3u"} +{"name":"Dagger","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"short","damage":"1d6","cost":2,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"
A dagger.
\nCan be used as light weapons (1d6+STR) or as thrown weapon (1d8)
\nIt can goes into slot weapon1 or when not used in belt slot.
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.XUOhKngx7fl9oVWV"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287978363,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"bl1pTDhGeVQPtTEc"} +{"name":"Bow","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"shooting","damage":"2d6","cost":32,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"It fires @UUID[Compendium.world.ammunitions.f7QTqfFzyTWLFOrY]{Arrow}
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.SF7nuKVRyXZSOcdB"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285448228,"modifiedTime":1674288088722,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"kkn0H33tCD3594Mx"} +{"name":"CrossBow","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"shooting","damage":"2d6","cost":45,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"It fires @UUID[Compendium.world.ammunitions.f7QTqfFzyTWLFOrY]{Arrow}
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.6xn63xsRt7AGSk8h"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285448228,"modifiedTime":1674288094741,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"koM5TEFPzTlZeuMn"} +{"name":"Dagger (Thrown)","type":"weapon","img":"systems/fvtt-warhero/images/icons/two-handed-sword.svg","system":{"weapontype":"throwing","damage":"1d8","cost":2,"equipped":false,"slotused":1,"slotlocation":"weapon1","description":"A dagger.
\nCan be used as light weapons (1d6+STR) or as thrown weapon (1d8)
\nIt can goes into slot weapon1 or when not used in belt slot.
","quantity":1},"effects":[],"flags":{"core":{"sourceId":"Item.LJWhSxBqpEqtSuhE"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674285262655,"modifiedTime":1674287980751,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"rD1xh7I9UNmSDFWR"} diff --git a/system.json b/system.json index 24887e3..0633185 100644 --- a/system.json +++ b/system.json @@ -29,6 +29,69 @@ "system": "fvtt-warhero", "private": false, "flags": {} + }, + { + "type": "Item", + "label": "Shields", + "name": "shields", + "path": "packs/shields.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Wepons", + "name": "weapons", + "path": "packs/weapons.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Ammunitions", + "name": "ammunitions", + "path": "packs/ammunitions.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Armors", + "name": "armors", + "path": "packs/armors.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Classes", + "name": "classes", + "path": "packs/classes.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Equipments", + "name": "equipments", + "path": "packs/equipments.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} + }, + { + "type": "Item", + "label": "Powers", + "name": "powers", + "path": "packs/powers.db", + "system": "fvtt-warhero", + "private": false, + "flags": {} } ], "primaryTokenAttribute": "secondary.hp", @@ -37,7 +100,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.3", + "version": "10.0.6", "compatibility": { "minimum": "10", "verified": "10", @@ -45,7 +108,7 @@ }, "title": "Warhero RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.3.zip", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.6.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-warhero", "background": "images/ui/warhero_welcome_page.webp", "id": "fvtt-warhero" diff --git a/template.json b/template.json index 77a0e9c..f98f5da 100644 --- a/template.json +++ b/template.json @@ -13,6 +13,7 @@ "sex": "", "eyes": "", "background": "", + "religion": "", "description": "", "notes": "", "gmnotes": "" @@ -20,72 +21,70 @@ }, "core": { "subactors": [], - "abilities": { - "str":{ - "label": "Strength", + "statistics": { + "str": { + "label": "WH.ui.Strength", "abbrev": "str", - "col": 1, - "value": 1 - }, - "agi":{ - "label": "Agility", - "abbrev": "agi", - "col": 1, - "value": 1 - }, - "dex":{ - "label": "Dexterity", - "abbrev": "dex", - "col": 1, - "value": 1 - }, - "con":{ - "label": "Constitution", - "abbrev": "con", - "col": 1, - "value": 1 - }, - "int":{ - "label": "Intelligence", - "abbrev": "int", - "col": 2, - "value": 1 - }, - "wit":{ - "label": "Wits", - "abbrev": "wit", - "col": 2, - "value": 1 - }, - "cha":{ - "label": "Charisma", - "abbrev": "cha", - "col": 2, - "value": 1 - } - }, - "secondary": { - "hp": { - "label": "Hitpoint", - "abbrev": "hb", - "value": -1, - "max": 0 - }, - "effort": { - "label": "Effort", - "abbrev": "eff", - "value": -1, - "max": 0 - } - }, - "social": { - "fame": { - "label": "Fame", + "style": "dropdown", "value": 0 }, - "reputation": { - "label": "Reputation", + "ist": { + "label": "WH.ui.Instinct", + "abbrev": "ist", + "style": "dropdown", "value": 0 + }, + "min": { + "label": "WH.ui.Mind", + "abbrev": "min", + "style": "dropdown", + "value": 0 + } + }, + "attributes": { + "hp":{ + "label": "WH.ui.HitPoints", + "abbrev": "hp", + "style": "edit", + "hasmax": true, + "max": 1, + "value": 1 + }, + "def":{ + "label": "WH.ui.Defence", + "abbrev": "def", + "style": "edit", + "max": 1, + "value": 1 + }, + "txc":{ + "label": "WH.ui.Throw2Hit", + "abbrev": "txc", + "style": "edit", + "max": 1, + "value": 1 + }, + "mana":{ + "label": "WH.ui.Mana", + "abbrev": "pm", + "style": "edit", + "hasmax": true, + "max": 1, + "value": 1 + }, + "ini":{ + "label": "WH.ui.Initiative", + "abbrev": "ini", + "style": "dropdown", + "max": 1, + "value": 1 + }, + "mov":{ + "label": "WH.ui.Movement", + "abbrev": "mov", + "style": "dropdown", + "max": 1, + "value": 1 } } }, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 26edc76..97cff68 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -11,79 +11,46 @@