Visibilité des jets /rdd
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## 13.0.48 - Les vagabondages d'Illisys
|
||||
|
||||
- suppression du type de TMR "Inconnu" des feuilles de création de signes draconiques (ce type sert uniquement pour le cas où une case saisie à la main est incorrecte)
|
||||
- les jets de dés /rdd utilisent le mode de visibilité sélectionné
|
||||
|
||||
## 13.0.47 - Les goûts et les couleurs d'Illisys
|
||||
|
||||
|
||||
+2
-31
@@ -1570,9 +1570,10 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajoutExperience(rollData, hideChatMessage = 'show') {
|
||||
const rollMode = rollData.current?.rollmode?.key ?? game.settings.get("core", "rollMode")
|
||||
if (!rollData.rolled.isPart ||
|
||||
rollData.finalLevel >= 0 ||
|
||||
game.settings.get("core", "rollMode") == 'selfroll' ||
|
||||
rollMode == 'selfroll' ||
|
||||
!Misc.hasConnectedGM()) {
|
||||
return
|
||||
}
|
||||
@@ -1795,36 +1796,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue
|
||||
* @param {*} caracName
|
||||
* @param {*} compName
|
||||
* @param {*} diff
|
||||
* @param {*} options
|
||||
* @returns
|
||||
*/
|
||||
async doRollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
const carac = this.getCaracByName(caracName);
|
||||
if (!carac) {
|
||||
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||
return;
|
||||
}
|
||||
const competence = this.getCompetence(compName);
|
||||
let rollData = {
|
||||
alias: this.getAlias(),
|
||||
caracValue: Number(carac.value),
|
||||
selectedCarac: carac,
|
||||
competence: competence,
|
||||
diffLibre: diff,
|
||||
show: { title: options?.title ?? '' }
|
||||
};
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
this.ajoutExperience(rollData);
|
||||
await RdDRollResult.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async creerTacheDepuisLivre(item, options = { renderSheet: true }) {
|
||||
const nomTache = "Lire " + item.name;
|
||||
|
||||
@@ -347,7 +347,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue
|
||||
* Méthode pour faire un jet prédéterminé sans ouvrir la fenêtre de dialogue
|
||||
*
|
||||
* @param {*} caracName code ou label de la caractéristique. On peut utiliser 'intel' pour Intellect.
|
||||
* @param {*} compName nom de compétence ou nom abrégé.
|
||||
* @param {*} diff difficulté (0 si undefined)
|
||||
@@ -367,12 +368,13 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
selectedCarac: carac,
|
||||
competence: competence,
|
||||
diffLibre: diff ?? 0,
|
||||
current: { rollmode: { key: game.settings.get("core", "rollMode") } },
|
||||
show: { title: options?.title ?? '' }
|
||||
}
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
this.ajoutExperience(rollData);
|
||||
await RdDResolutionTable.displayRollData(rollData, this)
|
||||
await RdDRollResult.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,8 +147,6 @@ export class RdDBaseActor extends Actor {
|
||||
return this.name
|
||||
}
|
||||
|
||||
isPersonnageJoueur() { return false }
|
||||
|
||||
getCarac() {
|
||||
return foundry.utils.duplicate(this.system.carac)
|
||||
}
|
||||
@@ -267,6 +265,7 @@ export class RdDBaseActor extends Actor {
|
||||
return game.users.players.find(player => player.active && player.character?.id == this.id);
|
||||
}
|
||||
|
||||
isPersonnageJoueur() { return false }
|
||||
isCreatureOuEntite() { return this.isCreature() || this.isEntite() }
|
||||
isCreature() { return false }
|
||||
isEntite() { return false }
|
||||
@@ -899,7 +898,8 @@ export class RdDBaseActor extends Actor {
|
||||
actionImpossible(action) {
|
||||
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||
}
|
||||
|
||||
async doRollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
}
|
||||
ajoutExperience(rollData) { }
|
||||
isAlcoolise() { return false }
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
|
||||
@@ -340,11 +340,11 @@ export class RdDCommands {
|
||||
const caracName = params[0];
|
||||
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined };
|
||||
if (competence) {
|
||||
for (let actor of actors) {
|
||||
await actor.doRollCaracCompetence(caracName, competence.name, diff);
|
||||
await Promise.all(
|
||||
actors.map(it => it.doRollCaracCompetence(caracName, competence.name, diff))
|
||||
)
|
||||
}
|
||||
}
|
||||
return;
|
||||
return
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn("Sélectionnez au moins un personnage pour lancer les dés")
|
||||
|
||||
@@ -98,7 +98,7 @@ export class RdDResolutionTable {
|
||||
/* -------------------------------------------- */
|
||||
static async rollData(rollData) {
|
||||
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData);
|
||||
return rollData;
|
||||
return rollData
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -107,7 +107,7 @@ export class RdDResolutionTable {
|
||||
this._updateChancesWithBonus(chances, rollData.bonus, finalLevel);
|
||||
this._updateChancesFactor(chances, rollData.diviseurSignificative);
|
||||
chances.showDice = rollData.showDice;
|
||||
chances.rollMode = rollData.rollMode;
|
||||
chances.rollMode = rollData.current?.rollmode?.key ?? game.settings.get("core", "rollMode")
|
||||
|
||||
let rolled = await this.rollChances(chances, rollData.diviseurSignificative, rollData.forceDiceResult);
|
||||
rolled.caracValue = caracValue;
|
||||
|
||||
@@ -6,7 +6,7 @@ export class RdDRollResult {
|
||||
static async displayRollData(rollData, actor = undefined, template = 'chat-resultat-general.hbs') {
|
||||
return await ChatMessage.create(ChatUtility.adaptVisibility(
|
||||
{ content: await RdDRollResult.buildRollDataHtml(rollData, template) },
|
||||
{ actor: actor, rollMode: rollData.current?.rollmode?.key }
|
||||
{ actor: actor, rollMode: rollData.current?.rollmode?.key ?? game.settings.get("core", "rollMode") }
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user