TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ CalculateShotStrength() [2/2]

static ShotStrength Terraria.GameContent.Golf.GolfHelper.CalculateShotStrength ( Vector2 shotVector,
ClubProperties clubProperties )
inlinestatic

Definition at line 477 of file GolfHelper.cs.

478 {
479 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
480 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
481 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
482 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
483 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
484 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
485 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
486 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
487 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
488 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
489 Vector2.Normalize(shotVector);
490 float num3 = ((Vector2)(ref shotVector)).Length();
491 Vector2 val = FindVectorOnOval(shotVector, clubProperties.MaximumStrength);
492 float num = ((Vector2)(ref val)).Length();
493 val = FindVectorOnOval(shotVector, clubProperties.MinimumStrength);
494 float num2 = ((Vector2)(ref val)).Length();
495 float num4 = MathHelper.Clamp(num3, num2, num);
496 float relativeStrength = Math.Max((num4 - num2) / (num - num2), 0.001f);
497 return new ShotStrength(num4 * 32f, relativeStrength, clubProperties.RoughLandResistance);
498 }
static Vector2 FindVectorOnOval(Vector2 vector, Vector2 radius)

References Terraria.GameContent.Golf.GolfHelper.FindVectorOnOval().

Referenced by Terraria.Projectile.AI_150_GolfClubHelper(), Terraria.GameContent.Golf.GolfHelper.CalculateShotStrength(), Terraria.Main.DrawInterface_Resources_GolfPower(), and Terraria.Main.DrawProj_DrawNormalProjs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: