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:
@@ -314,7 +314,7 @@ export class M5Item extends Item {
|
||||
return ret;
|
||||
}
|
||||
|
||||
async roll() {
|
||||
async roll(toggleAutomatedRoll = false) {
|
||||
const item = this as any;
|
||||
|
||||
// Initialize chat data.
|
||||
@@ -341,20 +341,20 @@ export class M5Item extends Item {
|
||||
}
|
||||
});
|
||||
|
||||
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||
this.actor["update"]({
|
||||
data: {
|
||||
ap: {
|
||||
value: this.actor["system"].ap.value - item.system.ap,
|
||||
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
|
||||
if (await roll.toMessage(toggleAutomatedRoll)) {
|
||||
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||
this.actor["update"]({
|
||||
data: {
|
||||
ap: {
|
||||
value: this.actor["system"].ap.value - item.system.ap,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
|
||||
return roll.toMessage();
|
||||
} else {
|
||||
ChatMessage.create({
|
||||
speaker: speaker,
|
||||
|
||||
Reference in New Issue
Block a user