Actor sheet

This commit is contained in:
LeRatierBretonnien 2023-01-29 16:56:09 +01:00
parent 0a0f87663d
commit f5e03886d5
21 changed files with 380 additions and 1064 deletions

View File

@ -36,5 +36,23 @@
"WH.ui.attrbonus": "Attribute (+4/Lvl4, +2/Lvl8)", "WH.ui.attrbonus": "Attribute (+4/Lvl4, +2/Lvl8)",
"WH.ui.weapons": "Weapons", "WH.ui.weapons": "Weapons",
"WH.ui.armors": "Armors", "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"
} }

View File

@ -14,7 +14,7 @@ export class WarheroActorSheet extends ActorSheet {
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
classes: ["fvtt-warhero", "sheet", "actor"], classes: ["fvtt-warhero", "sheet", "actor"],
template: "systems/fvtt-warhero/templates/actor-sheet.html", template: "systems/fvtt-warhero/templates/actor-sheet.html",
width: 960, width: 720,
height: 720, height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
@ -24,8 +24,7 @@ export class WarheroActorSheet extends ActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
async getData() { async getData() {
const objectData = this.object.system const objectData = duplicate(this.object.system)
let actorData = duplicate(objectData)
let formData = { let formData = {
title: this.title, title: this.title,
@ -35,25 +34,21 @@ export class WarheroActorSheet extends ActorSheet {
name: this.actor.name, name: this.actor.name,
editable: this.isEditable, editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked", cssClass: this.isEditable ? "editable" : "locked",
data: actorData, system: objectData,
limited: this.object.limited, limited: this.object.limited,
skills: this.actor.getSkills( ), skills: this.actor.getSkills( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())), armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())), 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()) ), equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ), slotEquipments: this.actor.buildEquipmentsSlot(),
equippedArmor: this.actor.getEquippedArmor(),
equippedShield: this.actor.getEquippedShield(),
subActors: duplicate(this.actor.getSubActors()), subActors: duplicate(this.actor.getSubActors()),
race: duplicate(this.actor.getRace()), race: duplicate(this.actor.getRace()),
class: duplicate(this.actor.getClass()),
moneys: duplicate(this.actor.getMoneys()), moneys: duplicate(this.actor.getMoneys()),
encCapacity: this.actor.getEncumbranceCapacity(),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}), description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}), notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}),
containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent,
options: this.options, options: this.options,
owner: this.document.isOwner, owner: this.document.isOwner,
editScore: this.options.editScore, editScore: this.options.editScore,
@ -136,35 +131,16 @@ export class WarheroActorSheet extends ActorSheet {
this.actor.incDecAmmo( li.data("item-id"), +1 ) this.actor.incDecAmmo( li.data("item-id"), +1 )
} ); } );
html.find('.roll-ability').click((event) => { html.find('.roll-this').click((event) => {
const abilityKey = $(event.currentTarget).data("ability-key"); const rollType = $(event.currentTarget).data("type")
this.actor.rollAbility(abilityKey); 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) => { html.find('.roll-weapon').click((event) => {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
const skillId = li.data("item-id") const skillId = li.data("item-id")
this.actor.rollWeapon(skillId) 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) => { html.find('.lock-unlock-sheet').click((event) => {

View File

@ -64,25 +64,6 @@ export class WarheroActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
computeHitPoints() { computeHitPoints() {
if (this.type == "character") { 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() { prepareDerivedData() {
if (this.type == 'character' || game.user.isGM) { if (this.type == 'character' || game.user.isGM) {
this.system.encCapacity = this.getEncumbranceCapacity()
this.buildContainerTree()
this.computeHitPoints() this.computeHitPoints()
this.computeEffortPoints()
} }
super.prepareDerivedData(); super.prepareDerivedData();
@ -150,12 +128,10 @@ export class WarheroActor extends Actor {
WarheroUtility.sortArrayObjectsByName(comp) WarheroUtility.sortArrayObjectsByName(comp)
return comp; return comp;
} }
getEquippedArmor() { getPowers() {
let comp = this.items.find(item => item.type == 'armor' && item.system.equipped) let comp = duplicate(this.items.filter(item => item.type == 'power') || []);
if (comp) { WarheroUtility.sortArrayObjectsByName(comp)
return duplicate(comp) return comp;
}
return undefined
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getShields() { getShields() {
@ -163,19 +139,17 @@ export class WarheroActor extends Actor {
WarheroUtility.sortArrayObjectsByName(comp) WarheroUtility.sortArrayObjectsByName(comp)
return comp; return comp;
} }
getEquippedShield() {
let comp = this.items.find(item => item.type == 'shield' && item.system.equipped)
if (comp) {
return duplicate(comp)
}
return undefined
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getRace() { getRace() {
let race = this.items.filter(item => item.type == 'race') let race = this.items.filter(item => item.type == 'race')
return race[0] ?? []; return race[0] ?? [];
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getClass() {
let classWH = this.items.filter(item => item.type == 'class')
return classWH[0] ?? [];
}
/* -------------------------------------------- */
checkAndPrepareEquipment(item) { checkAndPrepareEquipment(item) {
} }
@ -186,7 +160,22 @@ export class WarheroActor extends Actor {
} }
return listItem 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() { getConditions() {
let comp = duplicate(this.items.filter(item => item.type == 'condition') || []); let comp = duplicate(this.items.filter(item => item.type == 'condition') || []);
@ -533,98 +522,25 @@ export class WarheroActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getCommonRollData(abilityKey = undefined) { getCommonRollData() {
let noAction = this.isNoAction()
if (noAction) {
ui.notifications.warn("You can't do any actions du to the condition : " + noAction.name)
return
}
let rollData = WarheroUtility.getBasicRollData() let rollData = WarheroUtility.getBasicRollData()
rollData.alias = this.name rollData.alias = this.name
rollData.actorImg = this.img rollData.actorImg = this.img
rollData.actorId = this.id rollData.actorId = this.id
rollData.img = this.img 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) console.log("ROLLDATA", rollData)
return rollData return rollData
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
rollAbility(abilityKey) { rollFromType(rollType, rollKey) {
let rollData = this.getCommonRollData(abilityKey) let stat = duplicate(this.system[rollType][rollKey])
rollData.mode = "ability" let rollData = this.getCommonRollData()
if (rollData.target) { rollData.mode = rollType
ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.") rollData.stat = stat
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) this.startRoll(rollData)
} }
}
/* -------------------------------------------- */ /* -------------------------------------------- */
rollWeapon(weaponId) { rollWeapon(weaponId) {
@ -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) { async startRoll(rollData) {
this.syncRoll(rollData) this.syncRoll(rollData)

View File

@ -69,7 +69,6 @@ export class WarheroItemSheet extends ItemSheet {
limited: this.object.limited, limited: this.object.limited,
options: this.options, options: this.options,
owner: this.document.isOwner, owner: this.document.isOwner,
abilities: duplicate(game.model.Actor.character.abilities),
isGM: game.user.isGM isGM: game.user.isGM
} }
if ( this.object.type == "power") { if ( this.object.type == "power") {

View File

@ -5,7 +5,7 @@ export class WarheroRollDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async create(actor, rollData) { 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); let html = await renderTemplate('systems/fvtt-warhero/templates/roll-dialog-generic.html', rollData);
return new WarheroRollDialog(actor, rollData, html, options); return new WarheroRollDialog(actor, rollData, html, options);
@ -76,8 +76,8 @@ export class WarheroRollDialog extends Dialog {
html.find('#situational').change((event) => { html.find('#situational').change((event) => {
this.rollData.situational = event.currentTarget.value this.rollData.situational = event.currentTarget.value
}) })
html.find('#distanceBonusDice').change((event) => { html.find('#bonusMalus').change((event) => {
this.rollData.distanceBonusDice = Number(event.currentTarget.value) this.rollData.bonusMalus = Number(event.currentTarget.value)
}) })
} }

View File

@ -234,7 +234,7 @@ export class WarheroUtility {
const templatePaths = [ const templatePaths = [
'systems/fvtt-warhero/templates/editor-notes-gm.html', 'systems/fvtt-warhero/templates/editor-notes-gm.html',
'systems/fvtt-warhero/templates/partial-roll-select.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-actor-status.html',
'systems/fvtt-warhero/templates/partial-options-abilities.html', 'systems/fvtt-warhero/templates/partial-options-abilities.html',
'systems/fvtt-warhero/templates/partial-item-nav.html', 'systems/fvtt-warhero/templates/partial-item-nav.html',
@ -541,94 +541,12 @@ export class WarheroUtility {
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
// ability/save/size => 0 // ability/save/size => 0
let diceFormula let diceFormula = "1d20"
let startFormula = "0d6cs>=5[blue]" if ( rollData.stat) {
if (rollData.ability) { diceFormula += "+" + rollData.stat.value
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"
} }
diceFormula += "+" + rollData.bonusMalus
rollData.diceFormula = diceFormula
// Performs roll // Performs roll
console.log("Roll formula", diceFormula) console.log("Roll formula", diceFormula)
@ -637,74 +555,16 @@ export class WarheroUtility {
myRoll = new Roll(diceFormula).roll({ async: false }) myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
} }
rollData.rollOrder = 0
rollData.roll = myRoll 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 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) content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData)
}) })
msg.setFlag("world", "rolldata", rollData)
console.log("Rolldata result", 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; break;
} }
chatOptions.alias = chatOptions.alias || name; chatOptions.alias = chatOptions.alias || name;
ChatMessage.create(chatOptions); return ChatMessage.create(chatOptions);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -806,7 +666,8 @@ export class WarheroUtility {
let rollData = { let rollData = {
rollId: randomID(16), rollId: randomID(16),
rollMode: game.settings.get("core", "rollMode"), rollMode: game.settings.get("core", "rollMode"),
advantage: "none" advantage: "none",
bonusMalus: 0
} }
WarheroUtility.updateWithTarget(rollData) WarheroUtility.updateWithTarget(rollData)
return rollData return rollData
@ -821,8 +682,8 @@ export class WarheroUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions) { static async createChatWithRollMode(name, chatOptions) {
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions) return this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

1
packs/ammunitions.db Normal file
View File

@ -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":"<p>Arrow for &nbsp;@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.</p>"},"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"}

3
packs/armors.db Normal file
View File

@ -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":"<p>A medium armor. DR:4 (when weared)</p>","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":"<p>An heavy armor. DR:6 (when weared)</p>","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":"<p>A simple armor. DR:2 (when weared)</p>","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"}

1
packs/classes.db Normal file
View File

@ -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"}

8
packs/equipments.db Normal file
View File

@ -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":"<p>Container.</p>\n<p>Slot provided: infinite (only for @UUID[Item.g1U48kW3Uf3LkaeG]{Arrow})</p>\n<p>Slot occupied: 1 in Quiver slot</p>\n<p>A quiver</p>"},"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":"<p>Container.</p>\n<p>Slot provided: 20 (only for @UUID[Item.g1U48kW3Uf3LkaeG]{Arrow})</p>\n<p>Slot occupied: 1 in Quiver slot</p>\n<p>A quiver</p>"},"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":"<p>Container.</p>\n<p>Slot provided: 4</p>\n<p>Slot occupied: 1 in @UUID[Item.yEsS9y283ll5dPFG]{Belt}</p>\n<p>A belt pouch. It contains 4 slot of low volume items</p>"},"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":"<p>Container.</p>\n<p>Slot provided: 12</p>\n<p>Slot occupied: 1 in Backpack slot</p>\n<p>A standard backpack</p>"},"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":"<p>Container.</p>\n<p>Slot provided: 90</p>\n<p>Slot occupied: 1 in Backpack slot</p>\n<p>A backpack that can contains 90 items</p>"},"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":"<p>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}</p>\n<p>Each PC starts with 500 gold</p>"},"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":"<p>Container.</p>\n<p>Slot provided:6 in belt slot</p>\n<p>A belt</p>"},"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":"<p>Container.</p>\n<p>Slot provided: 30&nbsp;</p>\n<p>Slot occupied: 1 in Backpack slot or in belt slot</p>\n<p>A bag of holding</p>"},"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"}

1
packs/powers.db Normal file
View File

@ -0,0 +1 @@
{"name":"Ammaliamento","type":"power","img":"systems/fvtt-warhero/images/icons/magia.webp","system":{"level1":"<p>Sleep</p>","level2":"<p>Charme<br>il bersaglio considera l'incantatore un alleato per<br>l'intera giornata CD 15, MEN, negare.</p>","level3":"<p>Comando</p>\n<p>Il bersaglio esegue un ordine impartito alla<br>creatura che non sia un ordine suicida CD 16, MEN. Negare.<br>Una volta eseguito il comando l'effetto svanisce o dopo che<br>sia trascorso 3 giorni</p>","level4_1":"","level4_2":"","description":"","level4":"<p>Confusione<br>Il bersaglio lancia un 1d10 con 6+ pu&ograve;<br>eseguire il suo turno altrimenti lo perde e non pu&ograve; fare<br>nessuna mossa, deve ripetere questo tiro all&rsquo;inizio del suo<br>turno per la durata di 10 turni, CD 18 MEN per negare</p>"},"effects":[],"flags":{"core":{"sourceId":"Item.hfXnpQGBlc7V7NWr"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674288111691,"modifiedTime":1674288308186,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"pgI3q4NkVbcMwhBm"}

View File

@ -0,0 +1,2 @@
{"name":"Elf","type":"race","img":"systems/fvtt-warhero/images/icons/razze.webp","system":{"description":"<p>Creature raffinate dalle vaste conoscenze molto affini alla<br>magia, con aspetti esotici e lunghe orecchie a punta</p>\n<ul>\n<li>HP Progression = Low (+2 Hp for level)</li>\n<li>Languages: Common, Elf</li>\n<li>Level 1,5 = +1 use to counterspell</li>\n<li>Level 1,2,4,6,8= +2% to all throws with d100</li>\n<li>Level 2,5,7=+1 Mana</li>\n<li>Level 1,4,8 = +1 INT</li>\n<li>Livello 3,6,9 = +1 TxC e +1 Damage</li>\n</ul>"},"effects":[],"flags":{"core":{"sourceId":"Item.bXFkTKWCyWs7c9Ps"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674283365951,"modifiedTime":1674287954294,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"dGj39hnZpsEWw8kS"}
{"name":"Dirza","type":"race","img":"systems/fvtt-warhero/images/icons/razze.webp","system":{"description":"<p>Razza nata dall&rsquo;ingegno delle altre razze creata durante<br>esperimenti, sono dei costrutti con volont&agrave; propria</p>\n<p>&nbsp;</p>\n<ul>\n<li>HP Progression = Medium (+4 Hp for level)</li>\n<li>Languages: Common, Undercommon</li>\n<li>Level 1,5,7 = +1 use to disarm</li>\n<li>Level 1 =&nbsp; Weapon competency: Long weapon</li>\n<li>Level 1,4,8 = +1 STR or +1 DEX</li>\n<li>Livello 3,6,9 = +1 TxC e +1 Damage</li>\n</ul>"},"effects":[],"flags":{"core":{"sourceId":"Item.t9BvXbl4oqD7BAUT"}},"_stats":{"systemId":"fvtt-warhero","systemVersion":"10.0.2","coreVersion":"10.291","createdTime":1674283365951,"modifiedTime":1674287952690,"lastModifiedBy":"HTxW4IKZV3evIunu"},"folder":null,"sort":0,"ownership":{"default":0,"HTxW4IKZV3evIunu":3},"_id":"qeOasFFrQqrI0y62"}

3
packs/shields.db Normal file
View File

@ -0,0 +1,3 @@
{"name":"Wooden tower shield","type":"shield","img":"systems/fvtt-warhero/images/icons/difensiva.webp","system":{"shieldtype":"heavy","parrybonus":5,"equipped":false,"cost":38,"slotused":1,"slotlocation":"shield","description":"<p>A wooden large shield. Parry +5</p>","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":"<p>A wooden large shield. Parry +3</p>","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":"<p>A bucker. Parry +1</p>","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"}

8
packs/weapons.db Normal file
View File

@ -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":"<p>A Long sword</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>\n<p>It can be used 1 hand (1d6+STR) or 2 hands (1d8 + STR*1.5)</p>\n<p>&nbsp;</p>","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":"<p>A Long sword</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>","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":"<p>A Greatsword</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>","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":"<p>A Long sword</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>\n<p>It can be used 1 hand (1d6+STR) or 2 hands (1d8 + STR*1.5)</p>\n<p>&nbsp;</p>","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":"<p>A dagger.</p>\n<p>Can be used as light weapons (1d6+STR) or as thrown weapon (1d8)</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>","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":"<p>It fires @UUID[Compendium.world.ammunitions.f7QTqfFzyTWLFOrY]{Arrow}</p>","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":"<p>It fires @UUID[Compendium.world.ammunitions.f7QTqfFzyTWLFOrY]{Arrow}</p>","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":"<p>A dagger.</p>\n<p>Can be used as light weapons (1d6+STR) or as thrown weapon (1d8)</p>\n<p>It can goes into slot weapon1 or when not used in belt slot.</p>","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"}

View File

@ -29,6 +29,69 @@
"system": "fvtt-warhero", "system": "fvtt-warhero",
"private": false, "private": false,
"flags": {} "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", "primaryTokenAttribute": "secondary.hp",
@ -37,7 +100,7 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"version": "10.0.3", "version": "10.0.6",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "10",
@ -45,7 +108,7 @@
}, },
"title": "Warhero RPG", "title": "Warhero RPG",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", "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", "url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
"background": "images/ui/warhero_welcome_page.webp", "background": "images/ui/warhero_welcome_page.webp",
"id": "fvtt-warhero" "id": "fvtt-warhero"

View File

@ -13,6 +13,7 @@
"sex": "", "sex": "",
"eyes": "", "eyes": "",
"background": "", "background": "",
"religion": "",
"description": "", "description": "",
"notes": "", "notes": "",
"gmnotes": "" "gmnotes": ""
@ -20,72 +21,70 @@
}, },
"core": { "core": {
"subactors": [], "subactors": [],
"abilities": { "statistics": {
"str": { "str": {
"label": "Strength", "label": "WH.ui.Strength",
"abbrev": "str", "abbrev": "str",
"col": 1, "style": "dropdown",
"value": 1 "value": 0
}, },
"agi":{ "ist": {
"label": "Agility", "label": "WH.ui.Instinct",
"abbrev": "agi", "abbrev": "ist",
"col": 1, "style": "dropdown",
"value": 1 "value": 0
}, },
"dex":{ "min": {
"label": "Dexterity", "label": "WH.ui.Mind",
"abbrev": "dex", "abbrev": "min",
"col": 1, "style": "dropdown",
"value": 1 "value": 0
},
"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": { "attributes": {
"hp":{ "hp":{
"label": "Hitpoint", "label": "WH.ui.HitPoints",
"abbrev": "hb", "abbrev": "hp",
"value": -1, "style": "edit",
"max": 0 "hasmax": true,
"max": 1,
"value": 1
}, },
"effort": { "def":{
"label": "Effort", "label": "WH.ui.Defence",
"abbrev": "eff", "abbrev": "def",
"value": -1, "style": "edit",
"max": 0 "max": 1,
} "value": 1
}, },
"social": { "txc":{
"fame": { "label": "WH.ui.Throw2Hit",
"label": "Fame", "abbrev": "txc",
"value": 0 "style": "edit",
"max": 1,
"value": 1
}, },
"reputation": { "mana":{
"label": "Reputation", "label": "WH.ui.Mana",
"value": 0 "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
} }
} }
}, },

View File

@ -11,79 +11,46 @@
<div class="flexrow"> <div class="flexrow">
<div class="ability-item"> <div class="ability-item">
<ul> <ul>
{{#each data.abilities as |ability key|}} {{#each system.statistics as |stat key|}}
{{#if (eq ability.col 1)}} {{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key=key path="statistics" roll=true}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}} {{/each}}
</ul> </ul>
<li class="item flexrow list-item" data-attr-key="class">
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin">Class</h4>
</span>
<select class="competence-base flexrow" type="text" name="system.biodata.class" value="{{data.biodata.class}}" data-dtype="String">
{{#select data.biodata.class}}
<option value="chaplain">Chaplain</option>
<option value="magus">Magus</option>
<option value="martial">Martial</option>
<option value="skalawag">Skalawag</option>
<option value="warden">Warden</option>
{{/select}}
</select>
</li>
</div> </div>
<div class="ability-item"> <div class="ability-item">
<ul> <ul>
{{#each data.abilities as |ability key|}} <li class="flexrow item" data-item-id="{{race._id}}">
{{#if (eq ability.col 2)}} <label class="item-field-label-medium">Race</label>
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}} <a class="item-edit"><img class="sheet-competence-img" src="{{race.img}}"></a>
{{/if}} <input type="text" class="item-field-label-medium" disabled value="{{race.name}}" data-dtype="String" />
{{/each}}
{{#if equippedArmor}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="{{equippedArmor.img}}" />
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin"><a class="roll-armor-die ability-margin">{{equippedArmor.name}}</a></h4>
</span>
</li> </li>
{{/if}} <li class="flexrow item" data-item-id="{{class._id}}">
{{#if equippedShield}} <label class="item-field-label-medium">Class</label>
<li class="item flexrow list-item" data-attr-key="class"> <a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
<img class="sheet-competence-img" src="{{equippedShield.img}}" /> <input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" />
<span class="ability-label " name="equippedShield">
<h4 class="ability-text-white ability-margin"><a class="roll-shield-die ability-margin">{{equippedShield.name}}</a></h4>
</span>
</li> </li>
{{/if}} <li class="flexrow item" >
<li class="item flexrow list-item" data-attr-key="class"> <label class="item-field-label-medium">Religion</label>
<img class="sheet-competence-img" src="systems/fvtt-crucible-rpg/images/icons/feats/Marksman (Ballistic).webp" /> <input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
<span class="ability-label " name="rollTarget">
<h4 class="ability-text-white ability-margin"><a class="roll-target-die ability-margin">Target Roll</a></h4>
</span>
</li> </li>
</ul> </ul>
</div> </div>
<div class="ability-item status-block"> <div class="ability-item">
{{> systems/fvtt-crucible-rpg/templates/partial-actor-status.html}} </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</header> </header>
{{!-- Sheet Tab Navigation --}} {{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary"> <nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="skills">Skills</a> <a class="item" data-tab="main">Main</a>
<a class="item" data-tab="combat">Combat</a> <a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="lore">Lore</a> <a class="item" data-tab="power">Powers</a>
<a class="item" data-tab="equipment">Equipment</a> <a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="biodata">Biography</a> <a class="item" data-tab="biodata">Biography</a>
</nav> </nav>
@ -92,40 +59,19 @@
<section class="sheet-body"> <section class="sheet-body">
{{!-- Skills Tab --}} {{!-- Skills Tab --}}
<div class="tab skills" data-group="primary" data-tab="skills"> <div class="tab main" data-group="primary" data-tab="main">
<ul class="stat-list alternate-list item-list"> <div class="ability-item">
<li class="item flexrow list-item items-title-bg"> <ul>
<span class="item-name-label-header"> {{#each system.attributes as |attr key|}}
<h3><label class="items-title-text">Skills</label></h3> {{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=attr key=key path="attributes" roll=false}}
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Background</label>
</span>
</li>
{{#each skills as |skill key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{skill._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{skill.img}}" /></a>
<span class="item-name-label"><a class="roll-skill">{{skill.name}}</a></span>
<span class="item-field-label-short">{{upper skill.system.ability}}</span>
<span class="item-field-label-short">{{skill.system.skilldice}}</span>
<span class="item-field-label-long">&nbsp;-&nbsp;</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}} {{/each}}
</ul> </ul>
</div> </div>
</div>
{{!-- Combat Tab --}} {{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat"> <div class="tab combat" data-group="primary" data-tab="combat">
<div class="flexcol"> <div class="flexcol">
@ -137,21 +83,21 @@
<h3><label class="items-title-text">Weapons</label></h3> <h3><label class="items-title-text">Weapons</label></h3>
</span> </span>
<span class="item-field-label-short"> <span class="item-field-label-short">
<label class="short-label">Ability</label> <label class="short-label">{{localize "WH.ui.Type"}}</label>
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">Range</label> <label class="short-label">{{localize "WH.ui.Damage"}}</label>
</span> </span>
</li> </li>
{{#each equippedWeapons as |weapon key|}} {{#each weapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a> src="{{weapon.img}}" /></a>
<span class="item-name-label-long"><a class ="roll-weapon">{{weapon.name}}</a></span> <span class="item-name-label-long"><a class ="roll-weapon">{{weapon.name}}</a></span>
<span class="item-field-label-short">{{weapon.system.ability}}</span> <span class="item-field-label-short">{{weapon.system.weapontype}}</span>
<span class="item-field-label-medium">{{perk.system.range}}</span> <span class="item-field-label-medium">{{perk.system.damage}}</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
@ -166,27 +112,24 @@
<ul class="stat-list alternate-list"> <ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg"> <li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long"> <span class="item-name-label-header-long">
<h3><label class="items-title-text">Feats</label></h3> <h3><label class="items-title-text">Shields</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">{{localize "WH.ui.Type"}}</label>
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">Feature Die?</label> <label class="short-label">{{localize "WH.ui.parrybonus"}}</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL</label>
</span> </span>
</li> </li>
{{#each feats as |feat key|}} {{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{feat._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{feat.img}}" /></a> src="{{shield.img}}" /></a>
<span class="item-name-label-long">{{feat.name}}</span> <span class="item-name-label-long"><a class ="roll-weapon">{{shield.name}}</a></span>
<span class="item-field-label-medium">{{upperFirst feat.system.isfeatdie}}</span> <span class="item-field-label-short">{{shield.system.shieldtype}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.issl}}</span>
<span class="item-field-label-medium">{{feat.system.sl}}</span> <span class="item-field-label-medium">{{shield.system.parrybonus}}</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
@ -201,14 +144,25 @@
<ul class="stat-list alternate-list"> <ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg"> <li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long"> <span class="item-name-label-header-long">
<h3><label class="items-title-text">Conditions</label></h3> <h3><label class="items-title-text">Armors</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">{{localize "WH.ui.Type"}}</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">{{localize "WH.ui.damagereduction"}}</label>
</span> </span>
</li> </li>
{{#each conditions as |condition key|}} {{#each armors as |armor key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{condition._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{condition.img}}" /></a> src="{{armor.img}}" /></a>
<span class="item-name-label-long">{{condition.name}}</span> <span class="item-name-label-long"><a class ="roll-weapon">{{armor.name}}</a></span>
<span class="item-field-label-short">{{armor.system.armortype}}</span>
<span class="item-field-label-medium">{{armor.system.damagereduction}}</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -222,37 +176,25 @@
</div> </div>
{{!-- Lore Tab --}} {{!-- Powers Tab --}}
<div class="tab lore" data-group="primary" data-tab="lore"> <div class="tab power" data-group="primary" data-tab="power">
<div class="flexcol"> <div class="flexcol">
<ul class="stat-list alternate-list"> <ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg"> <li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header"> <span class="item-name-label-header">
<h3><label class="items-title-text">Lore</label></h3> <h3><label class="items-title-text">Powers</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Lore</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Circle</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Range</label>
</span> </span>
</li> </li>
{{#each spells as |spell key|}} {{#each powers as |power key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{spell._id}}"> <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{power._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{spell.img}}" /></a> src="{{power.img}}" /></a>
<span class="item-name-label"> <span class="item-name-label">
<a class="power-roll">{{spell.name}}</a> <a class="power-roll">{{power.name}}</a>
</span> </span>
<span class="item-field-label-medium">{{upperFirst spell.system.lore}}</span>
<span class="item-field-label-short">{{upperFirst spell.system.circle}}</span>
<span class="item-field-label-medium">{{upperFirst spell.system.range}}</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -268,52 +210,44 @@
{{!-- Equipement Tab --}} {{!-- Equipement Tab --}}
<div class="tab equipment" data-group="primary" data-tab="equipment"> <div class="tab equipment" data-group="primary" data-tab="equipment">
<div class="flexrow"> {{#each slotEquipments as |slot slotKey|}}
<h3>Encumbrance</h3>
<span class="small-label">Current : {{encCurrent}}</span>
<span class="small-label">Capacity : {{encCapacity}}</span>
</div>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg"> <li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header"> <span class="item-name-label-header">
<h3><label class="items-title-text">Money</label></h3> <h3><label class="items-title-text">{{localize slot.label}}</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">{{localize "WH.ui.Type"}}</label>
</span> </span>
<span class="item-field-label-long"> <span class="item-field-label-long">
<label class="short-label">Qty</label> <label class="short-label">{{localize "WH.ui.Qty"}}</label>
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">Weight</label> <label class="short-label">{{localize "WH.ui.maxslots"}}: {{slot.nbslots}}</label>
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">{{localize "WH.ui.slotsused"}}: {{slot.slotUsed}}</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a> <a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a>
</div> </div>
</li> </li>
{{#each moneys as |money key|}} {{#each slot.content as |item itemKey|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{item._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{money.img}}" /></a> src="{{item.img}}" /></a>
<span class="item-name-label">{{money.name}}</span> <span class="item-name-label">{{item.name}}</span>
<span class="item-field-label-medium">
<label class="short-label">{{upperFirst item.type}}</label>
</span>
<span class="item-field-label-long"><label> <span class="item-field-label-long"><label>
{{money.system.quantity}} {{item.system.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>) (<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label> </label>
</span> </span>
<span class="item-field-label-medium">
<label>{{money.system.weight}}</label>
</span>
<span class="item-field-label-medium">
{{#if money.system.idrDice}}
<a class="roll-idr" data-dice-value="{{money.data.idrDice}}">{{money.system.idrDice}}</a>
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
@ -322,128 +256,8 @@
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Weapons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Attack</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Damage</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each weapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label">{{weapon.name}}</span>
<span class="item-field-label-short"><label>{{upper weapon.system.ability}}</label></span>
<span class="item-field-label-short"><label>{{upper weapon.system.damage}}</label></span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if weapon.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}} {{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armors</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Absorption</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="armor" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each armors as |armor key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{armor.img}}" /></a>
<span class="item-name-label">{{armor.name}}</span>
<span class="item-field-label-short">{{upper armor.system.armortype}}</span>
<span class="item-field-label-short">{{armor.system.absorprionroll}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if armor.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Shields</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="shield" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{shield.img}}" /></a>
<span class="item-name-label">{{shield.name}}</span>
<span class="item-field-label-short">{{shield.system.levelDice}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if shield.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Equipment</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Quantity</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each containersTree as |equip key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=equip level=1}}
<ul class="item-list list-item-shadow2 list-item-margin1">
{{#each equip.data.contents as |subgear key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=subgear level=2}}
{{/each}}
</ul>
{{/each}}
</ul>
<hr> <hr>
@ -501,11 +315,6 @@
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}" <input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" /> data-dtype="String" />
</li> </li>
<li class="flexrow item" data-item-id="{{race._id}}">
<label class="generic-label">Race</label>
<a class="item-edit"><img class="stat-icon" src="{{race.img}}"></a>
<input type="text" class="" name="system.biodata.racename" value="{{data.biodata.racename}}" data-dtype="String" />
</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -18,130 +18,12 @@
<div> <div>
<ul> <ul>
{{#if (eq rollOrder 1)}} {{#if stat}}
<li><strong>Roll with {{rollType}} - Roll 1</strong></li> <li>{{localize stat.label}} : {{stat.value}}</li>
{{/if}}
{{#if (eq rollOrder 2)}}
<li><strong>Roll with {{rollType}} - Roll 2</strong></li>
{{/if}}
{{#if (eq rollOrder 3)}}
<li><strong>Roll with {{rollType}} - Final result !</strong></li>
{{/if}} {{/if}}
<li>Bonus/Malus : {{bonusMalus}}</li>
{{#if save}} <li><strong>Result : {{roll.total}} </strong></li>
<li>Save : {{save.label}} - {{save.value}}d6
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if sizeDice}}
<li>Size/Range/Cover/Situational dices
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if ability}}
<li>Ability : {{ability.label}} - {{ability.value}}d6
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if skill}}
<li>Skill : {{skill.name}} - {{skill.data.skilldice}}
{{#if featSL}}
- with Feat SL +{{featSL}}
{{/if}}
&nbsp;({{#each roll.terms.2.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if noAdvantage}}
<li>No advantage due to condition : {{noAdvantage.name}}</li>
{{else}}
{{#if (or (eq advantage "advantage1") forceAdvantage)}}
<li>1 Advantage Die !
&nbsp;({{#each roll.terms.8.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq advantage "advantage2") }}
<li>2 Advantage Dice !
&nbsp;({{#each roll.terms.8.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{/if}}
{{#if (or (eq disadvantage "disadvantage1") forceDisadvantage)}}
<li>1 Disadvantage Die !
&nbsp;({{#each roll.terms.10.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq disadvantage "disadvantage2")}}
<li>2 Disadvantage Dice !
&nbsp;({{#each roll.terms.10.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq rollAdvantage "roll-advantage")}}
<li>Roll with Advantage !</li>
{{/if}}
{{#if (eq rollAdvantage "roll-disadvantage")}}
<li>Roll with Disadvantage !</li>
{{/if}}
{{#if skillArmorPenalty}}
<li>Armor Penalty : {{skillArmorPenalty}} Disadvantage Dice
&nbsp;({{#each roll.terms.12.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if hasBonusDice}}
<li>Skill bonus dice : {{hasBonusDice}}
&nbsp;({{#each roll.terms.6.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if complexSkillDisadvantage}}
<li>Roll with Disadvantage because of Complex Skill at SL 0 !</li>
{{/if}}
{{#if hasFeatDie}}
<li>Feat Die : d10
&nbsp;({{#each roll.terms.4.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if useshield}}
<li>Shield : {{shield.name}} - {{shield.data.shielddie}}
({{#each roll.terms.14.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
<li><strong>Number of successes</strong> {{nbSuccess}} </li>
<!-- <button class="chat-card-button reroll-level-remaining" data-roll-id="{{rollId}}">Reroll</button> -->
</ul> </ul>
</div> </div>

View File

@ -1,19 +0,0 @@
<li class="item flexrow list-item item-ability-roll" data-attr-key="{{key}}">
<span class="ability-label ability-margin" name="{{key}}">
<h4 class="ability-text-white ability-margin"><a class="roll-ability ability-margin" data-ability-key="{{key}}">{{ability.label}}</a></h4>
</span>
<select class="status-small-label color-class-common" type="text" name="system.abilities.{{key}}.value" value="{{ability.value}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select ability.value}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
{{/select}}
</select>
</li>

View File

@ -0,0 +1,36 @@
<li class="item flexrow list-item item-stat-roll" data-attr-key="{{key}}">
<span class="item-field-label-medium" name="{{key}}">
<h4 class="item-field-label-medium">
{{#if roll}}
<a class="roll-this stat-margin" data-type="{{path}}" data-key="{{key}}">{{localize stat.label}}</a>
{{else}}
{{localize stat.label}}
{{/if}}
</h4>
</span>
{{#if (eq style "dropdown")}}
<select class="item-field-label-medium" type="text" name="system.{{path}}.{{key}}.value" value="{{stat.value}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.value}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
{{/select}}
</select>
{{/if}}
{{#if (eq style "edit")}}
<input type="text" class="item-field-label-medium " name="system.{{path}}.{{key}}.value" value="{{stat.value}}" data-dtype="Number"/>
{{#if hasmax}}
<input type="text" class="item-field-label-medium " name="system.{{path}}.{{key}}.max" value="{{stat.max}}" data-dtype="Number"/>
{{/if}}
{{/if}}
</li>

View File

@ -8,65 +8,10 @@
<div class="flexcol"> <div class="flexcol">
{{#if sizeDice}} {{#if stat}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Size basic dices : </span> <span class="item-field-label-medium">{{localize stat.label}}</span>
<span class="roll-dialog-label">{{sizeDice.nb}}{{sizeDice.dice}}</span> <span class="item-field-label-medium">{{stat.value}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Distance bonus dice(s) : </span>
<select class="status-small-label color-class-common" type="text" id="distanceBonusDice" value="{{distanceBonusDice}}" data-dtype="String" >
{{#select distanceBonusDice}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if hasCover}}
<div class="flexrow">
<span class="roll-dialog-label">Cover : </span>
<select class="status-small-label color-class-common" type="text" id="hasCover" value="{{hasCover}}" data-dtype="String" >
{{#select hasCover}}
<option value="none">None</option>
<option value="cover50">Cover at 50% (+1 dice)</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if situational}}
<div class="flexrow">
<span class="roll-dialog-label">Situational : </span>
<select class="status-small-label color-class-common" type="text" id="situational" value="{{situational}}" data-dtype="String" >
{{#select situational}}
<option value="none">None</option>
<option value="dodge">Dodge (+1 dice)</option>
<option value="prone">Prone (+1 dice)</option>
<option value="moving">Moving (+1 dice)</option>
<option value="Engaged">Engaged (+1 dice)</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if save}}
<div class="flexrow">
<span class="roll-dialog-label">{{save.label}} : </span>
<span class="roll-dialog-label">{{save.value}}d6</span>
</div>
{{/if}}
{{#if ability}}
<div class="flexrow">
<span class="roll-dialog-label">Ability : </span>
<span class="roll-dialog-label">{{ability.value}}d6</span>
</div> </div>
{{/if}} {{/if}}
@ -88,80 +33,26 @@
</div> </div>
{{/if}} {{/if}}
{{#if skill}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Skill : </span> <span class="item-field-label-medium">Bonus/Malus : </span>
<span class="roll-dialog-label">{{skill.name}} - {{skill.data.skilldice}}</span> <select class="item-field-label-medium" type="text" id="bonusMalus" value="{{bonusMalus}}">
</div> {{#select bonusMalus}}
<div class="flexrow"> <option value="-6">-6</option>
<span class="roll-dialog-label">Feature die or SL+2? : </span> <option value="-5">-5</option>
<span class="roll-dialog-label">{{#if skill.data.isfeatdie}} Yes {{else}} No {{/if}}</span> <option value="-4">-4</option>
</div> <option value="-3">-3</option>
{{/if}} <option value="-2">-2</option>
<option value="-1">-1</option>
{{#if noAdvantage}} <option value="0">0</option>
<div> <option value="1">1</option>
<span class="roll-dialog-label">No advantage due to condition : {{noAdvantage.name}}</span> <option value="2">2</option>
</div> <option value="3">3</option>
{{else}} <option value="4">4</option>
<div class="flexrow"> <option value="5">5</option>
<span class="roll-dialog-label">Advantage : </span> <option value="6">6</option>
<select class="status-small-label color-class-common" type="text" id="advantage" value="{{advantage}}" data-dtype="String" >
{{#select advantage}}
<option value="none">None</option>
<option value="advantage1">1 Advantage</option>
<option value="advantage2">2 Advantages</option>
{{/select}} {{/select}}
</select> </select>
</div> </div>
{{/if}}
<div class="flexrow">
<span class="roll-dialog-label">Disadvantage : </span>
<select class="status-small-label color-class-common" type="text" id="disadvantage" value="{{disadvantage}}" data-dtype="String" >
{{#select disadvantage}}
<option value="none">None</option>
<option value="disadvantage1">1 Disadvantage</option>
<option value="disadvantage2">2 Disadvantages</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Roll with Advantage/Disadvantage : </span>
<select class="status-small-label color-class-common" type="text" id="rollAdvantage" value="{{rollAdvantage}}" data-dtype="String" >
{{#select rollAdvantage}}
<option value="none">None</option>
<option value="roll-advantage">Roll with Advantage</option>
<option value="roll-disadvantage">Roll with Disadvantage</option>
{{/select}}
</select>
</div>
{{#if forceAdvantage}}
<div class="flexrow">
<span class="roll-dialog-label">1 Advantage from condition : {{forceAdvantage.name}}
{{#if advantageFromTarget}} (Provided by targetted actor) {{/if}}
</span>
</div>
{{/if}}
{{#if forceDisadvantage}}
<div class="flexrow">
<span class="roll-dialog-label">1 Disadvantage from condition : {{forceDisadvantage.name}} </span>
</div>
{{/if}}
{{#if forceRollAdvantage}}
<div class="flexrow">
<span class="roll-dialog-label">Roll Advantage from condition : {{forceRollAdvantage.name}} </span>
</div>
{{/if}}
{{#if forceRollDisadvantage}}
<div class="flexrow">
<span class="roll-dialog-label">Roll Disadvantage from condition : {{forceRollDisadvantage.name}} </span>
</div>
{{/if}}
</div> </div>
</form> </form>