Skip to content

Commit

Permalink
Fix Range not applying dice/difficulty modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Jan 16, 2025
1 parent 09b743a commit b704dc0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
26 changes: 25 additions & 1 deletion scripts/common/dialogs/weapon-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,43 @@ export class WeaponDialog extends AttackDialog {
}
this.tooltips.finish(this, "Weapon")


// Aiming
if (this.fields.aim)
{
this.fields.pool++;
this.tooltips.add("pool", 1, game.i18n.localize("WEAPON.AIM"))
}

// Range
this.tooltips.start(this)
if (this.fields.range == "short")
{
this.fields.pool += 1
if (this.weapon.traitList.rapidFire)
{
this.fields.ed.value += (parseInt(weapon.traitList.rapidFire.rating) || 0)
}
this.tooltips.finish(this, "Short Range")
}
else if (this.fields.range == "long")
{
this.fields.difficulty += 2
this.tooltips.finish(this, "Long Range")
}
else
{
this.tooltips.finish();
}

// Charging
if (this.fields.charging)
{
this.fields.pool++;
this.tooltips.add("pool", 1, game.i18n.localize("WEAPON.CHARGING"))
}

// Mob
if (this.actor.isMob)
{
this.fields.pool += Math.ceil(this.actor.mob / 2)
Expand Down Expand Up @@ -127,7 +151,7 @@ export class WeaponDialog extends AttackDialog {

computeRange()
{
let range
let range
let weapon = this.weapon;
if (this.fields.distance && weapon.isRanged) {

Expand Down
1 change: 0 additions & 1 deletion scripts/document/effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default class WrathAndGloryEffect extends WarhammerActiveEffect {

let transferData = this.system.transferData;

//TODO
let test;
let options = {appendTitle : " - " + this.name, resist : [this.key].concat(this.sourceTest?.item?.type || []), resistingTest : this.sourceTest, fields: {}};
if (this.sourceTest && this.sourceTest.result?.test)
Expand Down

0 comments on commit b704dc0

Please sign in to comment.