10.5.0 #604

Merged
uberwald merged 14 commits from VincentVk/foundryvtt-reve-de-dragon:v10 into v10 2023-01-08 09:49:45 +01:00
Showing only changes of commit 8844f76b65 - Show all commits

View File

@ -207,7 +207,7 @@ export class RdDCommands {
if (["gmroll", "blindroll"].includes(rollMode)) { if (["gmroll", "blindroll"].includes(rollMode)) {
msg["whisper"] = ChatMessage.getWhisperRecipients("GM"); msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
} }
if (rollMode === "blindroll"){ if (rollMode === "blindroll") {
msg["blind"] = true; msg["blind"] = true;
} }
msg["type"] = 0; msg["type"] = 0;
@ -225,7 +225,7 @@ export class RdDCommands {
return false; return false;
} }
_isCommandHandled(command){ _isCommandHandled(command) {
return this.commandsTable[command] != undefined; return this.commandsTable[command] != undefined;
} }
@ -331,7 +331,7 @@ export class RdDCommands {
diff = 0; diff = 0;
} }
const caracName = params[0]; const caracName = params[0];
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : {name:undefined}; let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined };
if (competence) { if (competence) {
for (let actor of actors) { for (let actor of actors) {
await actor.rollCaracCompetence(caracName, competence.name, diff); await actor.rollCaracCompetence(caracName, competence.name, diff);
@ -448,17 +448,27 @@ export class RdDCommands {
} }
async creerSignesDraconiques() { async creerSignesDraconiques() {
if (game.user.isGM) {
DialogCreateSigneDraconique.createSigneForActors(); DialogCreateSigneDraconique.createSigneForActors();
}
else {
ui.notifications.warn("Seul le MJ est autorisé à utiliser la commande /signe");
}
return true; return true;
} }
async supprimerSignesDraconiquesEphemeres() { async supprimerSignesDraconiquesEphemeres() {
if (game.user.isGM) {
game.actors.forEach(actor => { game.actors.forEach(actor => {
const ephemeres = actor.items.filter(item => item.type = 'signedraconique' && item.system.ephemere); const ephemeres = actor.items.filter(item => item.type = 'signedraconique' && item.system.ephemere);
if (ephemeres.length > 0) { if (ephemeres.length > 0) {
actor.deleteEmbeddedDocuments("Item", ephemeres.map(item => item.id)); actor.deleteEmbeddedDocuments("Item", ephemeres.map(item => item.id));
} }
}); });
}
else {
ui.notifications.warn("Seul le MJ est autorisé à utiliser la commande /signe");
}
return true; return true;
} }