Fix sur armes et affichage
This commit is contained in:
parent
2f3a8e91bd
commit
b0a3cb08cb
@ -141,6 +141,11 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
let compId = li.data("item-id")
|
let compId = li.data("item-id")
|
||||||
this.actor.rollCompetence(compId)
|
this.actor.rollCompetence(compId)
|
||||||
})
|
})
|
||||||
|
html.find('.roll-attaque-arme').click((event) => {
|
||||||
|
const li = $(event.currentTarget).parents(".item")
|
||||||
|
let armeId = li.data("item-id")
|
||||||
|
this.actor.rollAttaqueArme(armeId)
|
||||||
|
})
|
||||||
|
|
||||||
html.find('.item-add').click((event) => {
|
html.find('.item-add').click((event) => {
|
||||||
const itemType = $(event.currentTarget).data("type")
|
const itemType = $(event.currentTarget).data("type")
|
||||||
|
@ -142,7 +142,7 @@ export class HeritiersActor extends Actor {
|
|||||||
return this.items.filter(item => item.type == "profil")
|
return this.items.filter(item => item.type == "profil")
|
||||||
}
|
}
|
||||||
getPouvoirs() {
|
getPouvoirs() {
|
||||||
let pouvoirs = this.items.filter(item => item.type == "pouvoir")
|
let pouvoirs = this.items.filter(item => item.type == "pouvoir") || []
|
||||||
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
|
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
|
||||||
return pouvoirs
|
return pouvoirs
|
||||||
}
|
}
|
||||||
@ -184,7 +184,9 @@ export class HeritiersActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeritiersUtility.sortArrayObjectsByName(comp)
|
for (let key in comp) {
|
||||||
|
HeritiersUtility.sortArrayObjectsByName(comp[key])
|
||||||
|
}
|
||||||
return comp
|
return comp
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -551,7 +553,24 @@ export class HeritiersActor extends Actor {
|
|||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
rollDialog.render(true)
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async rollAttaqueArme(armeId) {
|
||||||
|
let arme = this.items.get(armeId)
|
||||||
|
if (arme) {
|
||||||
|
let competenceName = "Tir"
|
||||||
|
let key = "prec"
|
||||||
|
if (arme.system.categorie == "blanche" || arme.system.categorie == "improvise") {
|
||||||
|
competenceName = "Mêlée"
|
||||||
|
key = "agi"
|
||||||
|
}
|
||||||
|
let rollData = this.getCommonRollData(undefined, competenceName )
|
||||||
|
rollData.carac = this.system.caracteristiques[key]
|
||||||
|
rollData.caracKey = key
|
||||||
|
rollData.mode = "arme"
|
||||||
|
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||||
|
rollDialog.render(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollArmeOffensif(armeId) {
|
async rollArmeOffensif(armeId) {
|
||||||
let arme = this.items.get(armeId)
|
let arme = this.items.get(armeId)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "fvtt-les-heritiers",
|
"id": "fvtt-les-heritiers",
|
||||||
"description": "Les Héritiers pour FoundryVTT",
|
"description": "Les Héritiers pour FoundryVTT",
|
||||||
"version": "10.0.20",
|
"version": "10.0.21",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Uberwald/LeRatierBretonnien",
|
"name": "Uberwald/LeRatierBretonnien",
|
||||||
@ -19,7 +19,7 @@
|
|||||||
"gridUnits": "m",
|
"gridUnits": "m",
|
||||||
"license": "LICENSE.txt",
|
"license": "LICENSE.txt",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.20.zip",
|
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.21.zip",
|
||||||
"languages": [
|
"languages": [
|
||||||
{
|
{
|
||||||
"lang": "fr",
|
"lang": "fr",
|
||||||
|
@ -208,9 +208,6 @@
|
|||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Attaque</label>
|
<label class="short-label">Attaque</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
|
||||||
<label class="short-label">Défense</label>
|
|
||||||
</span>
|
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Dégats</label>
|
<label class="short-label">Dégats</label>
|
||||||
</span>
|
</span>
|
||||||
@ -226,7 +223,7 @@
|
|||||||
<span class="item-name-label competence-name">{{arme.name}}</span>
|
<span class="item-name-label competence-name">{{arme.name}}</span>
|
||||||
|
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<button class="roll-arme-offensif button-sheet-roll">Attaquer</button>
|
<button class="roll-attaque-arme button-sheet-roll">Attaquer</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
|
Loading…
Reference in New Issue
Block a user