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

◆ NPCLoot_DropCommonLifeAndMana()

void Terraria.NPC.NPCLoot_DropCommonLifeAndMana ( Player closestPlayer)
inlineprivate

Definition at line 71806 of file NPC.cs.

71807 {
71808 if (type != 16 && type != 81 && type != 121 && closestPlayer.RollLuck(6) == 0 && lifeMax > 1 && damage > 0)
71809 {
71810 if (Main.rand.Next(2) == 0 && closestPlayer.statMana < closestPlayer.statManaMax2)
71811 {
71812 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 184);
71813 }
71814 else if (Main.rand.Next(2) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2)
71815 {
71816 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
71817 }
71818 }
71819 if (type != 16 && type != 81 && type != 121 && closestPlayer.RollLuck(2) == 0 && lifeMax > 1 && damage > 0 && closestPlayer.statMana < closestPlayer.statManaMax2)
71820 {
71821 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 184);
71822 }
71823 }
Vector2 position
Definition Entity.cs:14
int damage
Definition NPC.cs:461
int lifeMax
Definition NPC.cs:479
int type
Definition NPC.cs:445
IEntitySource GetItemSource_Loot()
Definition NPC.cs:87551

References Terraria.Item.NewItem(), Terraria.Main.rand, and System.type.

Referenced by Terraria.NPC.NPCLoot_DropHeals().