Review sheet and headers

This commit is contained in:
2022-03-11 14:00:14 +01:00
parent e887828d53
commit 7974897c03
7 changed files with 52 additions and 29 deletions

View File

@ -84,10 +84,17 @@ export class PegasusActorSheet extends ActorSheet {
}
/* -------------------------------------------- */
async rollIDR( diceValue) {
async rollIDR( itemId, diceValue) {
let item = this.actor.data.items.get( itemId) ?? {name: "Unknown"}
let myRoll = new Roll(diceValue+"x").roll({ async: false })
//await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
myRoll.toMessage()
await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `${this.actor.name} has roll IDR for ${item.name} : ${myRoll.total}`
}
ChatMessage.create(chatData)
}
/* -------------------------------------------- */
@ -191,12 +198,12 @@ export class PegasusActorSheet extends ActorSheet {
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecAmmo( li.data("item-id"), +1 );
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.momentum-minus').click(event => {
@ -240,7 +247,8 @@ export class PegasusActorSheet extends ActorSheet {
});
html.find('.roll-idr').click((event) => {
const diceValue = $(event.currentTarget).data("dice-value")
this.rollIDR( diceValue)
const li = $(event.currentTarget).parents(".item")
this.rollIDR( li.data("item-id"), diceValue)
})
html.find('.roll-spec').click((event) => {