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

◆ FishingCheck_RollDropLevels()

void Terraria.Projectile.FishingCheck_RollDropLevels ( int fishingLevel,
out bool common,
out bool uncommon,
out bool rare,
out bool veryrare,
out bool legendary,
out bool crate )
inlineprivate

Definition at line 17914 of file Projectile.cs.

17915 {
17916 int num = 150 / fishingLevel;
17917 int num2 = 150 * 2 / fishingLevel;
17918 int num3 = 150 * 7 / fishingLevel;
17919 int num4 = 150 * 15 / fishingLevel;
17920 int num5 = 150 * 30 / fishingLevel;
17921 int num6 = 10;
17922 if (Main.player[owner].cratePotion)
17923 {
17924 num6 += 15;
17925 }
17926 if (num < 2)
17927 {
17928 num = 2;
17929 }
17930 if (num2 < 3)
17931 {
17932 num2 = 3;
17933 }
17934 if (num3 < 4)
17935 {
17936 num3 = 4;
17937 }
17938 if (num4 < 5)
17939 {
17940 num4 = 5;
17941 }
17942 if (num5 < 6)
17943 {
17944 num5 = 6;
17945 }
17946 common = false;
17947 uncommon = false;
17948 rare = false;
17949 veryrare = false;
17950 legendary = false;
17951 crate = false;
17952 if (Main.rand.Next(num) == 0)
17953 {
17954 common = true;
17955 }
17956 if (Main.rand.Next(num2) == 0)
17957 {
17958 uncommon = true;
17959 }
17960 if (Main.rand.Next(num3) == 0)
17961 {
17962 rare = true;
17963 }
17964 if (Main.rand.Next(num4) == 0)
17965 {
17966 veryrare = true;
17967 }
17968 if (Main.rand.Next(num5) == 0)
17969 {
17970 legendary = true;
17971 }
17972 if (Main.rand.Next(100) < num6)
17973 {
17974 crate = true;
17975 }
17976 }

References Terraria.Projectile.owner, Terraria.Main.player, and Terraria.Main.rand.

Referenced by Terraria.Projectile.FishingCheck().