diff --git a/src/Dialogs/Parade.hbs b/src/Dialogs/Parade.hbs new file mode 100644 index 0000000..e597f80 --- /dev/null +++ b/src/Dialogs/Parade.hbs @@ -0,0 +1,34 @@ +
+ {{localize "DSA41.kampf.modifikator"}} + {{>editable-input type="number" name="modifikator" value=(lookup formData "modifikator") }} + + {{localize "DSA41.kampf.crit"}} + {{>editable-input type="checkbox" name="crit" class="center" value=(lookup formData "crit")}} + +
+ {{#if formData.crit}}({{/if}} + {{options.item.basis_parade}}{{localize "DSA41.bewaffnung.nahkampfwaffe.basis"}} + + + {{options.item.talent_parade}}{{localize "DSA41.talente.label"}} + + {{#if (ne options.item.modifikator_parade 0)}} + + {{options.item.modifikator_parade}}{{localize "DSA41.bewaffnung.nahkampfwaffe.modifikator"}} + {{/if}} + + {{#if (ne options.item.parierwaffe_parade 0)}} + + {{options.item.parierwaffe_parade}}{{localize "DSA41.bewaffnung.parierwaffe.label"}} + {{/if}} + + {{#if (ne options.item.schild_parade 0)}} + + {{options.item.schild_parade}}{{localize "DSA41.bewaffnung.schild.label"}} + {{/if}} + + {{#if (lt options.item.tp_kk 0)}} + + {{options.item.tp_kk}}{{localize "DSA41.attributes.long.strength"}} + {{/if}} + + {{#if formData.crit}}) / 2{{localize "DSA41.kampf.crit"}}{{/if}} + + + {{formData.modifikator}}{{localize "DSA41.kampf.modifikator"}} +
+
diff --git a/src/main.mjs b/src/main.mjs index 69aa05b..a08a00c 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -590,6 +590,7 @@ function DSA41_ApplicationMixin(BaseApplication) { class DSA41_Dialog extends DSA41_ApplicationMixin(ApplicationV2) { static PARTS = { + Parade: { template: "systems/dsa-4th-edition/src/Dialogs/Parade.hbs" }, Trefferpunkte: { template: "systems/dsa-4th-edition/src/Dialogs/Trefferpunkte.hbs" }, FernkampfAngriff: { template: "systems/dsa-4th-edition/src/Dialogs/FernkampfAngriff.hbs" }, @@ -678,6 +679,43 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) { if (typeof success_value !== 'undefined') { flavor += " <= " + success_value; } + + + if (roll_type == "parade") { + const item = this.document.system.computed.kampf.waffen[item_id]; + const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name; + const data = await DSA41_Dialog.wait("Parade", { window: { title: title }, item: item }); + + if (data.crit == "on") { + roll_formula = "round((" + roll_formula + ") / 2)"; + } + + let roll = new Roll(roll_formula + " + " + data.modifikator, this.document.system); + roll.toMessage({ + speaker: ChatMessage.getSpeaker({ actor: this.document }), + flavor: flavor, + }); + + return; + } + + if (roll_type == "trefferpunkte") { + const item = this.document.system.computed.kampf.waffen[item_id]; + const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name; + const data = await DSA41_Dialog.wait("Trefferpunkte", { window: { title: title }, item: item }); + + if (data.crit == "on") { + roll_formula = "2 * (" + item.item.system.nahkampfwaffe.basis + ")" + " + " + item.tp_kk; + } + + let roll = new Roll(roll_formula + " + " + data.modifikator, this.document.system); + roll.toMessage({ + speaker: ChatMessage.getSpeaker({ actor: this.document }), + flavor: flavor, + }); + + return; + } if (roll_type == "fernkampf-attacke") { const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name; @@ -715,24 +753,6 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) { return; } - if (roll_type == "trefferpunkte") { - const item = this.document.system.computed.kampf.waffen[item_id]; - const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name; - const data = await DSA41_Dialog.wait("Trefferpunkte", { window: { title: title }, item: item }); - - if (data.crit == "on") { - roll_formula = "2 * (" + item.item.system.nahkampfwaffe.basis + ")" + " + " + item.tp_kk; - } - - let roll = new Roll(roll_formula + " + " + data.modifikator, this.document.system); - roll.toMessage({ - speaker: ChatMessage.getSpeaker({ actor: this.document }), - flavor: flavor, - }); - - return; - } - let roll = new Roll(roll_formula, this.document.system); roll.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.document }),