add crits to fernkampf damage

This commit is contained in:
Sven Balzer 2024-11-11 23:47:41 +01:00
parent 998951bafc
commit d9e1721459
3 changed files with 12 additions and 3 deletions

View File

@ -11,8 +11,13 @@
<span>{{localize "DSA41.kampf.modifikator"}}</span>
{{>editable-input type="number" name="modifikator" value=(lookup formData "modifikator") }}
<span>{{localize "DSA41.kampf.crit"}}</span>
{{>editable-input type="checkbox" name="crit" class="center" value=(lookup formData "crit")}}
<div class="dsa41-calculation colspan4 center">
{{#if formData.crit}}<ruby>2 * <rt>{{localize "DSA41.kampf.crit"}}</rt></ruby>({{/if}}
<ruby>{{options.item.system.fernkampfwaffe.basis}}<rt>{{localize "DSA41.bewaffnung.fernkampfwaffe.basis"}}</rt></ruby>
{{#if formData.crit}}){{/if}}
+ <ruby>{{lookup options.item.system.fernkampfwaffe formData.entfernung}}<rt>{{localize "DSA41.kampf.entfernung.label"}}</rt></ruby>
+ <ruby>{{formData.modifikator}}<rt>{{localize "DSA41.kampf.modifikator"}}</rt></ruby>
</div>

View File

@ -357,12 +357,13 @@
},
"kampf": {
"bewaffnung": "Bewaffnung",
"bewaffnung": "Bewaffnung",
"attacke": "Attacke",
"parade": "Parade",
"trefferpunkte": "Trefferpunkte",
"ruestungen": "Rüstungen",
"modifikator": "Modifikator",
"crit": "Glückliche Attacke",
"zielgroesse": {
"label": "Zielgröße",

View File

@ -664,7 +664,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
position: { width: "800", height: "650" },
actions: {
"roll": async function(event, target) {
const roll_formula = event.target.closest("[data-roll]").dataset.roll;
var roll_formula = event.target.closest("[data-roll]").dataset.roll;
const roll_type = event.target.closest("[data-roll-type]").dataset.rollType;
const success_value = event.target.closest("[data-success-value]")?.dataset.successValue;
const item_id = event.target.closest("[data-item-id]")?.dataset.itemId;
@ -693,6 +693,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
const data = await DSA41_Dialog.wait("FernkampfTrefferpunkte", { window: { title: title }, item: item });
const entfernung = item.system.fernkampfwaffe[data.entfernung];
if (data.crit == "on") {
roll_formula = "2 * (" + roll_formula + ")";
}
let roll = new Roll(roll_formula + " + " + (entfernung + data.modifikator), this.document.system);
roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.document }),
@ -701,7 +705,6 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
return;
}
let flavor = game.i18n.localize("DSA41.roll_types." + roll_type);
if (typeof success_value !== 'undefined') {
flavor += " <= " + success_value;