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

◆ NPCLoot_DropHeals()

void Terraria.NPC.NPCLoot_DropHeals ( Player closestPlayer)
inlineprivate

Definition at line 84739 of file NPC.cs.

84740 {
84742 switch (type)
84743 {
84744 case 305:
84745 case 306:
84746 case 307:
84747 case 308:
84748 case 309:
84749 case 310:
84750 case 311:
84751 case 312:
84752 case 313:
84753 case 314:
84754 case 329:
84755 case 330:
84756 if (closestPlayer.RollLuck(4) == 0)
84757 {
84758 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84759 }
84760 break;
84761 case 326:
84762 if (closestPlayer.RollLuck(6) == 0)
84763 {
84764 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84765 }
84766 break;
84767 case 315:
84768 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84769 break;
84770 case 341:
84771 {
84772 int num2 = Main.rand.Next(5, 11);
84773 for (int j = 0; j < num2; j++)
84774 {
84775 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84776 }
84777 break;
84778 }
84779 case 338:
84780 case 339:
84781 case 340:
84782 if (closestPlayer.RollLuck(5) == 0)
84783 {
84784 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84785 }
84786 break;
84787 case 342:
84788 if (Main.rand.Next(3) != 0)
84789 {
84790 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84791 }
84792 break;
84793 case 325:
84794 case 327:
84795 case 344:
84796 case 345:
84797 case 346:
84798 {
84799 int num = Main.rand.Next(6) + 6;
84800 for (int i = 0; i < num; i++)
84801 {
84802 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84803 }
84804 break;
84805 }
84806 case 267:
84807 if (Main.rand.Next(2) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2)
84808 {
84809 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84810 }
84811 break;
84812 case 13:
84813 case 14:
84814 case 15:
84815 if (Main.rand.Next(4) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2)
84816 {
84817 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84818 }
84819 break;
84820 case 116:
84821 case 117:
84822 case 118:
84823 case 119:
84824 if (!Main.expertMode || Main.rand.Next(5) == 0)
84825 {
84826 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84827 }
84828 break;
84829 case 139:
84830 if (Main.rand.Next(2) == 0)
84831 {
84832 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
84833 }
84834 break;
84835 }
84836 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
void NPCLoot_DropCommonLifeAndMana(Player closestPlayer)
Definition NPC.cs:85220
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
IEntitySource GetItemSource_Loot()
Definition NPC.cs:107573

References Terraria.Main.expertMode, Terraria.NPC.GetItemSource_Loot(), Terraria.Entity.height, Terraria.Item.NewItem(), Terraria.NPC.NPCLoot_DropCommonLifeAndMana(), Terraria.Entity.position, Terraria.Main.rand, Terraria.NPC.type, and Terraria.Entity.width.

Referenced by Terraria.NPC.NPCLoot().

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