Some fixes
This commit is contained in:
@@ -39,16 +39,14 @@ export class Hero6ActorSheet extends ActorSheet {
|
||||
limited: this.object.limited,
|
||||
skills: this.actor.getSkills( ),
|
||||
perks: this.actor.getPerks( ),
|
||||
powers: this.actor.getPowers( ),
|
||||
powers: await this.actor.getPowers( ),
|
||||
talents: this.actor.getTalents( ),
|
||||
complications: this.actor.getComplications( ),
|
||||
martialarts: this.actor.getMartialArts( ),
|
||||
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
|
||||
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
|
||||
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
|
||||
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
|
||||
equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ),
|
||||
equippedArmor: this.actor.getEquippedArmor(),
|
||||
equippedShield: this.actor.getEquippedShield(),
|
||||
subActors: duplicate(this.actor.getSubActors()),
|
||||
race: duplicate(this.actor.getRace()),
|
||||
moneys: duplicate(this.actor.getMoneys()),
|
||||
|
@@ -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") || [])
|
||||
}
|
||||
|
||||
/* ------------------------------------------- */
|
||||
|
@@ -1,6 +1,11 @@
|
||||
|
||||
export const Hero6_CONFIG = {
|
||||
|
||||
equipmentSubType: {
|
||||
equipment: "Equipment",
|
||||
weapon: "Weapon",
|
||||
armor: "Armor",
|
||||
shield: "Shield"
|
||||
},
|
||||
rollCharac : {
|
||||
"str": "Strength",
|
||||
"dex": "Dexterity",
|
||||
|
@@ -145,6 +145,16 @@ export class Hero6ItemSheet extends ItemSheet {
|
||||
let itemType = li.data("item-type");
|
||||
});
|
||||
|
||||
html.find('.item-skill-profiency').click(ev => {
|
||||
this.object.update( {'system.levels': 12, 'system.cost': 2} )
|
||||
} )
|
||||
html.find('.item-skill-familiarity').click(ev => {
|
||||
this.object.update( {'system.levels': 10, 'system.cost': 1} )
|
||||
} )
|
||||
html.find('.item-skill-everyman').click(ev => {
|
||||
this.object.update( {'system.levels': 8, 'system.cost': 0} )
|
||||
} )
|
||||
|
||||
html.find('.view-subitem').click(ev => {
|
||||
this.viewSubitem(ev);
|
||||
});
|
||||
|
@@ -50,8 +50,7 @@ export class Hero6Utility {
|
||||
return true;
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
this.gameSettings()
|
||||
|
||||
@@ -163,6 +162,8 @@ export class Hero6Utility {
|
||||
'systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs',
|
||||
'systems/fvtt-hero-system-6/templates/partials/partial-power-equipment-cost.hbs',
|
||||
'systems/fvtt-hero-system-6/templates/partials/partial-item-hasroll.hbs',
|
||||
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment.hbs',
|
||||
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment-section.hbs'
|
||||
]
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
|
Reference in New Issue
Block a user