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

◆ CalculateWind()

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

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

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

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

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