Skip to content

Commit

Permalink
Merge pull request #2751 from CombatExtended-Continued/world-tile-dam…
Browse files Browse the repository at this point in the history
…age-change

Update WorldObjectDamageWorker.cs
  • Loading branch information
N7Huntsman authored Oct 26, 2023
2 parents c08ac4e + cb03bbb commit 9f6588a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction)
var result = FragmentsPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier) + OtherPotentialDamage(projectile);
//Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained
result /= 3500f;
//Crit/Miss imitation
result *= Rand.Range(0.4f, 1.5f);
//manual overwrite
if (projectile.projectile is ProjectilePropertiesCE projectileProperties && projectileProperties.shellingProps.damage > 0f)
{
result *= projectileProperties.shellingProps.damage;
result = projectileProperties.shellingProps.damage;
}
//Crit/Miss imitation
result *= Rand.Range(0.4f, 1.5f);
return result;
}
protected const float fragDamageMultipler = 0.04f;
Expand Down

0 comments on commit 9f6588a

Please sign in to comment.