Ajout/upgrade des arts obscurs
This commit is contained in:
@@ -38,14 +38,15 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
skills: this.actor.getSkills(),
|
||||
utileSkillsMental :this.actor.organizeUtileSkills("mental"),
|
||||
utileSkillsPhysical :this.actor.organizeUtileSkills("physical"),
|
||||
futileSkills :this.actor.organizeFutileSkills(),
|
||||
utileSkillsMental: this.actor.organizeUtileSkills("mental"),
|
||||
utileSkillsPhysical: this.actor.organizeUtileSkills("physical"),
|
||||
competencesMagie: HeritiersUtility.getCompetencesMagie(),
|
||||
futileSkills: this.actor.organizeFutileSkills(),
|
||||
contacts: this.actor.organizeContacts(),
|
||||
armes: foundry.utils.duplicate(this.actor.getWeapons()),
|
||||
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
|
||||
pouvoirs: foundry.utils.duplicate(this.actor.getPouvoirs()),
|
||||
fee: foundry.utils.duplicate(this.actor.getFee() || {} ),
|
||||
fee: foundry.utils.duplicate(this.actor.getFee() || {}),
|
||||
protections: foundry.utils.duplicate(this.actor.getArmors()),
|
||||
combat: this.actor.getCombatValues(),
|
||||
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
|
||||
@@ -57,12 +58,12 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
pvMalus: this.actor.getPvMalus(),
|
||||
heritage: game.settings.get("fvtt-les-heritiers", "heritiers-heritage"),
|
||||
initiative: this.actor.getFlag("world", "last-initiative") || -1,
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||
revesetranges: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.revesetranges, {async: true}),
|
||||
secretsdecouverts: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.secretsdecouverts, {async: true}),
|
||||
questions: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.questions, {async: true}),
|
||||
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, {async: true}),
|
||||
playernotes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.playernotes, {async: true}),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
|
||||
revesetranges: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.revesetranges, { async: true }),
|
||||
secretsdecouverts: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.secretsdecouverts, { async: true }),
|
||||
questions: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.questions, { async: true }),
|
||||
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
|
||||
playernotes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.playernotes, { async: true }),
|
||||
magieList: this.actor.prepareMagie(),
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
@@ -126,7 +127,7 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
const item = this.actor.items.get( itemId )
|
||||
const item = this.actor.items.get(itemId)
|
||||
item.sheet.render(true)
|
||||
})
|
||||
// Delete Inventory Item
|
||||
@@ -136,8 +137,8 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
})
|
||||
html.find('.edit-item-data').change(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
let itemType = li.data("item-type")
|
||||
let itemId = li.data("item-id")
|
||||
let itemType = li.data("item-type")
|
||||
let itemField = $(ev.currentTarget).data("item-field")
|
||||
let dataType = $(ev.currentTarget).data("dtype")
|
||||
let value = ev.currentTarget.value
|
||||
@@ -154,7 +155,7 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
html.find('.quantity-modify').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
const value = Number($(event.currentTarget).data("quantite-value"))
|
||||
this.actor.incDecQuantity( li.data("item-id"), value );
|
||||
this.actor.incDecQuantity(li.data("item-id"), value);
|
||||
})
|
||||
|
||||
html.find('.roll-initiative').click((event) => {
|
||||
@@ -175,32 +176,32 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
})
|
||||
html.find('.roll-competence').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let compId = li.data("item-id")
|
||||
let compId = li.data("item-id")
|
||||
this.actor.rollCompetence(compId)
|
||||
})
|
||||
html.find('.roll-sort').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let sortId = li.data("item-id")
|
||||
let sortId = li.data("item-id")
|
||||
this.actor.rollSort(sortId)
|
||||
})
|
||||
html.find('.roll-attaque-arme').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollAttaqueArme(armeId)
|
||||
})
|
||||
html.find('.roll-attaque-brutale-arme').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollAttaqueBrutaleArme(armeId)
|
||||
})
|
||||
html.find('.roll-attaque-charge-arme').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollAttaqueChargeArme(armeId)
|
||||
})
|
||||
html.find('.roll-assomer-arme').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollAssomerArme(armeId)
|
||||
})
|
||||
|
||||
@@ -215,6 +216,14 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
html.find('.item-add').click((event) => {
|
||||
const itemType = $(event.currentTarget).data("type")
|
||||
if (itemType == "sort") {
|
||||
// Get data-sort-competence
|
||||
let sortCompetence = $(event.currentTarget).data("sort-competence");
|
||||
if (sortCompetence) {
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType} de ${sortCompetence}`, type: itemType, system: { competence: sortCompetence } }], { renderSheet: true })
|
||||
return
|
||||
}
|
||||
}
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||
})
|
||||
|
||||
@@ -224,7 +233,7 @@ export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.actor.equipItem(li.data("item-id"));
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user