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

◆ TryGetAmmo()

bool Terraria.Main.TryGetAmmo ( Item sourceItem,
out Item ammoItem,
out Color ammoColor,
out float ammoScale,
out Vector2 ammoOffset )
inlineprivate

Definition at line 58254 of file Main.cs.

58255 {
58256 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
58257 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
58258 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
58259 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
58260 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
58261 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
58262 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
58263 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
58264 ammoItem = null;
58265 ammoColor = Color.White;
58266 ammoScale = 0.8f;
58267 ammoOffset = Vector2.Zero;
58268 int type = sourceItem.type;
58269 if (type == 1071 || type == 1543 || type == 1072 || type == 1544)
58270 {
58271 int num = 22;
58272 int num2 = 22;
58273 if (type == 1072 || type == 1544)
58274 {
58275 num = 28;
58276 num2 = 28;
58277 }
58278 ammoOffset = new Vector2((float)num, (float)num2);
58279 ammoItem = player[myPlayer].FindPaintOrCoating();
58280 return ammoItem != null;
58281 }
58282 FlexibleTileWand flexibleTileWand = sourceItem.GetFlexibleTileWand();
58283 if (flexibleTileWand != null && flexibleTileWand.TryGetPlacementOption(LocalPlayer, Player.FlexibleWandRandomSeed, Player.FlexibleWandCycleOffset, out var _, out ammoItem))
58284 {
58285 ammoOffset = new Vector2(28f, 28f);
58286 return true;
58287 }
58288 return false;
58289 }
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static Player LocalPlayer
Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria....
Definition Main.cs:3001
static Player[] player
Definition Main.cs:1960

References Terraria.Player.FlexibleWandCycleOffset, Terraria.Player.FlexibleWandRandomSeed, Terraria.Main.LocalPlayer, Terraria.Main.myPlayer, and Terraria.Main.player.

Referenced by Terraria.Main.DrawInterface_40_InteractItemIcon().

+ Here is the caller graph for this function: