diff --git a/module/sheets/hench-cards-sheet.mjs b/module/sheets/hench-cards-sheet.mjs index d3c5eba..64eba3e 100644 --- a/module/sheets/hench-cards-sheet.mjs +++ b/module/sheets/hench-cards-sheet.mjs @@ -30,12 +30,16 @@ export class HenchCardsSheet extends CardsConfig { const index = element.dataset.cardIndex; // play the card! + const card = this.document.spread[index]; + this.playCard(card); await this.document.sendCards(this.document.spread.slice(index, index + 1), CARD_ZONES.DISCARD, CONST.CARD_DRAW_MODES.TOP); await this.document.sendCards(this.document.spread, CARD_ZONES.DECK, CONST.CARD_DRAW_MODES.BOTTOM); }); html.find('.hench-card-action-play-held').on('click', async (event) => { // play the card! + const card = this.document.held[0]; + this.playCard(card) await this.document.sendCards(this.document.held.slice(0, 1), CARD_ZONES.DISCARD, CONST.CARD_DRAW_MODES.TOP); }); @@ -72,4 +76,31 @@ export class HenchCardsSheet extends CardsConfig { return opts; } + + async playCard(card) { + const user = game.users.current; + + const content = ` +