Skip to content

Feature/weapon damage range variance taper#96

Merged
Andreas-W merged 3 commits into
mainfrom
feature/weapon-damage-range-variance-taper
Jul 1, 2026
Merged

Feature/weapon damage range variance taper#96
Andreas-W merged 3 commits into
mainfrom
feature/weapon-damage-range-variance-taper

Conversation

@Andreas-W

Copy link
Copy Markdown
Owner

various weapon parameter extensions

Andreas-W and others added 3 commits June 27, 2026 14:12
New INI-parseable WeaponTemplate fields:
- PrimaryDamage/SecondaryDamage now accept "Min:x Max:y" for random
  damage, stored internally as nominal(max)+variance and rolled once per
  shot via the synchronized game-logic RNG. Plain single-value form is
  unchanged.
- PrimaryDamageTaperOff/SecondaryDamageTaperOff: scale damage from full
  at the blast center to the given factor at the edge of the radius.
- DamageFactorAtMaxRange: scale damage by engagement distance / attack
  range. For projectiles the distance is measured from the launcher's
  position captured at launch time (projectileGetLaunchPos), not at
  detonation.
- ScatterRadiusFactorAtMaxRange: scale ScatterRadius by engagement
  distance / attack range (applied at fire time).

All fields default to no-op, so existing INI behavior is unchanged.

Projectile launch-position plumbing:
- ProjectileUpdateInterface::projectileGetLaunchPos() added (default
  returns false).
- MissileAIUpdate, FreeFallProjectileBehavior, NeutronMissileUpdate
  store the launcher position at launch and xfer it (version bumps).
  DumbProjectileBehavior reuses its existing m_flightPathStart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Scales primary/secondary damage radii from 1.0 at point-blank to the
given factor at (or beyond) the weapon's attack range, using the same
engagement-distance measure as DamageFactorAtMaxRange (launch-time
position for projectiles). Defaults to 1.0 (no scaling). Folded into the
existing range-factor block and applied before the radii are squared.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UseCallersRadius FX previously received the raw PrimaryDamageRadius, so
the particle emission volume did not match the range-scaled damage radius
from RadiusFactorAtMaxRange. Extract the range-factor math into
WeaponTemplate::computeRangeScaleFactor and reuse it in dealDamageInternal
(damage + radius) and at the detonation/laser doFXPos sites, so the FX
radius now tracks the actual damage radius (using launch-time distance for
projectiles). No behavior change when the factors are at their 1.0 default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Andreas-W Andreas-W merged commit ff65bfc into main Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant