Merge pull request 'Version 10.0.30' (#567) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: #567
This commit is contained in:
commit
484f02277b
@ -393,7 +393,7 @@ export class RdDActor extends Actor {
|
||||
potionImg: potion.img
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, messageData)
|
||||
});
|
||||
}
|
||||
@ -801,7 +801,7 @@ export class RdDActor extends Actor {
|
||||
rollData.poesie = await Poetique.getExtrait();
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.html`, rollData)
|
||||
});
|
||||
}
|
||||
@ -946,7 +946,7 @@ export class RdDActor extends Actor {
|
||||
message += "<br>" + troncName;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name),
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name),
|
||||
content: message
|
||||
});
|
||||
}
|
||||
@ -1426,9 +1426,21 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async actionRefoulement(item) {
|
||||
const refoulement = item?.system.refoulement ?? 0;
|
||||
if (refoulement>0){
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
if (refoulement>0) {
|
||||
RdDConfirm.confirmer({
|
||||
settingConfirmer: "confirmation-refouler",
|
||||
content: `<p>Prennez-vous le risque de refouler ${item.name} pour ${refoulement} points de refoulement ?</p>`,
|
||||
title: 'Confirmer la refoulement',
|
||||
buttonLabel: 'Refouler',
|
||||
onAction: async () => {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${this.name} a refoulé une queue ${item.nname} pour ${refoulement} points de refoulement`
|
||||
});
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1451,7 +1463,7 @@ export class RdDActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', [souffle]);
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: this.name + " subit un Souffle de Dragon : " + souffle.name
|
||||
});
|
||||
}
|
||||
@ -1471,7 +1483,7 @@ export class RdDActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', [queue]);
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: this.name + " subit une Queue de Dragon : " + queue.name
|
||||
});
|
||||
}
|
||||
@ -1509,7 +1521,7 @@ export class RdDActor extends Actor {
|
||||
let tmr = await TMRUtility.getTMRAleatoire(tmr => accessible(tmr) && !innaccessible.includes(tmr.coord));
|
||||
ChatMessage.create({
|
||||
content: `${raison} : ré-insertion aléatoire.`,
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name)
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name)
|
||||
});
|
||||
await this.forcerPositionTMRInconnue(tmr);
|
||||
return tmr;
|
||||
@ -1679,7 +1691,7 @@ export class RdDActor extends Actor {
|
||||
const result = await this._jetEndurance(this.system.sante.endurance.value)
|
||||
const message = {
|
||||
content: "Jet d'Endurance : " + result.roll.total + " / " + endurance + "<br>",
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
};
|
||||
if (result.sonne) {
|
||||
message.content += `${this.name} a échoué son Jet d'Endurance et devient Sonné`;
|
||||
@ -1729,7 +1741,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
const message = {
|
||||
content: msgText,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
};
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
@ -1838,7 +1850,7 @@ export class RdDActor extends Actor {
|
||||
const jetMoral = await this._jetDeMoral(situation);
|
||||
const finMessage = (jetMoral.succes ? messageReussi : messageManque) ?? (jetMoral.ajustement == 0 ? "Vous gardez votre moral" : jetMoral.ajustement > 0 ? "Vous gagnez du moral" : "Vous perdez du moral");
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${finMessage} - jet ${jetMoral.succes ? "réussi" : "manqué"} en situation ${situation} (${jetMoral.jet}/${jetMoral.difficulte}).`
|
||||
});
|
||||
return jetMoral.ajustement;
|
||||
@ -2133,7 +2145,7 @@ export class RdDActor extends Actor {
|
||||
};
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.html`, stressRollData)
|
||||
});
|
||||
|
||||
@ -2384,7 +2396,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
ChatMessage.create({
|
||||
content: "Vous êtes sous le coup d'une Mauvaise Rencontre en Persective." + addMsg,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return rencSpecial;
|
||||
@ -2396,7 +2408,7 @@ export class RdDActor extends Actor {
|
||||
if (countInertieDraconique > 0) {
|
||||
ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'Inertie Draconique : vous perdrez ${countInertieDraconique + 1} cases de Fatigue par déplacement au lieu d'une.`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return countInertieDraconique + 1;
|
||||
@ -2408,7 +2420,7 @@ export class RdDActor extends Actor {
|
||||
await this.reveActuelIncDec(-1);
|
||||
ChatMessage.create({
|
||||
content: "Vous êtes sous le coup d'un Péage : l'entrée sur cette case vous a coûté 1 Point de Rêve (déduit automatiquement).",
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -3015,7 +3027,7 @@ export class RdDActor extends Actor {
|
||||
// Cas de désir lancinant, pas d'expérience sur particulière
|
||||
ChatMessage.create({
|
||||
content: `Vous souffrez au moins d'un Désir Lancinant, vous ne pouvez pas gagner d'expérience sur une Particulière tant que le désir n'est pas assouvi`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
@ -3145,7 +3157,7 @@ export class RdDActor extends Actor {
|
||||
if (countMonteeLaborieuse > 0) {
|
||||
ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'une Montée Laborieuse : vos montées en TMR coûtent ${countMonteeLaborieuse} Point de Rêve de plus.`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return countMonteeLaborieuse;
|
||||
@ -3185,7 +3197,7 @@ export class RdDActor extends Actor {
|
||||
if (this.getReveActuel() < minReveValue) {
|
||||
ChatMessage.create({
|
||||
content: `Vous n'avez les ${minReveValue} Points de Reve nécessaires pour monter dans les Terres Médianes`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -3703,7 +3715,7 @@ export class RdDActor extends Actor {
|
||||
system: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
}
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat);
|
||||
if (achat.choix.consommer && vente.item.type == 'nourritureboisson') {
|
||||
achat.choix.doses = achat.choix.nombreLots;
|
||||
await acheteur.consommerNourritureboisson(items[0], achat.choix);
|
||||
@ -3931,7 +3943,7 @@ export class RdDActor extends Actor {
|
||||
this.bonusRecuperationPotion = potionData.system.herbeBonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.html`, potionData)
|
||||
});
|
||||
}
|
||||
@ -3964,7 +3976,7 @@ export class RdDActor extends Actor {
|
||||
this.bonusRepos = potionData.system.herbeBonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.html`, potionData)
|
||||
});
|
||||
}
|
||||
@ -4002,7 +4014,7 @@ export class RdDActor extends Actor {
|
||||
this.diminuerQuantiteObjet(herbeData._id, herbeData.nbBrins);
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.html`, messageData)
|
||||
});
|
||||
}
|
||||
@ -4027,7 +4039,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.html`, potionData)
|
||||
});
|
||||
}
|
||||
@ -4162,7 +4174,7 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
notifyGestionTeteSouffleQueue(item, manualMessage = true) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${this.name} a reçu un/une ${item.type}: ${item.name}, qui ${manualMessage ? "n'est pas" : "est"} géré(e) automatiquement. ${manualMessage ? manualMessage : ''}`
|
||||
});
|
||||
}
|
||||
|
@ -250,9 +250,9 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
_updateObject(event, formData) { // Deprecated en v0.8 à clarifier
|
||||
_updateObject(event, formData) {
|
||||
// Données de bonus de cases ?
|
||||
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
|
||||
formData['system.bonuscase'] = RdDItemSort.buildBonusCaseStringFromFormData(formData.bonusValue, formData.caseValue);
|
||||
|
||||
return this.item.update(formData);
|
||||
}
|
||||
|
@ -63,26 +63,21 @@ export class RdDItemSort extends Item {
|
||||
/** Met à jour les données de formulaire
|
||||
* si static des bonus de cases sont présents
|
||||
* */
|
||||
static buildBonusCaseStringFromFormData( formData ) {
|
||||
if ( formData.bonusValue ) {
|
||||
static buildBonusCaseStringFromFormData( bonuses, cases ) {
|
||||
if ( bonuses ) {
|
||||
let list = [];
|
||||
let caseCheck = {};
|
||||
for(let i=0; i<formData.bonusValue.length; i++) {
|
||||
let coord = formData.caseValue[i] || 'A1';
|
||||
coord = coord.toUpperCase();
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
|
||||
let bonus = formData.bonusValue[i] || 0;
|
||||
if ( bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
for (let i=0; i<bonuses.length; i++) {
|
||||
let coord = cases[i]?.toUpperCase() || 'A1';
|
||||
let bonus = bonuses[i] || 0;
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) && bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
}
|
||||
formData.bonusValue = undefined;
|
||||
formData.caseValue = undefined;
|
||||
formData.system.bonuscase = list.toString(); // Reset
|
||||
return list.toString();
|
||||
}
|
||||
return formData;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -148,7 +148,7 @@ Hooks.once("init", async function () {
|
||||
};
|
||||
|
||||
/* -------------------------------------------- */
|
||||
game.socket.on(SYSTEM_SOCKET_ID, sockmsg => {
|
||||
game.socket.on(SYSTEM_SOCKET_ID, async (sockmsg) => {
|
||||
console.log(">>>>> MSG RECV", sockmsg);
|
||||
try {
|
||||
RdDUtility.onSocketMessage(sockmsg);
|
||||
|
@ -18,8 +18,9 @@ const listeReglesOptionelles = [
|
||||
{ group: 'Règles générales', name: 'appliquer-fatigue', descr: "Appliquer les règles de fatigue"},
|
||||
{ group: 'Règles générales', name: 'afficher-colonnes-reussite', descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false },
|
||||
|
||||
{ group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-vider', descr: "Confirmer pour vider l'équipement", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-refouler', descr: "Confirmer avant de refouler", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-vider', descr: "Confirmer pour vider l'équipement", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-lien-acteur', descr: "Confirmer pour détacher un animal/suivant/véhicule", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-equipement', descr: "Confirmer la suppression des équipements", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-oeuvre', descr: "Confirmer la suppression des oeuvres", scope: "client"},
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.0.29",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.29.zip",
|
||||
"version": "10.0.30",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.30.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
|
Loading…
x
Reference in New Issue
Block a user