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

◆ HitGolfBall()

static void Terraria.GameContent.Golf.GolfHelper.HitGolfBall ( Entity entity,
Vector2 velocity,
float roughLandResistance )
inlinestatic

Definition at line 713 of file GolfHelper.cs.

714 {
715 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
716 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
717 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
718 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
719 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
720 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
721 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
722 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
723 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
724 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
725 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
726 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
727 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
728 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
729 Vector2 bottom = entity.Bottom;
730 bottom.Y += 1f;
731 Point point = bottom.ToTileCoordinates();
732 Tile tile = Main.tile[point.X, point.Y];
733 if (tile != null && tile.active())
734 {
736 velocity = Vector2.Lerp(velocity * byTileId.GolfPhysics.ClubImpactDampening, velocity, byTileId.GolfPhysics.ImpactDampeningResistanceEfficiency * roughLandResistance);
737 }
738 entity.velocity = velocity;
739 if (entity is Projectile projectile)
740 {
741 projectile.timeLeft = 18000;
742 if (projectile.ai[1] < 0f)
743 {
744 projectile.ai[1] = 0f;
745 }
746 projectile.ai[1] += 1f;
747 projectile.localAI[1] = 1f;
748 Main.LocalGolfState.RecordSwing(projectile);
749 }
750 }
static TileMaterial GetByTileId(ushort tileId)

References Terraria.Tile.active(), Terraria.Entity.Bottom, Terraria.GameContent.Metadata.TileMaterials.GetByTileId(), Terraria.Main.LocalGolfState, Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.Projectile.AI_150_GolfClubHelper(), and Terraria.GameContent.Golf.FancyGolfPredictionLine.Update().

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