Various fixes and enhancents

This commit is contained in:
LeRatierBretonnien 2023-02-06 07:37:39 +01:00
parent bc7910a50d
commit 7d8791f675
19 changed files with 633 additions and 173 deletions

View File

@ -33,7 +33,7 @@
"WH.ui.hpprog": "HP Progression",
"WH.ui.lan": "Languages",
"WH.ui.attrbonus": "Attribute (+4/Lvl4, +2/Lvl8)",
"WH.ui.attrbonus": "Attribute",
"WH.ui.weapons": "Weapons",
"WH.ui.armors": "Armors",
"WH.ui.shields": "Shields",
@ -46,10 +46,13 @@
"WH.ui.Type": "Type",
"WH.ui.HitPoints": "Hit Points",
"WH.ui.Defence": "Defence",
"WH.ui.Throw2Hit": "Throw to Hit",
"WH.ui.Throw2HitM": "Throw to Hit (Melee)",
"WH.ui.Throw2HitR": "Throw to Hit (Ranged)",
"WH.ui.Mana": "Mana",
"WH.ui.Initiative": "Initiative",
"WH.ui.Movement": "Movement",
"WH.ui.Movement": "Movement (Earth)",
"WH.ui.MovementSwim": "Movement (Swim)",
"WH.ui.MovementFly": "Movement (Fly)",
"WH.ui.power": "Power",
"WH.ui.Qty": "Qty",
@ -57,5 +60,22 @@
"WH.ui.slotsused": "Slots used",
"WH.ui.Damage": "Damage",
"WH.ui.parrybonus": "Parry bonus",
"WH.ui.damagereduction": "Damage reduction"
"WH.ui.damagereduction": "Damage reduction",
"WH.ui.save": "Save",
"WH.ui.XP": "XP",
"WH.ui.xphp": "HP Progression",
"WH.ui.Knowledge": "Knowledge",
"WH.ui.malusmultiweapon": "Mult. Weapons malus",
"WH.ui.drbonus": "DR bonus",
"WH.ui.parrybonustotal": "Parry bonus total",
"WH.ui.drbonustotal": "DR bonus total",
"WH.ui.counterspell": "Counter spell",
"WH.ui.createitem": "Create item",
"WH.ui.classSkills": "Class Skills",
"WH.ui.skills": "Skills",
"WH.ui.isclassskill": "Class skill ?",
"WH.ui.unlimited": "Unlimited use ?",
"WH.ui.currentuse": "Current use",
"WH.ui.maxuse": "Max use",
"WH.ui.languages": "Languages"
}

View File

@ -24,7 +24,13 @@ export class WarheroActorSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
this.actor.setLevel()
this.actor.computeDRTotal()
this.actor.computeParryBonusTotal()
this.actor.computeBonusLanguages()
const objectData = duplicate(this.object.system)
let race = this.actor.getRace()
let formData = {
title: this.title,
@ -36,7 +42,9 @@ export class WarheroActorSheet extends ActorSheet {
cssClass: this.isEditable ? "editable" : "locked",
system: objectData,
limited: this.object.limited,
skills: this.actor.getSkills( ),
skills: this.actor.getNormalSkills( ),
classSkills: this.actor.getClassSkills( ),
languages: this.actor.getLanguages( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
@ -44,7 +52,7 @@ export class WarheroActorSheet extends ActorSheet {
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
slotEquipments: this.actor.buildEquipmentsSlot(),
subActors: duplicate(this.actor.getSubActors()),
race: duplicate(this.actor.getRace()),
race: duplicate(race),
class: duplicate(this.actor.getClass()),
moneys: duplicate(this.actor.getMoneys()),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
@ -54,8 +62,10 @@ export class WarheroActorSheet extends ActorSheet {
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
if ( race && race.name) {
formData.hpprogression = game.system.warhero.config.progressionList[race.system.hpprogresion]
}
this.formData = formData
console.log("PC : ", formData, this.object);
return formData;
}
@ -136,6 +146,11 @@ export class WarheroActorSheet extends ActorSheet {
const statKey = $(event.currentTarget).data("key")
this.actor.rollFromType(rollType, statKey)
});
html.find('.roll-save').click((event) => {
const rollType = $(event.currentTarget).data("type")
const statKey = $(event.currentTarget).data("key")
this.actor.rollSaveFromType(rollType, statKey)
});
html.find('.roll-weapon').click((event) => {
const li = $(event.currentTarget).parents(".item")
const weaponId = li.data("item-id")

View File

@ -170,7 +170,7 @@ export class WarheroActor extends Actor {
&& it.system.slotlocation == slotName )
let slotUsed = 0
for(let item of containers[slotName].content) {
slotUsed += item.system.slotused
slotUsed += item.system.slotused * ((item.system.quantity) ? item.system.quantity : 1)
}
containers[slotName].slotUsed = slotUsed
}
@ -210,13 +210,25 @@ export class WarheroActor extends Actor {
}
return item;
}
/* -------------------------------------------- */
getLanguages() {
let comp = this.items.filter(it => it.type == "language")
WarheroUtility.sortArrayObjectsByName(comp)
return comp
}
/* -------------------------------------------- */
getNormalSkills() {
let comp = this.items.filter(it => it.type == "skill" && !it.system.classskill)
WarheroUtility.sortArrayObjectsByName(comp)
return comp
}
getClassSkills() {
let comp = this.items.filter(it => it.type == "skill" && it.system.classskill)
WarheroUtility.sortArrayObjectsByName(comp)
return comp
}
getSkills() {
let comp = duplicate(this.items.filter(item => item.type == 'skill') || [])
for (let skill of comp) {
WarheroUtility.updateSkill(skill)
}
WarheroUtility.sortArrayObjectsByName(comp)
return comp
}
@ -534,7 +546,33 @@ export class WarheroActor extends Actor {
isAttackerAdvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.targetadvantage)
}
/* -------------------------------------------- */
setLevel() {
let xp = this.system.secondary.xp.value
this.system.secondary.xp.level = Math.floor(xp/10)
}
/* -------------------------------------------- */
computeDRTotal() {
let armors = this.items.filter(it => it.type == "armor")
let dr = 0
for (let armor of armors) {
dr += armor.system.damagereduction
}
this.system.secondary.drbonustotal.value = this.system.secondary.drbonus.value + dr
}
/* -------------------------------------------- */
computeParryBonusTotal() {
let shields = this.items.filter(it => it.type == "shield")
let parry = 0
for (let shield of shields) {
parry += shield.system.parrybonus
}
this.system.secondary.parrybonustotal.value = this.system.secondary.parrybonus.value + parry
}
/* -------------------------------------------- */
computeBonusLanguages() {
this.system.secondary.nblanguage.value = Math.floor(this.system.statistics.min.value / 2)
}
/* -------------------------------------------- */
spentMana( mana) {
if ( Number(mana) > this.system.attributes.mana.value) {
@ -562,9 +600,21 @@ export class WarheroActor extends Actor {
let rollData = this.getCommonRollData()
rollData.mode = rollType
rollData.stat = stat
if ( rollKey == "parrybonustotal") {
WarheroUtility.rollParry(rollData)
return
}
this.startRoll(rollData)
}
/* -------------------------------------------- */
rollSaveFromType(rollType, rollKey) {
let stat = duplicate(this.system[rollType][rollKey])
let rollData = this.getCommonRollData()
rollData.mode = "save"
rollData.stat = stat
this.startRoll(rollData)
}
/* -------------------------------------------- */
rollWeapon(weaponId) {
let weapon = this.items.get(weaponId)
@ -572,7 +622,13 @@ export class WarheroActor extends Actor {
weapon = duplicate(weapon)
let rollData = this.getCommonRollData()
rollData.mode = "weapon"
rollData.stat = duplicate(this.system.statistics.dex)
if (weapon.system.weapontype ==="shooting" || weapon.system.weapontype ==="throwing") {
rollData.stat = duplicate(this.system.attributes.txcr)
} else {
rollData.stat = duplicate(this.system.attributes.txcm)
}
rollData.usemWeaponMalus =
rollData.mWeaponMalus = this.system.secondary.malusmultiweapon.value
rollData.weapon = weapon
rollData.img = weapon.img
this.startRoll(rollData)

View File

@ -21,22 +21,22 @@ export const WARHERO_CONFIG = {
},
slotNames : {
head: {nbslots: 1, label: "WH.conf.head"},
cloak: {nbslots: 1, label: "WH.conf.cloak"},
weapon1: {nbslots: 1, label: "WH.conf.weapon1"},
weapon2: {nbslots: 1, label: "WH.conf.weapon2"},
gloves: {nbslots: 1, label: "WH.conf.gloves"},
ring: {nbslots: 10, label: "WH.conf.ring"},
dress: {nbslots: 1, label: "WH.conf.dress"},
boots: {nbslots: 1, label: "WH.conf.boots"},
belt: {nbslots: 6, label: "WH.conf.belt"},
quiver: {nbslots: 20, label: "WH.conf.quiver"},
armor: {nbslots: 1, label: "WH.conf.armor"},
shield: {nbslots: 1, label: "WH.conf.shield"},
backpack: {nbslots: 12, label: "WH.conf.backpack"},
beltpouch1: {nbslots: 4, label: "WH.conf.beltpouch1"},
beltpouch2: {nbslots: 4, label: "WH.conf.beltpouch2"},
beltpouch3: {nbslots: 4, label: "WH.conf.beltpouch3"},
head: {nbslots: 1, itemtype:"armor", label: "WH.conf.head"},
cloak: {nbslots: 1, itemtype:"equipment", label: "WH.conf.cloak"},
weapon1: {nbslots: 1, itemtype:"weapon", label: "WH.conf.weapon1"},
weapon2: {nbslots: 1, itemtype:"weapon", label: "WH.conf.weapon2"},
gloves: {nbslots: 1, itemtype:"equipment",label: "WH.conf.gloves"},
ring: {nbslots: 10, itemtype:"equipment",label: "WH.conf.ring"},
dress: {nbslots: 1, itemtype:"equipment",label: "WH.conf.dress"},
boots: {nbslots: 1, itemtype:"equipment",label: "WH.conf.boots"},
belt: {nbslots: 6, itemtype:"equipment",label: "WH.conf.belt"},
quiver: {nbslots: 20, itemtype:"equipment",label: "WH.conf.quiver"},
armor: {nbslots: 1, itemtype:"armor",label: "WH.conf.armor"},
shield: {nbslots: 1, itemtype:"shield",label: "WH.conf.shield"},
backpack: {nbslots: 12, itemtype:"equipment",label: "WH.conf.backpack"},
beltpouch1: {nbslots: 4, itemtype:"equipment",label: "WH.conf.beltpouch1"},
beltpouch2: {nbslots: 4, itemtype:"equipment", label: "WH.conf.beltpouch2"},
beltpouch3: {nbslots: 4, itemtype:"equipment", label: "WH.conf.beltpouch3"},
},
progressionList: {

View File

@ -49,9 +49,6 @@ export class WarheroItemSheet extends ItemSheet {
/* -------------------------------------------- */
async getData() {
if ( this.object.type == "skill") {
WarheroUtility.updateSkill(this.object)
}
let objectData = duplicate(this.object.system)
let itemData = objectData
@ -66,6 +63,7 @@ export class WarheroItemSheet extends ItemSheet {
config: game.system.warhero.config,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
system: itemData,
statistics: duplicate(game.system.template.Actor.templates.core.statistics),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,

View File

@ -5,7 +5,7 @@ export class WarheroRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData) {
let options = { classes: ["WarheroDialog"], width: 320, height: 'fit-content', 'z-index': 99999 };
let options = { classes: ["WarheroDialog"], width: 420, 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);
@ -64,6 +64,10 @@ export class WarheroRollDialog extends Dialog {
html.find('#bonusMalus').change((event) => {
this.rollData.bonusMalus = Number(event.currentTarget.value)
})
html.find('#usemWeaponMalus').change((event) => {
this.rollData.usemWeaponMalus = event.currentTarget.checked
})
}
}

View File

@ -208,23 +208,6 @@ export class WarheroUtility {
html.on("click", '.view-item-from-chat', event => {
game.system.crucible.creator.openItemView(event)
})
html.on("click", '.roll-defense-melee', event => {
let rollId = $(event.currentTarget).data("roll-id")
let rollData = WarheroUtility.getRollData(rollId)
rollData.defenseWeaponId = $(event.currentTarget).data("defense-weapon-id")
let actor = game.canvas.tokens.get(rollData.defenderTokenId).actor
if (actor && (game.user.isGM || actor.isOwner)) {
actor.rollDefenseMelee(rollData)
}
})
html.on("click", '.roll-defense-ranged', event => {
let rollId = $(event.currentTarget).data("roll-id")
let rollData = WarheroUtility.getRollData(rollId)
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
if (defender && (game.user.isGM || defender.isOwner)) {
defender.rollDefenseRanged(rollData)
}
})
}
@ -319,11 +302,6 @@ export class WarheroUtility {
this.updateRollData(rollData)
}
/* -------------------------------------------- */
static getRollData(id) {
return this.rollDataStore[id]
}
/* -------------------------------------------- */
static async displayDefenseMessage(rollData) {
if (rollData.mode == "weapon" && rollData.defenderTokenId) {
@ -517,10 +495,6 @@ export class WarheroUtility {
}
}
/* -------------------------------------------- */
static updateSkill(skill) {
}
/* -------------------------------------------- */
static getDiceFromCover(cover) {
if (cover == "cover50") return 1
@ -534,6 +508,30 @@ export class WarheroUtility {
if (cover == "engaged") return 1
return 0
}
/* -------------------------------------------- */
static async rollParry(rollData) {
let actor = game.actors.get(rollData.actorId)
// ability/save/size => 0
let diceFormula = "1d12+" + rollData.stat.value
let myRoll = rollData.roll
if (!myRoll) { // New rolls only of no rerolls
myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
}
rollData.roll = myRoll
rollData.isSuccess = false
if (myRoll.total >= 12 || myRoll.terms[0].results[0].result == 12) {
rollData.isSuccess = true
}
if (myRoll.terms[0].results[0].result == 1) {
rollData.isSuccess = false
}
let msg = await this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-warhero/templates/chat-parry-result.html`, rollData)
})
msg.setFlag("world", "rolldata", rollData)
console.log("Rolldata result", rollData)
}
/* -------------------------------------------- */
static async rollWarhero(rollData) {
@ -569,6 +567,9 @@ export class WarheroUtility {
if ( rollData.stat) {
diceFormula += "+" + rollData.stat.value
}
if ( rollData.usemWeaponMalus) {
diceFormula += "+" + rollData.mWeaponMalus
}
diceFormula += "+" + rollData.bonusMalus
rollData.diceFormula = diceFormula
@ -581,8 +582,6 @@ export class WarheroUtility {
}
rollData.roll = myRoll
actor.lastRoll = rollData
let msg = await this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData)
})

View File

@ -562,8 +562,8 @@
.list-item {
margin: 0.125rem;
box-shadow: inset 0px 0px 1px #00000096;
border-radius: 0.25rem;
/*box-shadow: inset 0px 0px 1px #00000096;
border-radius: 0.25rem;*/
padding: 0.125rem;
flex: 1 1 5rem;
display: flex !important;
@ -1388,6 +1388,9 @@
background: black;
color: white;
}
.items-title-bg-red {
background: darkred;
}
.items-title-text {
margin-left: 4px;
}
@ -1465,8 +1468,8 @@
.item-field-label-vlong {
flex-grow:1;
margin-top: 4px;
max-width: 14rem;
min-width: 14rem;
max-width: 12rem;
min-width: 12rem;
}
.item-field-label-vlong2 {
flex-grow:1;

View File

@ -100,7 +100,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.7",
"version": "10.0.18",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -108,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.7.zip",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.18.zip",
"url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
"background": "images/ui/warhero_welcome_page.webp",
"id": "fvtt-warhero"

View File

@ -25,19 +25,28 @@
"str": {
"label": "WH.ui.Strength",
"abbrev": "str",
"style": "dropdown",
"style": "edit",
"hassave": true,
"roll": true,
"save": 0,
"value": 0
},
"dex": {
"label": "WH.ui.Dexterity",
"abbrev": "dex",
"style": "dropdown",
"style": "edit",
"hassave": true,
"roll": true,
"save": 0,
"value": 0
},
"min": {
"label": "WH.ui.Mind",
"abbrev": "min",
"style": "dropdown",
"style": "edit",
"hassave": true,
"roll": true,
"save": 0,
"value": 0
}
},
@ -50,6 +59,15 @@
"max": 1,
"value": 1
},
"knowledge":{
"label": "WH.ui.Knowledge",
"abbrev": "knowledge",
"style": "edit",
"hasmax": false,
"roll": true,
"max": 1,
"value": 1
},
"def":{
"label": "WH.ui.Defence",
"abbrev": "def",
@ -57,10 +75,21 @@
"max": 1,
"value": 1
},
"txc":{
"label": "WH.ui.Throw2Hit",
"abbrev": "txc",
"txcm":{
"label": "WH.ui.Throw2HitM",
"abbrev": "txcm",
"istxc": true,
"style": "edit",
"roll": true,
"max": 1,
"value": 1
},
"txcr":{
"label": "WH.ui.Throw2HitR",
"abbrev": "txcr",
"istxc": true,
"style": "edit",
"roll": true,
"max": 1,
"value": 1
},
@ -75,16 +104,94 @@
"ini":{
"label": "WH.ui.Initiative",
"abbrev": "ini",
"style": "dropdown",
"style": "edit",
"max": 1,
"value": 1
},
"mov":{
"movearth":{
"label": "WH.ui.Movement",
"abbrev": "mov",
"style": "dropdown",
"style": "edit",
"max": 1,
"value": 1
},
"movswim":{
"label": "WH.ui.MovementSwim",
"abbrev": "mov",
"style": "edit",
"max": 1,
"value": 1
},
"movfly":{
"label": "WH.ui.MovementFly",
"abbrev": "mov",
"style": "edit",
"max": 1,
"value": 1
}
},
"secondary": {
"xp": {
"label": "WH.ui.XP",
"abbrev": "xp",
"islevel": true,
"style": "edit",
"value": 0
},
"malusmultiweapon": {
"label": "WH.ui.malusmultiweapon",
"abbrev": "malusmultiweapon",
"style": "edit",
"value": 0
},
"drbonus": {
"label": "WH.ui.drbonus",
"abbrev": "drbonus",
"style": "edit",
"value": 0
},
"drbonustotal": {
"label": "WH.ui.drbonustotal",
"abbrev": "drbonustotal",
"disabled": true,
"style": "edit",
"value": 0
},
"parrybonus": {
"label": "WH.ui.parrybonus",
"abbrev": "parrybonus",
"isparrybonus": true,
"style": "edit",
"value": 0
},
"parrybonustotal": {
"label": "WH.ui.parrybonustotal",
"abbrev": "parrybonustotal",
"disabled": true,
"style": "edit",
"roll": true,
"value": 0
},
"counterspell": {
"label": "WH.ui.counterspell",
"abbrev": "counterspell",
"style": "edit",
"hasmax": true,
"max": 1,
"value": 0
},
"createitem": {
"label": "WH.ui.createitem",
"abbrev": "createitem",
"style": "edit",
"value": 0
},
"nblanguage": {
"label": "WH.ui.languages",
"abbrev": "nblanguage",
"style": "edit",
"disabled": true,
"value": 0
}
}
},
@ -101,40 +208,52 @@
}
},
"Item": {
"types": [ "race", "weapon", "armor", "shield", "equipment", "money" , "skill", "power", "condition", "class"],
"types": [ "equipment", "race", "weapon", "armor", "shield", "money" , "skill", "power", "language", "condition", "class"],
"templates": {
"commonclassrace": {
"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
}
}
},
"condition": {
"description": ""
},
"class": {
"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
},
"templates": ["commonclassrace"],
"description": ""
},
"race": {
"description": "",
"hpprogresion": "hp2",
"languages": "",
"attributebonus": "",
"weapons": "",
"shields": "",
"armors": ""
"attributebonus1": "",
"attributebonus4": "",
"attributebonus8": "",
"templates": ["commonclassrace"]
},
"language": {
"description": ""
},
"skill": {
"classskill": false,
"unlimited": false,
"currentuse": 0,
"maxuse": 0,
"description": ""
},
"weapon": {

View File

@ -12,32 +12,30 @@
<div class="ability-item">
<ul>
{{#each system.statistics as |stat key|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key=key path="statistics" roll=true}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key=key path="statistics" fieldClass="item-field-label-medium"}}
{{/each}}
</ul>
</div>
<div class="ability-item">
<ul>
<li class="flexrow item" data-item-id="{{race._id}}">
<label class="item-field-label-medium">Race</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{race.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{race.name}}" data-dtype="String" />
</li>
<li class="flexrow item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">Class</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" />
</li>
<li class="flexrow item" >
<label class="item-field-label-medium">Religion</label>
<input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
</li>
<li class="item flexrow list-item " data-item-id="{{race._id}}">
<label class="item-field-label-medium">Race</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{race.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{race.name}}" data-dtype="String" />
</li>
<li class="item flexrow list-item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">Class</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" />
</li>
<li class="item flexrow list-item" >
<label class="item-field-label-medium">Religion</label>
<input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
</li>
</ul>
</div>
<div class="ability-item">
</div>
</div>
</div>
@ -50,6 +48,7 @@
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="main">Main</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="skill">Skills&Effects</a>
<a class="item" data-tab="power">Powers</a>
<a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="biodata">Biography</a>
@ -60,14 +59,36 @@
{{!-- Skills Tab --}}
<div class="tab main" data-group="primary" data-tab="main">
<div class="flexrow">
<div class="ability-item">
<ul>
{{#each system.attributes as |attr key|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=attr key=key path="attributes" roll=false}}
{{/each}}
<div class="ability-item">
<ul>
{{#each system.attributes as |attr key|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=attr key=key path="attributes" fieldClass="item-field-label-vlong"}}
{{/each}}
</ul>
</div>
<div class="ability-item">
<ul>
{{#each system.secondary as |second key|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=second key=key path="secondary" fieldClass="item-field-label-vlong"}}
{{/each}}
<li class="item flexrow list-item item-stat-roll" data-attr-key="{{key}}">
<span class="item-field-label-vlong" name="{{key}}">
<h4 class="item-field-label-vlong">
{{localize "WH.ui.xphp"}}
</h4>
</span>
<span class="item-field-label-long" >{{hpprogression}}</span>
</li>
</ul>
</div>
</ul>
</div>
</div>
@ -175,6 +196,93 @@
</div>
</div>
{{!-- Skills Tab --}}
<div class="tab skill" data-group="primary" data-tab="skill">
<div class="flexcol">
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">{{localize "WH.ui.classSkills"}}</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">{{localize "WH.ui.currentuse"}}</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">{{localize "WH.ui.maxuse"}}</label>
</span>
</li>
{{#each classSkills as |skill key|}}
<li class="item 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-long">{{skill.name}}</a></span>
{{#if skill.system.unlimited}}
<span class="item-field-label-medium">N/A</span>
<span class="item-field-label-medium">N/A</span>
{{else}}
<span class="item-field-label-medium">{{skill.system.currentuse}}</span>
<span class="item-field-label-medium">{{skill.system.maxuse}}</span>
{{/if}}
<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}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">{{localize "WH.ui.skills"}}</label></h3>
</span>
</li>
{{#each skills as |skill key|}}
<li class="item 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-long">{{skill.name}}</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}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">{{localize "WH.ui.languages"}}</label></h3>
</span>
</li>
{{#each languages as |language key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{language.img}}" /></a>
<span class="item-name-label-long">{{language.name}}</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}}
</ul>
</div>
</div>
</div>
{{!-- Powers Tab --}}
<div class="tab power" data-group="primary" data-tab="power">
@ -212,7 +320,7 @@
{{#each slotEquipments as |slot slotKey|}}
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<li class="item flexrow list-item items-title-bg {{#if (gt slot.slotUsed slot.nbslots)}}items-title-bg-red{{/if}}">
<span class="item-name-label-header">
<h3><label class="items-title-text">{{localize slot.label}}</label></h3>
</span>
@ -230,7 +338,7 @@
</span>
<div class="item-filler">&nbsp;</div>
<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="{{itemtype}}" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each slot.content as |item itemKey|}}
@ -289,6 +397,11 @@
<label class="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
</ul>
</div>
<div>
@ -310,11 +423,6 @@
<label class="generic-label">Sex</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
</ul>
</div>
</div>

View File

@ -24,7 +24,11 @@
{{#if hasBM}}
<li>Bonus/Malus : {{bonusMalus}}</li>
{{/if}}
*
{{#if usemWeaponMalus}}
<li>Multiple weapons malus : {{mWeaponMalus}}</li>
{{/if}}
{{#if power}}
<li>{{localize "WH.ui.power"}} : {{power.name}}</li>
<li>{{{powerText}}}</li>

View File

@ -0,0 +1,28 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div>
<ul>
<li>{{localize stat.label}} : {{stat.value}}</li>
<li><strong>Result : {{roll.total}} </strong></li>
{{#if isSuccess}}
<li><strong>Parry success ! </strong></li>
{{else}}
<li><strong>Parry failed ! </strong></li>
{{/if}}
</ul>
</div>
</div>

View File

@ -0,0 +1,22 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-warhero/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-warhero/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul>
</ul>
</div>
</section>
</form>

View File

@ -18,7 +18,7 @@
<li class="flexrow"><label class="item-field-label-medium ">Quantity</label>
<input type="text" class="item-field-label-medium " name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Unit value</label>
<li class="flexrow"><label class="item-field-label-medium">Unit value</label>
<input type="text" class="item-field-label-medium " name="system.value" value="{{system.value}}" data-dtype="Number"/>
</li>
</ul>

View File

@ -21,7 +21,7 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.hpprog"}}</label>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.hpprog"}}</label>
<select class="item-field-label-long " type="text" name="system.hpprogresion" value="{{system.hpprogresion}}" data-dtype="String">
{{#select system.hpprogresion}}
{{#each config.progressionList as |prog key|}}
@ -31,30 +31,62 @@
</select>
</li>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.lan"}}</label>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.lan"}}</label>
<input type="text" class="item-field-label-long" name="system.languages" value="{{system.languages}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.attrbonus"}}</label>
<select class="item-field-label-long " type="text" name="system.attributebonus" value="{{system.attributebonus}}" data-dtype="String">
{{#select system.attributebonus}}
{{#each abilities as |ability key|}}
<option value="{{key}}">{{ability.label}}</option>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.attrbonus"}} Lvl 1</label>
<select class="item-field-label-long " type="text" name="system.attributebonus1" value="{{system.attributebonus1}}" data-dtype="String">
{{#select system.attributebonus1}}
{{#each statistics as |ability key|}}
<option value="{{key}}">{{localize ability.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.attrbonus"}} Lvl 4</label>
<select class="item-field-label-long " type="text" name="system.attributebonus4" value="{{system.attributebonus4}}" data-dtype="String">
{{#select system.attributebonus4}}
{{#each statistics as |ability key|}}
<option value="{{key}}">{{localize ability.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.attrbonus"}} Lvl 8</label>
<select class="item-field-label-long " type="text" name="system.attributebonus8" value="{{system.attributebonus8}}" data-dtype="String">
{{#select system.attributebonus8}}
{{#each statistics as |ability key|}}
<option value="{{key}}">{{localize ability.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.weapons"}}</label>
<input type="text" class="item-field-label-long3 " name="system.weapons" value="{{system.weapons}}" data-dtype="String"/>
{{#each system.weapons as |weaponflag key|}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.weapons"}} {{key}}</label>
<input type="checkbox" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.weapons.{{key}}" {{checked weaponflag}}/>
</li>
{{/each}}
{{#each system.armors as |armorflag key|}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.armors"}} {{key}}</label>
<input type="checkbox" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.armors.{{key}}" {{checked armorflag}}/>
</li>
{{/each}}
{{#each system.shields as |shieldflag key|}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.shields"}} {{key}}</label>
<input type="checkbox" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.shields.{{key}}" {{checked shieldflag}}/>
</li>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.armors"}}</label>
<input type="text" class="item-field-label-long3 " name="system.armors" value="{{system.armors}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.shields"}}</label>
<input type="text" class="item-field-label-long3 " name="system.shields" value="{{system.shields}}" data-dtype="String"/>
</li>
</ul>
{{/each}}
</ul>
</div>

View File

@ -15,8 +15,27 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.isclassskill"}}</label>
<input type="checkbox" name="system.classskill" {{checked system.classskill}}/>
</li>
{{#if system.classskill}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.unlimited"}}</label>
<input type="checkbox" name="system.unlimited" {{checked system.unlimited}}/>
</li>
</ul>
</div>
{{#if system.unlimited}}
{{else}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.currentuse"}}</label>
<input type="text" class="item-field-label-medium " name="system.currentuse" value="{{system.currentuse}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.maxuse"}}</label>
<input type="text" class="item-field-label-medium " name="system.maxuse" value="{{system.maxuse}}" data-dtype="Number"/>
</li>
{{/if}}
{{/if}}
</ul>
</div>
</section>
</form>

View File

@ -1,16 +1,16 @@
<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">
<span class="{{fieldClass}}" name="{{key}}">
<h4 class="{{fieldClass}}">
{{#if roll}}
<i class="fa-solid fa-dice-d20"></i><a class="roll-this stat-margin" data-type="{{path}}" data-key="{{key}}">{{localize stat.label}}</a>
<i class="fa-solid fa-dice-d20"></i><a class="roll-this stat-margin" data-type="{{path}}" data-key="{{key}}">{{localize stat.label}}</a>
{{else}}
{{localize stat.label}}
{{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}}"
<select class="item-field-label-short" 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>
@ -27,10 +27,30 @@
{{/if}}
{{#if (eq style "edit")}}
<input type="text" class="item-field-label-medium " name="system.{{path}}.{{key}}.value" value="{{stat.value}}" data-dtype="Number"/>
<input type="text" class="item-field-label-short " {{#if disabled}}disabled{{/if}} 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"/>
<input type="text" class="item-field-label-short " name="system.{{path}}.{{key}}.max" value="{{stat.max}}" data-dtype="Number"/>
{{/if}}
{{/if}}
{{#if hassave}}
<span class="item-field-label-short" name="{{key}}">
<h4 class="item-field-label-short">
<i class="fa-solid fa-dice-d20"></i>
<a class="roll-this stat-margin" data-is-save="yes" data-type="{{path}}" data-key="{{key}}">
{{localize "WH.ui.save"}}
</a>
</h4>
</span>
<input type="text" class="item-field-label-short " name="system.{{path}}.{{key}}.save" value="{{stat.save}}" data-dtype="Number"/>
{{/if}}
{{#if islevel}}
<span class="item-field-label-short" name="{{key}}">
<h4 class="item-field-label-short">{{localize "WH.ui.level"}}
</h4>
</span>
<input type="text" disabled class="item-field-label-short " value="{{stat.level}}" data-dtype="Number"/>
{{/if}}
</li>

View File

@ -7,45 +7,58 @@
</header>
<div class="flexcol">
{{#if stat}}
<div class="flexrow">
<span class="item-field-label-medium">{{localize stat.label}}</span>
<span class="item-field-label-medium">{{stat.value}}</span>
</div>
{{/if}}
{{#if weapon}}
<div class="flexrow">
<span class="item-field-label-medium">Weapon : </span>
<span class="roll-dialog-long">Weapon : </span>
<span class="item-field-label-medium">{{weapon.name}}</span>
{{#if (eq mode "damage")}}
<div class="flexrow">
<span class="item-field-label-medium">Damage : </span>
<span class="roll-dialog-long">Damage : </span>
<span class="item-field-label-medium">{{weapon.damageFormula}}</span>
</div>
{{/if}}
</div>
{{/if}}
{{#if stat}}
<div class="flexrow">
<span class="roll-dialog-long">{{localize stat.label}}</span>
{{#if (eq mode "save")}}
<span class="item-field-label-medium">{{stat.save}}</span>
{{else}}
<span class="item-field-label-medium">{{stat.value}}</span>
{{/if}}
</div>
{{#if stat.istxc}}
<div class="flexrow">
<span class="roll-dialog-long">Multiple weapons malus ({{mWeaponMalus}})? </span>
<span class="item-field-label-medium"><input type="checkbox" id="usemWeaponMalus" name="usemWeaponMalus" {{checked usemWeaponMalus}}/></span>
{{/if}}
</div>
{{/if}}
{{#if shield}}
<div class="flexrow">
<span class="roll-dialog-label">Use shield ? : </span>
<span class="roll-dialog-label"><input type="checkbox" id="useshield" name="useshield" {{checked useshield}}/></span>
<span class="roll-dialog-long">Use shield ? : </span>
<span class="roll-dialog-label">
<input type="checkbox" id="useshield" name="useshield" {{checked useshield}}/>
</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">{{shield.name}} : </span>
<span class="roll-dialog-long">{{shield.name}} : </span>
<span class="roll-dialog-label">{{shield.data.shielddie}}</span>
</div>
{{/if}}
{{#if power}}
<div class="flexrow">
<span class="item-field-label-medium">Power : </span>
<span class="item-field-label-long">Power : </span>
<span class="item-field-label-medium">{{power.name}}</span>
</div>
<div class="flexrow">
<span class="item-field-label-medium">Power Level : </span>
<span class="item-field-label-long">Power Level : </span>
<select class="item-field-label-medium" type="text" id="powerLevel" value="{{powerLevel}}">
{{#select powerLevel}}
<option value="1">1</option>
@ -60,7 +73,7 @@
{{#if hasBM}}
<div class="flexrow">
<span class="item-field-label-medium">Bonus/Malus : </span>
<span class="roll-dialog-long">Bonus/Malus : </span>
<select class="item-field-label-medium" type="text" id="bonusMalus" value="{{bonusMalus}}">
{{#select bonusMalus}}
<option value="-6">-6</option>