55117 {
55118
55119
55120
55121
55122
55123
55124
55125
55126
55127
55128
55129
55130
55131
55132
55133
55134
55135
55136
55137
55138
55139
55140
55141
55142
55143
55144
55145
55146
55147
55148
55149
55150
55151
55152
55153
55154
55155
55156
55158 if (!player.active)
55159 {
55161 return;
55162 }
55163 if (player.gravDir == -1
f)
55164 {
55165 player.SetDummyItemTime(0);
55167 return;
55168 }
55170 Rectangle
rectangle = Utils.CenteredRectangle(player.Center,
new Vector2(500
f, 500
f));
55171 for (int i = 0; i < 1000; i++)
55172 {
55173 Projectile projectile = Main.projectile[i];
55175 {
55177 break;
55178 }
55179 }
55181 {
55182 player.TryPlacingAGolfBallNearANearbyTee(Main.player[
owner].Center);
55183 }
55184 if (!player.channel &&
ai[0] == 0
f)
55185 {
55187 for (
int j = 0;
j < 1000;
j++)
55188 {
55192 {
55193 continue;
55194 }
55195 float num = Main.rand.NextFloatDirection();
55197 {
55198 Dust dust = Dust.NewDustPerfect(
projectile2.Center, 31, ((
float)
Math.PI * 2
f *
num2 +
num).ToRotationVector2() * 0.8f, 127);
55201 {
55202 dust.velocity *= 0.4f;
55203 }
55204 }
55206 if (
owner == Main.myPlayer)
55207 {
55211 NetMessage.SendData(27, -1, -1,
null,
j);
55212 }
55213 }
55217 }
55219 {
55221 float num3 = player.HeldItem.useAnimation + 30;
55223 {
55225 return;
55226 }
55229 player.heldProj =
whoAmI;
55230 int num4 = player.HeldItem.useAnimation - (int)
ai[1];
55232 {
55234 }
55235 player.SetDummyItemTime(
num4);
55236 }
55238 {
55239 return;
55240 }
55241 if (
owner == Main.myPlayer)
55242 {
55245 {
55248 }
55249 if (Main.mouseRight && Main.mouseRightRelease)
55250 {
55252 player.mouseInterface = true;
55253 Main.blockMouse = true;
55254 player.SetItemTime(0);
55255 player.itemAnimation = 0;
55256 player.itemAnimationMax = 0;
55257 player.reuseDelay = 0;
55258 return;
55259 }
55260 }
55262 {
55263 if (
base.Center.X - player.Center.X > 0
f)
55264 {
55266 }
55267 else
55268 {
55270 }
55271 }
55274 player.heldProj =
whoAmI;
55276 int num5 = player.HeldItem.useAnimation * 4;
55277 if (
ai[1] > (
float)(
num5 * 3))
55278 {
55280 }
55281 int num6 = player.HeldItem.useAnimation +
Math.Min(
num5, (
int)
ai[1]);
55283 {
55285 }
55286 player.SetDummyItemTime(
num6);
55287 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Vector2 position
The position of this Entity in world coordinates.
static void HitGolfBall(Entity entity, Vector2 velocity, float roughLandResistance)
static bool ValidateShot(Entity golfBall, Player player, ref Vector2 shotVector)
static ShotStrength CalculateShotStrength(Vector2 shotVector, ClubProperties clubProperties)
static bool[] IsAGolfBall
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is a kind of g...
static readonly SoundStyle Item1
static readonly SoundStyle Item126
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...