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

◆ NPCLoot_DropCommonLifeAndMana()

void Terraria.NPC.NPCLoot_DropCommonLifeAndMana ( Player closestPlayer)
inlineprivate

Definition at line 85220 of file NPC.cs.

85221 {
85222 if (type != 16 && type != 81 && type != 121 && closestPlayer.RollLuck(6) == 0 && lifeMax > 1 && damage > 0)
85223 {
85224 if (Main.rand.Next(2) == 0 && closestPlayer.statMana < closestPlayer.statManaMax2)
85225 {
85226 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 184);
85227 }
85228 else if (Main.rand.Next(2) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2)
85229 {
85230 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 58);
85231 }
85232 }
85233 if (type != 16 && type != 81 && type != 121 && closestPlayer.RollLuck(2) == 0 && lifeMax > 1 && damage > 0 && closestPlayer.statMana < closestPlayer.statManaMax2)
85234 {
85235 Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, 184);
85236 }
85237 }
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
int damage
The amount of contact damage this NPC deals. Changing this WILL NOT change the amount of damage done...
Definition NPC.cs:1027
int lifeMax
The maximum life of this NPC.
Definition NPC.cs:1077
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.Item.NewItem(), and Terraria.Main.rand.

Referenced by Terraria.NPC.NPCLoot_DropHeals().

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