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

◆ CalculateShotStrength() [1/2]

static ShotStrength Terraria.GameContent.Golf.GolfHelper.CalculateShotStrength ( Projectile golfHelper,
Entity golfBall )
inlinestatic

Definition at line 335 of file GolfHelper.cs.

336 {
337 int num = Main.screenWidth;
338 if (num > Main.screenHeight)
339 {
340 num = Main.screenHeight;
341 }
342 int num2 = 150;
343 num -= num2;
344 num /= 2;
345 if (num < 200)
346 {
347 num = 200;
348 }
349 float num3 = num;
350 num3 = 300f;
351 if (golfHelper.ai[0] != 0f)
352 {
353 return default(ShotStrength);
354 }
355 Vector2 shotVector = (golfHelper.Center - golfBall.Center) / num3;
356 ClubProperties clubPropertiesFromGolfHelper = GetClubPropertiesFromGolfHelper(golfHelper);
357 return CalculateShotStrength(shotVector, clubPropertiesFromGolfHelper);
358 }
static ShotStrength CalculateShotStrength(Vector2 shotVector, ClubProperties clubProperties)
static ClubProperties GetClubPropertiesFromGolfHelper(Projectile golfHelper)

References Terraria.Projectile.ai, Terraria.GameContent.Golf.GolfHelper.CalculateShotStrength(), Terraria.Entity.Center, Terraria.GameContent.Golf.GolfHelper.GetClubPropertiesFromGolfHelper(), Terraria.Main.screenHeight, and Terraria.Main.screenWidth.