DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CalculateWind()

override void EnochData::CalculateWind ( int newWeather,
bool suddenChange,
out float magnitude,
out float direction )
inlineprotected

См. определение в файле Enoch.c строка 483

484 {
485 magnitude = 5;
486 direction = 0;
487
488 float windChance = Math.RandomIntInclusive( 0, 100 );
489
490 if ( newWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
491 {
492 if ( windChance < 10 )
493 {
494 magnitude = Math.RandomFloatInclusive( 2 , 4 );
495 direction = Math.RandomFloatInclusive( -2.3 , -1.8);
496 }
497 else if ( windChance < 50 )
498 {
499 magnitude = Math.RandomFloatInclusive( 4 , 8 );
500 direction = Math.RandomFloatInclusive( -3.14 , -2.3);
501 }
502 else
503 {
504 magnitude = Math.RandomFloatInclusive( 6 , 12 );
505 direction = Math.RandomFloatInclusive( 2.3 , 3.14);
506 }
507
508 }
509 else if ( newWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
510 {
511 if ( windChance < 45 )
512 {
513 magnitude = Math.RandomFloatInclusive( 5 , 10 );
514 direction = Math.RandomFloatInclusive( -1.8 , -1.0);
515 }
516 else if ( windChance < 90 )
517 {
518 magnitude = Math.RandomFloatInclusive( 8 , 12 );
519 direction = Math.RandomFloatInclusive( -1.0, -0.7);
520 }
521 else
522 {
523 magnitude = Math.RandomFloatInclusive( 10 , 14 );
524 direction = Math.RandomFloatInclusive( -2.4 , -1.8);
525 }
526 }
527 else
528 {
529 if ( suddenChange || m_Weather.GetOvercast().GetActual() > m_WeatherDefaultSettings.m_StormThreshold || m_Weather.GetOvercast().GetForecast() - m_Weather.GetOvercast().GetActual() >= 0.4 )
530 {
531 magnitude = Math.RandomFloatInclusive( 17 , 20 );
532 direction = Math.RandomFloatInclusive( -0.2 , 1.0);
533 }
534 else if ( windChance < 45 )
535 {
536 magnitude = Math.RandomFloatInclusive( 6 , 12 );
537 direction = Math.RandomFloatInclusive( -0.6, 0);
538 }
539 else if ( windChance < 90 )
540 {
541 magnitude = Math.RandomFloatInclusive( 7 , 10 );
542 direction = Math.RandomFloatInclusive( 1.3 , 1.9);
543 }
544 else
545 {
546 magnitude = Math.RandomFloatInclusive( 4 , 8 );
547 direction = Math.RandomFloatInclusive( -1.8, -1.3 );
548 }
549 }
550 }
ref WorldDataWeatherSettings m_WeatherDefaultSettings
Определения WorldData.c:31
Weather m_Weather
Определения WorldData.c:18

Перекрестные ссылки WorldData::m_Weather, WorldData::m_WeatherDefaultSettings, Math::RandomFloatInclusive() и Math::RandomIntInclusive().

Используется в WeatherOnBeforeChange().