add crits to nahkampfwaffe damage
This commit is contained in:
parent
d9e1721459
commit
5179ecba91
@ -16,9 +16,9 @@
|
||||
|
||||
<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>
|
||||
<ruby>{{options.item.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>{{lookup options.item.item.system.fernkampfwaffe formData.entfernung}}<rt>{{localize "DSA41.kampf.entfernung.label"}}</rt></ruby>
|
||||
+ <ruby>{{formData.modifikator}}<rt>{{localize "DSA41.kampf.modifikator"}}</rt></ruby>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
19
src/Dialogs/Trefferpunkte.hbs
Normal file
19
src/Dialogs/Trefferpunkte.hbs
Normal file
@ -0,0 +1,19 @@
|
||||
<div class="trefferpunkte_dialog">
|
||||
<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.item.system.nahkampfwaffe.basis}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.basis"}}</rt></ruby>
|
||||
{{#if formData.crit}}){{/if}}
|
||||
|
||||
{{#if (ne options.item.tp_kk 0)}}
|
||||
+ <ruby>{{options.item.tp_kk}}<rt>{{localize "DSA41.attributes.long.strength"}}</rt></ruby>
|
||||
{{/if}}
|
||||
|
||||
+ <ruby>{{formData.modifikator}}<rt>{{localize "DSA41.kampf.modifikator"}}</rt></ruby>
|
||||
</div>
|
||||
</div>
|
||||
31
src/main.mjs
31
src/main.mjs
@ -44,6 +44,8 @@ Hooks.once("init", async function() {
|
||||
"fernkampf_attacke_tooltip": "systems/dsa-4th-edition/src/Tooltips/FernkampfAttacke.hbs",
|
||||
"fernkampf_trefferpunkte_tooltip": "systems/dsa-4th-edition/src/Tooltips/FernkampfTrefferpunkte.hbs",
|
||||
|
||||
"trefferpunkte_dialog": "systems/dsa-4th-edition/src/Dialog/Trefferpunkte.hbs",
|
||||
|
||||
"fernkampf_angriff_dialog": "systems/dsa-4th-edition/src/Dialogs/FernkampfAngriff.hbs",
|
||||
"fernkampf_trefferpunkte_dialog": "systems/dsa-4th-edition/src/Dialogs/FernkampfTrefferpunkte.hbs",
|
||||
});
|
||||
@ -588,6 +590,8 @@ function DSA41_ApplicationMixin(BaseApplication) {
|
||||
|
||||
class DSA41_Dialog extends DSA41_ApplicationMixin(ApplicationV2) {
|
||||
static PARTS = {
|
||||
Trefferpunkte: { template: "systems/dsa-4th-edition/src/Dialogs/Trefferpunkte.hbs" },
|
||||
|
||||
FernkampfAngriff: { template: "systems/dsa-4th-edition/src/Dialogs/FernkampfAngriff.hbs" },
|
||||
FernkampfTrefferpunkte: { template: "systems/dsa-4th-edition/src/Dialogs/FernkampfTrefferpunkte.hbs" },
|
||||
|
||||
@ -670,6 +674,11 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
||||
const item_id = event.target.closest("[data-item-id]")?.dataset.itemId;
|
||||
const item = this.document.items.get(item_id);
|
||||
|
||||
let flavor = game.i18n.localize("DSA41.roll_types." + roll_type);
|
||||
if (typeof success_value !== 'undefined') {
|
||||
flavor += " <= " + success_value;
|
||||
}
|
||||
|
||||
if (roll_type == "fernkampf-attacke") {
|
||||
const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name;
|
||||
const data = await DSA41_Dialog.wait("FernkampfAngriff", { window: { title: title }, item: this.document.system.computed.kampf.fernkampf_waffen[item_id] });
|
||||
@ -690,7 +699,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
||||
|
||||
if (roll_type == "fernkampf-trefferpunkte") {
|
||||
const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name;
|
||||
const data = await DSA41_Dialog.wait("FernkampfTrefferpunkte", { window: { title: title }, item: item });
|
||||
const data = await DSA41_Dialog.wait("FernkampfTrefferpunkte", { window: { title: title }, item: this.document.system.computed.kampf.fernkampf_waffen[item_id] });
|
||||
const entfernung = item.system.fernkampfwaffe[data.entfernung];
|
||||
|
||||
if (data.crit == "on") {
|
||||
@ -705,9 +714,23 @@ 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;
|
||||
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user