Les joueurs ne peuvent plus créer de signes

Les commandes /signe+ / /signe
This commit is contained in:
Vincent Vandemeulebrouck 2023-01-05 02:14:23 +01:00
parent ec24126e75
commit 8844f76b65

View File

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