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

◆ setFireFlyChance()

static void Terraria.NPC.setFireFlyChance ( )
inlinestatic

Definition at line 110591 of file NPC.cs.

110592 {
110593 if (Main.rand == null)
110594 {
110595 Main.rand = new UnifiedRandom((int)DateTime.Now.Ticks);
110596 }
110597 if (WorldGen.genRand.Next(9) == 0)
110598 {
110599 fireFlyChance = Main.rand.Next(5, 10);
110600 fireFlyFriendly = Main.rand.Next(1, 4);
110601 fireFlyMultiple = Main.rand.Next(3, 8);
110602 }
110603 else if (WorldGen.genRand.Next(3) == 0)
110604 {
110605 fireFlyChance = 999999;
110606 fireFlyFriendly = 999999;
110607 fireFlyMultiple = 999999;
110608 }
110609 else
110610 {
110611 fireFlyChance = Main.rand.Next(10, 60);
110612 fireFlyFriendly = Main.rand.Next(2, 15);
110613 fireFlyMultiple = Main.rand.Next(6, 30);
110614 }
110615 if (Main.rand.Next(3) == 0)
110616 {
110617 butterflyChance = 999999;
110618 stinkBugChance = Main.rand.Next(1, 14);
110619 if (WorldGen.genRand.Next(5) == 0)
110620 {
110621 stinkBugChance = 999999;
110622 }
110623 }
110624 else
110625 {
110626 stinkBugChance = 999999;
110627 butterflyChance = Main.rand.Next(1, 21);
110628 if (WorldGen.genRand.Next(5) == 0)
110629 {
110630 butterflyChance = 999999;
110631 }
110632 }
110633 if (Main.tenthAnniversaryWorld)
110634 {
110635 fireFlyChance = Math.Max(1, (int)((float)fireFlyChance * 0.5f));
110636 butterflyChance = Math.Max(1, (int)((float)butterflyChance * 0.5f));
110637 }
110638 }
static int stinkBugChance
Definition NPC.cs:572
static int butterflyChance
Definition NPC.cs:570
static int fireFlyChance
Definition NPC.cs:566
static int fireFlyFriendly
Definition NPC.cs:564
static int fireFlyMultiple
Definition NPC.cs:568

References Terraria.WorldGen.genRand, Terraria.Main.rand, and Terraria.Main.tenthAnniversaryWorld.

Referenced by Terraria.IO.WorldFile.LoadWorld(), and Terraria.Main.UpdateTime_StartNight().

+ Here is the caller graph for this function: