Skip to content

Commit

Permalink
Closes #876: Increased ST for weapon not increasing range for thrown …
Browse files Browse the repository at this point in the history
…weapon
  • Loading branch information
richardwilkes committed Aug 16, 2024
1 parent 5608035 commit f0083fc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions model/gurps/weapon_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func (wr WeaponRange) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) Weapo
result.InMiles = w.ResolveBoolFlag(wswitch.RangeInMiles, result.InMiles)
if result.MusclePowered {
var st fxp.Int
maxST := w.Strength.Resolve(w, nil).Min.Mul(fxp.Three)
if w.Owner != nil {
st = w.Owner.RatedStrength()
}
Expand All @@ -123,6 +124,24 @@ func (wr WeaponRange) Resolve(w *Weapon, modifiersTooltip *xio.ByteBuffer) Weapo
st = entity.ThrowingStrength()
}
}
var percentMin fxp.Int
for _, bonus := range w.collectWeaponBonuses(1, modifiersTooltip, feature.WeaponEffectiveSTBonus) {
amt := bonus.AdjustedAmountForWeapon(w)
if bonus.Percent {
percentMin += amt
} else {
st += amt
}
}
if percentMin != 0 {
st += st.Mul(percentMin).Div(fxp.Hundred).Trunc()
}
if st < 0 {
st = 0
}
if maxST > 0 && maxST < st {
st = maxST
}
if st > 0 {
result.HalfDamage = result.HalfDamage.Mul(st).Trunc().Max(0)
result.Min = result.Min.Mul(st).Trunc().Max(0)
Expand Down

0 comments on commit f0083fc

Please sign in to comment.