Изменения

Нет описания правки
Строка 1: Строка 1:  
← [[Модификации:Индекс|Индекс]]
 
← [[Модификации:Индекс|Индекс]]
{{Переведите}}
  −
This page explains how the game stores and parses crops data. This is an advanced guide for mod developers.
     −
==Raw data==
+
На этой странице объясняется, как игра хранит и анализирует данные о культурах. Это расширенное руководство для разработчиков модов.
Crop data is stored in <tt>Content\Data\Crops.xnb</tt>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
     −
{{collapse|Data|content=<syntaxhighlight lang="json">
+
==Источник==
 +
Данные о культурах храняться в <tt>Content\Data\Crops.xnb</tt>, могут быть [[Модификации:Редактирование_XNB_файлов#Редактирование распакованных данных|извлечены для редактирования]]. Вот исходные данные по состоянию на {{version|1.5.1}} для примера:
 +
 
 +
{{collapse|Данные|content=<syntaxhighlight lang="json">
 
{
 
{
 
   "472": "1 1 1 1/spring/0/24/-1/0/false/false/false",
 
   "472": "1 1 1 1/spring/0/24/-1/0/false/false/false",
Строка 57: Строка 57:  
</syntaxhighlight>}}
 
</syntaxhighlight>}}
   −
==Format==
+
==Формат==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Index
+
! Индекс
! Field
+
! Поле
! colspan="2"|Example Value
+
! colspan="2"|Пример значения
 
|-
 
|-
 
| Key
 
| Key
| Seed Index <small>(from [[Modding:Object data|ObjectInformation.xnb]])</small>
+
| Индекс семян <small>(смотри [[Модификации:Объекты|ObjectInformation.xnb]])</small>
| 473 <small>''(Bean Starter)''</small>
+
| 473 <small>''([[Рассада зеленой фасоли]])''</small>
| 455 <small>''(Spangle Seeds)''</small>
+
| 455 <small>''([[Семена блестника]])''</small>
 
|-
 
|-
 
| 0
 
| 0
| Days in each stage of growth
+
| Дни до каждой стадии роста
 
| 1 1 1 3 4
 
| 1 1 1 3 4
 
| 1 2 3 2
 
| 1 2 3 2
 
|-
 
|-
 
| 1
 
| 1
| Growth Season(s)
+
| Сезон(ы) роста
 
| spring
 
| spring
 
| summer
 
| summer
 
|-
 
|-
 
| 2
 
| 2
| Index in Sprite Sheet <small>(<tt>Content\TileSheets\Crops.xnb</tt>)</small>
+
| ID спрайт-листа <small>(<tt>Content\TileSheets\Crops.xnb</tt>)</small>
 
| 1
 
| 1
 
| 29
 
| 29
 
|-
 
|-
 
| 3
 
| 3
| Index of Harvest <small>(from [[Modding:Object data|ObjectInformation.xnb]])</small>
+
| ID урожая <small>(from [[Модификации:Объекты|ObjectInformation.xnb]])</small>
| 188 <small>''(Green Bean)''</small>
+
| 188 <small>''([[Зеленая фасоль]])''</small>
| 593 <small>''(Summer Spangle)''</small>
+
| 593 <small>''([[Летний блестник]])''</small>
 
|-
 
|-
 
| 4
 
| 4
| Regrow after Harvest
+
| Продолжить давать урожай
 
| 3
 
| 3
 
| -1
 
| -1
 
|-
 
|-
 
| 5
 
| 5
| Harvest Method
+
| Способ сбора Урожая
 
| 0
 
| 0
 
| 0
 
| 0
 
|-
 
|-
 
| 6
 
| 6
| Chance for Extra Harvest
+
| Шанс на дополнительный урожай
 
| true 1 2 6 0
 
| true 1 2 6 0
 
| false
 
| false
 
|-
 
|-
 
| 7
 
| 7
| Raised Seeds
+
| Выращенные семена
 
| true
 
| true
 
| false
 
| false
 
|-
 
|-
 
| 8
 
| 8
| Tint Color
+
| Цвет/оттенок
 
| false
 
| false
 
| true 0 208 255 99 255 210 255 212 0 255 144 122 255 0 238 206 91 255
 
| true 0 208 255 99 255 210 255 212 0 255 144 122 255 0 238 206 91 255
 
|}
 
|}
   −
===Days in each stage of growth===
+
===Дни на каждой стадии роста===
The number of days in each visual step of growth. The final stage will be harvestable after the specified number of days.
+
Количество дней в каждом визуальном шаге роста. Заключительный этап будет убран через указанное количество дней.
   −
===Regrow after harvest===
+
===Продолжить давать урожай===
Either -1 for no regrowth, or the number of days until the crop can be harvested again.
+
Либо -1 для разового сбора, либо количество дней до того, как урожай можно будет собрать снова.
   −
===Harvest method===
+
===Способ сбора урожая===
1 for Scythe, 0 for all others
+
1 для косы, 0 для всех остальных
   −
===Chance for extra harvest===
+
===Шанс на дополнительный урожай===
If this value is true, then the numbers that follow are parsed as:
+
Если это значение равно true, то последующие числа анализируются как:
 
#minHarvest
 
#minHarvest
 
#maxHarvest
 
#maxHarvest
Строка 131: Строка 131:  
#chanceForExtraCrops
 
#chanceForExtraCrops
   −
The game determines the number of crops gained at a single harvest using the following code from <tt>Crops.cs::harvest()</tt>, where <tt>num</tt> is the number of crops gained:
+
Игра определяет количество урожаев, полученных за один сбор урожая, используя следующий код из<tt>Crops.cs::harvest()</tt>, где <tt>num</tt> является количеством полученного урожая:
    
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
Строка 145: Строка 145:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
The result (''i.e.'', <tt>num</tt>) of <code>random.Next(this.minHarvest, Math.Min(this.minHarvest + 1, this.maxHarvest + 1 + Game1.player.FarmingLevel / this.maxHarvestIncreasePerFarmingLevel))</code> is '''always the minHarvest''', for 2 reasons.
+
Результат (''т.е.'', <tt>число</tt>) <code>random.Next(this.minHarvest, Math.Min(this.minHarvest + 1, this.maxHarvest + 1 + Game1.player.FarmingLevel / this.maxHarvestIncreasePerFarmingLevel))</code> - '''всегда minHarvest''', по 2 причинам.
#Taking the <tt>Math.Min</tt> of (<tt>minHarvest + 1</tt>) and (<tt>this.maxHarvest + 1 + Game1.player.FarmingLevel / this.maxHarvestIncreasePerFarmingLevel</tt>) always results in (<tt>minHarvest + 1</tt>)
+
#Принимая <tt>Math.Min</tt> от (<tt>minHarvest + 1</tt>) да (<tt>this.maxHarvest + 1 + Game1.player.FarmingLevel / this.maxHarvestIncreasePerFarmingLevel</tt>) всегда приводит к (<tt>minHarvest + 1</tt>)
#<tt>random.Next</tt> uses an inclusive lower bound and an exclusive upper bound, so it is effectively calculating a random number between <tt>minHarvest</tt> and <tt>minHarvest</tt>
+
#<tt>random.Next</tt> использует инклюзивную нижнюю границу и эксклюзивную верхнюю границу, поэтому он эффективно вычисляет случайное число между <tt>minHarvest</tt> и <tt>minHarvest</tt>
Therefore, as of v1.2, only 3 seeds always give more than one crop per harvest, and that number is equal to the minHarvest:
+
Следовательно, по состоянию на v1.2, только 3 семени всегда дают более одного урожая за урожай, и это число равно minHarvest:
*Coffee Bean (433) -- 4 Beans
+
*Кофейные Зерна (433) -- 4 зерна
*Blueberry Seeds (481) -- 3 Blueberries
+
*Семена черники (481) -- 3 ягоды
*Cranberry Seeds (493) -- 2 Cranberries
+
*Семена клюквы (493) -- 2 ягоды
   −
The value in <tt>chanceForExtraCrops</tt> may add additional crops to a harvest, calculated independently of the other 3 variables. For example, each harvest of a Potato Seed (475) has &#8776;20% chance of yielding an extra potato, in addition to the one Potato given as standard harvest. Each harvest of a Blueberry Seed (481) has &#8776;2% chance of yielding an extra Blueberry, in addition to the 3 Blueberries given as standard harvest.
+
Значение в <tt>chanceForExtraCrops</tt> может добавить дополнительные культуры к урожаю, рассчитанному независимо от других 3 переменных. Например, каждый урожай Семян картофеля (475) имеет 20% шанс получить дополнительный картофель в дополнение к одному картофелю, полученному в качестве стандартного урожая. Каждый урожай семян черники (481) имеет 2% шанс получить дополнительную чернику в дополнение к 3 ягодам черники, полученным в качестве стандартного урожая.
   −
===Raised seeds===
+
===Выращенные семена===
True for trellis crops (Grapes, Hops, Green Beans), false for all others.
+
Верно для следующих культур: Виноград, Хмель, Зеленая фасоль, неверно для всех остальных.
   −
===Tint color===
+
===Цвет/Оттенок===
If Tint Color is true, a string of rgb() values followsIn the example above, Summer Spangle can be one of 6 different colors:
+
Если значение Tint Color равно true, то следует строка значений rgb().  В приведенном выше примере Летний блестник может быть одного из 6 различных цветов:
 
*rgb(0, 208, 255)
 
*rgb(0, 208, 255)
 
*rgb(99, 255, 210)
 
*rgb(99, 255, 210)
602

правки