Retrieving the value of a damage class

orangepecan

Terrarian
Hi guys, see title.

Currently I'm using the following but it's only a guess whether it's even correct or not:

float meleeDmg = player.GetDamage(DamageClass.Melee).Base + player.GetDamage(DamageClass.Melee).Additive * player.GetDamage(DamageClass.Melee).Multiplicative;

Surely there must be an easier way?
 
So anyone know? I'm sure there must be a simple solution.

EDIT: Any chance either of the following are correct?

float rangedDamageMod = player.GetTotalDamage(DamageClass.Ranged).ApplyTo(1);

OR

float rangedDamageMod = player.GetDamage(DamageClass.Ranged).ApplyTo(1);

If I'm understanding the documentation correctly, if I pass 1 into ApplyTo() then the return result should be the combined multiplicative damage modifier for the specified damage type?

EDIT2:

Bit of more testing seems to suggest that player.GetTotalDamage(DamageClass.whatever).ApplyTo(1) will return an appropriate value that you could use as the player's damage modifier for a specified damage type. Would really appreciate someone chiming in on this however.
 
Last edited:
Back
Top Bottom