Update magie

This commit is contained in:
2025-09-15 21:09:09 +02:00
parent cc7de0e53c
commit c993a9a5b1
80 changed files with 728 additions and 540 deletions

View File

@@ -15,7 +15,7 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
});
}
@@ -63,7 +63,7 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
owner: this.document.isOwner,
config: game.system.lesheritiers.config,
isArmeMelee: HeritiersUtility.isArmeMelee(this.object),
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}),
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, { async: true }),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
usageMax: -1
@@ -76,7 +76,7 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
this.object.system.pointsusagecourant = formData.usageMax
}
}
if (this.object.type == 'sort' ) {
if (this.object.type == 'sort') {
formData.competencesMagie = HeritiersUtility.getCompetencesMagie()
}
@@ -143,15 +143,15 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
html.find('#add-specialite').click(ev => {
let spec = foundry.utils.duplicate(this.object.system.specialites)
spec.push( { name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
this.object.update( { 'system.specialites': spec })
spec.push({ name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
this.object.update({ 'system.specialites': spec })
})
html.find('.delete-specialite').click(ev => {
const li = $(ev.currentTarget).parents(".specialite-item")
let index = li.data("specialite-index")
let spec = foundry.utils.duplicate(this.object.system.specialites)
spec.splice(index,1)
this.object.update( { 'system.specialites': spec })
spec.splice(index, 1)
this.object.update({ 'system.specialites': spec })
})
html.find('.edit-specialite').change(ev => {
const li = $(ev.currentTarget).parents(".specialite-item")
@@ -159,7 +159,7 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
let spec = foundry.utils.duplicate(this.object.system.specialites)
spec[index].name = ev.currentTarget.value
spec[index].id = spec[index].id || foundry.utils.randomID(16)
this.object.update( { 'system.specialites': spec })
this.object.update({ 'system.specialites': spec })
})
html.find('.edit-specialite-description').change(ev => {
const li = $(ev.currentTarget).parents(".specialite-item")
@@ -167,20 +167,20 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
let spec = foundry.utils.duplicate(this.object.system.specialites)
spec[index].description = ev.currentTarget.value
spec[index].id = spec[index].id || foundry.utils.randomID(16)
this.object.update( { 'system.specialites': spec })
this.object.update({ 'system.specialites': spec })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
this.object.update( { 'system.automations': autom })
autom.push({ eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
this.object.update({ 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
autom.splice(index, 1)
this.object.update({ 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
@@ -188,7 +188,7 @@ export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || foundry.utils.randomID(16)
this.object.update( { 'system.automations': auto })
this.object.update({ 'system.automations': auto })
})
// Update Inventory Item