@@ -494,6 +494,10 @@ class WeaponTemplate : public MemoryPoolObject
494494
495495protected:
496496
497+ // compute the range-based scaling factor (1.0 at point-blank to factorAtMaxRange at attack range)
498+ // for the engagement from 'source' to 'pos'. Uses launch-time position for projectile detonations.
499+ Real computeRangeScaleFactor (const Object* source, const Coord3D* pos, const WeaponBonus& bonus, Real factorAtMaxRange, Bool isProjectileDetonation) const ;
500+
497501 // actually deal out the damage.
498502 void dealDamageInternal (ObjectID sourceID, ObjectID victimID, const Coord3D *pos, const WeaponBonus& bonus, Bool isProjectileDetonation) const ;
499503 void trimOldHistoricDamage () const ;
@@ -508,6 +512,8 @@ class WeaponTemplate : public MemoryPoolObject
508512 static void parseWeaponBonusSet ( INI * ini, void *instance, void * /* store*/ , const void * /* userData*/ );
509513 static void parseScatterTarget ( INI * ini, void *instance, void * /* store*/ , const void * /* userData*/ );
510514 static void parseShotDelay ( INI * ini, void *instance, void * /* store*/ , const void * /* userData*/ );
515+ static void parsePrimaryDamage ( INI * ini, void *instance, void * /* store*/ , const void * /* userData*/ );
516+ static void parseSecondaryDamage ( INI * ini, void *instance, void * /* store*/ , const void * /* userData*/ );
511517
512518 static const FieldParse TheWeaponTemplateFieldParseTable[]; // /< the parse table for INI definition
513519
@@ -516,10 +522,17 @@ class WeaponTemplate : public MemoryPoolObject
516522 AsciiString m_projectileStreamName; // /< Name of object that tracks are stream, if we have one
517523 AsciiString m_laserName; // /< Name of the laser object that persists.
518524 AsciiString m_laserBoneName; // /< Where to put the laser object
519- Real m_primaryDamage; // /< primary damage amount
525+ Real m_primaryDamage; // /< primary damage amount (nominal/max when variance is used)
526+ Real m_primaryDamageVariance; // /< if nonzero, actual primary damage is randomly reduced by up to this much (from Min:/Max: definition)
520527 Real m_primaryDamageRadius; // /< primary damage radius range
521- Real m_secondaryDamage; // /< secondary damage amount
528+ Real m_secondaryDamage; // /< secondary damage amount (nominal/max when variance is used)
529+ Real m_secondaryDamageVariance; // /< if nonzero, actual secondary damage is randomly reduced by up to this much (from Min:/Max: definition)
522530 Real m_secondaryDamageRadius; // /< secondary damage radius range
531+ Real m_primaryDamageTaperOff; // /< factor of primary damage applied at the edge of the primary radius (1.0 = no taper)
532+ Real m_secondaryDamageTaperOff; // /< factor of secondary damage applied at the edge of the secondary radius (1.0 = no taper)
533+ Real m_damageFactorAtMaxRange; // /< scales damage based on engagement distance / attack range (1.0 = no scaling)
534+ Real m_radiusFactorAtMaxRange; // /< scales damage radii based on engagement distance / attack range (1.0 = no scaling)
535+ Real m_scatterRadiusFactorAtMaxRange; // /< scales ScatterRadius based on engagement distance / attack range (1.0 = no scaling)
523536 Real m_shockWaveAmount; // /( How much shockwave generated
524537 Real m_shockWaveRadius; // /( How far shockwave effect affects objects
525538 Real m_shockWaveTaperOff; // /( How much shockwave is left at the tip of the shockwave radius
0 commit comments