ObjectTemplate.DistToStartLoseDamage

From Pilot_51's Wiki
Revision as of 02:13, 20 November 2008 by Pilot 51 (talk | contribs) (New page: == MDT description == A number of hand weapons, namely the medics' submachineguns, the Breda and Bren, the shotgun, and the pistols, have their damage drop off with range. Call this drop-o...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

MDT description

A number of hand weapons, namely the medics' submachineguns, the Breda and Bren, the shotgun, and the pistols, have their damage drop off with range. Call this drop-off factor the DistanceMod. For all other weapons this term is always 1.0, i.e. the range does not affect the result. The important factors here are in the objects/handweapons/Common/Weapons.con file. Here is a typical entry, for the shotgun:

 ObjectTemplate.MinDamage 0.5
 ObjectTemplate.DistToStartLoseDamage 40
 ObjectTemplate.DistToMinDamage 80

The DistToStartLoseDamage specifies the distance (in meters) at which the damage of the projectile will start to decrease. The MinDamage value is the lowest ratio possible for damage. The DistToMinDamage is the distance beyond which the projectile does its minimum amount of damage. In other words, if a shotgun pellet hits at closer than 40 meters, the DistanceMod is 1.0, beyond 80 meters the DistanceMod is 0.5, between these two the DistanceMod drops linearly from 1.0 to 0.5. Submachineguns start to lose damage at 50 meters and drop to 0.5 at 100 meters. The pistols start to drop at 20 meters and drop to 0.5 at 40 meters. When the distance is between DistToStartLoseDamage and DistToMinDamage, the equation is this:

 DistanceMod = MinDamage + (1-MinDamage) * (DistToMinDamage - distance) / (DistToMinDamage - DistToStartLoseDamage) 

So for a shotgun pellet hitting at, say, 50 meters, the value would be:

 DistanceMod = 0.5 + (1-0.5) * (80 - 50) / (80 - 40) = 0.875


Source and more details

Additional Description