Upgrade to v9
This commit is contained in:
@ -24,31 +24,50 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
getData() {
|
||||
this.actor.calculerSommeStats();
|
||||
let data = super.getData();
|
||||
|
||||
data.editScore = this.options.editScore;
|
||||
data.donnees = this.actor.getDonnees();
|
||||
data.eglises = this.actor.getEglises();
|
||||
data.competences = this.actor.getCompetences();
|
||||
data.sorts = this.actor.getSorts();
|
||||
data.devotions = this.actor.getDevotions();
|
||||
data.attributs = this.actor.getAttributs();
|
||||
data.techniques = this.actor.getTechniques();
|
||||
data.armes = this.actor.getArmes();
|
||||
data.armures = this.actor.getArmures();
|
||||
data.equipements = this.actor.getEquipements();
|
||||
data.monnaies = this.actor.getMonnaies();
|
||||
|
||||
data.optionsBase = VadentisUtility.createDirectOptionList(0, 50);
|
||||
data.optionsMalus = VadentisUtility.createDirectReverseOptionList(-50, 0);
|
||||
data.optionsBonus = VadentisUtility.createDirectOptionList(0, 50);
|
||||
data.optionsPV = VadentisUtility.createOptionList(-50, 200);
|
||||
data.optionsPE = VadentisUtility.createOptionList(-50, 200);
|
||||
data.optionsPA = VadentisUtility.createOptionList(0, 20);
|
||||
|
||||
data.isGM = game.user.isGM;
|
||||
const objectData = VadentisUtility.data(this.object);
|
||||
|
||||
let actorData = duplicate(VadentisUtility.templateData(this.object));
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: actorData,
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
isGM: game.user.isGM
|
||||
}
|
||||
|
||||
return data;
|
||||
formData.editScore = this.options.editScore;
|
||||
formData.donnees = this.actor.getDonnees();
|
||||
formData.eglises = this.actor.getEglises();
|
||||
formData.competences = this.actor.getCompetences();
|
||||
formData.sorts = this.actor.getSorts();
|
||||
formData.devotions = this.actor.getDevotions();
|
||||
formData.attributs = this.actor.getAttributs();
|
||||
formData.techniques = this.actor.getTechniques();
|
||||
formData.armes = this.actor.getArmes();
|
||||
formData.armures = this.actor.getArmures();
|
||||
formData.equipements = this.actor.getEquipements();
|
||||
formData.monnaies = this.actor.getMonnaies();
|
||||
|
||||
formData.optionsBase = VadentisUtility.createDirectOptionList(0, 50);
|
||||
formData.optionsMalus = VadentisUtility.createDirectReverseOptionList(-50, 0);
|
||||
formData.optionsBonus = VadentisUtility.createDirectOptionList(0, 50);
|
||||
formData.optionsPV = VadentisUtility.createOptionList(-50, 200);
|
||||
formData.optionsPE = VadentisUtility.createOptionList(-50, 200);
|
||||
formData.optionsPA = VadentisUtility.createOptionList(0, 20);
|
||||
|
||||
|
||||
return formData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -69,6 +88,7 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
title: "Utiliser une technique",
|
||||
content: "Etes vous certain de vouloir utiliser cette Technique ?",
|
||||
yes: async () => {
|
||||
console.log("Technique ", techniqueId)
|
||||
this.actor.rollTechnique(techniqueId);
|
||||
},
|
||||
no: () => {},
|
||||
@ -86,7 +106,7 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
// Delete Inventory Item
|
||||
@ -97,33 +117,33 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
|
||||
html.find('.munition-moins').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.decrementeMunition( item );
|
||||
} );
|
||||
html.find('.munition-plus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.incrementeMunition( item );
|
||||
} );
|
||||
html.find('.equipement-moins').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.decrementeQuantite( item );
|
||||
} );
|
||||
html.find('.equipement-plus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.incrementeQuantite( item );
|
||||
} );
|
||||
|
||||
html.find('.argent-moins').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.decrementeArgent( item );
|
||||
} );
|
||||
html.find('.argent-plus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.incrementeArgent( item );
|
||||
} );
|
||||
|
||||
@ -162,27 +182,27 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.weapon-label a').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.rollWeapon(weapon);
|
||||
});
|
||||
html.find('.weapon-damage').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.rollDamage(weapon, 'damage');
|
||||
});
|
||||
html.find('.weapon-damage-critical').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.rollDamage(weapon, 'criticaldamage');
|
||||
});
|
||||
html.find('.sort-damage').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.rollSortDevotionDamage(weapon, 'damage');
|
||||
});
|
||||
html.find('.sort-damage-critical').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(li.data("item-id"));
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
this.actor.rollSortDevotionDamage(weapon, 'damagecritical');
|
||||
});
|
||||
|
||||
@ -204,7 +224,7 @@ export class VadentisActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.item-link a').click((event) => {
|
||||
const itemId = $(event.currentTarget).data("item-id");
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
const item = this.actor.items.get(itemId);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
|
@ -46,48 +46,48 @@ export class VadentisActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCompetences() {
|
||||
return this.data.items.filter( item => item.type == 'competence');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'competence') || [] );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getDonnees() {
|
||||
return this.data.items.filter( item => item.type == 'donnee');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'donnee')|| [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getEglises() {
|
||||
return this.data.items.filter( item => item.type == 'eglise');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'eglise')|| [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getSorts() {
|
||||
return this.data.items.filter( item => item.type == 'sort');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'sort')|| [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getAttributs() {
|
||||
return this.data.items.filter( item => item.type == 'attribut');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'attribut')|| [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getTechniques() {
|
||||
return this.data.items.filter( item => item.type == 'technique');
|
||||
return duplicate( this.data.items.filter( item => item.type == 'technique') || [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getDevotions() {
|
||||
return this.data.items.filter( item => item.type == 'devotion');
|
||||
return duplicate(this.data.items.filter( item => item.type == 'devotion')|| [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getEquipements() {
|
||||
return this.data.items.filter( item => item.type == 'equipement' );
|
||||
return duplicate(this.data.items.filter( item => item.type == 'equipement' ) || [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getArmes() {
|
||||
return this.data.items.filter( item => item.type == 'armecc' || item.type == 'tir' );
|
||||
return duplicate(this.data.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getArmures() {
|
||||
return this.data.items.filter( item => item.type == 'armurebouclier' );
|
||||
return duplicate(this.data.items.filter( item => item.type == 'armurebouclier' ) || [] );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getMonnaies() {
|
||||
return this.data.items.filter( item => item.type == 'monnaie' );
|
||||
return duplicate(this.data.items.filter( item => item.type == 'monnaie' ) || [] );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -95,16 +95,16 @@ export class VadentisActor extends Actor {
|
||||
let competence = this.data.items.find( item => item.type == 'competence' && item.name == name);
|
||||
if (competence) {
|
||||
let dataPath = 'data.'+field;
|
||||
await this.updateOwnedItem( { _id: competence._id, [dataPath]:value });
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: competence.id, [dataPath]:value }] );
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async equiperObject( equipementId ) {
|
||||
let item = this.getOwnedItem(equipementId);
|
||||
if (item && item.data.data) {
|
||||
let update = { _id: item._id, "data.equipee": !item.data.data.equipee };
|
||||
await this.updateEmbeddedEntity("OwnedItem", update);
|
||||
let item = this.items.get(equipementId)
|
||||
if (item) {
|
||||
let update = { _id: item.id, "data.equipee": !item.data.data.equipee };
|
||||
await this.updateEmbeddedDocuments("Item", [ update ] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,31 +289,34 @@ export class VadentisActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollSort( sortId ) {
|
||||
let sort = this.data.items.find( item => item.type == 'sort' && item._id == sortId );
|
||||
let sort = this.data.items.get( sortId );
|
||||
if ( sort ) {
|
||||
sort = duplicate(sort)
|
||||
this.processSortDevotion( "sort", sort);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollDevotion( devotionId ) {
|
||||
let devotion = this.data.items.find( item => item.type == 'devotion' && item._id == devotionId );
|
||||
let devotion = this.data.items.get( devotionId );
|
||||
if ( devotion ) {
|
||||
devotion = duplicate(devotion)
|
||||
this.processSortDevotion( "devotion", devotion);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollSortOuDevotion( sortId ) {
|
||||
let sort = this.data.items.find( item => item._id == sortId );
|
||||
let sort = this.data.items.get( sortId );
|
||||
this.processSortDevotion( sort.type, sort);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollTechnique( techniqueId ) {
|
||||
let technique = this.data.items.find( item => item.type == 'technique' && item._id == techniqueId );
|
||||
let technique = this.data.items.get( techniqueId )
|
||||
if (technique) {
|
||||
technique = duplicate(technique)
|
||||
let msgData = {
|
||||
alias: this.name,
|
||||
img: technique.img,
|
||||
@ -338,8 +341,10 @@ export class VadentisActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCompetence( competenceId ) {
|
||||
let competence = this.data.items.find( item => item.type == 'competence' && item._id == competenceId);
|
||||
console.log(competenceId)
|
||||
let competence = this.data.items.get( competenceId);
|
||||
if ( competence) {
|
||||
competence = duplicate(competence)
|
||||
let msgData = {
|
||||
alias: this.name,
|
||||
img: competence.img,
|
||||
@ -351,12 +356,13 @@ export class VadentisActor extends Actor {
|
||||
let formulaFull = this.buildTexteFormula( competence.data );
|
||||
let myRoll = await VadentisUtility.processRoll("1d20+"+statValue, msgData.rollMode );
|
||||
msgData.msg = `${formulaFull} => <strong>${myRoll.total}</strong>`;
|
||||
|
||||
if (myRoll.results[0] == 1 ) { // Critique ?
|
||||
console.log(formulaFull, myRoll)
|
||||
|
||||
if (myRoll.dice[0].results[0].result == 1 ) { // Critique ?
|
||||
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_échec_critique.webp';
|
||||
msgData.msg += `<br>C'est un <strong>échec critique</strong> !`;
|
||||
}
|
||||
if (myRoll.results[0] == 20 ) { // Critique ?
|
||||
if (myRoll.dice[0].results[0].result == 20 ) { // Critique ?
|
||||
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_réussite_critique.webp';
|
||||
msgData.msg += `<br>C'est une <strong>réussite critique</strong> !`;
|
||||
}
|
||||
@ -378,8 +384,7 @@ export class VadentisActor extends Actor {
|
||||
async genericRoll( stat, key ) {
|
||||
let statValue = this._getCombatValue( stat );
|
||||
let formulaFull = this.buildTexteFormula( stat );
|
||||
|
||||
|
||||
|
||||
let myRoll = await VadentisUtility.processRoll("1d20+"+statValue );
|
||||
let msgData = {
|
||||
alias: this.name,
|
||||
@ -419,17 +424,19 @@ export class VadentisActor extends Actor {
|
||||
async incrementeArgent( arme ) {
|
||||
let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name);
|
||||
if (monnaie) {
|
||||
monnaie = duplicate(monnaie)
|
||||
let newValeur = monnaie.data.nombre + 1;
|
||||
await this.updateOwnedItem( { _id: monnaie._id, 'data.nombre': newValeur } );
|
||||
await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'data.nombre': newValeur }] );
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async decrementeArgent( arme ) {
|
||||
let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name);
|
||||
if (monnaie) {
|
||||
monnaie = duplicate(monnaie)
|
||||
let newValeur = monnaie.data.nombre - 1;
|
||||
newValeur = (newValeur <= 0) ? 0 : newValeur;
|
||||
await this.updateOwnedItem( { _id: monnaie._id, 'data.nombre': newValeur } );
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'data.nombre': newValeur }] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -437,17 +444,19 @@ export class VadentisActor extends Actor {
|
||||
async incrementeMunition( arme ) {
|
||||
let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name);
|
||||
if (armeTir) {
|
||||
armeTir = duplicate(armeTir)
|
||||
let newMunition = armeTir.data.munition + 1;
|
||||
await this.updateOwnedItem( { _id: armeTir._id, 'data.munition': newMunition } );
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition }] );
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async decrementeMunition( arme ) {
|
||||
let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name);
|
||||
if (armeTir) {
|
||||
armeTir = duplicate(armeTir)
|
||||
let newMunition = armeTir.data.munition - 1;
|
||||
newMunition = (newMunition <= 0) ? 0 : newMunition;
|
||||
await this.updateOwnedItem( { _id: armeTir._id, 'data.munition': newMunition } );
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition } ]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,8 +464,9 @@ export class VadentisActor extends Actor {
|
||||
async incrementeQuantite( objet ) {
|
||||
let objetQ = this.data.items.find( item => item._id == objet._id );
|
||||
if (objetQ) {
|
||||
objetQ = duplicate(objetQ)
|
||||
let newQ = objetQ.data.quantite + 1;
|
||||
await this.updateOwnedItem( { _id: objetQ._id, 'data.quantite': newQ } );
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -464,9 +474,10 @@ export class VadentisActor extends Actor {
|
||||
async decrementeQuantite( objet ) {
|
||||
let objetQ = this.data.items.find( item => item._id == objet._id );
|
||||
if (objetQ) {
|
||||
objetQ = duplicate(objetQ)
|
||||
let newQ = objetQ.data.quantite - 1;
|
||||
newQ = (newQ <= 0) ? 0 : newQ;
|
||||
await this.updateOwnedItem( { _id: objetQ._id, 'data.quantite': newQ } );
|
||||
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,6 +488,7 @@ export class VadentisActor extends Actor {
|
||||
if ( target ) {
|
||||
let arme = this.data.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item._id == armeId);
|
||||
if (arme) {
|
||||
arme = duplicate(arme)
|
||||
if ( arme.type == 'tir' && arme.data.munition <= 0 ) {
|
||||
ui.notifications.warn("Vous n'avez plus de munitions avec cette arme.");
|
||||
return;
|
||||
|
@ -43,16 +43,32 @@ export class VadentisItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
let data = super.getData();
|
||||
if (data.item.type == 'sort') {
|
||||
data.donnees = await VadentisUtility.getDonnees();
|
||||
const objectData = VadentisUtility.data(this.object);
|
||||
|
||||
let itemData = foundry.utils.deepClone(VadentisUtility.templateData(this.object));
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: itemData,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
isGM: game.user.isGM
|
||||
}
|
||||
if (data.item.type == 'devotion') {
|
||||
data.eglises = await VadentisUtility.getEglises();
|
||||
if (objectData.type == 'sort') {
|
||||
formData.donnees = await VadentisUtility.getDonnees();
|
||||
}
|
||||
data.isGM = game.user.isGM;
|
||||
|
||||
return data;
|
||||
if (objectData.type == 'devotion') {
|
||||
formData.eglises = await VadentisUtility.getEglises();
|
||||
}
|
||||
|
||||
console.log("ITEM DATA", formData, this);
|
||||
return formData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -41,8 +41,8 @@ Hooks.once("init", async function () {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Define custom Entity classes
|
||||
CONFIG.Actor.entityClass = VadentisActor;
|
||||
CONFIG.Combat.entityClass = VadentisCombat;
|
||||
CONFIG.Actor.documentClass = VadentisActor;
|
||||
CONFIG.Combat.documentClass = VadentisCombat;
|
||||
CONFIG.Vadentis = {
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { VadentisCombat } from "./vadentis-combat.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class VadentisUtility extends Entity {
|
||||
export class VadentisUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async preloadHandlebarsTemplates() {
|
||||
@ -64,6 +64,19 @@ export class VadentisUtility extends Entity {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static templateData(it) {
|
||||
return VadentisUtility.data(it)?.data ?? {}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static data(it) {
|
||||
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
|
||||
return it.data;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static processDamageString( formula, actor ) {
|
||||
let workFormula = formula.toLowerCase();
|
||||
@ -76,7 +89,7 @@ export class VadentisUtility extends Entity {
|
||||
/* -------------------------------------------- */
|
||||
static async processRoll( formula, rollMode ) {
|
||||
let myRoll = new Roll(formula);
|
||||
myRoll.evaluate();
|
||||
myRoll.roll( { async: false} );
|
||||
if (game.modules.get("dice-so-nice") && game.modules.get("dice-so-nice").active) {
|
||||
await game.dice3d.showForRoll(myRoll, game.user, true);
|
||||
}
|
||||
@ -207,14 +220,13 @@ export class VadentisUtility extends Entity {
|
||||
/* -------------------------------------------- */
|
||||
static async confirmDelete(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
let objet = actorSheet.actor.items.find(item => item._id == itemId);
|
||||
let msgTxt = "<p>Etes vous certain de souhaiter supprimer cet item ?";
|
||||
let buttons = {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Oui, à supprimer",
|
||||
callback: () => {
|
||||
actorSheet.actor.deleteOwnedItem(itemId);
|
||||
actorSheet.actor.deleteEmbeddedDocuments('Item', [ itemId] );
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user