fix parade crit calculation
This commit is contained in:
parent
9d4e8f7c9e
commit
b58d0c9ec7
12
src/main.mjs
12
src/main.mjs
@ -578,8 +578,11 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
this.computed.num_waffen += 1;
|
||||
let computed = this.computed.kampf.waffen[item._id] = {
|
||||
item: item,
|
||||
|
||||
attacke: 0,
|
||||
parade: 0,
|
||||
parade_crit: 0,
|
||||
|
||||
trefferpunkte: "",
|
||||
trefferpunkte_display: "",
|
||||
|
||||
@ -632,6 +635,7 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
|
||||
computed.attacke = computed.basis_attacke + computed.talent_attacke + computed.modifikator_attacke + computed.parierwaffe_attacke + computed.schild_attacke + Math.min(computed.tp_kk, 0);
|
||||
computed.parade = computed.basis_parade + computed.talent_parade + computed.modifikator_parade + computed.parierwaffe_parade + computed.schild_parade + Math.min(computed.tp_kk, 0);
|
||||
computed.parade_crit = Math.round(computed.parade / 2);
|
||||
|
||||
computed.trefferpunkte = get_minified_formula(item.system.nahkampfwaffe.basis + (computed.tp_kk != 0 ? " + " + computed.tp_kk : ""));
|
||||
computed.trefferpunkte_display = computed.trefferpunkte.replace(/[\+\-]/, (op) => "<br>" + op);
|
||||
@ -1108,13 +1112,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
||||
const data = await DSA41_Dialog.wait("Parade", { window: { title: title }, item: item });
|
||||
|
||||
let flavor = game.i18n.localize("DSA41.roll_types." + roll_type);
|
||||
if (typeof success_value !== 'undefined') {
|
||||
flavor += " <= " + (Number(success_value) + data.modifikator);
|
||||
}
|
||||
|
||||
if (data.crit == "on") {
|
||||
roll_formula = "round((" + roll_formula + ") / 2)";
|
||||
}
|
||||
flavor += " <= " + (Number((data.crit == "on") ? item.parade_crit : item.parade) + data.modifikator);
|
||||
|
||||
let roll = new Roll(roll_formula, this.document.system);
|
||||
roll.toMessage({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user