Vereinfachter-NPC/Kreaturen-Bogen (#107)

Ich habe mal den ersten Entwurf eines NPC Bogens fertiggestellt. Ist jetzt ein eigener Actor Type geworden und nicht nur ein alternativer Char Bogen:
Einfach beim Erstellen eines neuen Actors NPC wählen.

Co-authored-by: Ender <harald@drueppels.de>
Co-authored-by: LeFrique <lefrique@live.de>
Co-authored-by: Byroks <byroks@gmail.com>
Reviewed-on: #107
Reviewed-by: Le-Frique <lefrique@live.de>
This commit was merged in pull request #107.
This commit is contained in:
2024-05-14 11:38:20 +02:00
co-authored by Ender Le-Frique Byroks
parent 37d6ba12e7
commit 3ecd2c6c1e
17 changed files with 636 additions and 54 deletions
+14 -6
View File
@@ -142,18 +142,26 @@ export class M5Roll {
return renderTemplate(M5Roll.TEMPLATE_PATH, this.data);
}
async toMessage() {
let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") });
if (checkOptions["cancelled"]) {
return;
async toMessage(toggleAutomatedRoll = false) {
let automatedRoll = (game as Game).settings.get("midgard5", "automatedRoll");
automatedRoll = toggleAutomatedRoll ? !automatedRoll : automatedRoll;
const rMode = (game as Game).settings.get("core", "rollMode");
if (!automatedRoll) {
let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") });
if (checkOptions["cancelled"]) {
return;
} else {
const rMode = checkOptions["rollMode"];
this.data.b = checkOptions;
}
} else {
this.data.b = checkOptions;
this.data.b = { difficulty: 20, modifier: 0 };
}
if (!this._evaluated) await this.evaluate();
const faces = this.pool.dice.map((x) => x.faces);
const rMode = checkOptions["rollMode"] || (game as Game).settings.get("core", "rollMode");
const chatData = {
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
content: await this.render(),