Coding Help Confused about the calculation of the effective zone of the fishing bubble in Stardew Valley 1.6.15

Fai0

Newcomer
I'm reading source code of FishingRod.cs, curious about the effective zone of the fishing bubbles.
Why the offset of bobber's rectangle need to subtract (80, 80)?
The following code is from about line 488 of FishingRod.cs in the decompiled code of Stardew Valley 1.6.15.

C#:
bool splashPoint = false;
if (location.fishSplashPoint != null)
{
    Rectangle fishSplashRect2 = new Rectangle(location.fishSplashPoint.X * 64, location.fishSplashPoint.Y * 64, 64, 64);
    // Why do it need to subtract 80 here? Why not 64 or 96?
    // It seems that 96 can make the bobber rect intersets with 4 map tiles, too.
    Rectangle bobberRect = new Rectangle((int)this.bobber.X - 80, (int)this.bobber.Y - 80, 64, 64);
    splashPoint = fishSplashRect2.Intersects(bobberRect);
}
o = location.getFish(this.fishingNibbleAccumulator, bait?.QualifiedItemId, this.clearWaterDistance + (splashPoint ? 1 : 0), who, baitPotency + (splashPoint ? 0.4 : 0.0), bobberTile);
The following picture is drawn according to my understanding.
bobber400.png
 
Last edited:
Top