133
edits
m (Fix small fishing spoiler format.) |
(Added fishing sea land feat.) |
||
Line 98: | Line 98: | ||
The initial chance of catching one extra fish starts at '''5%'''. | The initial chance of catching one extra fish starts at '''5%'''. | ||
If the land feats include '''Beach (3604)''' | If the land feats include: | ||
* '''Beach (3604)''': Adds '''20%''' to the base chance. | |||
* '''Sea (3605)''': Adds '''20%''' to the base chance. | |||
* '''Fishing Spot (3706)''': Adds '''25%''' to the base chance. | |||
Since only '''Sea (3605)''' or '''Beach (3604)''' can be present at the same time (not both), the total chance is calculated as: | |||
<pre> | <pre> | ||
chanceForOneMoreFish = 5 | chanceForOneMoreFish = 5 | ||
chanceForOneMoreFish += isBeach * 20 + isFishingSpot * 25 | chanceForOneMoreFish += isBeach * 20 + isSea * 20 + isFishingSpot * 25 | ||
</pre> | </pre> | ||
Where: | Where: | ||
* '''isBeach''' | * '''isBeach''': A flag (either 0 or 1) indicating whether the land feat is a '''Beach (3604)'''. | ||
* '''isFishingSpot''' | * '''isSea''': A flag (either 0 or 1) indicating whether the land feat is '''Sea (3605)'''. | ||
* '''isFishingSpot''': A flag (either 0 or 1) indicating whether the land feat is a '''Fishing Spot (3706)'''. | |||
For example: | |||
* If '''Sea (3605)''' is present, and '''Fishing Spot (3706)''' is also present: | |||
<pre> | |||
chanceForOneMoreFish = 5 + 1 * 20 + 1 * 25 = 50 | |||
</pre> | |||
* If '''Beach (3604)''' is present instead of '''Sea (3605)''': | |||
<pre> | <pre> | ||
chanceForOneMoreFish = 5 + 1 * 20 + 1 * 25 = 50 | chanceForOneMoreFish = 5 + 1 * 20 + 1 * 25 = 50 | ||
Line 123: | Line 127: | ||
==== Checking the Chance to Increase the Number of Fish ==== | ==== Checking the Chance to Increase the Number of Fish ==== | ||
The '''chanceForOneMoreFish''' value is | The '''chanceForOneMoreFish''' value is compared to a random number generated by the <code>rnd(100)</code> function, which produces a number between '''0''' and '''99''' (inclusive). | ||
If | If '''chanceForOneMoreFish''' is greater than or equal to the random number, the number of fish will increase by '''1'''. | ||
This check is | This check is implemented with: | ||
<pre> | <pre> | ||
Line 133: | Line 137: | ||
</pre> | </pre> | ||
* If the random number generated by <code>rnd(100)</code> is '''50 or less''', | For example: | ||
* If '''chanceForOneMoreFish = 50''', and the random number generated by <code>rnd(100)</code> is '''50 or less''', you will catch an additional fish. | |||
==== Example with Land Feats ==== | |||
==== Example | ===== Example 1: Fishing Spot (3706) and Sea (3605) ===== | ||
Let's say your fishing level is '''22''', and the fish LV is '''1'''. | Let's say your fishing level is '''22''', and the fish LV is '''1'''. The base number of fish is calculated as: | ||
<pre>numberOfFish = rnd(22 / (1 + 10)) + 1 = rnd(2) + 1</pre> | <pre> | ||
numberOfFish = rnd(22 / (1 + 10)) + 1 = rnd(2) + 1 | |||
</pre> | |||
This gives '''1 or 2 fish''', depending on the random result. | |||
Now, | Now, evaluating the land feats: | ||
* | * Start with '''chanceForOneMoreFish = 5''' (base chance). | ||
* '''Sea (3605)''' adds '''20'''. | |||
* '''Fishing Spot (3706)''' adds '''25'''. | |||
The new '''chanceForOneMoreFish''' becomes: | |||
<pre> | <pre> | ||
Line 160: | Line 165: | ||
Next, the random chance is checked: | Next, the random chance is checked: | ||
<pre>if (chanceForOneMoreFish >= rnd(100))</pre> | <pre> | ||
if (chanceForOneMoreFish >= rnd(100)) | |||
</pre> | |||
If the random number generated by <code>rnd(100)</code> is '''50 or less''', the number of fish will increase by '''1'''. Thus: | |||
* '''numberOfFish = numberOfFish + 1''' (if the random check passes). | |||
* If the random number exceeds '''50''', the number of fish remains unchanged. | |||
===== Example 2: Fishing Spot (3706) and Beach (3604) ===== | |||
For the same fishing level and fish LV, the land feats contribute: | |||
* '''Beach (3604)''' adds '''20'''. | |||
* '''Fishing Spot (3706)''' adds '''25'''. | |||
The total '''chanceForOneMoreFish''' remains: | |||
<pre> | |||
chanceForOneMoreFish = 5 + 20 + 25 = 50 | |||
</pre> | |||
The random check behaves the same as above, with the same chance for an additional fish. | |||
====Number of Fish Table==== | ====Number of Fish Table==== | ||
Line 194: | Line 212: | ||
|} | |} | ||
====Code (EA 23. | ==== Code (EA 23.40) ==== | ||
<syntaxhighlight lang="c#" line="1"> | <syntaxhighlight lang="c#" line="1"> | ||
Line 201: | Line 219: | ||
if (EClass.Branch != null) | if (EClass.Branch != null) | ||
{ | { | ||
num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3706) * 25; | num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3605) * 20 + EClass.Branch.Evalue(3706) * 25; | ||
} | } | ||
if (num4 >= EClass.rnd(100)) | if (num4 >= EClass.rnd(100)) |
edits