17095 {
17096 if (Main.player[
owner].wet && !(
base.Center.Y >= Main.player[
owner].RotatedRelativePoint(Main.player[
owner].MountedCenter).Y))
17097 {
17098 return;
17099 }
17101 fisher.X = (int)(
base.Center.X / 16f);
17102 fisher.Y = (int)(
base.Center.Y / 16f);
17103 fisher.bobberType =
type;
17105 if (Main.notTheBeesWorld && Main.rand.Next(2) == 0)
17106 {
17107 fisher.inHoney = false;
17108 }
17109 if (
fisher.waterTilesCount < 75)
17110 {
17112 return;
17113 }
17114 fisher.playerFishingConditions = Main.player[
owner].GetFishingConditions();
17117 {
17119 if ((
fisher.X < 380 ||
fisher.X > Main.maxTilesX - 380) &&
fisher.waterTilesCount > 1000 && !
NPC.AnyNPCs(370))
17120 {
17121 ai[1] = Main.rand.Next(-180, -60) - 100;
17124 }
17125 return;
17126 }
17127 fisher.fishingLevel =
fisher.playerFishingConditions.FinalFishingLevel;
17128 if (
fisher.fishingLevel == 0)
17129 {
17130 return;
17131 }
17133 if (
fisher.chumsInWater > 0)
17134 {
17135 fisher.fishingLevel += 11;
17136 }
17137 if (
fisher.chumsInWater > 1)
17138 {
17139 fisher.fishingLevel += 6;
17140 }
17141 if (
fisher.chumsInWater > 2)
17142 {
17143 fisher.fishingLevel += 3;
17144 }
17146 fisher.waterNeededToFish = 300;
17147 float num = (float)Main.maxTilesX / 4200f;
17148 num *= num;
17149 fisher.atmo = (float)((double)(position.Y / 16f - (60f + 10f * num)) / (Main.worldSurface / 6.0));
17150 if ((double)fisher.atmo < 0.25)
17151 {
17152 fisher.atmo = 0.25f;
17153 }
17155 {
17156 fisher.atmo = 1f;
17157 }
17158 fisher.waterNeededToFish = (int)((
float)fisher.waterNeededToFish *
fisher.atmo);
17159 fisher.waterQuality = (float)
fisher.waterTilesCount / (
float)
fisher.waterNeededToFish;
17160 if (
fisher.waterQuality < 1f)
17161 {
17162 fisher.fishingLevel = (int)((
float)fisher.fishingLevel *
fisher.waterQuality);
17163 }
17164 fisher.waterQuality = 1f -
fisher.waterQuality;
17165 if (
fisher.waterTilesCount <
fisher.waterNeededToFish)
17166 {
17168 }
17169 if (Main.player[
owner].luck < 0f)
17170 {
17171 if (Main.rand.NextFloat() < 0f - Main.player[
owner].luck)
17172 {
17173 fisher.fishingLevel = (int)((double)fisher.fishingLevel * (0.9 - (double)Main.rand.NextFloat() * 0.3));
17174 }
17175 }
17176 else if (Main.rand.NextFloat() < Main.player[
owner].luck)
17177 {
17178 fisher.fishingLevel = (int)((double)fisher.fishingLevel * (1.1 + (double)Main.rand.NextFloat() * 0.3));
17179 }
17180 int num2 = (fisher.fishingLevel + 75) / 2;
17181 if (Main.rand.Next(100) >
num2)
17182 {
17183 return;
17184 }
17185 fisher.heightLevel = 0;
17186 if (Main.remixWorld)
17187 {
17188 if ((double)fisher.Y < Main.worldSurface * 0.5)
17189 {
17190 fisher.heightLevel = 0;
17191 }
17192 else if ((double)fisher.Y < Main.worldSurface)
17193 {
17194 fisher.heightLevel = 1;
17195 }
17196 else if ((double)fisher.Y < Main.rockLayer)
17197 {
17198 fisher.heightLevel = 3;
17199 }
17200 else if (
fisher.Y < Main.maxTilesY - 300)
17201 {
17202 fisher.heightLevel = 2;
17203 }
17204 else
17205 {
17206 fisher.heightLevel = 4;
17207 }
17208 if (
fisher.heightLevel == 2 && Main.rand.Next(2) == 0)
17209 {
17210 fisher.heightLevel = 1;
17211 }
17212 }
17213 else if ((double)fisher.Y < Main.worldSurface * 0.5)
17214 {
17215 fisher.heightLevel = 0;
17216 }
17217 else if ((double)fisher.Y < Main.worldSurface)
17218 {
17219 fisher.heightLevel = 1;
17220 }
17221 else if ((double)fisher.Y < Main.rockLayer)
17222 {
17223 fisher.heightLevel = 2;
17224 }
17225 else if (
fisher.Y < Main.maxTilesY - 300)
17226 {
17227 fisher.heightLevel = 3;
17228 }
17229 else
17230 {
17231 fisher.heightLevel = 4;
17232 }
17237 bool flag = false;
17238 if (
fisher.rolledItemDrop > 0)
17239 {
17240 if (Main.player[
owner].sonarPotion)
17241 {
17245 PopupText.AssignAsSonarText(PopupText.NewText(PopupTextContext.SonarAlert,
item, 1,
noStack:
true));
17246 }
17248 ai[1] = (float)Main.rand.Next(-240, -90) -
num3;
17251 flag = true;
17252 }
17253 if (
fisher.rolledEnemySpawn > 0)
17254 {
17255 if (Main.player[
owner].sonarPotion)
17256 {
17258 }
17260 ai[1] = (float)Main.rand.Next(-240, -90) -
num4;
17263 flag = true;
17264 }
17265 if (!flag &&
fisher.inLava)
17266 {
17269 {
17271 }
17273 {
17275 }
17276 if (Main.player[
owner].accLavaFishing)
17277 {
17279 }
17281 {
17283 }
17284 }
17286 {
17288 }
17289 }
static decimal Round(decimal d)
static void HandleSpecialEvent(Player player, int eventID)
static bool[] CanFishInLava
static string GetTextValue(string key)
void FishingCheck_RollDropLevels(int fishingLevel, out bool common, out bool uncommon, out bool rare, out bool veryrare, out bool legendary, out bool crate)
static void GetFishingPondState(int x, int y, out bool lava, out bool honey, out int numWaters, out int chumCount)
void FishingCheck_RollItemDrop(ref FishingAttempt fisher)
void FishingCheck_ProbeForQuestFish(ref FishingAttempt fisher)
void FishingCheck_RollEnemySpawns(ref FishingAttempt fisher)