Tirage des tarots

This commit is contained in:
LeRatierBretonnien 2023-02-07 19:55:33 +01:00
parent 1923a63ebf
commit 04039513bc
35 changed files with 334 additions and 56 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 KiB

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 KiB

After

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 KiB

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 KiB

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 KiB

After

Width:  |  Height:  |  Size: 525 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 KiB

After

Width:  |  Height:  |  Size: 494 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

After

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 KiB

After

Width:  |  Height:  |  Size: 473 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 KiB

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 KiB

After

Width:  |  Height:  |  Size: 546 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 KiB

After

Width:  |  Height:  |  Size: 449 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 KiB

After

Width:  |  Height:  |  Size: 537 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 KiB

After

Width:  |  Height:  |  Size: 533 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 KiB

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 KiB

After

Width:  |  Height:  |  Size: 517 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 KiB

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 KiB

After

Width:  |  Height:  |  Size: 571 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 KiB

After

Width:  |  Height:  |  Size: 506 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

After

Width:  |  Height:  |  Size: 521 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB

After

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -2,6 +2,7 @@
import { MaleficesUtility } from "./malefices-utility.js";
import { MaleficesRollDialog } from "./malefices-roll-dialog.js";
import { MaleficesTirageTarotDialog } from "./malefices-tirage-tarot-dialog.js"
/* -------------------------------------------- */
export class MaleficesCommands {
@ -9,7 +10,7 @@ export class MaleficesCommands {
static init() {
if (!game.system.malefices.commands) {
const commands = new MaleficesCommands();
//crucibleCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => crucibleCommands.createChar(msg), descr: "Create a new character" });
commands.registerCommand({ path: ["/tirage"], func: (content, msg, params) => MaleficesCommands.createTirage(msg), descr: "Tirage des tarots" });
//crucibleCommands.registerCommand({ path: ["/pool"], func: (content, msg, params) => crucibleCommands.poolRoll(msg), descr: "Generic Roll Window" });
game.system.malefices.commands = commands;
}
@ -100,18 +101,30 @@ export class MaleficesCommands {
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
ChatMessage.create(msg);
}
/* -------------------------------------------- */
async poolRoll( msg) {
let rollData = MaleficesUtility.getBasicRollData()
rollData.alias = "Dice Pool Roll",
rollData.mode = "generic"
rollData.title = `Dice Pool Roll`;
let rollDialog = await MaleficesRollDialog.create( this, rollData);
rollDialog.render( true );
static async createTirage(msg) {
if (game.user.isGM) {
let tirageData = {
state: 'select-player',
nbCard: 0,
maxPlayerCard: 5,
maxSecretCard: 1,
cards: [],
players: duplicate(game.users),
secretCards: [],
deck: MaleficesUtility.getTarots()
}
for (let i = 0; i < 5; i++) {
tirageData.cards.push({ name: "???", img: "systems/fvtt-malefices/images/tarots/background.webp" })
}
tirageData.secretCards.push({ name: "???", img: "systems/fvtt-malefices/images/tarots/background.webp" })
let tirageDialog = await MaleficesTirageTarotDialog.create(this, tirageData)
tirageDialog.render(true)
}
}
}

View File

@ -111,7 +111,7 @@ Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.Malefices.commands.processChatCommand(commands, content, msg)) {
if (game.system.malefices.commands.processChatCommand(commands, content, msg)) {
return false;
}
}

View File

@ -0,0 +1,155 @@
import { MaleficesUtility } from "./malefices-utility.js";
export class MaleficesTirageTarotDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, tirageData) {
let options = { classes: ["MaleficesDialog"], width: 820, height: 740, 'z-index': 99999 };
let html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs', tirageData);
return new MaleficesTirageTarotDialog(actor, tirageData, html, options);
}
/* -------------------------------------------- */
constructor(actor, tirageData, html, options, close = undefined) {
let conf = {
title: "Tirage des tarots",
content: html,
buttons: {
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Fermer/Annuler",
callback: () => { this.close() }
}
},
close: close
}
super(conf, options);
this.actor = actor;
this.tirageData = tirageData;
}
/* -------------------------------------------- */
async sendCardRequest() {
this.tirageData.state = 'waiting-user-card'
let msg = await MaleficesUtility.createChatMessage(this.tirageData.user.name, "useronly", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/request-tarot-card.hbs`, this.tirageData)
})
//msg.setFlag("world", "tirage-data", this.tirageData)
console.log("MSG IS", msg)
}
/* -------------------------------------------- */
drawCard() {
let index = Math.round(Math.random() * (this.tirageData.deck.length-1))
let selectedCard = this.tirageData.deck[index]
selectedCard.system.ispositif = true
if ( selectedCard.system.isdualside) { // Cas des cartes pouvant avoir 2 sens
selectedCard.system.ispositif = (Math.random() > 0.5)
}
console.log("CARD SELECTED:", selectedCard)
// Cas spécial de la Roue de la Fortune
if ( selectedCard.name.toLowerCase().includes("fortune")) {
this.tirageData.maxPlayerCard += 1
this.tirageData.maxSecretCard += 1
}
let newList = []
for(let card of this.tirageData.deck) {
if (card.name != selectedCard.name) {
newList.push(card)
}
}
this.tirageData.deck = newList
return selectedCard
}
/* -------------------------------------------- */
async addCard( msgId ) {
MaleficesUtility.removeChatMessageId(msgId)
let selectedCard = this.drawCard()
selectedCard.system.isgm = false
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
})
if (this.tirageData.cards[0].name == "???") {
this.tirageData.cards.shift()
}
this.tirageData.cards.push(selectedCard)
this.tirageData.nbCard++
if (this.tirageData.nbCard == this.tirageData.maxPlayerCard) {
for (let i=0; i<this.tirageData.maxSecretCard; i++) {
let selectedCard = this.drawCard()
selectedCard.system.isgm = true
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "blindroll", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
})
if (this.tirageData.secretCards[0].name == "???") {
this.tirageData.secretCards.shift()
}
this.tirageData.secretCards.push(selectedCard)
}
this.tirageData.actors = duplicate(game.actors)
this.tirageData.state = 'attribute-to-actor'
}else {
this.sendCardRequest()
}
this.refreshDialog()
}
/* -------------------------------------------- */
async processSelectedPlayer() {
let user = game.users.get(this.tirageData.playerId)
this.tirageData.user = user
this.tirageData.players = null
console.log("Going to work with ", user.name)
game.system.malefices.currentTirage = this
this.refreshDialog()
this.sendCardRequest()
}
/* -------------------------------------------- */
attributeToActor(actorId) {
let actor = game.actors.get(actorId)
if (actor) {
actor.createEmbeddedDocuments('Item', this.tirageData.cards)
actor.createEmbeddedDocuments('Item', this.tirageData.secretCards)
ui.notifications.info("Les cartes ont été attribuées à " + actor.name)
}
}
/* -------------------------------------------- */
async refreshDialog() {
const content = await renderTemplate("systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs", this.tirageData)
this.data.content = content
this.render(true)
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#playerId').change((event) => {
if ( event.currentTarget.value != "none") {
dialog.tirageData.playerId = event.currentTarget.value
dialog.processSelectedPlayer()
}
})
html.find('#actorId').change((event) => {
if ( event.currentTarget.value != "none") {
let actorId = event.currentTarget.value
dialog.attributeToActor(actorId)
}
})
}
}

View File

@ -1,5 +1,4 @@
/* -------------------------------------------- */
import { MaleficesCombat } from "./malefices-combat.js";
import { MaleficesCommands } from "./malefices-commands.js";
@ -89,6 +88,14 @@ export class MaleficesUtility {
}
return actor
}
/* -------------------------------------------- */
static drawDeckCard(msgId) {
if (game.user.isGM) {
game.system.malefices.currentTirage.addCard(msgId)
} else {
game.socket.emit( "system.fvtt-malefices", {name: "msg-draw-card", data: {msgId: msgId}})
}
}
/* -------------------------------------------- */
static async chatListeners(html) {
@ -102,6 +109,11 @@ export class MaleficesUtility {
rollData.isReroll = true
this.rollMalefices(rollData)
})
html.on("click", '.draw-tarot-card', event => {
let messageId = MaleficesUtility.findChatMessageId(event.currentTarget)
this.drawDeckCard(messageId)
})
}
/* -------------------------------------------- */
@ -185,21 +197,10 @@ export class MaleficesUtility {
/* -------------------------------------------- */
static async onSocketMesssage(msg) {
console.log("SOCKET MESSAGE", msg.name)
if (msg.name == "msg_update_roll") {
this.updateRollData(msg.data)
}
if (msg.name == "msg_gm_process_attack_defense") {
this.processSuccessResult(msg.data)
}
if (msg.name == "msg_gm_item_drop" && game.user.isGM) {
let actor = game.actors.get(msg.data.actorId)
let item
if (msg.data.isPack) {
item = await fromUuid("Compendium." + msg.data.isPack + "." + msg.data.itemId)
} else {
item = game.items.get(msg.data.itemId)
if (msg.name == "msg-draw-card") {
if ( game.user.isGM && game.system.malefices.currentTirage) {
game.system.malefices.currentTirage.addCard(msg.data.msgId)
}
this.addItemDropToActor(actor, item)
}
}
@ -331,11 +332,17 @@ export class MaleficesUtility {
switch (rollMode) {
case "blindroll": return this.getUsers(user => user.isGM);
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
case "useronly": return this.getWhisperRecipientsOnly(name);
case "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
static getWhisperRecipientsOnly(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1
}
/* -------------------------------------------- */
static getWhisperRecipientsAndGMs(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
@ -369,7 +376,7 @@ export class MaleficesUtility {
}
/* -------------------------------------------- */
static createChatMessage(name, rollMode, chatOptions) {
static async createChatMessage(name, rollMode, chatOptions) {
switch (rollMode) {
case "blindroll": // GM only
if (!game.user.isGM) {
@ -387,7 +394,7 @@ export class MaleficesUtility {
break;
}
chatOptions.alias = chatOptions.alias || name;
return ChatMessage.create(chatOptions);
return await ChatMessage.create(chatOptions);
}
/* -------------------------------------------- */
@ -413,8 +420,8 @@ export class MaleficesUtility {
}
/* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions) {
return this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions)
static async createChatWithRollMode(name, chatOptions) {
return await this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions)
}
/* -------------------------------------------- */

View File

@ -1,22 +1,22 @@
{"name":"Le Moine","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Moine_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053851,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"1DRKmbzGzbCRCswc"}
{"name":"La Lune Noire","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Lune%20Noire_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053846,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"6jHm4eWelq7eLKwU"}
{"name":"Hippocrate","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Hippocrate_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053843,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"BCQenQMvFjLKkl56"}
{"name":"Eve","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Eve_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053842,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"IJaK9oxcsamMs4pw"}
{"name":"Le Sorcier","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Sorcier_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053852,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"IwsZkMHLKGuCGUf7"}
{"name":"La Mort","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_La%20Mort_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053847,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"MHdmnX0tbbjhPbA0"}
{"name":"L'Artiste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Artiste_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053845,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"NQBZmrYhEiyNxEo2"}
{"name":"Le Savetier","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Savetier_600%20dpi%20copie.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053852,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"SClVaCgZjZoR1WiD"}
{"name":"La Roue de la Fortune","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_La%20roue%20de%20la%20fortune_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053847,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"WRILaKwS1cjxZGRk"}
{"name":"L'Alchimiste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Alchimiste_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053844,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"WlsCeal346QfJweB"}
{"name":"L'Archange","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Archange_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053844,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"bVvGkOVe3BQeK7HR"}
{"name":"La Chance","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Chance_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053846,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"ba7fmG0dYpV2jpIv"}
{"name":"Le Vicaire","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Vicaire_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053853,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"dbc8W1qD0kj5rQ4s"}
{"name":"Le Juge","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Le%20Juge_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053849,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"dkvHSWzgbOqbykUL"}
{"name":"Le Diable","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Diable_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053848,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"earXcKB3NZ9sM8S7"}
{"name":"Le Centurion","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Centurion_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053848,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"fIHWGqwcubToEjOK"}
{"name":"Le Cabaliste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Cabaliste_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053847,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"gS7fULIr9lPCl5Vb"}
{"name":"Adam","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Adam_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053841,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"ooRr6cSNg73cPyaU"}
{"name":"Le Medium","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Medium_600%20dpi.webp","system":{"tarottype":"mineur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053850,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"rOgagyXv5RWxvyBa"}
{"name":"L'Archiviste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Archiviste_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053845,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"wHc7WwyWPZIqt219"}
{"name":"Le Laboureur","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Laboureur_600%20dpi.webp","system":{"tarottype":"metier","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053850,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"wLFdvRd9eLiCtc7b"}
{"name":"Le Grand Livre","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Grand%20Livre_600%20dpi.webp","system":{"tarottype":"majeur","isreversed":false,"description":""},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.3","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675372053849,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"zbGGMEQFdwVdlKAf"}
{"name":"Le Moine","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Moine_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"1DRKmbzGzbCRCswc"}
{"name":"La Lune Noire","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Lune%20Noire_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{"core":{"sourceId":"Item.uE5g6H5J0ccBe0ON"}},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109539,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"6jHm4eWelq7eLKwU"}
{"name":"Hippocrate","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Hippocrate_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109538,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"BCQenQMvFjLKkl56"}
{"name":"Eve","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Eve_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109538,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"IJaK9oxcsamMs4pw"}
{"name":"Le Sorcier","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Sorcier_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"IwsZkMHLKGuCGUf7"}
{"name":"La Mort","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_La%20Mort_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109540,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"MHdmnX0tbbjhPbA0"}
{"name":"L'Artiste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Artiste_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109539,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"NQBZmrYhEiyNxEo2"}
{"name":"Le Savetier","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Savetier_600%20dpi%20copie.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"SClVaCgZjZoR1WiD"}
{"name":"La Roue de la Fortune","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_La%20roue%20de%20la%20fortune_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109540,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"WRILaKwS1cjxZGRk"}
{"name":"L'Alchimiste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Alchimiste_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109538,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"WlsCeal346QfJweB"}
{"name":"L'Archange","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Archange_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109539,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"bVvGkOVe3BQeK7HR"}
{"name":"La Chance","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Chance_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109539,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"ba7fmG0dYpV2jpIv"}
{"name":"Le Vicaire","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Vicaire_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"dbc8W1qD0kj5rQ4s"}
{"name":"Le Juge","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Le%20Juge_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"dkvHSWzgbOqbykUL"}
{"name":"Le Diable","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Diable_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109540,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"earXcKB3NZ9sM8S7"}
{"name":"Le Centurion","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Centurion_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109540,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"fIHWGqwcubToEjOK"}
{"name":"Le Cabaliste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Cabaliste_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109540,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"gS7fULIr9lPCl5Vb"}
{"name":"Adam","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Adam_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109538,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"ooRr6cSNg73cPyaU"}
{"name":"Le Medium","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Medium_600%20dpi.webp","system":{"tarottype":"mineur","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"rOgagyXv5RWxvyBa"}
{"name":"L'Archiviste","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Archiviste_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109539,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"wHc7WwyWPZIqt219"}
{"name":"Le Laboureur","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Laboureur_600%20dpi.webp","system":{"tarottype":"metier","isdualside":true,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"wLFdvRd9eLiCtc7b"}
{"name":"Le Grand Livre","type":"tarot","img":"systems/fvtt-malefices/images/tarots/Malefice_Tarot_Grand%20Livre_600%20dpi.webp","system":{"tarottype":"majeur","isdualside":false,"ispositif":true,"isgm":false,"description":"","isreversed":false},"effects":[],"flags":{},"_stats":{"systemId":"fvtt-malefices","systemVersion":"10.0.17","coreVersion":"10.291","createdTime":1675369447354,"modifiedTime":1675789109541,"lastModifiedBy":"R9gIh86vXDB4IFn1"},"folder":null,"sort":0,"ownership":{"default":0,"R9gIh86vXDB4IFn1":3},"_id":"zbGGMEQFdwVdlKAf"}

View File

@ -1299,3 +1299,14 @@ ul, li {
max-width: 16px;
max-height: 12px;
}
.flip-tarot {
transform: scaleY(-1);
}
.tarot-fixed-width {
width: 140px;
max-width: 140px;
}
.tarot-title {
text-align: center;
font-weight: bold;
}

View File

@ -64,7 +64,7 @@
],
"title": "Maléfices, le Jeu de Rôle",
"url": "https://www.uberwald.me/gitea/public/fvtt-malefices",
"version": "10.0.16",
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.16.zip",
"version": "10.0.18",
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.18.zip",
"background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp"
}

View File

@ -110,6 +110,7 @@
},
"tarot": {
"tarottype": "",
"isdualside": false,
"ispositif": true,
"isgm": false,
"description": ""

View File

@ -0,0 +1,9 @@
</div>
<div class="flexcol">
<img class="{{#if system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{img}}">
<span class="tarot-title">{{name}}</span>
{{#if system.isdualside}}
<span class="tarot-title">{{#if system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
</div>
</div>

View File

@ -0,0 +1,4 @@
<div>
<button class="chat-card-button draw-tarot-card">Tirer une carte de Tarot</button>
</div>

View File

@ -0,0 +1,72 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<h1 class="dialog-roll-title roll-dialog-header">Joueur : {{user.name}}</h1>
</header>
<div class="flexcol">
{{#if (eq state "select-player")}}
<div class="flexrow">
<span>Sélectionnez le joueur pour faire le tirage</span>
<select id="playerId" name="playerId">
{{#select playerId}}
<option value="none"></option>
{{#each players as |player id|}}
<option value="{{player._id}}">{{player.name}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
{{#if (eq state "attribute-to-actor")}}
<div class="flexrow">
<span>Sélectionnez l'acteur pour lui attribuer les tarots</span>
<select id="actorId" name="actorId">
{{#select actorId}}
<option value="none"></option>
{{#each actors as |actor id|}}
<option value="{{actor._id}}">{{actor.name}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
<div class="flexcol">
<span><h2>Main du joueur : </h2></span>
<div class="flexrow">
{{#each cards as |card index|}}
<div class="flexcol">
<div class="tarot-fixed-width flexcol">
<img class="tarot-fixed-width {{#if card.system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{card.img}}">
<span class="tarot-title">{{card.name}}</span>
{{#if card.system.isdualside}}
<span class="tarot-title">{{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
</div>
</div>
{{/each}}
</div>
<hr>
<span><h2>Main secrête : </h2></span>
<div class="flexrow">
{{#each secretCards as |card index|}}
<div class="flexcol">
<div class="tarot-fixed-width flexcol">
<img class="tarot-fixed-width {{#if card.system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{card.img}}">
<span class="tarot-title">{{card.name}}</span>
{{#if card.system.isdualside}}
<span class="tarot-title">{{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
</div>
</div>
{{/each}}
</div>
</div>
</div>
</form>

View File

@ -36,9 +36,15 @@
{{#if isGM}}
<li class="flexrow">
<label class="item-field-label-long">En positif ?</label>
<input type="checkbox" class="item-field-label-short" name="system.ispositif" {{checked system.ispositif}} />
<label class="item-field-label-long">A un sens (ie positif/négatif)?</label>
<input type="checkbox" class="item-field-label-short" name="system.isdualside" {{checked system.isdualside}} />
</li>
{{#if system.isdualside}}
<li class="flexrow">
<label class="item-field-label-long">En positif ?</label>
<input type="checkbox" class="item-field-label-short" name="system.ispositif" {{checked system.ispositif}} />
</li>
{{/if}}
<li class="flexrow">
<label class="item-field-label-long">Carte cachée (ie MJ seulement) ?</label>
<input type="checkbox" class="item-field-label-short" name="system.isgm" {{checked system.isgm}} />