Add Enemy sheet

This commit is contained in:
2025-05-25 20:43:10 +02:00
parent 57706629e1
commit 7e517bfb12
6 changed files with 54 additions and 22 deletions

View File

@@ -90,12 +90,24 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
case "status":
context.tab = context.tabs.status
context.perks = doc.itemTypes.perk
context.perks.sort((a, b) => a.name.localeCompare(b.name))
// Sort the perks by system.role and then by the system.level
context.perks.sort((a, b) => {
if (a.system.role === b.system.role) {
return a.system.level.localeCompare(b.system.level)
}
return a.system.role.localeCompare(b.system.role)
})
break;
case "maleficas":
context.tab = context.tabs.maleficas
context.maleficas = doc.itemTypes.malefica
context.maleficas.sort((a, b) => a.name.localeCompare(b.name))
// Sort the maleficas by system.domain and then by the system.level
context.maleficas.sort((a, b) => {
if (a.system.domain === b.system.domain) {
return a.system.level.localeCompare(b.system.level)
}
return a.system.domain.localeCompare(b.system.domain)
})
context.rituals = doc.itemTypes.ritual
context.rituals.sort((a, b) => a.name.localeCompare(b.name))
break