private static int Player_FishingLevel(On.Terraria.Player.orig_FishingLevel orig, Player self) { Item fishingPole = self.inventory[self.selectedItem]; if (fishingPole.fishingPole == 0) { for (int i = 0; i < 58; i++) { if (self.inventory[i].fishingPole > fishingPole.fishingPole) { fishingPole = self.inventory[i]; } } foreach (Item item in self.inventory.OfType <FishingBelt>().SelectMany(belt => belt.Handler.Items)) { if (item.fishingPole > fishingPole.fishingPole) { fishingPole = item; } } } Item bait = new Item(); for (int i = 0; i < 58; i++) { if (self.inventory[i].stack > 0 && self.inventory[i].bait > 0) { if (self.inventory[i].type == 2673) { return(-1); } bait = self.inventory[i]; break; } } if (bait.IsAir) { foreach (Item item in self.inventory.OfType <FishingBelt>().SelectMany(belt => belt.Handler.Items)) { if (item.stack > 0 && item.bait > 0) { if (item.type == 2673) { return(-1); } bait = item; break; } } } if (bait.IsAir || fishingPole.fishingPole == 0) { return(0); } int fishingLevel = bait.bait + fishingPole.fishingPole + self.fishingSkill; if (Main.raining) { fishingLevel = (int)(fishingLevel * 1.2f); } if (Main.cloudBGAlpha > 0f) { fishingLevel = (int)(fishingLevel * 1.1f); } if (Main.dayTime && (Main.time < 5400.0 || Main.time > 48600.0)) { fishingLevel = (int)(fishingLevel * 1.3f); } if (Main.dayTime && Main.time > 16200.0 && Main.time < 37800.0) { fishingLevel = (int)(fishingLevel * 0.8f); } if (!Main.dayTime && Main.time > 6480.0 && Main.time < 25920.0) { fishingLevel = (int)(fishingLevel * 0.8f); } if (Main.moonPhase == 0) { fishingLevel = (int)(fishingLevel * 1.1f); } if (Main.moonPhase == 1 || Main.moonPhase == 7) { fishingLevel = (int)(fishingLevel * 1.05f); } if (Main.moonPhase == 3 || Main.moonPhase == 5) { fishingLevel = (int)(fishingLevel * 0.95f); } if (Main.moonPhase == 4) { fishingLevel = (int)(fishingLevel * 0.9f); } PlayerHooks.GetFishingLevel(self, fishingPole, bait, ref fishingLevel); return(fishingLevel); }