133
edits
(Fix variable name to specify +1 additional fish.) |
m (Fix variable name to specify +1 additional fish.) |
||
Line 147: | Line 147: | ||
Now, you evaluate the land feats: | Now, you evaluate the land feats: | ||
* Starting with ''' | * Starting with '''chanceForOneMoreFish = 5''' (the base chance). | ||
* If the land feats are present: | * If the land feats are present: | ||
* '''Beach (3604)''' adds '''20''' to ''' | * '''Beach (3604)''' adds '''20''' to '''chanceForOneMoreFish'''. | ||
* '''Fishing Spot (3706)''' adds '''25''' to ''' | * '''Fishing Spot (3706)''' adds '''25''' to '''chanceForOneMoreFish'''. | ||
So, the new ''' | So, the new '''chanceForOneMoreFish''' becomes: | ||
<pre> | <pre> | ||
chanceForOneMoreFish = 5 + 20 + 25 = 50 | |||
</pre> | </pre> | ||
Next, the random chance is checked: | Next, the random chance is checked: | ||
<pre>if ( | <pre>if (chanceForOneMoreFish >= rnd(100))</pre> | ||
If the random number generated by <code>rnd(100)</code> is '''50 or less''', '''numberOfFish''' will increase by 1. This means that if the random number is between '''0 and 50''' (inclusive), you will catch an additional fish, making '''numberOfFish''' increase by 1. | If the random number generated by <code>rnd(100)</code> is '''50 or less''', '''numberOfFish''' will increase by 1. This means that if the random number is between '''0 and 50''' (inclusive), you will catch an additional fish, making '''numberOfFish''' increase by 1. |
edits