forked from public/foundryvtt-reve-de-dragon
Compare commits
17 Commits
26e805cf46
...
foundryvtt
| Author | SHA1 | Date | |
|---|---|---|---|
| f95f5b2b81 | |||
| d30226cb33 | |||
| 5cf7dda76c | |||
| 9bc2593b8c | |||
| efd02b40a9 | |||
| feb3116c47 | |||
| 91a870ad91 | |||
| 2bbf606f30 | |||
| a385b98126 | |||
| 8775df5285 | |||
| a103239288 | |||
| 0b1c5d0a3d | |||
| e19577eab2 | |||
| c3b502ff6c | |||
| db2ca2453e | |||
| 915283a674 | |||
| 621bb4ebc3 |
BIN
assets/scenes/9fmf9lcb3L9XO3bJ-thumb.png
Normal file
BIN
assets/scenes/9fmf9lcb3L9XO3bJ-thumb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
12
changelog.md
12
changelog.md
@@ -1,4 +1,16 @@
|
|||||||
# 11.2
|
# 11.2
|
||||||
|
## 11.2.22 - Le futur d'Akarlikarlikar
|
||||||
|
- correction de la vente par le tchat: seul le premier acheteur pouvait acheter
|
||||||
|
- correction d'erreurs intempestives 'User ... lacks permission to update ...'
|
||||||
|
|
||||||
|
### Support V12
|
||||||
|
- adaptation fenêtre de recherche
|
||||||
|
- correction des comparaisons de version pour les migrations automatiques
|
||||||
|
- correction des roll.eveluate: l'option async est maintenant standard
|
||||||
|
- correction des templates liés aux selections
|
||||||
|
- correction de l'ajustement de luminosité de la scène selon l'heure
|
||||||
|
- correction des images d'effets sur les tokens
|
||||||
|
|
||||||
## 11.2.21 - Le questionnement d'Akarlikarlikar
|
## 11.2.21 - Le questionnement d'Akarlikarlikar
|
||||||
- Une confirmation spécifique est demandée pour monter dans les terres médianes en cas de rencontre en attente
|
- Une confirmation spécifique est demandée pour monter dans les terres médianes en cas de rencontre en attente
|
||||||
- L'expérience en caractéristique sur les jets de chance et rêve actuels est mise dans la caractéristique correspondante
|
- L'expérience en caractéristique sur les jets de chance et rêve actuels est mise dans la caractéristique correspondante
|
||||||
|
|||||||
4
icons/heures/.directory
Normal file
4
icons/heures/.directory
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[Dolphin]
|
||||||
|
Timestamp=2024,5,29,20,57,41.954
|
||||||
|
Version=4
|
||||||
|
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails
|
||||||
65
module/achat-vente/chat-vente.js
Normal file
65
module/achat-vente/chat-vente.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import { SYSTEM_RDD } from "../constants.js";
|
||||||
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
|
|
||||||
|
const DETAIL_VENTE = 'detailVente';
|
||||||
|
const NB_LOTS = 'nbLotss';
|
||||||
|
|
||||||
|
export class ChatVente {
|
||||||
|
|
||||||
|
static getDetailVente(chatMessageId) {
|
||||||
|
const chatMessage = game.messages.get(chatMessageId)
|
||||||
|
if (!chatMessage) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const nbLots = chatMessage.getFlag(SYSTEM_RDD, NB_LOTS)
|
||||||
|
const detail = foundry.utils.duplicate(chatMessage.getFlag(SYSTEM_RDD, DETAIL_VENTE))
|
||||||
|
if (!detail.item) {
|
||||||
|
ui.notifications.warn("Impossible d'acheter: informations sur l'objet manquantes")
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const vendeur = detail.vendeurId ? game.actors.get(detail.vendeurId) : undefined;
|
||||||
|
return foundry.utils.mergeObject(detail,
|
||||||
|
{
|
||||||
|
alias: vendeur?.name ?? game.user.name,
|
||||||
|
vendeur,
|
||||||
|
nbLots: nbLots,
|
||||||
|
chatMessageIdVente: chatMessageId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
static getDetailAchatVente(chatMessageId) {
|
||||||
|
const acheteur = RdDUtility.getSelectedActor()
|
||||||
|
const detail = ChatVente.getDetailVente(chatMessageId)
|
||||||
|
if (!acheteur && !detail.vendeur) {
|
||||||
|
ui.notifications.info("Pas d'acheteur ni de vendeur, aucun changement");
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return foundry.utils.mergeObject(detail, { acheteur })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async diminuerQuantiteAchatVente(chatMessageId, quantite) {
|
||||||
|
const chatMessage = game.messages.get(chatMessageId)
|
||||||
|
const vente = ChatVente.getDetailVente(chatMessageId)
|
||||||
|
vente.nbLots = Math.max(0, vente.nbLots - quantite)
|
||||||
|
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||||
|
|
||||||
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
||||||
|
chatMessage.update({ content: html });
|
||||||
|
chatMessage.render(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static async displayAchatVente(vente) {
|
||||||
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
||||||
|
const chatMessage = await ChatMessage.create(RdDUtility.chatDataSetup(html))
|
||||||
|
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||||
|
await chatMessage.setFlag(SYSTEM_RDD, DETAIL_VENTE, {
|
||||||
|
item: vente.item,
|
||||||
|
properties: vente.item.getProprietes(),
|
||||||
|
vendeurId: vente.vendeurId,
|
||||||
|
tailleLot: vente.tailleLot,
|
||||||
|
quantiteIllimite: vente.quantiteIllimite,
|
||||||
|
prixLot: vente.prixLot
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,13 @@
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
|
import { ChatVente } from "./chat-vente.js";
|
||||||
|
|
||||||
export class DialogItemAchat extends Dialog {
|
export class DialogItemAchat extends Dialog {
|
||||||
|
|
||||||
static preparerAchat(chatButton) {
|
static preparerAchat(chatButton) {
|
||||||
const vendeurId = chatButton.attributes['data-vendeurId']?.value;
|
return ChatVente.getDetailAchatVente(RdDUtility.findChatMessageId(chatButton))
|
||||||
const vendeur = vendeurId ? game.actors.get(vendeurId) : undefined;
|
|
||||||
const acheteur = RdDUtility.getSelectedActor();
|
|
||||||
const json = chatButton.attributes['data-jsondata']?.value;
|
|
||||||
if (!acheteur && !vendeur) {
|
|
||||||
ui.notifications.info("Pas d'acheteur ni de vendeur, aucun changement");
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
if (!json) {
|
|
||||||
ui.notifications.warn("Impossible d'acheter: informations sur l'objet manquantes")
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
item: JSON.parse(json),
|
|
||||||
vendeur,
|
|
||||||
acheteur,
|
|
||||||
nbLots: parseInt(chatButton.attributes['data-quantiteNbLots']?.value),
|
|
||||||
tailleLot: parseInt(chatButton.attributes['data-tailleLot']?.value ?? 1),
|
|
||||||
prixLot: Number(chatButton.attributes['data-prixLot']?.value ?? 0),
|
|
||||||
quantiteIllimite: chatButton.attributes['data-quantiteIllimite']?.value == 'true',
|
|
||||||
chatMessageIdVente: RdDUtility.findChatMessageId(chatButton),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static async onAcheter({ item, vendeur, acheteur, tailleLot, prixLot, nbLots, quantiteIllimite, chatMessageIdVente }) {
|
static async onAcheter({ item, vendeur, acheteur, tailleLot, prixLot, nbLots, quantiteIllimite, chatMessageIdVente }) {
|
||||||
const venteData = {
|
const venteData = {
|
||||||
item,
|
item,
|
||||||
@@ -38,17 +16,21 @@ export class DialogItemAchat extends Dialog {
|
|||||||
acheteur,
|
acheteur,
|
||||||
tailleLot,
|
tailleLot,
|
||||||
quantiteIllimite,
|
quantiteIllimite,
|
||||||
quantiteNbLots: nbLots,
|
nbLots,
|
||||||
choix: { seForcer: false, supprimerSiZero: true },
|
choix: { seForcer: false, supprimerSiZero: true },
|
||||||
prixLot,
|
prixLot,
|
||||||
isVente: prixLot > 0,
|
isVente: prixLot > 0,
|
||||||
isConsommable: item.type == 'nourritureboisson' && acheteur?.isPersonnage(),
|
isConsommable: item.type == 'nourritureboisson' && acheteur?.isPersonnage(),
|
||||||
chatMessageIdVente
|
chatMessageIdVente
|
||||||
};
|
}
|
||||||
|
if (venteData.vendeur?.id == venteData.acheteur?.id) {
|
||||||
|
ui.notifications.info("Inutile de se vendre à soi-même")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
DialogItemAchat.changeNombreLots(venteData, 1);
|
DialogItemAchat.changeNombreLots(venteData, 1)
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData);
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData)
|
||||||
new DialogItemAchat(html, venteData).render(true);
|
new DialogItemAchat(html, venteData).render(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
static changeNombreLots(venteData, nombreLots) {
|
static changeNombreLots(venteData, nombreLots) {
|
||||||
@@ -116,18 +98,18 @@ export class DialogItemAchat extends Dialog {
|
|||||||
this.venteData.choix.seForcer = event.currentTarget.checked;
|
this.venteData.choix.seForcer = event.currentTarget.checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
setNombreLots(nombreLots) {
|
setNombreLots(nbLots) {
|
||||||
|
|
||||||
if (!this.venteData.quantiteIllimite) {
|
if (!this.venteData.quantiteIllimite) {
|
||||||
if (!this.venteData.quantiteIllimite && nombreLots > this.venteData.quantiteNbLots) {
|
if (!this.venteData.quantiteIllimite && nbLots > this.venteData.nbLots) {
|
||||||
ui.notifications.warn(`Seulement ${this.venteData.quantiteNbLots} lots disponibles, vous ne pouvez pas en prendre ${nombreLots}`)
|
ui.notifications.warn(`Seulement ${this.venteData.nbLots} lots disponibles, vous ne pouvez pas en prendre ${nbLots}`)
|
||||||
}
|
}
|
||||||
nombreLots = Math.min(nombreLots, this.venteData.quantiteNbLots);
|
nbLots = Math.min(nbLots, this.venteData.nbLots);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogItemAchat.changeNombreLots(this.venteData, nombreLots);
|
DialogItemAchat.changeNombreLots(this.venteData, nbLots);
|
||||||
|
|
||||||
this.html.find(".nombreLots").val(nombreLots);
|
this.html.find(".nombreLots").val(nbLots);
|
||||||
this.html.find(".prixTotal").text(this.venteData.prixTotal);
|
this.html.find(".prixTotal").text(this.venteData.prixTotal);
|
||||||
this.html.find("span.total-sust").text(this.venteData.totalSust);
|
this.html.find("span.total-sust").text(this.venteData.totalSust);
|
||||||
this.html.find("span.total-desaltere").text(this.venteData.totalDesaltere);
|
this.html.find("span.total-desaltere").text(this.venteData.totalDesaltere);
|
||||||
@@ -1,29 +1,30 @@
|
|||||||
import { HtmlUtility } from "./html-utility.js";
|
import { HtmlUtility } from "../html-utility.js";
|
||||||
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
|
import { ChatVente } from "./chat-vente.js";
|
||||||
|
|
||||||
export class DialogItemVente extends Dialog {
|
export class DialogItemVente extends Dialog {
|
||||||
|
|
||||||
static async display({ item, callback, quantiteMax = undefined }) {
|
static async display({ item, quantiteMax = undefined }) {
|
||||||
const quantite = quantiteMax ?? item.getQuantite() ?? 1;
|
const quantite = quantiteMax ?? item.getQuantite() ?? 1;
|
||||||
const isOwned = item.parent;
|
|
||||||
const venteData = {
|
const venteData = {
|
||||||
item: item,
|
item: item,
|
||||||
alias: item.actor?.name ?? game.user.name,
|
alias: item.actor?.name ?? game.user.name,
|
||||||
vendeurId: item.actor?.id,
|
vendeurId: item.actor.id,
|
||||||
prixOrigine: item.calculerPrixCommercant(),
|
prixOrigine: item.calculerPrixCommercant(),
|
||||||
prixUnitaire: item.calculerPrixCommercant(),
|
prixUnitaire: item.calculerPrixCommercant(),
|
||||||
prixLot: item.calculerPrixCommercant(),
|
prixLot: item.calculerPrixCommercant(),
|
||||||
tailleLot: 1,
|
tailleLot: 1,
|
||||||
quantiteNbLots: quantite,
|
nbLots: quantite,
|
||||||
quantiteMaxLots: quantite,
|
maxLots: quantite,
|
||||||
quantiteMax: quantite,
|
quantiteMax: quantite,
|
||||||
quantiteIllimite: item.isItemCommerce() ? quantiteMax == undefined : !isOwned,
|
quantiteIllimite: item.isItemCommerce() ? quantiteMax == undefined : !item.parent,
|
||||||
isOwned: isOwned,
|
isOwned: item.parent,
|
||||||
};
|
}
|
||||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.html`, venteData);
|
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.html`, venteData);
|
||||||
return new DialogItemVente(venteData, html, callback).render(true);
|
return new DialogItemVente(venteData, html).render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(venteData, html, callback) {
|
constructor(venteData, html) {
|
||||||
let options = { classes: ["dialogvente"], width: 400, height: 'fit-content', 'z-index': 99999 };
|
let options = { classes: ["dialogvente"], width: 400, height: 'fit-content', 'z-index': 99999 };
|
||||||
|
|
||||||
let conf = {
|
let conf = {
|
||||||
@@ -34,7 +35,6 @@ export class DialogItemVente extends Dialog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
super(conf, options);
|
super(conf, options);
|
||||||
this.callback = callback;
|
|
||||||
this.venteData = venteData;
|
this.venteData = venteData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export class DialogItemVente extends Dialog {
|
|||||||
|
|
||||||
this.html = html;
|
this.html = html;
|
||||||
this.html.find(".tailleLot").change(event => this.setTailleLot(Number(event.currentTarget.value)));
|
this.html.find(".tailleLot").change(event => this.setTailleLot(Number(event.currentTarget.value)));
|
||||||
this.html.find(".quantiteNbLots").change(event => this.setNbLots(Number(event.currentTarget.value)));
|
this.html.find(".nbLots").change(event => this.setNbLots(Number(event.currentTarget.value)));
|
||||||
this.html.find(".quantiteIllimite").change(event => this.setQuantiteIllimite(event.currentTarget.checked));
|
this.html.find(".quantiteIllimite").change(event => this.setQuantiteIllimite(event.currentTarget.checked));
|
||||||
this.html.find(".prixLot").change(event => this.setPrixLot(Number(event.currentTarget.value)));
|
this.html.find(".prixLot").change(event => this.setPrixLot(Number(event.currentTarget.value)));
|
||||||
|
|
||||||
@@ -52,7 +52,15 @@ export class DialogItemVente extends Dialog {
|
|||||||
|
|
||||||
async onProposer(it) {
|
async onProposer(it) {
|
||||||
this.updateVente(this.getChoixVente());
|
this.updateVente(this.getChoixVente());
|
||||||
this.callback(this.venteData);
|
|
||||||
|
this.venteData["properties"] = this.venteData.item.getProprietes();
|
||||||
|
if (this.venteData.isOwned) {
|
||||||
|
if (this.venteData.nbLots * this.venteData.tailleLot > this.venteData.quantiteMax) {
|
||||||
|
ui.notifications.warn(`Vous avez ${this.venteData.quantiteMax} ${this.venteData.item.name}, ce n'est pas suffisant pour vendre ${this.venteData.nbLots} de ${this.venteData.tailleLot}`)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await ChatVente.displayAchatVente(this.venteData)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateVente(update) {
|
updateVente(update) {
|
||||||
@@ -61,7 +69,7 @@ export class DialogItemVente extends Dialog {
|
|||||||
|
|
||||||
getChoixVente() {
|
getChoixVente() {
|
||||||
return {
|
return {
|
||||||
quantiteNbLots: Number(this.html.find(".quantiteNbLots").val()),
|
nbLots: Number(this.html.find(".nbLots").val()),
|
||||||
tailleLot: Number(this.html.find(".tailleLot").val()),
|
tailleLot: Number(this.html.find(".tailleLot").val()),
|
||||||
quantiteIllimite: this.html.find(".quantiteIllimite").is(':checked'),
|
quantiteIllimite: this.html.find(".quantiteIllimite").is(':checked'),
|
||||||
prixLot: Number(this.html.find(".prixLot").val())
|
prixLot: Number(this.html.find(".prixLot").val())
|
||||||
@@ -77,26 +85,26 @@ export class DialogItemVente extends Dialog {
|
|||||||
const maxLots = Math.floor(this.venteData.quantiteMax / tailleLot);
|
const maxLots = Math.floor(this.venteData.quantiteMax / tailleLot);
|
||||||
this.updateVente({
|
this.updateVente({
|
||||||
tailleLot,
|
tailleLot,
|
||||||
quantiteNbLots: Math.min(maxLots, this.venteData.quantiteNbLots),
|
nbLots: Math.min(maxLots, this.venteData.nbLots),
|
||||||
quantiteMaxLots: maxLots,
|
maxLots: maxLots,
|
||||||
prixLot: (tailleLot * this.venteData.prixOrigine).toFixed(2)
|
prixLot: (tailleLot * this.venteData.prixOrigine).toFixed(2)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.html.find(".prixLot").val(this.venteData.prixLot);
|
this.html.find(".prixLot").val(this.venteData.prixLot);
|
||||||
this.html.find(".quantiteNbLots").val(this.venteData.quantiteNbLots);
|
this.html.find(".nbLots").val(this.venteData.nbLots);
|
||||||
this.html.find(".quantiteNbLots").attr("max", this.venteData.quantiteMaxLots)
|
this.html.find(".nbLots").attr("max", this.venteData.maxLots)
|
||||||
}
|
}
|
||||||
|
|
||||||
setNbLots(nbLots) {
|
setNbLots(nbLots) {
|
||||||
this.updateVente({
|
this.updateVente({
|
||||||
quantiteNbLots: this.venteData.isOwned ? Math.max(0, Math.min(nbLots, this.venteData.quantiteMaxLots)) : nbLots
|
nbLots: this.venteData.isOwned ? Math.max(0, Math.min(nbLots, this.venteData.maxLots)) : nbLots
|
||||||
})
|
})
|
||||||
this.html.find(".quantiteNbLots").val(this.venteData.quantiteNbLots);
|
this.html.find(".nbLots").val(this.venteData.nbLots);
|
||||||
}
|
}
|
||||||
|
|
||||||
setQuantiteIllimite(checked) {
|
setQuantiteIllimite(checked) {
|
||||||
this.updateVente({ quantiteIllimite: checked })
|
this.updateVente({ quantiteIllimite: checked })
|
||||||
this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles");
|
this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles");
|
||||||
HtmlUtility.showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite)
|
HtmlUtility.showControlWhen(this.html.find(".nbLots"), !this.venteData.quantiteIllimite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,21 +32,20 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
width: 550,
|
width: 550,
|
||||||
showCompNiveauBase: false,
|
showCompNiveauBase: false,
|
||||||
vueArchetype: false,
|
vueArchetype: false,
|
||||||
});
|
}, { inplace: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async getData() {
|
async getData() {
|
||||||
let formData = await super.getData();
|
let formData = await super.getData();
|
||||||
foundry.utils.mergeObject(formData,
|
foundry.utils.mergeObject(formData, {
|
||||||
{
|
editable: this.isEditable,
|
||||||
editable: this.isEditable,
|
cssClass: this.isEditable ? "editable" : "locked",
|
||||||
cssClass: this.isEditable ? "editable" : "locked",
|
limited: this.actor.limited,
|
||||||
limited: this.actor.limited,
|
owner: this.actor.isOwner,
|
||||||
owner: this.actor.isOwner,
|
biographie: await TextEditor.enrichHTML(this.actor.system.biographie, { async: true }),
|
||||||
biographie: await TextEditor.enrichHTML(this.actor.system.biographie, { async: true }),
|
notes: await TextEditor.enrichHTML(this.actor.system.notes, { async: true }),
|
||||||
notes: await TextEditor.enrichHTML(this.actor.system.notes, { async: true }),
|
});
|
||||||
});
|
|
||||||
foundry.utils.mergeObject(formData.calc, {
|
foundry.utils.mergeObject(formData.calc, {
|
||||||
surenc: this.actor.computeMalusSurEncombrement(),
|
surenc: this.actor.computeMalusSurEncombrement(),
|
||||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||||
@@ -211,7 +210,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
const key = Number(li.data("key") ?? -1);
|
const key = Number(li.data("key") ?? -1);
|
||||||
await this.actor.deleteExperienceLog(0, key + 1);
|
await this.actor.deleteExperienceLog(0, key + 1);
|
||||||
});
|
});
|
||||||
// Boutons spéciaux MJs
|
// Boutons spéciaux MJs
|
||||||
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
||||||
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -902,7 +902,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
async ajouterRefoulement(value = 1, refouler) {
|
async ajouterRefoulement(value = 1, refouler) {
|
||||||
let refoulement = this.system.reve.refoulement.value + value;
|
let refoulement = this.system.reve.refoulement.value + value;
|
||||||
const roll = new Roll("1d20");
|
const roll = new Roll("1d20");
|
||||||
await roll.evaluate({ async: true });
|
await roll.evaluate();
|
||||||
await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` });
|
await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` });
|
||||||
if (roll.total <= refoulement) {
|
if (roll.total <= refoulement) {
|
||||||
refoulement = 0;
|
refoulement = 0;
|
||||||
@@ -991,9 +991,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
buildTMRInnaccessible() {
|
buildTMRInnaccessible() {
|
||||||
return this.items[TYPES.casetmr]
|
return this.items.filter(it => it.type == TYPES.casetmr).filter(it => EffetsDraconiques.isInnaccessible(it)).map(it => it.system.coord)
|
||||||
.filter(it => EffetsDraconiques.isInnaccessible(it))
|
|
||||||
.map(it => it.system.coord)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -1149,6 +1147,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
finalLevel: 0,
|
finalLevel: 0,
|
||||||
diffConditions: 0,
|
diffConditions: 0,
|
||||||
ajustementsForce: CONFIG.RDD.difficultesLibres,
|
ajustementsForce: CONFIG.RDD.difficultesLibres,
|
||||||
|
config: game.system.rdd.config
|
||||||
}
|
}
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-ethylisme.html', rollData);
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-ethylisme.html', rollData);
|
||||||
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
||||||
@@ -2345,7 +2344,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
async _xpCaracDerivee(xpData) {
|
async _xpCaracDerivee(xpData) {
|
||||||
const caracs = RdDActor._getComposantsCaracDerivee(xpData.caracName)
|
const caracs = RdDActor._getComposantsCaracDerivee(xpData.caracName)
|
||||||
.map(c => foundry.utils.mergeObject(this.system.carac[c], { isMax: this.isCaracMax(c) }))
|
.map(c => foundry.utils.mergeObject(this.system.carac[c], { isMax: this.isCaracMax(c) }, { inplace: false }))
|
||||||
switch (caracs.filter(it => !it.isMax).length) {
|
switch (caracs.filter(it => !it.isMax).length) {
|
||||||
case 0:
|
case 0:
|
||||||
xpData.caracRepartitionManuelle = true;
|
xpData.caracRepartitionManuelle = true;
|
||||||
@@ -2627,13 +2626,13 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async resetItemUse() {
|
async resetItemUse() {
|
||||||
await this.unsetFlag(SYSTEM_RDD, 'itemUse');
|
|
||||||
await this.setFlag(SYSTEM_RDD, 'itemUse', {});
|
await this.setFlag(SYSTEM_RDD, 'itemUse', {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async incDecItemUse(itemId, inc = 1) {
|
async incDecItemUse(itemId, inc = 1) {
|
||||||
let itemUse = foundry.utils.duplicate(this.getFlag(SYSTEM_RDD, 'itemUse') ?? {});
|
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
||||||
|
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
||||||
itemUse[itemId] = (itemUse[itemId] ?? 0) + inc;
|
itemUse[itemId] = (itemUse[itemId] ?? 0) + inc;
|
||||||
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
||||||
console.log("ITEM USE INC", inc, itemUse);
|
console.log("ITEM USE INC", inc, itemUse);
|
||||||
|
|||||||
@@ -286,12 +286,12 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
|
|
||||||
getCarac() {
|
getCarac() {
|
||||||
// TODO: le niveau d'une entité de cauchemar devrait être exclu...
|
// TODO: le niveau d'une entité de cauchemar devrait être exclu...
|
||||||
const carac = foundry.utils.mergeObject(foundry.utils.duplicate(this.system.carac),
|
return foundry.utils.mergeObject(this.system.carac,
|
||||||
{
|
{
|
||||||
'reve-actuel': this.getCaracReveActuel(),
|
'reve-actuel': this.getCaracReveActuel(),
|
||||||
'chance-actuelle': this.getCaracChanceActuelle()
|
'chance-actuelle': this.getCaracChanceActuelle()
|
||||||
});
|
},
|
||||||
return carac;
|
{ inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],
|
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],
|
||||||
vueDetaillee: false
|
vueDetaillee: false
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -38,7 +38,8 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }),
|
description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }),
|
||||||
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
|
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
|
||||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
||||||
effects: this.actor.effects
|
effects: this.actor.effects,
|
||||||
|
config: game.system.rdd.config
|
||||||
}
|
}
|
||||||
|
|
||||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { ChatVente } from "../achat-vente/chat-vente.js";
|
||||||
import { ChatUtility } from "../chat-utility.js";
|
import { ChatUtility } from "../chat-utility.js";
|
||||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
@@ -31,10 +32,10 @@ export class RdDBaseActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static init() {
|
static init() {
|
||||||
Hooks.on("preUpdateItem", (item, change, options, id) => RdDBaseActor.getParentActor(item)?.onPreUpdateItem(item, change, options, id));
|
Hooks.on("preUpdateItem", (item, change, options, id) => Misc.documentIfResponsible(item.parent)?.onPreUpdateItem(item, change, options, id))
|
||||||
Hooks.on("createItem", (item, options, id) => RdDBaseActor.getParentActor(item)?.onCreateItem(item, options, id));
|
Hooks.on("createItem", (item, options, id) => Misc.documentIfResponsible(item.parent)?.onCreateItem(item, options, id))
|
||||||
Hooks.on("deleteItem", (item, options, id) => RdDBaseActor.getParentActor(item)?.onDeleteItem(item, options, id));
|
Hooks.on("deleteItem", (item, options, id) => Misc.documentIfResponsible(item.parent)?.onDeleteItem(item, options, id))
|
||||||
Hooks.on("updateActor", (actor, change, options, actorId) => actor.onUpdateActor(change, options, actorId));
|
Hooks.on("updateActor", (actor, change, options, actorId) => Misc.documentIfResponsible(actor)?.onUpdateActor(change, options, actorId))
|
||||||
}
|
}
|
||||||
|
|
||||||
static onSocketMessage(sockmsg) {
|
static onSocketMessage(sockmsg) {
|
||||||
@@ -81,10 +82,6 @@ export class RdDBaseActor extends Actor {
|
|||||||
|
|
||||||
static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; };
|
static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; };
|
||||||
|
|
||||||
static getParentActor(document) {
|
|
||||||
return document?.parent instanceof Actor ? document.parent : undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cette methode surcharge Actor.create() pour ajouter si besoin des Items par défaut:
|
* Cette methode surcharge Actor.create() pour ajouter si besoin des Items par défaut:
|
||||||
* compétences et monnaies.
|
* compétences et monnaies.
|
||||||
@@ -360,12 +357,9 @@ export class RdDBaseActor extends Actor {
|
|||||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(cout / 100)} sols !`);
|
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(cout / 100)} sols !`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.decrementerVente(vendeur, itemVendu, quantite, cout);
|
await vendeur?.vendre(itemVendu, quantite, cout);
|
||||||
if (acheteur) {
|
await acheteur?.acheter(itemVendu, quantite, cout, achat)
|
||||||
await acheteur.depenserSols(cout);
|
|
||||||
const createdItemId = await acheteur.creerQuantiteItem(itemVendu, quantite);
|
|
||||||
await acheteur.consommerNourritureAchetee(achat, achat.vente, createdItemId);
|
|
||||||
}
|
|
||||||
if (cout > 0) {
|
if (cout > 0) {
|
||||||
RdDAudio.PlayContextAudio("argent");
|
RdDAudio.PlayContextAudio("argent");
|
||||||
}
|
}
|
||||||
@@ -379,24 +373,26 @@ export class RdDBaseActor extends Actor {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!achat.vente.quantiteIllimite) {
|
if (!achat.vente.quantiteIllimite) {
|
||||||
if (achat.vente.quantiteNbLots <= achat.choix.nombreLots) {
|
if (achat.vente.nbLots <= achat.choix.nombreLots) {
|
||||||
ChatUtility.removeChatMessageId(achat.chatMessageIdVente);
|
ChatUtility.removeChatMessageId(achat.chatMessageIdVente);
|
||||||
}
|
}
|
||||||
else if (achat.chatMessageIdVente) {
|
else if (achat.chatMessageIdVente) {
|
||||||
achat.vente.properties = itemVendu.getProprietes();
|
await ChatVente.diminuerQuantiteAchatVente(achat.chatMessageIdVente, achat.choix.nombreLots)
|
||||||
achat.vente.quantiteNbLots -= achat.choix.nombreLots;
|
|
||||||
achat.vente.jsondata = JSON.stringify(achat.vente.item);
|
|
||||||
const messageVente = game.messages.get(achat.chatMessageIdVente);
|
|
||||||
messageVente.update({ content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', achat.vente) });
|
|
||||||
messageVente.render(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async decrementerVente(vendeur, itemVendu, quantite, cout) {
|
async vendre(item, quantite, cout) {
|
||||||
if (vendeur) {
|
await this.ajouterSols(cout);
|
||||||
await vendeur.ajouterSols(cout);
|
await this.decrementerQuantiteItem(item, quantite);
|
||||||
await vendeur.decrementerQuantiteItem(itemVendu, quantite);
|
}
|
||||||
|
|
||||||
|
async acheter(item, quantite, cout, achat) {
|
||||||
|
await this.depenserSols(cout)
|
||||||
|
const createdItemId = await this.creerQuantiteItem(item, quantite)
|
||||||
|
if (achat.choix.consommer && item.type == 'nourritureboisson' && createdItemId != undefined) {
|
||||||
|
achat.choix.doses = achat.choix.nombreLots;
|
||||||
|
await this.consommerNourritureboisson(createdItemId, achat.choix, achat.vente.actingUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,31 +405,28 @@ export class RdDBaseActor extends Actor {
|
|||||||
return disponible == undefined || disponible >= quantiteDemande;
|
return disponible == undefined || disponible >= quantiteDemande;
|
||||||
}
|
}
|
||||||
|
|
||||||
async consommerNourritureAchetee(achat, vente, createdItemId) {
|
async consommerNourritureboisson(itemId, choix, userId) { }
|
||||||
if (achat.choix.consommer && vente.item.type == 'nourritureboisson' && createdItemId != undefined) {
|
|
||||||
achat.choix.doses = achat.choix.nombreLots;
|
|
||||||
await this.consommerNourritureboisson(createdItemId, achat.choix, vente.actingUserId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) {
|
async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) {
|
||||||
if (item.isService()) {
|
if (item.isService()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const itemId = item.id;
|
||||||
let resteQuantite = (item.system.quantite ?? 1) - quantite;
|
let resteQuantite = (item.system.quantite ?? 1) - quantite;
|
||||||
if (resteQuantite <= 0) {
|
if (resteQuantite <= 0) {
|
||||||
if (options.supprimerSiZero) {
|
if (options.supprimerSiZero) {
|
||||||
await this.deleteEmbeddedDocuments("Item", [item.id]);
|
await this.deleteEmbeddedDocuments("Item", [item.id]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await this.updateEmbeddedDocuments("Item", [{ _id: item.id, 'system.quantite': 0 }]);
|
await this.updateEmbeddedDocuments("Item", [{ _id: itemId, 'system.quantite': 0 }]);
|
||||||
}
|
}
|
||||||
if (resteQuantite < 0) {
|
if (resteQuantite < 0) {
|
||||||
ui.notifications.warn(`La quantité de ${item.name} était insuffisante, l'objet a donc été supprimé`)
|
ui.notifications.warn(`La quantité de ${item.name} était insuffisante, l'objet a donc été supprimé`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (resteQuantite > 0) {
|
else if (resteQuantite > 0) {
|
||||||
|
const realItem = this.getItem(item.id)
|
||||||
|
realItem.update({ 'system.quantite': resteQuantite });
|
||||||
await this.updateEmbeddedDocuments("Item", [{ _id: item.id, 'system.quantite': resteQuantite }]);
|
await this.updateEmbeddedDocuments("Item", [{ _id: item.id, 'system.quantite': resteQuantite }]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -445,7 +438,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
type: item.type,
|
type: item.type,
|
||||||
img: item.img,
|
img: item.img,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
system: foundry.utils.mergeObject(item.system, { quantite: isItemEmpilable ? quantite : undefined })
|
system: foundry.utils.mergeObject(item.system, { quantite: isItemEmpilable ? quantite : undefined }, { inplace: false })
|
||||||
};
|
};
|
||||||
const newItems = isItemEmpilable ? [baseItem] : Array.from({ length: quantite }, (_, i) => baseItem);
|
const newItems = isItemEmpilable ? [baseItem] : Array.from({ length: quantite }, (_, i) => baseItem);
|
||||||
const items = await this.createEmbeddedDocuments("Item", newItems);
|
const items = await this.createEmbeddedDocuments("Item", newItems);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DialogItemAchat } from "../dialog-item-achat.js";
|
import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js";
|
||||||
import { RdDItem } from "../item.js";
|
import { RdDItem } from "../item.js";
|
||||||
import { RdDUtility } from "../rdd-utility.js";
|
import { RdDUtility } from "../rdd-utility.js";
|
||||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||||
@@ -15,7 +15,7 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
|||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.html",
|
||||||
width: 600, height: 720,
|
width: 600, height: 720,
|
||||||
tabs: []
|
tabs: []
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
get title() {
|
get title() {
|
||||||
if (this.actor.token && this.actor.token != this.actor.prototypeToken) {
|
if (this.actor.token && this.actor.token != this.actor.prototypeToken) {
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ export class RdDCommerce extends RdDBaseActor {
|
|||||||
}
|
}
|
||||||
await super.depenserSols(cout)
|
await super.depenserSols(cout)
|
||||||
}
|
}
|
||||||
|
async consommerNourritureboisson(itemId, choix, userId) {
|
||||||
async consommerNourritureAchetee(achat, vente, createdItemId) {
|
|
||||||
// ne pas consommer pour un commerce
|
// ne pas consommer pour un commerce
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export class RdDCreatureSheet extends RdDBaseActorSangSheet {
|
|||||||
return foundry.utils.mergeObject(RdDBaseActorSangSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorSangSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html",
|
||||||
width: 640, height: 720
|
width: 640, height: 720
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
|||||||
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html",
|
||||||
width: 640, height: 720,
|
width: 640, height: 720,
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
|||||||
return foundry.utils.mergeObject(RdDBaseActorSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDBaseActorSheet.defaultOptions, {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
||||||
width: 640, height: 720,
|
width: 640, height: 720,
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -149,14 +149,13 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async setMessageData(chatMessage, key, flag) {
|
static async setMessageData(chatMessage, key, flag) {
|
||||||
if (flag) {
|
if (flag && chatMessage.isAuthor) {
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, key, JSON.stringify(flag));
|
await chatMessage.setFlag(SYSTEM_RDD, key, flag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getMessageData(chatMessage, key) {
|
static getMessageData(chatMessage, key) {
|
||||||
const json = chatMessage.getFlag(SYSTEM_RDD, key);
|
return chatMessage.getFlag(SYSTEM_RDD, key);
|
||||||
return json ? JSON.parse(json) : undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static getChatMessage(event) {
|
static getChatMessage(event) {
|
||||||
@@ -175,6 +174,8 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async onCreateChatMessage(chatMessage, options, id) {
|
static async onCreateChatMessage(chatMessage, options, id) {
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
if (chatMessage.isAuthor) {
|
||||||
|
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ export class RdDCoeur {
|
|||||||
}
|
}
|
||||||
ChatUtility.removeChatMessageId(infoCoeur.chatMessageId)
|
ChatUtility.removeChatMessageId(infoCoeur.chatMessageId)
|
||||||
|
|
||||||
infoCoeur.target.jetTendre = (await (new Roll('1d6').evaluate({ async: true }))).total
|
infoCoeur.target.jetTendre = (await (new Roll('1d6').evaluate())).total
|
||||||
infoCoeur.source.jetTendre = (await (new Roll('1d6').evaluate({ async: true }))).total
|
infoCoeur.source.jetTendre = (await (new Roll('1d6').evaluate())).total
|
||||||
const diff = Math.abs(infoCoeur.source.jetTendre - infoCoeur.target.jetTendre)
|
const diff = Math.abs(infoCoeur.source.jetTendre - infoCoeur.target.jetTendre)
|
||||||
for (let amoureux of [infoCoeur.source, infoCoeur.target]) {
|
for (let amoureux of [infoCoeur.source, infoCoeur.target]) {
|
||||||
const actorAmoureux = game.actors.get(amoureux.actor.id);
|
const actorAmoureux = game.actors.get(amoureux.actor.id);
|
||||||
|
|||||||
@@ -8,3 +8,46 @@ export const SHOW_DICE = 'show';
|
|||||||
export const ENTITE_INCARNE = 'incarne';
|
export const ENTITE_INCARNE = 'incarne';
|
||||||
export const ENTITE_NONINCARNE = 'nonincarne';
|
export const ENTITE_NONINCARNE = 'nonincarne';
|
||||||
export const ENTITE_BLURETTE = 'blurette';
|
export const ENTITE_BLURETTE = 'blurette';
|
||||||
|
|
||||||
|
export const RDD_CONFIG = {
|
||||||
|
niveauEthylisme : [
|
||||||
|
{value: "1", label: "Aucun"},
|
||||||
|
{value: "0", label: "Eméché (0)"},
|
||||||
|
{value: "-1", label: "Gris (-1)"},
|
||||||
|
{value: "-2", label: "Pinté (-2)"},
|
||||||
|
{value: "-3", label: "Pas Frais (-3)"},
|
||||||
|
{value: "-4", label: "Ivre (-4)"},
|
||||||
|
{value: "-5", label: "Bu (-5)"},
|
||||||
|
{value: "-6", label: "Complètement fait (-6)"},
|
||||||
|
{value: "-7", label: "Ivre mort (-7)"}
|
||||||
|
],
|
||||||
|
categorieEntite: {
|
||||||
|
"cauchemar": "Cauchemar",
|
||||||
|
"reve": "Rêve"
|
||||||
|
},
|
||||||
|
typeEntite: {
|
||||||
|
"incarne": "Incarnée",
|
||||||
|
"nonincarne": "Non Incarnée",
|
||||||
|
"blurette": "Blurette"
|
||||||
|
},
|
||||||
|
heuresRdD : [
|
||||||
|
{value : "vaisseau", label: "Vaisseau", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd01.webp"},
|
||||||
|
{value : "sirene", label: "Sirène", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd02.webp"},
|
||||||
|
{value : "faucon", label: "Faucon", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd03.webp"},
|
||||||
|
{value : "couronne", label: "Couronne", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd04.webp"},
|
||||||
|
{value : "dragon", label: "Dragon", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd05.webp"},
|
||||||
|
{value : "epees", label: "Epées", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd06.webp"},
|
||||||
|
{value : "lyre", label: "Lyre", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd07.webp"},
|
||||||
|
{value : "serpent", label: "Serpent", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd08.webp"},
|
||||||
|
{value : "poissonacrobate", label: "Poisson Acrobate", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd09.webp"},
|
||||||
|
{value : "araignee", label: "Araignée", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd10.webp"},
|
||||||
|
{value : "roseau", label: "Roseau", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd11.webp"},
|
||||||
|
{value : "chateaudormant", label: "Chateau Dormant", img: "modules/foundryvtt-reve-de-dragon/icons/heures/hd12.webp"}
|
||||||
|
],
|
||||||
|
raretes: [
|
||||||
|
{value: "Commune", label: "Commune"},
|
||||||
|
{value: "Frequente", label: "Fréquente"},
|
||||||
|
{value: "Rare", label: "Rare"},
|
||||||
|
{value: "Rarissime", label: "Rarissime"}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -199,7 +199,7 @@ export class RdDItemCompetence extends Item {
|
|||||||
if (idOrName == undefined || idOrName == "") {
|
if (idOrName == undefined || idOrName == "") {
|
||||||
return RdDItemCompetence.sansCompetence();
|
return RdDItemCompetence.sansCompetence();
|
||||||
}
|
}
|
||||||
options = foundry.utils.mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence' }, { overwrite: false });
|
options = foundry.utils.mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence' }, { overwrite: false, inplace: false });
|
||||||
return RdDItemCompetence.findFirstItem(list, idOrName, options);
|
return RdDItemCompetence.findFirstItem(list, idOrName, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
if (categorieAttaque != undefined) {
|
if (categorieAttaque != undefined) {
|
||||||
// si c'est un Item compétence: cloner pour ne pas modifier la compétence
|
// si c'est un Item compétence: cloner pour ne pas modifier la compétence
|
||||||
let arme = item.clone();
|
let arme = item.clone();
|
||||||
foundry.utils.mergeObject(arme,
|
return foundry.utils.mergeObject(arme, {
|
||||||
{
|
|
||||||
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
||||||
system: {
|
system: {
|
||||||
competence: arme.name,
|
competence: arme.name,
|
||||||
@@ -48,8 +47,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
force: 0,
|
force: 0,
|
||||||
rapide: true,
|
rapide: true,
|
||||||
}
|
}
|
||||||
});
|
}, { inplace: false });
|
||||||
return arme;
|
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE),
|
template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE),
|
||||||
width: 550,
|
width: 550,
|
||||||
height: 550
|
height: 550
|
||||||
});
|
}, { inplace: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -108,8 +108,8 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
const competences = await SystemCompendiums.getCompetences('personnage');
|
const competences = await SystemCompendiums.getCompetences('personnage');
|
||||||
formData.categories = this.item.getCategories()
|
formData.categories = this.item.getCategories()
|
||||||
if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') {
|
if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') {
|
||||||
formData.caracList = foundry.utils.duplicate(game.system.model.Actor.personnage.carac)
|
formData.caracList = foundry.utils.duplicate(game.model.Actor.personnage.carac)
|
||||||
formData.caracList["reve-actuel"] = foundry.utils.duplicate(game.system.model.Actor.personnage.reve.reve)
|
formData.caracList["reve-actuel"] = foundry.utils.duplicate(game.model.Actor.personnage.reve.reve)
|
||||||
formData.competences = competences;
|
formData.competences = competences;
|
||||||
}
|
}
|
||||||
if (this.item.type == 'arme') {
|
if (this.item.type == 'arme') {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DialogItemVente } from "./dialog-item-vente.js";
|
import { DialogItemVente } from "./achat-vente/dialog-item-vente.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDHerbes } from "./rdd-herbes.js";
|
import { RdDHerbes } from "./rdd-herbes.js";
|
||||||
@@ -233,7 +233,7 @@ export class RdDItem extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isCompetenceArme() {
|
isCompetenceArme() {
|
||||||
return this.isCompetence() && [ 'melee','tir', 'lancer'].includes(this.system.categorie)
|
return this.isCompetence() && ['melee', 'tir', 'lancer'].includes(this.system.categorie)
|
||||||
}
|
}
|
||||||
|
|
||||||
isCompetencePossession() { return TYPES.competencecreature == this.type && this.system.categorie == "possession" }
|
isCompetencePossession() { return TYPES.competencecreature == this.type && this.system.categorie == "possession" }
|
||||||
@@ -538,7 +538,7 @@ export class RdDItem extends Item {
|
|||||||
_id: this.id,
|
_id: this.id,
|
||||||
'system.quantite': this.system.quantite * sust,
|
'system.quantite': this.system.quantite * sust,
|
||||||
'system.encombrement': Misc.keepDecimals(this.system.encombrement / sust, 2),
|
'system.encombrement': Misc.keepDecimals(this.system.encombrement / sust, 2),
|
||||||
'system.cout': Misc.keepDecimals(this.system.cout / sust, 2),
|
'system.cout': Math.max(0, Misc.keepDecimals(this.system.cout / sust, 2)),
|
||||||
'system.sust': 1
|
'system.sust': 1
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
@@ -621,23 +621,7 @@ export class RdDItem extends Item {
|
|||||||
ui.notifications.warn(`Votre ${this.name} n'est pas vide, pas possible de le proposer`);
|
ui.notifications.warn(`Votre ${this.name} n'est pas vide, pas possible de le proposer`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await DialogItemVente.display({
|
await DialogItemVente.display({ item: this, quantiteMax })
|
||||||
item: this,
|
|
||||||
quantiteMax,
|
|
||||||
callback: async (vente) => {
|
|
||||||
vente["properties"] = this.getProprietes();
|
|
||||||
if (vente.isOwned) {
|
|
||||||
if (vente.quantiteNbLots * vente.tailleLot > vente.quantiteMax) {
|
|
||||||
ui.notifications.warn(`Vous avez ${vente.quantiteMax} ${vente.item.name}, ce n'est pas suffisant pour vendre ${vente.quantiteNbLots} de ${vente.tailleLot}`)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vente.jsondata = JSON.stringify(vente.item);
|
|
||||||
|
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
|
||||||
ChatMessage.create(RdDUtility.chatDataSetup(html));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return foundry.utils.mergeObject(foundry.utils.duplicate(BASE_TACHE_SOIN_BLESSURE), tache)
|
return foundry.utils.mergeObject(BASE_TACHE_SOIN_BLESSURE, tache, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
static async applyFullBlessure(actor, gravite) {
|
static async applyFullBlessure(actor, gravite) {
|
||||||
@@ -48,7 +48,7 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
let lostEndurance = 0
|
let lostEndurance = 0
|
||||||
let lostVie = 0
|
let lostVie = 0
|
||||||
if (definition.endurance) {
|
if (definition.endurance) {
|
||||||
lostEndurance = new Roll(definition.endurance).roll({async: false}).total;
|
lostEndurance = await new Roll(definition.endurance).roll().total;
|
||||||
actor.santeIncDec("endurance", -Number(lostEndurance));
|
actor.santeIncDec("endurance", -Number(lostEndurance));
|
||||||
}
|
}
|
||||||
if (definition.vie) {
|
if (definition.vie) {
|
||||||
@@ -106,12 +106,12 @@ export class RdDItemBlessure extends RdDItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setSoinsBlessure(systemUpdate = {}) {
|
async setSoinsBlessure(systemUpdate = {}) {
|
||||||
systemUpdate = foundry.utils.mergeObject(systemUpdate, this.system, { overwrite: false }),
|
systemUpdate = foundry.utils.mergeObject(systemUpdate, this.system, { overwrite: false })
|
||||||
systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done
|
systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done
|
||||||
await this.update({
|
await this.update({
|
||||||
img: this.getImgSoins(systemUpdate.gravite, systemUpdate.soinscomplets.done),
|
img: this.getImgSoins(systemUpdate.gravite, systemUpdate.soinscomplets.done),
|
||||||
system: systemUpdate
|
system: systemUpdate
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) {
|
async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
|||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, {
|
return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, {
|
||||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }]
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }]
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
setPosition(options = {}) {
|
setPosition(options = {}) {
|
||||||
@@ -23,9 +23,10 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
|||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
const formData = await super.getData();
|
const formData = await super.getData();
|
||||||
return foundry.utils.mergeObject(formData, {
|
foundry.utils.mergeObject(formData, {
|
||||||
milieux: await game.system.rdd.environnement.autresMilieux(this.item)
|
milieux: await game.system.rdd.environnement.autresMilieux(this.item)
|
||||||
});
|
})
|
||||||
|
return formData
|
||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export class RdDRencontreItemSheet extends RdDItemSheet {
|
|||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }]
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }]
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -35,7 +35,7 @@ export class RdDRencontreItemSheet extends RdDItemSheet {
|
|||||||
select: RdDRencontre.mapEffets(this.item.system.echec.effets)
|
select: RdDRencontre.mapEffets(this.item.system.echec.effets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ export class Migrations {
|
|||||||
if (currentVersion.startsWith("v")) {
|
if (currentVersion.startsWith("v")) {
|
||||||
currentVersion = currentVersion.substring(1)
|
currentVersion = currentVersion.substring(1)
|
||||||
}
|
}
|
||||||
if (isNewerVersion(game.system.version, currentVersion)) {
|
if (foundry.utils.isNewerVersion(game.system.version, currentVersion)) {
|
||||||
// if (true) { /* comment previous and uncomment here to test before upgrade */
|
// if (true) { /* comment previous and uncomment here to test before upgrade */
|
||||||
const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion));
|
const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion));
|
||||||
if (migrations.length > 0) {
|
if (migrations.length > 0) {
|
||||||
|
|||||||
@@ -166,15 +166,42 @@ export class Misc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static firstConnectedGM() {
|
static firstConnectedGM() {
|
||||||
return game.users.filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
if (game.users?.activeGM) {
|
||||||
|
return game.users.activeGM
|
||||||
|
}
|
||||||
|
return game.users.sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
||||||
|
}
|
||||||
|
static connectedGMs() {
|
||||||
|
return game.users.filter(u => u.isGM && u.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
static isOwnerPlayer(actor, user = undefined) {
|
/**
|
||||||
return actor.testUserPermission(user ?? game.user, CONST.DOCUMENT_PERMISSION_LEVELS.OWNER)
|
* This helper method allows to get the docuument, for a single user (either first connected GM, or the owner
|
||||||
|
* if there is no connected GMs), or else return undefined.
|
||||||
|
*
|
||||||
|
* This allows for example update hooks that should apply modifications to actors to be called only for one
|
||||||
|
* user (preventing the "User ... lacks permission to update Item" that was occuring on hooks when Item updates
|
||||||
|
* were triggering other changes)
|
||||||
|
*
|
||||||
|
* @param {*} document the Document with is potentially an Actor
|
||||||
|
* @returns the actor if either the game.user is the first connected GM, or if the game.user is the owner
|
||||||
|
* and there is no connected GM
|
||||||
|
*/
|
||||||
|
static documentIfResponsible(document) {
|
||||||
|
if (document instanceof Document) {
|
||||||
|
if (Misc.isUniqueConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
|
||||||
|
return document
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
static isOwnerPlayerOrUniqueConnectedGM(actor, user = undefined) {
|
static isOwnerPlayer(actor) {
|
||||||
return Misc.isOwnerPlayer(actor, user) ?? Misc.isUniqueConnectedGM();
|
return actor.testUserPermission(game.user, CONST.DOCUMENT_PERMISSION_LEVELS.OWNER)
|
||||||
|
}
|
||||||
|
|
||||||
|
static isOwnerPlayerOrUniqueConnectedGM(actor) {
|
||||||
|
return Misc.isOwnerPlayer(actor) ?? Misc.isUniqueConnectedGM();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export class RdDCombatManager extends Combat {
|
|||||||
//console.log("Combatat", c);
|
//console.log("Combatat", c);
|
||||||
const roll = combatant.getInitiativeRoll(rollFormula);
|
const roll = combatant.getInitiativeRoll(rollFormula);
|
||||||
if (!roll.total) {
|
if (!roll.total) {
|
||||||
roll.evaluate({ async: false });
|
await roll.evaluate();
|
||||||
}
|
}
|
||||||
const total = Math.max(roll.total, 0.00);
|
const total = Math.max(roll.total, 0.00);
|
||||||
console.log("Compute init for", rollFormula, roll, total, combatant);
|
console.log("Compute init for", rollFormula, roll, total, combatant);
|
||||||
@@ -128,21 +128,17 @@ export class RdDCombatManager extends Combat {
|
|||||||
|
|
||||||
// Send a chat message
|
// Send a chat message
|
||||||
let rollMode = messageOptions.rollMode || game.settings.get("core", "rollMode");
|
let rollMode = messageOptions.rollMode || game.settings.get("core", "rollMode");
|
||||||
let messageData = foundry.utils.mergeObject(
|
let messageData = foundry.utils.mergeObject({
|
||||||
{
|
speaker: {
|
||||||
speaker: {
|
scene: canvas.scene._id,
|
||||||
scene: canvas.scene._id,
|
actor: combatant.actor?._id,
|
||||||
actor: combatant.actor?._id,
|
token: combatant.token._id,
|
||||||
token: combatant.token._id,
|
alias: combatant.token.name,
|
||||||
alias: combatant.token.name,
|
sound: CONFIG.sounds.dice,
|
||||||
sound: CONFIG.sounds.dice,
|
|
||||||
},
|
|
||||||
flavor: `${combatant.token.name} a fait son jet d'Initiative (${messageOptions.initInfo})
|
|
||||||
<br>
|
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
messageOptions
|
flavor: `${combatant.token.name} a fait son jet d'Initiative (${messageOptions.initInfo})<br>`,
|
||||||
);
|
},
|
||||||
|
messageOptions);
|
||||||
roll.toMessage(messageData, { rollMode, create: true });
|
roll.toMessage(messageData, { rollMode, create: true });
|
||||||
|
|
||||||
RdDCombatManager.processPremierRoundInit();
|
RdDCombatManager.processPremierRoundInit();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export class RdDConfirm {
|
|||||||
buttons = foundry.utils.mergeObject(RdDConfirm._createButtonActionSave(options), buttons);
|
buttons = foundry.utils.mergeObject(RdDConfirm._createButtonActionSave(options), buttons);
|
||||||
}
|
}
|
||||||
if (autresActions) {
|
if (autresActions) {
|
||||||
buttons = foundry.utils.mergeObject(autresActions, buttons);
|
buttons = foundry.utils.mergeObject(autresActions, buttons, { inplace: false });
|
||||||
}
|
}
|
||||||
const dialogDetails = {
|
const dialogDetails = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ export class RdDDice {
|
|||||||
|
|
||||||
static async roll(formula, options = { showDice: SHOW_DICE, rollMode: undefined }) {
|
static async roll(formula, options = { showDice: SHOW_DICE, rollMode: undefined }) {
|
||||||
const roll = new Roll(RdDDice._formulaOrFake(formula, options));
|
const roll = new Roll(RdDDice._formulaOrFake(formula, options));
|
||||||
await roll.evaluate({ async: true });
|
await roll.evaluate();
|
||||||
await this.showDiceSoNice(roll, options);
|
await this.showDiceSoNice(roll, options);
|
||||||
return roll;
|
return roll;
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ export class RdDDice {
|
|||||||
|
|
||||||
static async fakeD10(faces) {
|
static async fakeD10(faces) {
|
||||||
let roll = new Roll(`1d${faces}`);
|
let roll = new Roll(`1d${faces}`);
|
||||||
await roll.evaluate({ async: true });
|
await roll.evaluate();
|
||||||
return roll.total;
|
return roll.total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
import { SYSTEM_RDD, SYSTEM_SOCKET_ID, RDD_CONFIG } from "./constants.js";
|
||||||
import { Migrations } from './migrations.js';
|
import { Migrations } from './migrations.js';
|
||||||
|
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
@@ -108,7 +108,8 @@ export class SystemReveDeDragon {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async onInit() {
|
async onInit() {
|
||||||
game.system.rdd = this;
|
game.system.rdd = this;
|
||||||
this.AppAstrologie = AppAstrologie;
|
game.system.rdd.config = RDD_CONFIG;
|
||||||
|
this.AppAstrologie = AppAstrologie;
|
||||||
|
|
||||||
|
|
||||||
console.log(`Initializing Reve de Dragon System`);
|
console.log(`Initializing Reve de Dragon System`);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const temperatures = [
|
|||||||
export class RdDMeteo {
|
export class RdDMeteo {
|
||||||
static async getForce() {
|
static async getForce() {
|
||||||
const roll = new Roll(`1dr`);
|
const roll = new Roll(`1dr`);
|
||||||
await roll.evaluate({ async: true });
|
await roll.evaluate();
|
||||||
return roll.total;
|
return roll.total;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,14 +67,14 @@ export class RdDMeteo {
|
|||||||
static async getTemperature() {
|
static async getTemperature() {
|
||||||
const degre = await RdDMeteo.getForce();
|
const degre = await RdDMeteo.getForce();
|
||||||
const rollChaudFroid = new Roll('1d2');
|
const rollChaudFroid = new Roll('1d2');
|
||||||
await rollChaudFroid.evaluate({ async: true });
|
await rollChaudFroid.evaluate();
|
||||||
const chaudFroid = rollChaudFroid.total == 1;
|
const chaudFroid = rollChaudFroid.total == 1;
|
||||||
return chaudFroid.total ? degre : -degre;
|
return chaudFroid.total ? degre : -degre;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async getDirection(direction) {
|
static async getDirection(direction) {
|
||||||
const roll = new Roll(`1d16`);
|
const roll = new Roll(`1d16`);
|
||||||
await roll.evaluate({ async: true });
|
await roll.evaluate();
|
||||||
switch (roll.total % 16) {
|
switch (roll.total % 16) {
|
||||||
case 0: return 'Nord';
|
case 0: return 'Nord';
|
||||||
case 1: return 'Nord Nord Est';
|
case 1: return 'Nord Nord Est';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { RdDCombat } from "./rdd-combat.js";
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { TMRUtility } from "./tmr-utility.js";
|
import { TMRUtility } from "./tmr-utility.js";
|
||||||
import { DialogItemAchat } from "./dialog-item-achat.js";
|
import { DialogItemAchat } from "./achat-vente/dialog-item-achat.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
import { RdDDice } from "./rdd-dice.js";
|
import { RdDDice } from "./rdd-dice.js";
|
||||||
import { RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
@@ -300,6 +300,14 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('plusMoins', diff => (diff > 0 ? '+' : '') + Math.round(diff))
|
Handlebars.registerHelper('plusMoins', diff => (diff > 0 ? '+' : '') + Math.round(diff))
|
||||||
Handlebars.registerHelper('experienceLog-topic', topic => ExperienceLog.labelTopic(topic));
|
Handlebars.registerHelper('experienceLog-topic', topic => ExperienceLog.labelTopic(topic));
|
||||||
|
|
||||||
|
// Handle v12 removal of this helper
|
||||||
|
Handlebars.registerHelper('select', function (selected, options) {
|
||||||
|
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected));
|
||||||
|
const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']');
|
||||||
|
const html = options.fn(this);
|
||||||
|
return html.replace(rgx, "$& selected");
|
||||||
|
});
|
||||||
|
|
||||||
return loadTemplates(templatePaths);
|
return loadTemplates(templatePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,7 +632,7 @@ export class RdDUtility {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async _evaluatePerte(formula, over20) {
|
static async _evaluatePerte(formula, over20) {
|
||||||
let perte = new Roll(formula, { over20: over20 });
|
let perte = new Roll(formula, { over20: over20 });
|
||||||
await perte.evaluate({ async: true });
|
await perte.evaluate();
|
||||||
return perte.total;
|
return perte.total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,7 @@ export class ReglesOptionnelles extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
const options = super.defaultOptions;
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
foundry.utils.mergeObject(options, {
|
|
||||||
id: "regles-optionnelles",
|
id: "regles-optionnelles",
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/settings/regles-optionnelles.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/settings/regles-optionnelles.html",
|
||||||
height: 650,
|
height: 650,
|
||||||
@@ -80,8 +79,7 @@ export class ReglesOptionnelles extends FormApplication {
|
|||||||
minimizable: false,
|
minimizable: false,
|
||||||
closeOnSubmit: true,
|
closeOnSubmit: true,
|
||||||
title: "Règles optionnelles"
|
title: "Règles optionnelles"
|
||||||
});
|
}, { inplace: false })
|
||||||
return options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getData() {
|
getData() {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export class SystemCompendiums extends FormApplication {
|
|||||||
|
|
||||||
getData() {
|
getData() {
|
||||||
const systemCompendiums = Object.values(CONFIGURABLE_COMPENDIUMS)
|
const systemCompendiums = Object.values(CONFIGURABLE_COMPENDIUMS)
|
||||||
.map(it => foundry.utils.mergeObject(it, { value: SystemCompendiums.getCompendium(it.compendium) }));
|
.map(it => foundry.utils.mergeObject(it, { value: SystemCompendiums.getCompendium(it.compendium) }, { inplace: false }))
|
||||||
const availableCompendiums = game.packs.map(pack => {
|
const availableCompendiums = game.packs.map(pack => {
|
||||||
return {
|
return {
|
||||||
name: pack.collection,
|
name: pack.collection,
|
||||||
@@ -163,7 +163,7 @@ export class SystemCompendiums extends FormApplication {
|
|||||||
return foundry.utils.mergeObject(super.getData(), {
|
return foundry.utils.mergeObject(super.getData(), {
|
||||||
systemCompendiums: systemCompendiums,
|
systemCompendiums: systemCompendiums,
|
||||||
availableCompendiums: availableCompendiums
|
availableCompendiums: availableCompendiums
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class AppAstrologie extends Application {
|
|||||||
classes: ['calendar-astrologie'],
|
classes: ['calendar-astrologie'],
|
||||||
popOut: true,
|
popOut: true,
|
||||||
resizable: false
|
resizable: false
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(actor, options = {}) {
|
constructor(actor, options = {}) {
|
||||||
@@ -49,7 +49,7 @@ export class AppAstrologie extends Application {
|
|||||||
signeNaissance: RdDTimestamp.definition(0)
|
signeNaissance: RdDTimestamp.definition(0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return this.appData;
|
return this.appData
|
||||||
}
|
}
|
||||||
|
|
||||||
getActorAstrologie() {
|
getActorAstrologie() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class AutoAdjustDarkness {
|
|||||||
static async adjust(darkness) {
|
static async adjust(darkness) {
|
||||||
if (AutoAdjustDarkness.isAuto()) {
|
if (AutoAdjustDarkness.isAuto()) {
|
||||||
const scene = game.scenes.viewed;
|
const scene = game.scenes.viewed;
|
||||||
if (scene?.globalLight && scene?.tokenVision) {
|
if (scene?.environment?.globalLight?.enabled && scene?.tokenVision) {
|
||||||
await scene.update({ darkness });
|
await scene.update({ darkness });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export class RdDCalendrier extends Application {
|
|||||||
resizable: false,
|
resizable: false,
|
||||||
width: 'fit-content',
|
width: 'fit-content',
|
||||||
height: 'fit-content',
|
height: 'fit-content',
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export class FenetreRechercheTirage extends Application {
|
|||||||
popOut: true,
|
popOut: true,
|
||||||
dragDrop: [{ dragSelector: "a.content-link" }],
|
dragDrop: [{ dragSelector: "a.content-link" }],
|
||||||
resizable: true
|
resizable: true
|
||||||
});
|
}, { inplace: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
static async create() {
|
static async create() {
|
||||||
|
|||||||
@@ -142,18 +142,19 @@ export class DialogFatigueVoyage extends Dialog {
|
|||||||
it => this.$extractActor(this.html.find(it))
|
it => this.$extractActor(this.html.find(it))
|
||||||
)
|
)
|
||||||
actors.filter(it => it.selected)
|
actors.filter(it => it.selected)
|
||||||
.forEach(async it => {
|
.forEach(async it => {
|
||||||
const perteFatigue = fatigueBase + it.ajustement
|
const perteFatigue = fatigueBase + it.ajustement
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(it.actor.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(it.actor.name),
|
||||||
content: await renderTemplate(
|
content: await renderTemplate(
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/voyage/chat-fatigue_voyage.hbs', foundry.utils.mergeObject(it,
|
'systems/foundryvtt-reve-de-dragon/templates/voyage/chat-fatigue_voyage.hbs',
|
||||||
|
foundry.utils.mergeObject(it,
|
||||||
{
|
{
|
||||||
parameters: this.parameters,
|
parameters: this.parameters,
|
||||||
fatigueBase: fatigueBase,
|
fatigueBase: fatigueBase,
|
||||||
perteFatigue: perteFatigue,
|
perteFatigue: perteFatigue,
|
||||||
isVoyage: fatigueBase == this.parameters.nombreHeures * this.parameters.fatigueHoraire
|
isVoyage: fatigueBase == this.parameters.nombreHeures * this.parameters.fatigueHoraire
|
||||||
})
|
}, { inplace: false })
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
await it.actor.santeIncDec("fatigue", perteFatigue)
|
await it.actor.santeIncDec("fatigue", perteFatigue)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"id": "foundryvtt-reve-de-dragon",
|
"id": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"version": "11.2.20",
|
"version": "12.0.1",
|
||||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.2.20.zip",
|
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.1.zip",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
|
||||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "11",
|
"minimum": "11",
|
||||||
"verified": "11"
|
"verified": "12"
|
||||||
},
|
},
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|||||||
@@ -55,9 +55,7 @@
|
|||||||
<li class="caracteristique flexrow list-item" data-tooltip="Niveau d'éthylisme">
|
<li class="caracteristique flexrow list-item" data-tooltip="Niveau d'éthylisme">
|
||||||
<label class="derivee-label" for="system.compteurs.ethylisme.value">{{system.compteurs.ethylisme.label}}</label>
|
<label class="derivee-label" for="system.compteurs.ethylisme.value">{{system.compteurs.ethylisme.label}}</label>
|
||||||
<select class="derivee-value" name="system.compteurs.ethylisme.value" data-dtype="Number">
|
<select class="derivee-value" name="system.compteurs.ethylisme.value" data-dtype="Number">
|
||||||
{{#select system.compteurs.ethylisme.value}}
|
{{selectOptions @root.config.niveauEthylisme selected=system.compteurs.ethylisme.value valueAttr="value" nameAttr="value" labelAttr="label"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-niveau-ethylisme.html"}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,13 @@
|
|||||||
<li class="caracteristique flexrow list-item">
|
<li class="caracteristique flexrow list-item">
|
||||||
<span class="carac-label" name="catEntite">Catégorie : </span>
|
<span class="carac-label" name="catEntite">Catégorie : </span>
|
||||||
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
||||||
{{#select system.definition.categorieentite}}
|
{{selectOptions @root.config.categorieEntite selected=system.definition.categorieentite}}
|
||||||
<option value="cauchemar">Cauchemar</option>
|
|
||||||
<option value="reve">Rêve</option>
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li class="caracteristique flexrow list-item">
|
<li class="caracteristique flexrow list-item">
|
||||||
<span class="carac-label" name="typeEntite">Type d'entité : </span>
|
<span class="carac-label" name="typeEntite">Type d'entité : </span>
|
||||||
<select name="system.definition.typeentite" value="{{system.definition.typeentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
<select name="system.definition.typeentite" value="{{system.definition.typeentite}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}>
|
||||||
{{#select system.definition.typeentite}}
|
{{selectOptions @root.config.typeEntite selected=system.definition.typeentite}}
|
||||||
<option value="incarne">Incarnée</option>
|
|
||||||
<option value="nonincarne">Non Incarnée</option>
|
|
||||||
<option value="blurette">Blurette</option>
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
{{#each system.attributs as |attr key|}}
|
{{#each system.attributs as |attr key|}}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{{#if effects}}
|
{{#if effects}}
|
||||||
{{#each effects as |effect key|}}
|
{{#each effects as |effect key|}}
|
||||||
<span class="active-effect" data-effect="{{effect.id}}">
|
<span class="active-effect" data-effect="{{effect.id}}">
|
||||||
<img class="button-effect-img {{#if @root.options.isGM}}delete-active-effect{{/if}}" src="{{effect.icon}}" data-tooltip="{{localize effect.name}}" width="24" height="24" />
|
<img class="button-effect-img {{#if @root.options.isGM}}delete-active-effect{{/if}}" src="{{effect.img}}" data-tooltip="{{localize effect.name}}" width="24" height="24" />
|
||||||
</span>
|
</span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#if calc.surprise}}<span>{{calc.surprise}}!</span>{{/if}}
|
{{#if calc.surprise}}<span>{{calc.surprise}}!</span>{{/if}}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{log 'chat-vente-item' this}}
|
||||||
<div class="post-item" data-transfer="{{transfer}}">
|
<div class="post-item" data-transfer="{{transfer}}">
|
||||||
<h3>{{#if alias}}{{alias}} propose: {{else}}Acheter {{/if}}{{item.name}}</h3>
|
<h3>{{#if alias}}{{alias}} propose: {{else}}Acheter {{/if}}{{item.name}}</h3>
|
||||||
{{#if item.img}}
|
{{#if item.img}}
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<p>
|
<p>
|
||||||
{{#unless quantiteIllimite}}
|
{{#unless quantiteIllimite}}
|
||||||
<span>Lots disponibles: <span class="quantiteNbLots">{{quantiteNbLots}}</span></span><br>
|
<span>Lots disponibles: {{nbLots}}</span><br>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{#if (gt tailleLot 1)}}
|
{{#if (gt tailleLot 1)}}
|
||||||
<span>Lots de: <span class="tailleLot">{{tailleLot}}</span></span><br>
|
<span>Lots de: <span class="tailleLot">{{tailleLot}}</span></span><br>
|
||||||
@@ -22,15 +23,9 @@
|
|||||||
<span class="prixLot">{{numberFormat prixLot decimals=2 sign=false}}</span> Sols</strong></span><br>
|
<span class="prixLot">{{numberFormat prixLot decimals=2 sign=false}}</span> Sols</strong></span><br>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
{{#if (or (gt quantiteNbLots 0) quantiteIllimite)}}
|
{{#if (or (gt nbLots 0) quantiteIllimite)}}
|
||||||
<span class="chat-card-button-area">
|
<span class="chat-card-button-area">
|
||||||
<a class="button-acheter chat-card-button"
|
<a class="button-acheter chat-card-button">
|
||||||
data-jsondata='{{jsondata}}'
|
|
||||||
{{#if vendeurId}}data-vendeurId='{{vendeurId}}'{{/if}}
|
|
||||||
data-tailleLot="{{tailleLot}}"
|
|
||||||
data-quantiteNbLots="{{quantiteNbLots}}"
|
|
||||||
data-quantiteIllimite="{{#if quantiteIllimite}}true{{else}}false{{/if}}"
|
|
||||||
data-prixLot="{{prixLot}}">
|
|
||||||
{{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}}</a>
|
{{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}}</a>
|
||||||
</span>
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
<span draggable="true">
|
<span draggable="true">
|
||||||
{{#if pack}}
|
<a class="{{#if pack}}content-link{{else}}rdd-world-content-link{{/if}}"
|
||||||
{{!-- draggable="true" --}}
|
data-id="{{id}}"
|
||||||
<a class="content-link"
|
data-link=""
|
||||||
|
{{#if doctype}}
|
||||||
|
data-doctype="{{doctype}}"
|
||||||
|
data-type="{{doctype}}"
|
||||||
|
{{/if}}
|
||||||
|
{{#if pack}}
|
||||||
|
data-pack="{{pack}}"
|
||||||
data-uuid="Compendium.{{pack}}.{{id}}"
|
data-uuid="Compendium.{{pack}}.{{id}}"
|
||||||
data-pack="{{pack}}"
|
{{/if}} >
|
||||||
{{#if doctype}}data-doctype="{{doctype}}"{{/if}}
|
{{#if img}}
|
||||||
data-id="{{id}}"
|
<img class="in-text-img" src="{{img}}" data-tooltip="{{name}}" />
|
||||||
>
|
{{else}}
|
||||||
{{else}}
|
<i class="fas fa-suitcase"></i>
|
||||||
<a class="rdd-world-content-link"
|
{{/if}}
|
||||||
{{#if doctype}}data-doctype="{{doctype}}"{{/if}}
|
{{name}}
|
||||||
data-id="{{id}}"
|
</a>
|
||||||
>
|
|
||||||
{{/if}}
|
|
||||||
{{#if img}}
|
|
||||||
<img class="in-text-img" src="{{img}}" data-tooltip="{{name}}" />
|
|
||||||
{{else}}
|
|
||||||
<i class="fas fa-suitcase"></i>
|
|
||||||
{{/if}}
|
|
||||||
{{name}}</a>
|
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<input type="number" name="{{path}}.nombre" value="{{nombre}}" data-dtype="Number"/>
|
<input type="number" name="{{path}}.nombre" value="{{nombre}}" data-dtype="Number"/>
|
||||||
<select name="{{path}}.unite" data-dtype="String" >
|
<select name="{{path}}.unite" data-dtype="String" >
|
||||||
{{#select unite}}
|
{{selectOptions (timestamp-formulesPeriode) selected=unite labelAttr="label" nameAttr="code" valueAttr="code"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-periode.html"}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
type="number" data-dtype="Number" min="1" max="28"
|
type="number" data-dtype="Number" min="1" max="28"
|
||||||
name="{{path}}.jourDuMois" value="{{jourDuMois}}" />
|
name="{{path}}.jourDuMois" value="{{jourDuMois}}" />
|
||||||
<select {{#if disabled}}{{disabled}}{{/if}} name="{{path}}.mois" class="calendar-signe-heure" data-dtype="String">
|
<select {{#if disabled}}{{disabled}}{{/if}} name="{{path}}.mois" class="calendar-signe-heure" data-dtype="String">
|
||||||
{{#select mois.key}}
|
{{select config.heuresRdD selected=mois.key labelAttr="label" nameAttr="value" valueAttr="value"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
{{timestamp-imgSigne mois}}
|
{{timestamp-imgSigne mois}}
|
||||||
<input {{#if disabled}}{{disabled}}{{/if}} type="number" class="number-x2" name="{{path}}.annee" value="{{annee}}" data-dtype="Number"/>
|
<input {{#if disabled}}{{disabled}}{{/if}} type="number" class="number-x2" name="{{path}}.annee" value="{{annee}}" data-dtype="Number"/>
|
||||||
@@ -17,9 +15,7 @@
|
|||||||
<label></label>
|
<label></label>
|
||||||
<label>heure</label>
|
<label>heure</label>
|
||||||
<select {{#if disabled}}{{disabled}}{{/if}} name="{{path}}.heure" class="calendar-signe-heure" data-dtype="String">
|
<select {{#if disabled}}{{disabled}}{{/if}} name="{{path}}.heure" class="calendar-signe-heure" data-dtype="String">
|
||||||
{{#select heure.key}}
|
{{select config.heuresRdD selected=heure.key labelAttr="label" nameAttr="value" valueAttr="value"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
{{timestamp-imgSigne heure}}
|
{{timestamp-imgSigne heure}}
|
||||||
<input {{#if disabled}}{{disabled}}{{/if}} type="number" class="number-x2" name="{{path}}.minute" value="{{minute}}" data-dtype="Number"/>
|
<input {{#if disabled}}{{disabled}}{{/if}} type="number" class="number-x2" name="{{path}}.minute" value="{{minute}}" data-dtype="Number"/>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<label>{{#if quantiteIllimite}}
|
<label>{{#if quantiteIllimite}}
|
||||||
pas de limite
|
pas de limite
|
||||||
{{else}}
|
{{else}}
|
||||||
{{quantiteNbLots}}
|
{{nbLots}}
|
||||||
{{/if}}</label>
|
{{/if}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow flex-group-left">
|
<div class="flexrow flex-group-left">
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<input name="nombreLots" class="nombreLots flex-shrink number-x2" type="number" min="1"
|
<input name="nombreLots" class="nombreLots flex-shrink number-x2" type="number" min="1"
|
||||||
{{#unless quantiteIllimite}} max="{{quantiteNbLots}}" {{/unless}}
|
{{#unless quantiteIllimite}} max="{{nbLots}}" {{/unless}}
|
||||||
value="{{choix.nombreLots}}"
|
value="{{choix.nombreLots}}"
|
||||||
data-dtype="Number" />
|
data-dtype="Number" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
quantiteIllimite}}checked{{/if}} />
|
quantiteIllimite}}checked{{/if}} />
|
||||||
<label class="label-quantiteIllimite flex-shrink">disponibles</label>
|
<label class="label-quantiteIllimite flex-shrink">disponibles</label>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
<input name="quantiteNbLots" class="quantiteNbLots flex-shrink number-x2" type="number" min="1"
|
<input name="nbLots" class="nbLots flex-shrink number-x2" type="number" min="1"
|
||||||
max="{{quantiteMaxLots}}" value="{{quantiteNbLots}}" data-dtype="Number" />
|
max="{{maxLots}}" value="{{nbLots}}" data-dtype="Number" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexrow flex-group-left">
|
<div class="flexrow flex-group-left">
|
||||||
|
|||||||
@@ -26,9 +26,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<span class="flexrow">
|
<span class="flexrow">
|
||||||
<select name="milieu-{{key}}-rarete" class="environnement-rarete flex-shrink" data-dtype="String">
|
<select name="milieu-{{key}}-rarete" class="environnement-rarete flex-shrink" data-dtype="String">
|
||||||
{{#select env.rarete}}
|
{{selectOptions config.rarete selected=env.rarete labelAttr="label" valueAttr="value" nameAttr="value"}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html"}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
{{rangePicker name="milieu-{{key}}-frequence" value=env.frequence min=(rarete-getChamp env.rarete 'min') max=(rarete-getChamp env.rarete 'max') step=1}}
|
{{rangePicker name="milieu-{{key}}-frequence" value=env.frequence min=(rarete-getChamp env.rarete 'min') max=(rarete-getChamp env.rarete 'max') step=1}}
|
||||||
<label>[{{rarete-getChamp env.rarete 'min'}}-{{rarete-getChamp env.rarete 'max'}}]</label>
|
<label>[{{rarete-getChamp env.rarete 'min'}}-{{rarete-getChamp env.rarete 'max'}}]</label>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
<input class="resource-content select-effect" type="checkbox" name="{{effect.id}}" {{#if effect.active}}checked{{/if}}/>
|
<input class="resource-content select-effect" type="checkbox" name="{{effect.id}}" {{#if effect.active}}checked{{/if}}/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<img class="button-effect-img" height="16" width="16" src="{{effect.icon}}" data-tooltip="{{localize effect.name}}" />
|
<img class="button-effect-img" height="16" width="16" src="{{effect.img}}" data-tooltip="{{localize effect.name}}" />
|
||||||
<label>{{localize effect.name}}</label>
|
<label>{{localize effect.name}}</label>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{{#each systemCompendiums as |definition key|}}
|
{{#each systemCompendiums as |definition key|}}
|
||||||
<li class="flexrow">
|
<li class="flexrow">
|
||||||
<label>{{definition.label}}</label>
|
<label>{{definition.label}}</label>
|
||||||
<select data-dtype="String" class="system-compendium-setting flex-grow-2" data-compendium="{{definition.compendium}}" >
|
<select data-dtype="String" class="system-compendium-setting flex-grow-2" data-compendium="{{definition.compendium}}" >
|
||||||
{{#select definition.value}}
|
{{#select definition.value}}
|
||||||
{{#each @root.availableCompendiums as |available key|}}
|
{{#each @root.availableCompendiums as |available key|}}
|
||||||
{{#if (eq available.type definition.type)}}
|
{{#if (eq available.type definition.type)}}
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<label>Conditions</label>
|
<label>Conditions</label>
|
||||||
<select name="diffConditions" data-dtype="Number">
|
<select name="diffConditions" data-dtype="Number">
|
||||||
{{#select '0'}}
|
{{selectOptions actorAstrologie.ajustements selected='0'}}
|
||||||
{{#each actorAstrologie.ajustements as |ajustement|}}
|
|
||||||
<option value={{ajustement}}>{{ajustement}}</option>
|
|
||||||
{{/each}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
<label> Jours</label>
|
<label> Jours</label>
|
||||||
<select name="joursAstrologie" data-dtype="Number">
|
<select name="joursAstrologie" data-dtype="Number">
|
||||||
{{#select ''}}
|
{{selectOptions dates selected='' labelAttr='label' valueAttr='index' nameAttr='index'}}
|
||||||
{{#each dates as |date|}}
|
|
||||||
<option value={{date.index}}>{{date.label}}</option>
|
|
||||||
{{/each}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
</select>
|
||||||
<label>
|
<label>
|
||||||
Etat Général: {{actorAstrologie.etat}}
|
Etat Général: {{actorAstrologie.etat}}
|
||||||
|
|||||||
Reference in New Issue
Block a user