Изменения

Нет описания правки
Строка 2: Строка 2:  
{{Переведите}}
 
{{Переведите}}
   −
This page documents how the game generates [[weather]] in the game.
+
Данная страница документирует генерацию внутриигровой [[Погода|погоды]].
    
==Данные==
 
==Данные==
The weather is controlled by the integer field <tt>Game1::weatherForTomorrow</tt>. The possible values are:
+
Погода управляется целым числом <samp>Game1::weatherForTomorrow</samp>. Возможные значения погоды:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
 
! Значение
 
! Значение
Строка 14: Строка 14:  
|-
 
|-
 
| 0
 
| 0
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| sunny
+
| Солнечно
 
|-
 
|-
 
| 1
 
| 1
| <tt>weather_rain</tt>
+
| <samp>weather_rain</samp>
| rain
+
| Дождь
 
|-
 
|-
 
| 2
 
| 2
| <tt>weather_debris</tt>
+
| <samp>weather_debris</samp>
| windy
+
| Ветер
 
|-
 
|-
 
| 3
 
| 3
| <tt>weather_lightning</tt>
+
| <samp>weather_lightning</samp>
| lightning
+
| Гроза
 
|-
 
|-
 
| 4
 
| 4
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| festival
+
| Фестиваль
 
|-
 
|-
 
| 5
 
| 5
| <tt>weather_snow</tt>
+
| <samp>weather_snow</samp>
| snow
+
| Снегопад
 
|-
 
|-
 
| 6
 
| 6
| <tt>weather_wedding</tt>
+
| <samp>weather_wedding</samp>
| wedding
+
| Свадьба
 
|}
 
|}
   −
==Algorithm==
+
==Алгоритм==
===Forced weather===
+
===Фиксированная погода===
Certain dates always have the same weather:
+
На определённые даты погода уже предопределена:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! date
+
! дата
! weather
+
! погода
! overridden by
+
! переопределено
 
|-
 
|-
| spring 1
+
| весна 1
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt> and <tt>tv</tt>
+
| <samp>newday</samp> and <samp>tv</samp>
 
|-
 
|-
| spring 2 (year 1)
+
| весна 2 (год 1)
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| spring 3 (year 1)
+
| весна 3 (год 1)
| <tt>weather_rain</tt>
+
| <samp>weather_rain</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| spring 4 (year 1)
+
| весна 4 (год 1)
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| spring 13
+
| весна 13
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| spring 24
+
| весна 24
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| summer 1
+
| лето 1
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt> and <tt>tv</tt>
+
| <samp>newday</samp> and <samp>tv</samp>
 
|-
 
|-
| summer 11
+
| лето 11
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| summer 13
+
| лето 13
| <tt>weather_lightning</tt>
+
| <samp>weather_lightning</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| summer 26
+
| лето 26
| <tt>weather_lightning</tt>
+
| <samp>weather_lightning</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| summer 28
+
| лето 28
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| fall 1
+
| осень 1
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt> and <tt>tv</tt>
+
| <samp>newday</samp> and <samp>tv</samp>
 
|-
 
|-
| fall 16
+
| осень 16
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| fall 27
+
| осень 27
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| winter 1
+
| зима 1
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt> and <tt>tv</tt>
+
| <samp>newday</samp> and <samp>tv</samp>
 
|-
 
|-
| winter 8
+
| зима 8
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| winter 14
+
| зима 14
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| winter 15
+
| зима 15
| <tt>weather_sunny</tt>
+
| <samp>weather_sunny</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|-
 
|-
| winter 16
+
| зима 16
| <tt>weather_sunny</tt>
+
| <samp
| <tt>newday</tt>
+
 
 +
>weather_sunny</samp>
 +
| <samp>newday</samp>
 
|-
 
|-
| winter 25
+
| зима 25
| <tt>weather_festival</tt>
+
| <samp>weather_festival</samp>
| <tt>newday</tt>
+
| <samp>newday</samp>
 
|}
 
|}
   −
===Generated weather===
+
===Генерируемая погода===
Weather in Stardew Valley is set within the <tt>Game1::newDayAfterFade()</tt> function (after the day change code, but before SMAPI's <tt>SaveEvents.BeforeSave</tt> event).
+
Weather in Stardew Valley is set within the <samp>Game1::newDayAfterFade()</samp> function (after the day change code, but before SMAPI's <samp>SaveEvents.BeforeSave</samp> event).
    
The game follows these steps to decide which weather and debris to set for the next day:
 
The game follows these steps to decide which weather and debris to set for the next day:
    
# Check for [[#Forced weather|forced weather]].
 
# Check for [[#Forced weather|forced weather]].
# If today is a festival, set the weather to <tt>weather_festival</tt>.
+
# If today is a festival, set the weather to <samp>weather_festival</samp>.
# If today is a wedding, set the weather to <tt>weather_wedding</tt>.
+
# If today is a wedding, set the weather to <samp>weather_wedding</samp>.
# Set <tt>Game1::wasRainingYesterday</tt> based on whether it was raining or storming.
+
# Set <samp>Game1::wasRainingYesterday</samp> based on whether it was raining or storming.
 
# Reset all weather flags, and sets them in the following pattern
 
# Reset all weather flags, and sets them in the following pattern
 
## If it is going to rain or storm, set the rain flag to true
 
## If it is going to rain or storm, set the rain flag to true
Строка 158: Строка 160:  
#### Else, it's .63  
 
#### Else, it's .63  
 
### If it is, it uses the following: Check if it's day 1.
 
### If it is, it uses the following: Check if it's day 1.
#### If it's not, the chance is .12 + <tt>Game1::dayOfMonth</tt> * 3/1000
+
#### If it's not, the chance is .12 + <samp>Game1::dayOfMonth</samp> * 3/1000
 
#### If it is, the chance is 0. Which.. is kinda redundant, as the force days take care of this.
 
#### If it is, the chance is 0. Which.. is kinda redundant, as the force days take care of this.
 
# Check to see if a random number is less than the odds. If it is, it follows the following algorithm
 
# Check to see if a random number is less than the odds. If it is, it follows the following algorithm
## Set <tt>Game1::weatherForTomorrow</tt> to <tt>weather_rain</tt>
+
## Set <samp>Game1::weatherForTomorrow</samp> to <samp>weather_rain</samp>
 
## If:
 
## If:
 
### It's summer, and if a random number is less than .85
 
### It's summer, and if a random number is less than .85
 
### Or If it's not winter, and if a random number is less than .25 AND the day of the month is more than 2 and more than 27 days have been played
 
### Or If it's not winter, and if a random number is less than .25 AND the day of the month is more than 2 and more than 27 days have been played
### Set <tt>Game1::weatherForTomorrow</tt> to <tt>weather_lightning</tt>
+
### Set <samp>Game1::weatherForTomorrow</samp> to <samp>weather_lightning</samp>
 
## If it is winter
 
## If it is winter
### Set <tt>Game1::weatherForTomorrow</tt> to <tt>weather_snow</tt>
+
### Set <samp>Game1::weatherForTomorrow</samp> to <samp>weather_snow</samp>
 
# Else, if it's over the rain odds.
 
# Else, if it's over the rain odds.
 
## If you've played less than 3 days.  
 
## If you've played less than 3 days.  
Строка 174: Строка 176:  
### And it's not fall or a random number is greater than or equal to .6 (so 40%) and fall.
 
### And it's not fall or a random number is greater than or equal to .6 (so 40%) and fall.
 
### Or: If there is a wedding today
 
### Or: If there is a wedding today
#### Set <tt>Game1::weatherForTomorrow</tt> to <tt>weather_sunny</tt> if true
+
#### Set <samp>Game1::weatherForTomorrow</samp> to <samp>weather_sunny</samp> if true
#### Set <tt>Game1::weatherForTomorrow</tt> to <tt>weather_debris</tt> if false
+
#### Set <samp>Game1::weatherForTomorrow</samp> to <samp>weather_debris</samp> if false
## Check if tomorrow is a festival, and set weather to <tt>weather_festival</tt> if true.
+
## Check if tomorrow is a festival, and set weather to <samp>weather_festival</samp> if true.
## Again force the 3rd day to be <tt>weather_rain</tt>
+
## Again force the 3rd day to be <samp>weather_rain</samp>
    
At this point, the main function is done setting weather.
 
At this point, the main function is done setting weather.
   −
===TV Channel===
+
===Телевидение===
The TV checks the weather, but will occasionally set it on certain days. It follows the following chart:
+
Телевизор проверяет погоду, но иногда устанавливает ее в определенные дни. It follows the following chart:
    
The TV force sets by:
 
The TV force sets by:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
 
! date
 
! date
Строка 192: Строка 194:  
|-
 
|-
 
| spring 1
 
| spring 1
| <tt>weather_sunny</tt
+
| <samp>weather_sunny</samp
 
|-
 
|-
 
| spring 3
 
| spring 3
| <tt>weather_rainy</tt
+
| <samp>weather_rainy</samp
 
|-
 
|-
 
| summer 1
 
| summer 1
| <tt>weather_sunny</tt
+
| <samp>weather_sunny</samp
 
|-
 
|-
 
| fall 1
 
| fall 1
| <tt>weather_sunny</tt
+
| <samp>weather_sunny</samp
 
|-
 
|-
 
| winter 1
 
| winter 1
| <tt>weather_sunny</tt
+
| <samp>weather_sunny</samp
 
|}
 
|}
   −
<small>¹ Also set (and thus overridden) by the <tt>Game1::newDayAfterFade()</tt> method.</small><br />
+
<small>¹ Also set (and thus overridden) by the <samp>Game1::newDayAfterFade()</samp> method.</small><br />
   −
The TV will check the weather and show the following message:
+
Телевизор проверит погоду и покажет соответствующее описание:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! weather
+
! погода
! message
+
! описание
 
|-
 
|-
| sunny or wedding
+
| солнечно или день свадьбы
 
| 50% chance each:
 
| 50% chance each:
* "It's going to be clear and sunny all day."
+
* "Завтра весь день будет ясно и солнечно."
* "It's going to be a beautiful, sunny day tommorow!"
+
* "Завтра будет прекрасный солнечный день!"
 
|-
 
|-
| rain
+
| дождь
| "It's going to rain all day tomorrow"
+
| "Завтра весь день будет идти дождь."
 
|-
 
|-
| debris
+
| ветер
| Per conditions:
+
| В соответствии:
# If spring: "Partially cloudy with a light breeze. Expect lots of pollen!"
+
# Весна: "Переменная облачность с лёгким ветерком. В воздухе будет много пыльцы!"
# If not fall: "It's going to snow all day. Make sure you bundle up, folks!" and defaults with: "It's going to be cloudy, with gusts of wind throught the day."
+
# Осень: "Завтра будет облачно, с порывами ветра на протяжении всего дня."
# If storm: "Looks like a storm is approaching. Thunder and lightning is expected."
+
# Гроза: "Похоже, приближается буря. Ожидаются гром и молнии."
 
# If festival, it attempts to read the festival data. If it fails, it will say "Um... that's odd. My information sheet just says 'null'. This is embarrassing..." If it succeeds, it will read out where it is and when it is.
 
# If festival, it attempts to read the festival data. If it fails, it will say "Um... that's odd. My information sheet just says 'null'. This is embarrassing..." If it succeeds, it will read out where it is and when it is.
# If snow, a 50% chance of one of two strings: "Expect a few inches of snow tomorrow" or "Bundle up, folks. It's going to snow tomorrow!"
+
# Снегопад: "Завтра ожидается пара дюймов снега." или "Одевайтесь потеплее, ребята, завтра будет снег!" или "Завтра весь день будет идти снег. Одевайтесь потеплее, ребята!"
 
|-
 
|-
 
| ''any other''
 
| ''any other''
Строка 236: Строка 238:  
|}
 
|}
   −
'''Note:''' the TV will not necessarily be accurate for any other day than non festival days, the first of the month and the 3rd of spring, which are force-set by the <tt>Game1::newDayAfterFade</tt> method. Farmhands (and not host players) may not even get that accuracy for the first of the month and 3rd of spring.
+
'''Note:''' the TV will not necessarily be accurate for any other day than non festival days, the first of the month and the 3rd of spring, which are force-set by the <samp>Game1::newDayAfterFade</samp> method. Farmhands (and not host players) may not even get that accuracy for the first of the month and 3rd of spring.
    
'''Note 2:''' The Night Market is not considered a festival for the purposes of weather.
 
'''Note 2:''' The Night Market is not considered a festival for the purposes of weather.
    
===Weather Icon===
 
===Weather Icon===
The weather icon is set in <tt>Game1::updateWeatherIcon</tt>, which sets an index in <tt>LooseSprite/Cursors.xnb</tt>:
+
The weather icon is set in <samp>Game1::updateWeatherIcon</samp>, which sets an index in <samp>LooseSprite/Cursors.xnb</samp>:
    
# If snowing: 7.
 
# If snowing: 7.
Строка 254: Строка 256:  
# If winter: 7 (same as snowing).
 
# If winter: 7 (same as snowing).
   −
===Rain Totem===
+
===Тотем дождя===
The rain totem (item #681) and is controlled by <tt>Object::rainTotem</tt>, which is invoked by <tt>Object::performUseAction</tt>. If tomorrow is a festival day, the item is used up but nothing happens. Otherwise, it uses up the item and sets the weather for tomorrow to <tt>weather_rain</tt> and displays the message.
+
The rain totem (item #681) and is controlled by <samp>Object::rainTotem</samp>, which is invoked by <samp>Object::performUseAction</samp>. If tomorrow is a festival day, the item is used up but nothing happens. Otherwise, it uses up the item and sets the weather for tomorrow to <samp>weather_rain</samp> and displays the message.
    
==Weather probability by type==
 
==Weather probability by type==
Строка 274: Строка 276:  
* Winter: never rains.
 
* Winter: never rains.
   −
===Debris===
+
===Ветер===
 
Debris weather covers weather variable 2.
 
Debris weather covers weather variable 2.
   −
* Spring: there's a 20% chance of this after rain, so approximately 16.6% chance of debris weather.
+
* Весна: после дождя шанс 20%, поэтому приблизительный шанс 16.6%.
* Summer: no debris weather.
+
* Лето: не бывает ветра.
* Fall: there's a 60% chance for this after rain, so approximately 49.8% chance of debris weather.
+
* Осень: после дождя шанс 60%, поэтому приблизительный шанс 49.8%.
* Winter: no debris weather.
+
* Зима: не бывает ветра.
   −
===Stormy===
+
===Гроза===
 
Stormy weather covers weather variable 3.
 
Stormy weather covers weather variable 3.
   −
* Spring: 4.57% chance of storms.
+
* Весна: 4.57% шанс грозы.
* Summer: variable chance of storms; starts at 10.71% and increases to 17.085%.
+
* Лето: переменный шанс грозы; начиная от 10.71% и до 17.085%.
* Fall: 4.57% chance of storms.
+
* Осень: 4.57% шанс грозы.
* Winter: no stormy weather.
+
* Зима: не бывает грозы.
   −
===Snowy===
+
===Снегопад===
In winter, there's a 63% chance of snow. No other season has snow.
+
Зимой шанс выпадения снега 63%. Снегопад может пойти только зимой.
   −
==Save files==
+
==Сохранения==
The save file is a snapshot of the day at 0600 the next morning. The <tt>WeatherForTommorow</tt> field was used to calculate the weather, but changing it has no effect on the weather since the weather flags have already been set by this point. To change the weather, you need to set one of these combinations of flags:
+
The save file is a snapshot of the day at 0600 the next morning. The <samp>WeatherForTommorow</samp> field was used to calculate the weather, but changing it has no effect on the weather since the weather flags have already been set by this point. To change the weather, you need to set one of these combinations of flags:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
 
! weather  
 
! weather  
! <tt>isRaining</tt>
+
! <samp>isRaining</samp>
! <tt>isDebrisWeather</tt>
+
! <samp>isDebrisWeather</samp>
! <tt>isLightning</tt>
+
! <samp>isLightning</samp>
! <tt>isSnowing</tt>
+
! <samp>isSnowing</samp>
 
|-
 
|-
 
| sunny
 
| sunny
Строка 347: Строка 349:  
|}
 
|}
   −
'''Примечание:''' changing <tt>isDebrisWeather</tt> during an active game will not create the array. You'll need to call <tt>Game1::populateDebrisWeatherArray</tt> to get the debris populated. Correspondingly, if you're removing the debris weather flag, remember to call <tt>Game1::debrisWeather::Clear</tt>.
+
'''Примечание:''' changing <samp>isDebrisWeather</samp> during an active game will not create the array. You'll need to call <samp>Game1::populateDebrisWeatherArray</samp> to get the debris populated. Correspondingly, if you're removing the debris weather flag, remember to call <samp>Game1::debrisWeather::Clear</samp>.
    
==Примечания/FAQ==
 
==Примечания/FAQ==