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

◆ LadyBugLuck()

void Terraria.NPC.LadyBugLuck ( int plr,
bool GoldLadyBug = false )
inlineprivate

Definition at line 92131 of file NPC.cs.

92132 {
92133 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
92134 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
92135 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
92136 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
92137 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
92138 if (releaseOwner != 255 || Main.player[plr].ladyBugLuckTimeLeft < 0.0)
92139 {
92140 return;
92141 }
92142 Vector2 vector = base.Center - Main.player[plr].Center;
92143 int num = 800;
92144 if (((Vector2)(ref vector)).Length() < (float)num)
92145 {
92146 if (((Vector2)(ref vector)).Length() < 30f)
92147 {
92148 vector = default(Vector2);
92149 }
92150 double x = 1.0 - (double)((Vector2)(ref vector)).Length() / (double)num;
92151 x = Math.Pow(x, 6.0);
92152 int num2 = (int)((double)ladyBugGoodLuckTime * x);
92153 if (GoldLadyBug)
92154 {
92155 num2 *= 2;
92156 }
92157 if ((double)num2 > Main.player[plr].ladyBugLuckTimeLeft)
92158 {
92159 Main.player[plr].ladyBugLuckTimeLeft = num2;
92160 Main.player[plr].luckNeedsSync = true;
92161 }
92162 }
92163 }
short releaseOwner
Identifies the player who released this NPC into the world. Used mainly for released critters....
Definition NPC.cs:514
static int ladyBugGoodLuckTime
Definition NPC.cs:1266

References Terraria.Main.player.

Referenced by Terraria.NPC.CheckActive().

+ Here is the caller graph for this function: