Skip to content

Commit

Permalink
Update WorldObjectDamageWorker.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CMDR-Bill-Doors committed Oct 10, 2023
1 parent 7e6f693 commit ba96587
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction)
}
}
var result = FragmentsPotentialDamage(projectile) + ExplosionPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier);
//Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained
result /= 3500f;
//manual overwrite
if (projectile.projectile is ProjectilePropertiesCE projectileProperties && projectileProperties.shellingProps.damage > 0f)
{
result = projectileProperties.shellingProps.damage;
}
//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);
return result;
Expand Down

0 comments on commit ba96587

Please sign in to comment.