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

◆ GetPreferredGolfBallToUse()

void Terraria.Player.GetPreferredGolfBallToUse ( out int projType)
inline

Definition at line 50346 of file Player.cs.

50347 {
50348 projType = 721;
50349 Item item = inventory[selectedItem];
50350 if (!item.IsAir && item.shoot > 0 && ProjectileID.Sets.IsAGolfBall[item.shoot])
50351 {
50352 projType = item.shoot;
50353 }
50354 else
50355 {
50357 {
50358 return;
50359 }
50360 for (int num = 19; num >= 0; num--)
50361 {
50363 {
50364 _ = num % 10;
50365 Item item2 = armor[num];
50366 if (!item2.IsAir && item2.shoot > 0 && ProjectileID.Sets.IsAGolfBall[item2.shoot])
50367 {
50368 projType = item2.shoot;
50369 return;
50370 }
50371 }
50372 }
50373 for (int i = 0; i < 50; i++)
50374 {
50375 Item item3 = inventory[i];
50376 if (!item3.IsAir && item3.shoot > 0 && ProjectileID.Sets.IsAGolfBall[item3.shoot])
50377 {
50378 projType = item3.shoot;
50379 break;
50380 }
50381 }
50382 }
50383 }
static bool[] IsAGolfBall
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is a kind of g...
bool PreferredGolfBall(ref int projType)
Mirrors Player.GetPreferredGolfBallToUse. Provides the golf ball projectile from an accessory slot.
This serves as a central place to store equipment slots and their corresponding textures....
Item[] armor
The player's armor and accessories. Indexes 0-2 hold head, chest, and legs armor while 10-12 hold the...
Definition Player.cs:1651
bool IsItemSlotUnlockedAndUsable(int slot)
Definition Player.cs:10650
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player.armor, Terraria.Player.inventory, Terraria.ID.ProjectileID.Sets.IsAGolfBall, Terraria.Item.IsAir, Terraria.Player.IsItemSlotUnlockedAndUsable(), Terraria.ModLoader.AccessorySlotLoader.PreferredGolfBall(), Terraria.Player.selectedItem, and Terraria.Item.shoot.

Referenced by Terraria.Player.TileInteractionsUse(), and Terraria.Player.TryPlacingAGolfBallNearANearbyTee().

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