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

◆ CalculateWind()

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

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

400 {
401 magnitude = 5;
402 direction = 0;
403
404 float windChance = Math.RandomIntInclusive( 0, 100 );
405
406 if ( newWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
407 {
408 if ( windChance < 30 )
409 {
410 magnitude = Math.RandomFloatInclusive( 6 , 10 );
411 direction = Math.RandomFloatInclusive( -1.0 , -0.5);
412 }
413 else if ( windChance < 75 )
414 {
415 magnitude = Math.RandomFloatInclusive( 8 , 12 );
416 direction = Math.RandomFloatInclusive( -1.3 , -0.9);
417 }
418 else
419 {
420 magnitude = Math.RandomFloatInclusive( 4 , 6 );
421 direction = Math.RandomFloatInclusive( -0.6 , 0.0);
422 }
423
424 }
425 else if ( newWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
426 {
427 if ( windChance < 45 )
428 {
429 magnitude = Math.RandomFloatInclusive( 6 , 10 );
430 direction = Math.RandomFloatInclusive( -3.14 , -2.4);
431 }
432 else if ( windChance < 90 )
433 {
434 magnitude = Math.RandomFloatInclusive( 8 , 12 );
435 direction = Math.RandomFloatInclusive( -2.6, -2.0);
436 }
437 else
438 {
439 magnitude = Math.RandomFloatInclusive( 10 , 14 );
440 direction = Math.RandomFloatInclusive( -2.2 , -1.4);
441 }
442 }
443 else
444 {
445 if ( suddenChange || m_Weather.GetOvercast().GetActual() > m_WeatherDefaultSettings.m_StormThreshold || m_Weather.GetOvercast().GetForecast() - m_Weather.GetOvercast().GetActual() >= 0.4 )
446 {
447 magnitude = Math.RandomFloatInclusive( 14 , 17 );
448 direction = Math.RandomFloatInclusive( 0.9 , 1.45);
449 }
450 else if ( windChance < 45 )
451 {
452 magnitude = Math.RandomFloatInclusive( 9 , 12 );
453 direction = Math.RandomFloatInclusive( 1.45, 1.7);
454 }
455 else if ( windChance < 90 )
456 {
457 magnitude = Math.RandomFloatInclusive( 7 , 10 );
458 direction = Math.RandomFloatInclusive( 1.6 , 2);
459 }
460 else
461 {
462 magnitude = Math.RandomFloatInclusive( 4 , 8 );
463 direction = Math.RandomFloatInclusive( 1.9, 2.2 );
464 }
465 }
466 }
ref WorldDataWeatherSettings m_WeatherDefaultSettings
Определения WorldData.c:31
Weather m_Weather
Определения WorldData.c:18

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

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