Feature/weapon damage range variance taper#96
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
various weapon parameter extensions