|
|
|
@ -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,10 +1426,22 @@ export class RdDActor extends Actor {
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
async actionRefoulement(item) {
|
|
|
|
|
const refoulement = item?.system.refoulement ?? 0;
|
|
|
|
|
if (refoulement>0){
|
|
|
|
|
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 : ''}`
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|