Changes

Jump to navigation Jump to search
Added full detailed description of targeted bait functionality
==Exact Functionality of Targeted Bait==
In order to clear up some of the misconceptions around Targeted Bait, I've decided to actually spell out exactly how it affects the fish-catching process, which is rather complicated. The relevant code can be found in <samp>GameLocation::GetFishFromLocationData</samp> for the overall loop, and <samp>GameLocation::CheckGenericFishRequirements</samp> for the [[Modding:Fish_data#Spawn_rate|Spawn Rate]] effects.
1) First, the game gets a list of all possible catches for the location. This list is then ordered by ascending precedence, and randomly shuffled within each level of precedence.
2) Now, the game iterates over the list of possible catches, checking each Fish in sequence to see if it passes the two associated RNG checks:
:* Locational Chance (specified in <samp>Locations.xnb</samp>) - this is unaffected by Targeted Bait.
:* Spawn Rate (specified in <samp>Fish.xnb</samp>) - this is multiplied by 1.66 for the Targeted Fish, after it has been modified by Fishing Level and after the 0.9 cap. For fish above their Minimum Fishing Zone, this means that final Spawn Rate for targeted fish can be simplified to <code>(Spawn_Multiplier + 0.02 * Fishing_Level) * 1.66</code>. Any Spawn Rate over 1.0 has no effect, as it simply guarantees the RNG check passing.
The game continues iterating over the list, performing these checks on all catches until one of three conditions is met:
:* The Targeted Fish passes both checks. In this case, the Targeted Fish is returned.
:* Three items pass both checks. In this case, the third item (which may or may not be the targeted Fish) is returned.
:* Two full loops of the list are completed without either of the above happening. In this case, the first item to pass both checks is returned.
(Due to Trash existing in all locations (see Default in <samp>Location.xnb</samp>) which has a 1.0 Locational Chance and no <samp>Fish.xnb</samp> data (causing it to auto-pass the Spawn Rate check unless it's the Fishing Tutorial), this means that Trash will always pass its checks, making it impossible to have no items pass both checks.)

So there are two effects that Targeted Bait has on the catch. If not using Targeted Bait, the game simply returns the first item to pass both checks. See the following code from <samp>GameLocation::GetFishFromLocationData</samp>:
:<samp>if (baitTargetFish == null || !(fish.QualifiedItemId != baitTargetFish) || targetedBaitTries >= 2) { return fish; }</samp>
127

edits

Navigation menu