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

◆ UpdateNPC_SoulDrainDebuff()

void Terraria.NPC.UpdateNPC_SoulDrainDebuff ( )
inlineprivate

Definition at line 107819 of file NPC.cs.

107820 {
107821 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
107822 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
107823 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
107824 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
107825 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
107826 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
107827 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
107828 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
107829 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
107830 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
107831 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
107832 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
107833 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
107834 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
107835 //IL_0154: Unknown result type (might be due to invalid IL or missing references)
107836 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
107837 if (!soulDrain)
107838 {
107839 return;
107840 }
107841 int num = 1100;
107842 for (int i = 0; i < 255; i++)
107843 {
107844 if (!Main.player[i].active || Main.player[i].dead)
107845 {
107846 continue;
107847 }
107848 Vector2 val = base.Center - Main.player[i].position;
107849 if (((Vector2)(ref val)).Length() < (float)num && Main.player[i].inventory[Main.player[i].selectedItem].type == 3006 && Main.player[i].itemAnimation > 0)
107850 {
107851 if (i == Main.myPlayer)
107852 {
107853 Main.player[i].soulDrain++;
107854 }
107855 if (Main.rand.Next(3) != 0)
107856 {
107857 Vector2 center = base.Center;
107858 center.X += (float)Main.rand.Next(-100, 100) * 0.05f;
107859 center.Y += (float)Main.rand.Next(-100, 100) * 0.05f;
107860 center += velocity;
107861 int num2 = Dust.NewDust(center, 1, 1, 235);
107862 Dust obj = Main.dust[num2];
107863 obj.velocity *= 0f;
107864 Main.dust[num2].scale = (float)Main.rand.Next(70, 85) * 0.01f;
107865 Main.dust[num2].fadeIn = i + 1;
107866 }
107867 }
107868 }
107869 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
bool soulDrain
Definition NPC.cs:682

References Terraria.Main.dust, Terraria.Main.myPlayer, Terraria.Dust.NewDust(), Terraria.Main.player, and Terraria.Main.rand.

+ Here is the call graph for this function: