#36 et #70 : corrections sur XP et ajout première version des taches

This commit is contained in:
2020-12-15 08:37:52 +01:00
parent 0e5caf048e
commit a726705c0c
12 changed files with 154 additions and 31 deletions

View File

@ -194,6 +194,12 @@ export class RdDActorSheet extends ActorSheet {
new Dialog( dialogData ).render(true);
}
/* -------------------------------------------- */
async createEmptyTache( ) {
let emptyTache = await Item.create( { name: 'Nouvelle tache', type: 'tache'} );
await this.actor.createOwnedItem( emptyTache.data, { renderSheet: true } );
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
@ -226,6 +232,9 @@ export class RdDActorSheet extends ActorSheet {
this.actor.remiseANeuf();
}
});
html.find('#creer-tache').click(ev => {
this.createEmptyTache();
});
// Blessure control
html.find('.blessure-control').click(ev => {
@ -280,7 +289,12 @@ export class RdDActorSheet extends ActorSheet {
let compName = event.currentTarget.text;
this.actor.rollCompetence( compName);
});
html.find('.tache-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
let tacheId = li.data('item-id');
this.actor.rollTache( tacheId );
});
// Points de reve actuel
html.find('.ptreve-actuel a').click((event) => {
this.actor.rollCarac( 'reve-actuel' );