19512 {
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522 if (Main.player[
owner].wet && !(
base.Center.Y >= Main.player[
owner].RotatedRelativePoint(Main.player[
owner].MountedCenter).Y))
19523 {
19524 return;
19525 }
19527 fisher.X = (int)(
base.Center.X / 16
f);
19528 fisher.Y = (int)(
base.Center.Y / 16
f);
19529 fisher.bobberType =
type;
19531 if (Main.notTheBeesWorld && Main.rand.Next(2) == 0)
19532 {
19533 fisher.inHoney = false;
19534 }
19535 if (
fisher.waterTilesCount < 75)
19536 {
19538 return;
19539 }
19540 fisher.playerFishingConditions = Main.player[
owner].GetFishingConditions();
19541 if (
fisher.playerFishingConditions.BaitItemType == 2673)
19542 {
19544 if ((
fisher.X < 380 ||
fisher.X > Main.maxTilesX - 380) &&
fisher.waterTilesCount > 1000 && !
NPC.AnyNPCs(370))
19545 {
19546 ai[1] = Main.rand.Next(-180, -60) - 100;
19549 }
19550 return;
19551 }
19552 fisher.fishingLevel =
fisher.playerFishingConditions.FinalFishingLevel;
19553 if (
fisher.fishingLevel == 0)
19554 {
19555 return;
19556 }
19558 if (
fisher.chumsInWater > 0)
19559 {
19560 fisher.fishingLevel += 11;
19561 }
19562 if (
fisher.chumsInWater > 1)
19563 {
19564 fisher.fishingLevel += 6;
19565 }
19566 if (
fisher.chumsInWater > 2)
19567 {
19568 fisher.fishingLevel += 3;
19569 }
19571 fisher.waterNeededToFish = 300;
19572 float num = (float)Main.maxTilesX / 4200
f;
19574 fisher.atmo = (float)((
double)(position.Y / 16
f - (60
f + 10
f *
num)) / (Main.worldSurface / 6.0));
19575 if ((double)fisher.atmo < 0.25)
19576 {
19577 fisher.atmo = 0.25f;
19578 }
19580 {
19582 }
19583 fisher.waterNeededToFish = (int)((
float)fisher.waterNeededToFish *
fisher.atmo);
19584 fisher.waterQuality = (float)
fisher.waterTilesCount / (
float)
fisher.waterNeededToFish;
19585 if (
fisher.waterQuality < 1
f)
19586 {
19587 fisher.fishingLevel = (int)((
float)fisher.fishingLevel *
fisher.waterQuality);
19588 }
19589 fisher.waterQuality = 1
f -
fisher.waterQuality;
19590 if (
fisher.waterTilesCount <
fisher.waterNeededToFish)
19591 {
19593 }
19594 if (Main.player[
owner].luck < 0
f)
19595 {
19596 if (Main.rand.NextFloat() < 0
f - Main.player[
owner].luck)
19597 {
19598 fisher.fishingLevel = (int)((double)fisher.fishingLevel * (0.9 - (double)Main.rand.NextFloat() * 0.3));
19599 }
19600 }
19601 else if (Main.rand.NextFloat() < Main.player[
owner].luck)
19602 {
19603 fisher.fishingLevel = (int)((double)fisher.fishingLevel * (1.1 + (double)Main.rand.NextFloat() * 0.3));
19604 }
19605 int num2 = (fisher.fishingLevel + 75) / 2;
19606 if (Main.rand.Next(100) >
num2)
19607 {
19608 return;
19609 }
19610 fisher.heightLevel = 0;
19611 if (Main.remixWorld)
19612 {
19613 if ((double)fisher.Y < Main.worldSurface * 0.5)
19614 {
19615 fisher.heightLevel = 0;
19616 }
19617 else if ((double)fisher.Y < Main.worldSurface)
19618 {
19619 fisher.heightLevel = 1;
19620 }
19621 else if ((double)fisher.Y < Main.rockLayer)
19622 {
19623 fisher.heightLevel = 3;
19624 }
19625 else if (
fisher.Y < Main.maxTilesY - 300)
19626 {
19627 fisher.heightLevel = 2;
19628 }
19629 else
19630 {
19631 fisher.heightLevel = 4;
19632 }
19633 if (
fisher.heightLevel == 2 && Main.rand.Next(2) == 0)
19634 {
19635 fisher.heightLevel = 1;
19636 }
19637 }
19638 else if ((double)fisher.Y < Main.worldSurface * 0.5)
19639 {
19640 fisher.heightLevel = 0;
19641 }
19642 else if ((double)fisher.Y < Main.worldSurface)
19643 {
19644 fisher.heightLevel = 1;
19645 }
19646 else if ((double)fisher.Y < Main.rockLayer)
19647 {
19648 fisher.heightLevel = 2;
19649 }
19650 else if (
fisher.Y < Main.maxTilesY - 300)
19651 {
19652 fisher.heightLevel = 3;
19653 }
19654 else
19655 {
19656 fisher.heightLevel = 4;
19657 }
19664 AdvancedPopupRequest sonar = default(AdvancedPopupRequest);
19668 if (sonar.Text !=
null && Main.player[
owner].sonarPotion)
19669 {
19670 PopupText.AssignAsSonarText(PopupText.NewText(sonar,
sonarPosition));
19671 }
19672 if (
fisher.rolledItemDrop > 0)
19673 {
19674 if (sonar.Text ==
null && Main.player[
owner].sonarPotion)
19675 {
19676 Item item = new Item();
19677 item.SetDefaults(
fisher.rolledItemDrop);
19679 PopupText.AssignAsSonarText(PopupText.NewText(PopupTextContext.SonarAlert, item, 1,
noStack:
true));
19680 }
19682 ai[1] = (float)Main.rand.Next(-240, -90) -
num3;
19686 }
19687 if (
fisher.rolledEnemySpawn > 0)
19688 {
19689 if (sonar.Text ==
null && Main.player[
owner].sonarPotion)
19690 {
19692 }
19694 ai[1] = (float)Main.rand.Next(-240, -90) -
num4;
19698 }
19700 {
19703 {
19705 }
19707 {
19709 }
19710 if (Main.player[
owner].accLavaFishing)
19711 {
19713 }
19715 {
19717 }
19718 }
19720 {
19722 }
19723 }
Vector2 position
The position of this Entity in world coordinates.
static void HandleSpecialEvent(Player player, int eventID)
static bool[] CanFishInLava
If true for a given item type (F:Terraria.Item.type), then fishing rods (F:Terraria....
static bool[] IsLavaBait
If true for a given item type (F:Terraria.Item.type), then bait (F:Terraria.Item.bait > 0) of that ty...
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
static void ModifyFishingAttempt(Player player, ref FishingAttempt attempt)
static void CatchFish(Player player, FishingAttempt attempt, ref int itemDrop, ref int enemySpawn, ref AdvancedPopupRequest sonar, ref Vector2 sonarPosition)
This is where all ModPlayer hooks are gathered and called.
void FishingCheck_RollDropLevels(int fishingLevel, out bool common, out bool uncommon, out bool rare, out bool veryrare, out bool legendary, out bool crate)
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
static void GetFishingPondState(int x, int y, out bool lava, out bool honey, out int numWaters, out int chumCount)
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
void FishingCheck_RollItemDrop(ref FishingAttempt fisher)
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
void FishingCheck_ProbeForQuestFish(ref FishingAttempt fisher)
void FishingCheck_RollEnemySpawns(ref FishingAttempt fisher)