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

◆ DropGeodeLoot()

static void Terraria.Projectile.DropGeodeLoot ( Entity entity)
inlinestatic

Will drop loot the same way as when F:Terraria.ID.ProjectileID.Geode is cracked open.

Parameters
entityThe entity the loot originates from

Definition at line 93145 of file Projectile.cs.

93146 {
93147 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
93148 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
93149 Dictionary<int, (int, int)> dict = ItemID.Sets.GeodeDrops;
93150 List<int> list = dict.Keys.ToList();
93151 int attempts = 0;
93153 {
93154 attempts++;
93155 int item = Main.rand.Next(list);
93156 list.Remove(item);
93157 int stack = Main.rand.Next(dict[item].Item1, dict[item].Item2);
93158 int num = Item.NewItem(new EntitySource_Loot(entity), entity.position, entity.Size, item, stack);
93159 Main.item[num].noGrabDelay = 0;
93160 if (Main.netMode == 1)
93161 {
93162 NetMessage.SendData(21, -1, -1, null, num, 1f);
93163 }
93164 }
93165 }
Used when an NPC or Projectile is killed and drops loot. Vanilla projectile examples are geodes and...
static Dictionary< int,(int minStack, int maxStack)> GeodeDrops
Dictionary for defining what items will drop from a F:Terraria.ID.ProjectileID.Geode when broken....
Definition ItemID.cs:1625

References Terraria.ID.ItemID.Sets.GeodeDrops, Terraria.Main.item, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Entity.position, Terraria.Main.rand, Terraria.NetMessage.SendData(), and Terraria.Entity.Size.

+ Here is the call graph for this function: