Ajout des traits dans le header + gestion plus simple des PNJs

This commit is contained in:
2024-03-19 09:15:30 +01:00
parent 2450dce46c
commit 40e12c1bba
38 changed files with 210 additions and 118 deletions

View File

@ -90,6 +90,9 @@ export class EcrymeActorSheet extends ActorSheet {
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
if (!itemId) {
itemId = $(ev.currentTarget).data("item-id")
}
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});

View File

@ -387,14 +387,25 @@ export class EcrymeActor extends Actor {
/* -------------------------------------------- */
getCommonSkill(categKey, skillKey) {
let skill = this.system.skills[categKey].skilllist[skillKey]
let rollData = this.getCommonRollData()
skill = duplicate(skill)
// Specific NPC case
let skill
if (skillKey == "rawnpc") {
skill = {
name: "ECRY.ui." + categKey,
max: 10,
value: this.system.skills[categKey].pnjvalue,
spec: []
}
} else {
skill = this.system.skills[categKey].skilllist[skillKey]
skill = duplicate(skill)
skill.spec = this.getSpecializations(skillKey)
}
skill.categKey = categKey
skill.skillKey = skillKey
skill.spec = this.getSpecializations(skillKey)
rollData.skill = skill
rollData.img = skill.img
rollData.impactMalus = this.getImpactMalus(categKey)