Alterações

4 319 bytes adicionados ,  03h19min de 29 de janeiro de 2019
Criou a página com "{{Traduzir}} ← Modding:Index This page explains how the game stores and parses fish data, including spawning mechanics. This is an advanced guide for mod developers...."
{{Traduzir}}
← [[Modding:Index]]

This page explains how the game stores and parses fish data, including spawning mechanics. This is an advanced guide for mod developers.

==Parsing fish spawn conditions==
The game checks two places to determine which fish to spawn when the player is fishing. This only applies to normal fish; the chance of spawning a legendary fish is calculated separately by the location code, ''before'' following the rules below. <small>(Reverse engineered from <tt>BobberBar</tt> and <tt>GameLocation::getFish</tt>.)</small>

===Spawn locations===
Each fish is assigned to an area within the location, and will only spawn if the player is within that area. The tile coordinates for each area is defined by <code>GameLocation::getFishingLocation</code>, which can be overridden for each game location. The following areas are defined:
* [[Cindersap Forest]]:
** [[Cindersap Forest#The Pond|pond]] (area #1 for tiles <code>(0, 0)</code> through <code>(52, 42)</code> inclusively);
** [[Cindersap Forest#The River|river]] (area #0 matching any other part of the forest).
* All other locations only have area -1, so where you fish from has no impact.

The fish that can be spawned in a given location are defined in the slash-delimited data from <code>Data\Locations.xnb</code>, specifically field indexes 4 (spring), 5 (summer), 6 (fall), and 7 (winter). Each field contains any number of {{t|int fishID}} (matching <code>Data\Fish.xnb</code>) + {{t|int areaID}} (or -1 for any area) pairs. For example, [[Cindersap Forest]] has this fish data for summer: <code>153 -1 145 0 144 -1 138 0 132 0 706 0 704 0 702 0</code>. That can be parsed as:
{| class="wikitable"
|-
! value
! fish
! area
|-
| <code>153 -1</code>
| [[Green Algae]]
| any (pond or river)
|-
| <code>145 0</code>
| [[Sunfish]]
| river
|-
| <code>144 -1</code>
| [[Pike]]
| any (pond or river)
|-
| <code>138 0</code>
| [[Rainbow Trout]]
| river
|-
| <code>132 0</code>
| [[Bream]]
| river
|-
| <code>706 0</code>
| [[Shad]]
| river
|-
| <code>704 0</code>
| [[Dorado]]
| river
|-
| <code>702 0</code>
| [[Chub]]
| river
|}

===Fish data and spawn criteria===
The fish data and spawn criteria is stored as thirteen slash-delimited fields in <code>Data\Fish.xnb</code>:
{| class="wikitable"
|-
! index
! syntax
! example
! content
|-
| 0
| <code>name</code>
| <code>Pufferfish</code>
| The fish name.
|-
| 1
| <code>number</code>
| <code>80</code>
| How often the fish darts in the fishing minigame; between 15 ([[carp]]) and 100 ([[glacierfish]]).
|-
| 2
| <code>"mixed&#124;dart&#124;smooth&#124;floater&#124;sinker"</code>
| <code>floater</code>
| How the bobber behaves during the fishing minigame.
|-
| 3
| <code>int</code>
| <code>1</code>
| The minimum fish size (in inches).
|-
| 4
| <code>int</code>
| <code>36</code>
| The maximum fish size (in inches).
|-
| 5
| [<code>min time</code> <code>max time</code>]+
| <code>1200 1600</code>
| The time of day when they spawn. The min time is inclusive, max time is exclusive. May specify multiple ranges.
|-
| 6
| [<code>"spring&#124;summer&#124;fall&#124;winter</code>"]+
| <code>season ID</code>
| The seasons when they spawn. May specify multiple. (This is ignored. Seasons are taken from Locations.xnb instead)
|-
| 7
| <code>"sunny&#124;rainy&#124;both"</code>
| <code>sunny</code>
| The weather when they spawn.
|-
| 8
|
| <code>690 .4 685 .1</code>
| Unused.
|-
| 9
| <code>number</code>
| <code>4</code>
| The minimum water depth.
|-
| 10
| <code>number</code>
| <code>.3</code>
| Spawn multiplier; used in spawn rate calculation (see below).
|-
| 11
| <code>number</code>
| <code>.5</code>
| Depth multiplier; used in spawn rate calculation (see below).
|-
| 12
| <code>level</code>
| <code>0</code>
| The minimum [[skills|fishing level]].
|}
Note that as of v1.2, the game multiplies fish size by 2.54 for all languages other than English (for conversion from inches to cm). See <tt>FishingRod::draw</tt>.

===Spawn rate===
If a fish matches the spawn criteria, the probability that it will spawn is ''{spawn multiplier} - max(0, {minimum depth} - {actual depth}) × {depth multiplier} × {spawn multiplier} + {fishing level} / 50'', up to a maximum of 90%. The ''actual depth'' is the bobber's tile distance from land.

[[Category:Modding]]

[[en:Modding:Fish data]]
660

edições