Various fixes
This commit is contained in:
@@ -141,7 +141,7 @@ export class HeritiersActor extends Actor {
|
||||
return this.getItemSorted( ["capacitenaturelle"])
|
||||
}
|
||||
getFee() {
|
||||
return this.items.filter(item => item.type =="fee")
|
||||
return this.items.find(item => item.type =="fee")
|
||||
}
|
||||
getProfils() {
|
||||
return this.getItemSorted( ["profil"])
|
||||
@@ -174,23 +174,25 @@ export class HeritiersActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
organizeUtileSkills() {
|
||||
organizeUtileSkills(kind = "mental") {
|
||||
let comp = {}
|
||||
for (let key in game.system.lesheritiers.config.competenceProfil) {
|
||||
if ( game.system.lesheritiers.config.competenceProfil[key].kind == kind)
|
||||
comp[key] = []
|
||||
}
|
||||
for (let item of this.items) {
|
||||
if (item.type == "competence") {
|
||||
if (item.system.categorie == "utile") {
|
||||
if (item.system.categorie == "utile" && comp[item.system.profil]) {
|
||||
this.prepareUtileSkill(item)
|
||||
comp[item.system.profil].push(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let key in comp) {
|
||||
HeritiersUtility.sortArrayObjectsByName(comp[key])
|
||||
}
|
||||
return comp
|
||||
return Object.fromEntries(Object.entries(comp).sort())
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
organizeContacts() {
|
||||
@@ -553,6 +555,16 @@ export class HeritiersActor extends Actor {
|
||||
rollDialog.render(true)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollRang(key, isInit = false) {
|
||||
let rollData = this.getCommonRollData()
|
||||
rollData.mode = "rang"
|
||||
rollData.rang = this.system.rang[key]
|
||||
rollData.rangKey = key
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCompetence(compId) {
|
||||
let rollData = this.getCommonRollData(compId)
|
||||
|
Reference in New Issue
Block a user