Some fixes
This commit is contained in:
@@ -43,8 +43,8 @@ export class Hero6Actor extends Actor {
|
||||
}
|
||||
|
||||
if (data.type == 'character') {
|
||||
const skills = await Hero6Utility.loadCompendium("fvtt-hero-system-6.skills");
|
||||
data.items = skills.map(i => i.toObject())
|
||||
//const skills = await Hero6Utility.loadCompendium("fvtt-hero-system-6.skills");
|
||||
//data.items = skills.map(i => i.toObject())
|
||||
}
|
||||
if (data.type == 'npc') {
|
||||
}
|
||||
@@ -175,8 +175,11 @@ export class Hero6Actor extends Actor {
|
||||
Hero6Utility.sortArrayObjectsByName(comp)
|
||||
return comp
|
||||
}
|
||||
getPowers() {
|
||||
async getPowers() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'power') || [])
|
||||
for(let c of comp) {
|
||||
c.enrichDescription = c.name + "<br>" + await TextEditor.enrichHTML(c.system.description, {async: true})
|
||||
}
|
||||
Hero6Utility.sortArrayObjectsByName(comp)
|
||||
return comp
|
||||
}
|
||||
@@ -185,6 +188,11 @@ export class Hero6Actor extends Actor {
|
||||
Hero6Utility.sortArrayObjectsByName(comp)
|
||||
return comp
|
||||
}
|
||||
getMartialArts() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'martialart') || [])
|
||||
Hero6Utility.sortArrayObjectsByName(comp)
|
||||
return comp
|
||||
}
|
||||
getComplications() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'complication') || [])
|
||||
Hero6Utility.sortArrayObjectsByName(comp)
|
||||
@@ -227,11 +235,20 @@ export class Hero6Actor extends Actor {
|
||||
|
||||
/* ------------------------------------------- */
|
||||
getEquipments() {
|
||||
return this.items.filter(item => item.type == 'shield' || item.type == 'armor' || item.type == "weapon" || item.type == "equipment");
|
||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment");
|
||||
}
|
||||
getWeapons() {
|
||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "weapon");
|
||||
}
|
||||
getArmors() {
|
||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "armor");
|
||||
}
|
||||
getShields() {
|
||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "shield");
|
||||
}
|
||||
/* ------------------------------------------- */
|
||||
getEquipmentsOnly() {
|
||||
return duplicate(this.items.filter(item => item.type == "equipment") || [])
|
||||
return duplicate(this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment") || [])
|
||||
}
|
||||
|
||||
/* ------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user