Files
OpenRCT2-Web/src/openrct2/world/Climate.cpp
T

514 lines
19 KiB
C++
Raw Normal View History

2017-03-11 11:13:35 +00:00
/*****************************************************************************
2020-07-21 15:04:34 +02:00
* Copyright (c) 2014-2020 OpenRCT2 developers
2017-03-11 11:13:35 +00:00
*
2018-06-15 14:07:34 +02:00
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
2017-03-11 11:13:35 +00:00
*
2018-06-15 14:07:34 +02:00
* OpenRCT2 is licensed under the GNU General Public License version 3.
2017-03-11 11:13:35 +00:00
*****************************************************************************/
2018-06-22 23:17:03 +02:00
#include "Climate.h"
2017-12-13 13:02:24 +01:00
#include "../Cheats.h"
2018-06-22 23:17:03 +02:00
#include "../Context.h"
#include "../Game.h"
#include "../OpenRCT2.h"
#include "../audio/AudioMixer.h"
#include "../audio/audio.h"
#include "../config/Config.h"
2018-01-05 21:17:33 +00:00
#include "../drawing/Drawing.h"
2018-01-06 00:05:16 +00:00
#include "../interface/Window.h"
2018-01-06 18:32:25 +01:00
#include "../localisation/Date.h"
2018-01-02 17:58:43 +00:00
#include "../scenario/Scenario.h"
#include "../sprites.h"
2017-12-13 13:02:24 +01:00
#include "../util/Util.h"
2018-01-17 01:39:03 +01:00
#include "../windows/Intent.h"
2017-03-11 11:13:35 +00:00
2018-08-12 12:50:40 +01:00
#include <algorithm>
2018-11-21 23:16:04 +01:00
#include <iterator>
2018-08-12 12:50:40 +01:00
constexpr int32_t MAX_THUNDER_INSTANCES = 2;
2017-03-11 11:13:35 +00:00
enum class THUNDER_STATUS
{
NONE,
PLAYING,
};
struct WeatherTransition
{
int8_t BaseTemperature;
int8_t DistributionSize;
WeatherType Distribution[24];
2017-03-11 11:13:35 +00:00
};
2018-06-22 23:17:03 +02:00
extern const WeatherTransition* ClimateTransitions[4];
extern const WeatherState ClimateWeatherData[EnumValue(WeatherType::Count)];
extern const FilterPaletteID ClimateWeatherGloomColours[4];
2017-03-11 11:13:35 +00:00
// Climate data
ClimateType gClimate;
2018-06-22 23:17:03 +02:00
ClimateState gClimateCurrent;
ClimateState gClimateNext;
uint16_t gClimateUpdateTimer;
uint16_t gClimateLightningFlash;
2017-03-11 11:13:35 +00:00
// Sound data
2020-09-14 21:36:30 +02:00
static int32_t _weatherVolume = 1;
2018-06-22 23:17:03 +02:00
static uint32_t _lightningTimer;
static uint32_t _thunderTimer;
static void* _thunderSoundChannels[MAX_THUNDER_INSTANCES];
static THUNDER_STATUS _thunderStatus[MAX_THUNDER_INSTANCES] = { THUNDER_STATUS::NONE, THUNDER_STATUS::NONE };
2020-10-07 00:34:42 +03:00
static OpenRCT2::Audio::SoundId _thunderSoundId;
2018-06-22 23:17:03 +02:00
static int32_t _thunderVolume;
static int32_t _thunderStereoEcho = 0;
2017-03-11 11:13:35 +00:00
static int8_t climate_step_weather_level(int8_t currentWeatherLevel, int8_t nextWeatherLevel);
static void climate_determine_future_weather(int32_t randomDistribution);
2020-09-14 21:36:30 +02:00
static void climate_update_weather_sound();
2017-03-11 11:13:35 +00:00
static void climate_update_thunder_sound();
static void climate_update_lightning();
static void climate_update_thunder();
2020-10-07 00:34:42 +03:00
static void climate_play_thunder(int32_t instanceIndex, OpenRCT2::Audio::SoundId soundId, int32_t volume, int32_t pan);
2017-03-11 11:13:35 +00:00
int32_t climate_celsius_to_fahrenheit(int32_t celsius)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
return (celsius * 29) / 16 + 32;
}
/**
* Set climate and determine start weather.
*/
void climate_reset(ClimateType climate)
2018-02-01 18:49:14 +01:00
{
auto weather = WeatherType::PartiallyCloudy;
int32_t month = date_get_month(gDateMonthsElapsed);
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(climate)][month];
const WeatherState* weatherState = &ClimateWeatherData[EnumValue(weather)];
2018-02-01 18:49:14 +01:00
gClimate = climate;
gClimateCurrent.Weather = weather;
gClimateCurrent.Temperature = transition->BaseTemperature + weatherState->TemperatureDelta;
gClimateCurrent.WeatherEffect = weatherState->EffectLevel;
gClimateCurrent.WeatherGloom = weatherState->GloomLevel;
gClimateCurrent.Level = weatherState->Level;
2018-02-01 18:49:14 +01:00
_lightningTimer = 0;
_thunderTimer = 0;
2020-09-14 21:36:30 +02:00
if (_weatherVolume != 1)
2017-03-11 11:13:35 +00:00
{
2020-10-07 00:34:42 +03:00
OpenRCT2::Audio::StopWeatherSound();
2020-09-14 21:36:30 +02:00
_weatherVolume = 1;
2017-03-11 11:13:35 +00:00
}
2018-02-01 18:49:14 +01:00
climate_determine_future_weather(scenario_rand());
}
/**
* Weather & climate update iteration.
* Gradually changes the weather parameters towards their determined next values.
*/
void climate_update()
{
// Only do climate logic if playing (not in scenario editor or title screen)
2018-06-22 23:17:03 +02:00
if (gScreenFlags & (~SCREEN_FLAGS_PLAYING))
return;
2018-02-01 18:49:14 +01:00
if (!gCheatsFreezeWeather)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
if (gClimateUpdateTimer)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
if (gClimateUpdateTimer == 960)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE);
context_broadcast_intent(&intent);
2017-03-11 11:13:35 +00:00
}
2018-02-01 18:49:14 +01:00
gClimateUpdateTimer--;
}
else if (!(gCurrentTicks & 0x7F))
{
if (gClimateCurrent.Temperature == gClimateNext.Temperature)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
if (gClimateCurrent.WeatherGloom == gClimateNext.WeatherGloom)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
gClimateCurrent.WeatherEffect = gClimateNext.WeatherEffect;
_thunderTimer = 0;
_lightningTimer = 0;
2017-03-11 11:13:35 +00:00
if (gClimateCurrent.Level == gClimateNext.Level)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
gClimateCurrent.Weather = gClimateNext.Weather;
climate_determine_future_weather(scenario_rand());
auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE);
context_broadcast_intent(&intent);
}
2020-09-14 21:36:30 +02:00
else if (gClimateNext.Level <= WeatherLevel::Heavy)
2018-02-01 18:49:14 +01:00
{
2020-09-14 21:36:30 +02:00
gClimateCurrent.Level = static_cast<WeatherLevel>(climate_step_weather_level(
static_cast<int8_t>(gClimateCurrent.Level), static_cast<int8_t>(gClimateNext.Level)));
2017-03-11 11:13:35 +00:00
}
}
else
{
gClimateCurrent.WeatherGloom = climate_step_weather_level(
gClimateCurrent.WeatherGloom, gClimateNext.WeatherGloom);
2018-02-01 18:49:14 +01:00
gfx_invalidate_screen();
2017-03-11 11:13:35 +00:00
}
}
2018-02-01 18:49:14 +01:00
else
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
gClimateCurrent.Temperature = climate_step_weather_level(gClimateCurrent.Temperature, gClimateNext.Temperature);
auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE);
context_broadcast_intent(&intent);
2017-03-11 11:13:35 +00:00
}
}
}
2018-02-01 18:49:14 +01:00
if (_thunderTimer != 0)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
climate_update_lightning();
climate_update_thunder();
2017-03-11 11:13:35 +00:00
}
2020-02-20 22:57:04 +00:00
else if (
gClimateCurrent.WeatherEffect == WeatherEffectType::Storm
|| gClimateCurrent.WeatherEffect == WeatherEffectType::Blizzard)
2017-03-11 11:13:35 +00:00
{
2018-02-01 18:49:14 +01:00
// Create new thunder and lightning
uint32_t randomNumber = util_rand();
2018-02-01 18:49:14 +01:00
if ((randomNumber & 0xFFFF) <= 0x1B4)
{
randomNumber >>= 16;
_thunderTimer = 43 + (randomNumber % 64);
_lightningTimer = randomNumber % 32;
}
2017-03-11 11:13:35 +00:00
}
}
void climate_force_weather(WeatherType weather)
2018-02-01 18:49:14 +01:00
{
int32_t month = date_get_month(gDateMonthsElapsed);
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(gClimate)][month];
const auto weatherState = &ClimateWeatherData[EnumValue(weather)];
2018-02-01 18:49:14 +01:00
gClimateCurrent.Weather = weather;
gClimateCurrent.WeatherGloom = weatherState->GloomLevel;
gClimateCurrent.Level = weatherState->Level;
2018-02-01 18:49:14 +01:00
gClimateCurrent.WeatherEffect = weatherState->EffectLevel;
gClimateCurrent.Temperature = transition->BaseTemperature + weatherState->TemperatureDelta;
2018-02-01 18:49:14 +01:00
gClimateUpdateTimer = 1920;
climate_update();
// In case of change in gloom level force a complete redraw
gfx_invalidate_screen();
}
void climate_update_sound()
{
2020-10-07 00:34:42 +03:00
if (!OpenRCT2::Audio::IsAvailable())
2018-06-22 23:17:03 +02:00
return;
2020-10-03 02:16:08 +03:00
2018-06-22 23:17:03 +02:00
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
2018-02-01 18:49:14 +01:00
2020-09-14 21:36:30 +02:00
climate_update_weather_sound();
2018-02-01 18:49:14 +01:00
climate_update_thunder_sound();
}
2018-01-06 13:39:08 +00:00
bool climate_is_raining()
{
if (gClimateCurrent.Weather == WeatherType::Rain || gClimateCurrent.Weather == WeatherType::HeavyRain
|| gClimateCurrent.Weather == WeatherType::Thunder)
2020-02-20 22:57:04 +00:00
{
return true;
}
else
{
return false;
}
}
bool climate_is_snowing()
{
if (gClimateCurrent.Weather == WeatherType::Snow || gClimateCurrent.Weather == WeatherType::HeavySnow
|| gClimateCurrent.Weather == WeatherType::Blizzard)
2020-02-20 22:57:04 +00:00
{
return true;
}
else
{
return false;
}
2018-01-06 13:39:08 +00:00
}
bool WeatherIsDry(WeatherType weatherType)
{
return weatherType == WeatherType::Sunny || weatherType == WeatherType::PartiallyCloudy
|| weatherType == WeatherType::Cloudy;
}
FilterPaletteID climate_get_weather_gloom_palette_id(const ClimateState& state)
2018-01-12 22:53:41 +00:00
{
auto paletteId = FilterPaletteID::PaletteNull;
2018-01-12 22:53:41 +00:00
auto gloom = state.WeatherGloom;
2018-11-21 23:16:04 +01:00
if (gloom < std::size(ClimateWeatherGloomColours))
2018-01-12 22:53:41 +00:00
{
paletteId = ClimateWeatherGloomColours[gloom];
}
return paletteId;
}
2018-06-22 23:17:03 +02:00
uint32_t climate_get_weather_sprite_id(const ClimateState& state)
{
uint32_t spriteId = SPR_WEATHER_SUN;
if (EnumValue(state.Weather) < std::size(ClimateWeatherData))
{
spriteId = ClimateWeatherData[EnumValue(state.Weather)].SpriteId;
}
return spriteId;
2017-03-11 11:13:35 +00:00
}
static int8_t climate_step_weather_level(int8_t currentWeatherLevel, int8_t nextWeatherLevel)
2017-03-11 11:13:35 +00:00
{
if (nextWeatherLevel > currentWeatherLevel)
{
return currentWeatherLevel + 1;
}
else
{
return currentWeatherLevel - 1;
}
}
/**
2018-06-22 23:17:03 +02:00
* Calculates future weather development.
2021-01-10 18:23:35 +00:00
* RCT2 implements this as discrete probability distributions dependent on month and climate
2018-06-22 23:17:03 +02:00
* for nextWeather. The other weather parameters are then looked up depending only on the
* next weather.
*/
static void climate_determine_future_weather(int32_t randomDistribution)
2017-03-11 11:13:35 +00:00
{
2020-08-25 19:06:38 -03:00
int32_t month = date_get_month(gDateMonthsElapsed);
2017-03-11 11:13:35 +00:00
2018-06-22 23:17:03 +02:00
// Generate a random variable with values 0 up to DistributionSize-1 and chose weather from the distribution table
// accordingly
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(gClimate)][month];
WeatherType nextWeather = (transition->Distribution[((randomDistribution & 0xFF) * transition->DistributionSize) >> 8]);
gClimateNext.Weather = nextWeather;
2017-03-11 11:13:35 +00:00
const auto nextWeatherState = &ClimateWeatherData[EnumValue(nextWeather)];
gClimateNext.Temperature = transition->BaseTemperature + nextWeatherState->TemperatureDelta;
gClimateNext.WeatherEffect = nextWeatherState->EffectLevel;
gClimateNext.WeatherGloom = nextWeatherState->GloomLevel;
gClimateNext.Level = nextWeatherState->Level;
2017-03-11 11:13:35 +00:00
gClimateUpdateTimer = 1920;
}
2020-09-14 21:36:30 +02:00
static void climate_update_weather_sound()
2017-03-11 11:13:35 +00:00
{
if (gClimateCurrent.WeatherEffect == WeatherEffectType::Rain || gClimateCurrent.WeatherEffect == WeatherEffectType::Storm)
2017-03-11 11:13:35 +00:00
{
2020-09-14 21:36:30 +02:00
// Start playing the weather sound
2020-10-07 00:34:42 +03:00
if (OpenRCT2::Audio::gWeatherSoundChannel == nullptr)
2017-03-11 11:13:35 +00:00
{
2020-10-07 00:34:42 +03:00
OpenRCT2::Audio::gWeatherSoundChannel = Mixer_Play_Effect(
OpenRCT2::Audio::SoundId::Rain, MIXER_LOOP_INFINITE, DStoMixerVolume(-4000), 0.5f, 1, 0);
2017-03-11 11:13:35 +00:00
}
2020-09-14 21:36:30 +02:00
if (_weatherVolume == 1)
2017-03-11 11:13:35 +00:00
{
2020-09-14 21:36:30 +02:00
_weatherVolume = -4000;
2017-03-11 11:13:35 +00:00
}
else
{
2020-09-14 21:36:30 +02:00
// Increase weather sound
_weatherVolume = std::min(-1400, _weatherVolume + 80);
2020-10-07 00:34:42 +03:00
if (OpenRCT2::Audio::gWeatherSoundChannel != nullptr)
2017-03-11 11:13:35 +00:00
{
2020-10-07 00:34:42 +03:00
Mixer_Channel_Volume(OpenRCT2::Audio::gWeatherSoundChannel, DStoMixerVolume(_weatherVolume));
2017-03-11 11:13:35 +00:00
}
}
}
2020-09-14 21:36:30 +02:00
else if (_weatherVolume != 1)
2017-03-11 11:13:35 +00:00
{
2020-09-14 21:36:30 +02:00
// Decrease weather sound
_weatherVolume -= 80;
if (_weatherVolume > -4000)
2017-03-11 11:13:35 +00:00
{
2020-10-07 00:34:42 +03:00
if (OpenRCT2::Audio::gWeatherSoundChannel != nullptr)
2017-03-11 11:13:35 +00:00
{
2020-10-07 00:34:42 +03:00
Mixer_Channel_Volume(OpenRCT2::Audio::gWeatherSoundChannel, DStoMixerVolume(_weatherVolume));
2017-03-11 11:13:35 +00:00
}
}
else
{
2020-10-07 00:34:42 +03:00
OpenRCT2::Audio::StopWeatherSound();
2020-09-14 21:36:30 +02:00
_weatherVolume = 1;
2017-03-11 11:13:35 +00:00
}
}
}
static void climate_update_thunder_sound()
{
if (_thunderStereoEcho)
{
// Play thunder on right side
_thunderStereoEcho = 0;
climate_play_thunder(1, _thunderSoundId, _thunderVolume, 10000);
}
// Stop thunder sounds if they have finished
for (int32_t i = 0; i < MAX_THUNDER_INSTANCES; i++)
2017-03-11 11:13:35 +00:00
{
if (_thunderStatus[i] != THUNDER_STATUS::NONE)
{
2018-06-22 23:17:03 +02:00
void* channel = _thunderSoundChannels[i];
2017-03-11 11:13:35 +00:00
if (!Mixer_Channel_IsPlaying(channel))
{
Mixer_Stop_Channel(channel);
_thunderStatus[i] = THUNDER_STATUS::NONE;
}
}
}
}
static void climate_update_lightning()
{
2018-06-22 23:17:03 +02:00
if (_lightningTimer == 0)
return;
if (gConfigGeneral.disable_lightning_effect)
return;
if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom)
return;
2017-03-11 11:13:35 +00:00
_lightningTimer--;
if (gClimateLightningFlash == 0)
{
if ((util_rand() & 0xFFFF) <= 0x2000)
{
gClimateLightningFlash = 1;
}
}
}
static void climate_update_thunder()
{
_thunderTimer--;
if (_thunderTimer == 0)
{
uint32_t randomNumber = util_rand();
2017-03-11 11:13:35 +00:00
if (randomNumber & 0x10000)
{
2018-06-22 23:17:03 +02:00
if (_thunderStatus[0] == THUNDER_STATUS::NONE && _thunderStatus[1] == THUNDER_STATUS::NONE)
2017-03-11 11:13:35 +00:00
{
// Play thunder on left side
2020-10-07 00:34:42 +03:00
_thunderSoundId = (randomNumber & 0x20000) ? OpenRCT2::Audio::SoundId::Thunder1
: OpenRCT2::Audio::SoundId::Thunder2;
2020-04-17 16:08:22 -03:00
_thunderVolume = (-(static_cast<int32_t>((randomNumber >> 18) & 0xFF))) * 8;
2017-03-11 11:13:35 +00:00
climate_play_thunder(0, _thunderSoundId, _thunderVolume, -10000);
// Let thunder play on right side
_thunderStereoEcho = 1;
}
}
else
{
if (_thunderStatus[0] == THUNDER_STATUS::NONE)
{
2020-10-07 00:34:42 +03:00
_thunderSoundId = (randomNumber & 0x20000) ? OpenRCT2::Audio::SoundId::Thunder1
: OpenRCT2::Audio::SoundId::Thunder2;
int32_t pan = (((randomNumber >> 18) & 0xFF) - 128) * 16;
2017-03-11 11:13:35 +00:00
climate_play_thunder(0, _thunderSoundId, 0, pan);
}
}
}
}
2020-10-07 00:34:42 +03:00
static void climate_play_thunder(int32_t instanceIndex, OpenRCT2::Audio::SoundId soundId, int32_t volume, int32_t pan)
2017-03-11 11:13:35 +00:00
{
_thunderSoundChannels[instanceIndex] = Mixer_Play_Effect(
soundId, MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(pan), 1, 0);
2017-03-11 11:13:35 +00:00
if (_thunderSoundChannels[instanceIndex] != nullptr)
{
_thunderStatus[instanceIndex] = THUNDER_STATUS::PLAYING;
}
}
#pragma region Climate / Weather data tables
const FilterPaletteID ClimateWeatherGloomColours[4] = {
FilterPaletteID::PaletteNull,
FilterPaletteID::PaletteDarken1,
FilterPaletteID::PaletteDarken2,
FilterPaletteID::PaletteDarken3,
2017-03-11 11:13:35 +00:00
};
// There is actually a sprite at 0x5A9C for snow but only these weather types seem to be fully implemented
const WeatherState ClimateWeatherData[EnumValue(WeatherType::Count)] = {
2020-09-14 21:36:30 +02:00
{ 10, WeatherEffectType::None, 0, WeatherLevel::None, SPR_WEATHER_SUN }, // Sunny
{ 5, WeatherEffectType::None, 0, WeatherLevel::None, SPR_WEATHER_SUN_CLOUD }, // Partially Cloudy
{ 0, WeatherEffectType::None, 0, WeatherLevel::None, SPR_WEATHER_CLOUD }, // Cloudy
{ -2, WeatherEffectType::Rain, 1, WeatherLevel::Light, SPR_WEATHER_LIGHT_RAIN }, // Rain
{ -4, WeatherEffectType::Rain, 2, WeatherLevel::Heavy, SPR_WEATHER_HEAVY_RAIN }, // Heavy Rain
{ 2, WeatherEffectType::Storm, 2, WeatherLevel::Heavy, SPR_WEATHER_STORM }, // Thunderstorm
2020-02-20 22:57:04 +00:00
{ -10, WeatherEffectType::Snow, 1, WeatherLevel::Light, SPR_WEATHER_SNOW }, // Snow
{ -15, WeatherEffectType::Snow, 2, WeatherLevel::Heavy, SPR_WEATHER_SNOW }, // Heavy Snow
{ -20, WeatherEffectType::Blizzard, 2, WeatherLevel::Heavy, SPR_WEATHER_SNOW }, // Blizzard
2017-03-11 11:13:35 +00:00
};
constexpr auto S = WeatherType::Sunny;
constexpr auto P = WeatherType::PartiallyCloudy;
constexpr auto C = WeatherType::Cloudy;
constexpr auto R = WeatherType::Rain;
constexpr auto H = WeatherType::HeavyRain;
constexpr auto T = WeatherType::Thunder;
2018-06-22 23:17:03 +02:00
static constexpr const WeatherTransition ClimateTransitionsCoolAndWet[] = {
{ 8, 18, { S, P, P, P, P, P, C, C, C, C, C, C, C, R, R, R, H, H, S, S, S, S, S } },
{ 10, 21, { P, P, P, P, P, C, C, C, C, C, C, C, C, C, R, R, R, H, H, H, T, S, S } },
{ 14, 17, { S, S, S, P, P, P, P, P, P, C, C, C, C, R, R, R, H, S, S, S, S, S, S } },
{ 17, 17, { S, S, S, S, P, P, P, P, P, P, P, C, C, C, C, R, R, S, S, S, S, S, S } },
{ 19, 23, { S, S, S, S, S, S, S, S, S, S, P, P, P, P, P, P, C, C, C, C, C, R, H } },
{ 20, 23, { S, S, S, S, S, S, P, P, P, P, P, P, P, P, C, C, C, C, R, H, H, H, T } },
{ 16, 19, { S, S, S, P, P, P, P, P, C, C, C, C, C, C, R, R, H, H, T, S, S, S, S } },
{ 13, 16, { S, S, P, P, P, P, C, C, C, C, C, C, R, R, H, T, S, S, S, S, S, S, S } },
2017-03-11 11:13:35 +00:00
};
2018-01-11 14:50:31 +01:00
static constexpr const WeatherTransition ClimateTransitionsWarm[] = {
{ 12, 21, { S, S, S, S, S, P, P, P, P, P, P, P, P, C, C, C, C, C, C, C, H, S, S } },
{ 13, 22, { S, S, S, S, S, P, P, P, P, P, P, C, C, C, C, C, C, C, C, C, R, T, S } },
{ 16, 17, { S, S, S, S, S, S, P, P, P, P, P, P, C, C, C, C, R, S, S, S, S, S, S } },
{ 19, 18, { S, S, S, S, S, S, P, P, P, P, P, P, P, C, C, C, C, R, S, S, S, S, S } },
{ 21, 22, { S, S, S, S, S, S, S, S, S, S, P, P, P, P, P, P, P, P, P, C, C, C, S } },
{ 22, 17, { S, S, S, S, S, S, S, S, S, P, P, P, P, P, C, C, T, S, S, S, S, S, S } },
{ 19, 17, { S, S, S, S, S, P, P, P, P, P, C, C, C, C, C, C, R, S, S, S, S, S, S } },
{ 16, 17, { S, S, P, P, P, P, P, C, C, C, C, C, C, C, C, C, H, S, S, S, S, S, S } },
2017-03-11 11:13:35 +00:00
};
2018-01-11 14:50:31 +01:00
static constexpr const WeatherTransition ClimateTransitionsHotAndDry[] = {
{ 12, 15, { S, S, S, S, P, P, P, P, P, P, P, P, C, C, R, S, S, S, S, S, S, S, S } },
{ 14, 12, { S, S, S, S, S, P, P, P, P, P, C, C, S, S, S, S, S, S, S, S, S, S, S } },
{ 16, 11, { S, S, S, S, S, S, P, P, P, P, C, S, S, S, S, S, S, S, S, S, S, S, S } },
{ 19, 9, { S, S, S, S, S, S, P, P, P, S, S, S, S, S, S, S, S, S, S, S, S, S, S } },
{ 21, 13, { S, S, S, S, S, S, S, S, S, S, P, P, P, S, S, S, S, S, S, S, S, S, S } },
{ 22, 11, { S, S, S, S, S, S, S, S, S, P, P, S, S, S, S, S, S, S, S, S, S, S, S } },
{ 21, 12, { S, S, S, S, S, S, S, P, P, P, C, T, S, S, S, S, S, S, S, S, S, S, S } },
{ 16, 13, { S, S, S, S, S, S, S, S, P, P, P, C, R, S, S, S, S, S, S, S, S, S, S } },
2017-03-11 11:13:35 +00:00
};
2018-01-11 14:50:31 +01:00
static constexpr const WeatherTransition ClimateTransitionsCold[] = {
{ 4, 18, { S, S, S, S, P, P, P, P, P, C, C, C, C, C, C, C, R, H, S, S, S, S, S } },
{ 5, 21, { S, S, S, S, P, P, P, P, P, C, C, C, C, C, C, C, C, C, R, H, T, S, S } },
{ 7, 17, { S, S, S, S, P, P, P, P, P, P, P, C, C, C, C, R, H, S, S, S, S, S, S } },
{ 9, 17, { S, S, S, S, P, P, P, P, P, P, P, C, C, C, C, R, R, S, S, S, S, S, S } },
{ 10, 23, { S, S, S, S, S, S, S, S, S, S, P, P, P, P, P, P, C, C, C, C, C, R, H } },
{ 11, 23, { S, S, S, S, S, S, P, P, P, P, P, P, P, P, P, P, C, C, C, C, R, H, T } },
{ 9, 19, { S, S, S, S, S, P, P, P, P, P, C, C, C, C, C, C, R, H, T, S, S, S, S } },
{ 6, 16, { S, S, P, P, P, P, C, C, C, C, C, C, R, R, H, T, S, S, S, S, S, S, S } },
2017-03-11 11:13:35 +00:00
};
2018-06-22 23:17:03 +02:00
const WeatherTransition* ClimateTransitions[] = {
2017-03-11 11:13:35 +00:00
ClimateTransitionsCoolAndWet,
ClimateTransitionsWarm,
ClimateTransitionsHotAndDry,
ClimateTransitionsCold,
};
#pragma endregion