Manye enhancements for combat

This commit is contained in:
2025-09-18 17:24:42 +02:00
parent 7994aa7db4
commit 710ee54531
86 changed files with 735 additions and 408 deletions

View File

@@ -15,7 +15,7 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
classes: ["fvtt-te-deum", "sheet", "actor"],
template: "systems/fvtt-te-deum/templates/actors/actor-sheet.hbs",
width: 860,
height:680,
height: 680,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
@@ -67,7 +67,6 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
@@ -80,7 +79,7 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
html.bind("keydown", function (e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
@@ -88,7 +87,7 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item-id")
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
@@ -100,16 +99,20 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "Nouveau " + dataType, type: dataType }], { renderSheet: true })
})
html.find('.blessure-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "Nouvelle " + dataType, type: dataType, system: { typeBlessure: "estafilade", localisation: "corps", value: 0, appliquee: true, description: "" } }], { renderSheet: true })
})
html.find('.competence-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
let caracKey = $(ev.currentTarget).data("carac-key")
this.actor.createEmbeddedDocuments('Item', [{ name: "Nouvelle " + dataType, type: dataType, system: {caracteristique: caracKey} }], { renderSheet: true })
this.actor.createEmbeddedDocuments('Item', [{ name: "Nouvelle " + dataType, type: dataType, system: { caracteristique: caracKey } }], { renderSheet: true })
})
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
let actor = game.actors.get(actorId);
actor.sheet.render(true);
});
@@ -120,12 +123,12 @@ export class TeDeumActorPJSheet extends foundry.appv1.sheets.ActorSheet {
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
this.actor.incDecQuantity(li.data("item-id"), -1);
});
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
this.actor.incDecQuantity(li.data("item-id"), +1);
});
html.find('.roll-competence').click((event) => {
let compId = $(event.currentTarget).data("comp-id")
@@ -147,13 +150,13 @@ export class TeDeumActorPJSheet 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);
});
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
this.actor.update({ [`${fieldName}`]: value });
});
}