Attempts to select an ammo item stack from this player's inventory to shoot with the given weapon.
- Parameters
-
| weapon | The weapon for which this call should try to find ammo. |
- Returns
- Null if no suitable ammo is found; otherwise, returns the first ammo item found.
Definition at line 54039 of file Player.cs.
54040 {
54041 Item item = null;
54044 {
54045 for (int i = 0; i < 4; i++)
54046 {
54049 {
54052 break;
54053 }
54054 }
54055 }
54056 for (
int j = 54;
j < 58;
j++)
54057 {
54059 {
54062 break;
54063 }
54064 }
54066 {
54067 for (
int k = 0;
k < 54;
k++)
54068 {
54070 {
54072 break;
54073 }
54074 }
54075 }
54076 return item;
54077 }
AmmoID entries represent ammo types. Ammo items that share the same AmmoID value assigned to F:Terrar...
static bool CanChooseAmmo(Item weapon, Item ammo, Player player)
Calls each M:Terraria.ModLoader.GlobalItem.CanChooseAmmo(Terraria.Item,Terraria.Item,...
This serves as the central class from which item-related functions are carried out....
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
References Terraria.ModLoader.ItemLoader.CanChooseAmmo(), Terraria.ID.AmmoID.Coin, and Terraria.Player.inventory.
Referenced by Terraria.Player.HasAmmo(), and Terraria.Player.PickAmmo().