DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс EnochData
+ Граф наследования:EnochData:

Защищенные члены

override void Init ()
 
override void InitYieldBank ()
 
override void SetupWeatherSettings ()
 
override void SetupLiquidTemperatures ()
 
override bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 
override void CalculateWind (int newWeather, bool suddenChange, out float magnitude, out float direction)
 
override void CalculateVolFog (float lerpValue, float windMagnitude, float changeTime)
 
bool LogWeatherData ()
 

Защищенные данные

const int CLEAR_WEATHER = 1
 DEPRECATED (see WorldDataWeatherConstants)
 
const int CLOUDY_WEATHER = 2
 
const int BAD_WEATHER = 3
 
const int OVERCAST_MIN_TIME = 600
 DEPRECATED (see WorldDataWeatherSettings)
 
const int OVERCAST_MAX_TIME = 900
 
const float RAIN_THRESHOLD = 0.6
 
const int RAIN_TIME_MIN = 60
 
const int RAIN_TIME_MAX = 120
 
const float STORM_THRESHOLD = 0.85
 
int m_clearWeatherChance = m_ClearWeatherChance
 
int m_badWeatherChance = m_BadWeatherChance
 
int m_sameWeatherCnt = m_SameWeatherCnt
 
int m_stepValue = m_StepValue
 
int m_chance = m_Chance
 
int m_choosenWeather = m_ChoosenWeather
 
int m_lastWeather = m_LastWeather
 

Статические защищенные данные

static const ref array< vectorLIVONIA_ARTY_STRIKE_POS
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от WorldData
void WorldData ()
 
void Init ()
 
float GetApproxSunriseTime (float monthday)
 
float GetApproxSunsetTime (float monthday)
 
int GetDaytime ()
 
float CalcBaseEnvironmentTemperature (float monthday, float daytime)
 
void UpdateBaseEnvTemperature (float timeslice)
 
void UpdateWeatherEffects (Weather weather, float timeslice)
 Updates local weather effects.
 
float ComputeSnowflakeScale (Weather weather)
 Returns the desired snowflake scale based on weather simulation state.
 
float GetBaseEnvTemperature ()
 
float GetBaseEnvTemperatureAtObject (notnull Object object)
 
float GetBaseEnvTemperatureAtPosition (vector pos)
 
float GetBaseEnvTemperatureExact (int month, int day, int hour, int minute)
 
float GetLiquidTypeEnviroTemperature (int liquidType)
 
bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 
array< vectorGetArtyFiringPos ()
 
float GetAgentSpawnChance (eAgents agent)
 
float GetColdAreaToolDamageModifier ()
 
void BaseTempDebug (int month, int day)
 
int GetPollution ()
 
float GetWindCoef ()
 
float GetUniversalTemperatureSourceCapModifier ()
 
void CalculateWind (int newWeather, bool suddenChange, out float magnitude, out float direction)
 
void CalculateVolFog (float lerpValue, float windMagnitude, float changeTime)
 
void CreateYieldBank ()
 
void InitYieldBank ()
 override this to properly register world-specific yields
 
void SetupWeatherSettings ()
 
void SetupLiquidTemperatures ()
 
CatchYieldBank GetCatchYieldBank ()
 
TStringArray GetDefaultPRAPaths ()
 
float GetDayTemperature ()
 
float GetNightTemperature ()
 
override void Init ()
 
override void SetupWeatherSettings ()
 
override bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 
override void CalculateWind (int newWeather, bool suddenChange, out float magnitude, out float direction)
 
override void CalculateVolFog (float lerpValue, float windMagnitude, float changeTime)
 
bool LogWeatherData ()
 
- Закрытые данные унаследованные от WorldData
float SUDDENCHANGE_TIME_MULTIPLIER = 0.2
 how many % of environment temperature can be lowered by clouds
 
float SUDDENCHANGE_LENGTH_MULTIPLIER = 0.4
 
float WIND_MAGNITUDE_TIME_MULTIPLIER = 0.1
 
float WIND_DIRECTION_TIME_MULTIPLIER = 0.05
 
Weather m_Weather
 
float m_EnvironmentTemperature
 
bool m_EnTempUpdated
 
float m_Timer
 
float m_MaxTemps [12]
 
float m_MinTemps [12]
 
float m_Sunrise_Jan
 
float m_Sunset_Jan
 
float m_Sunrise_Jul
 
float m_Sunset_Jul
 
ref array< vectorm_FiringPos
 
bool m_Pollution
 
ref CatchYieldBank m_YieldBank
 
ref WorldDataWeatherSettings m_WeatherDefaultSettings
 
ref WorldDataLiquidSettings m_LiquidSettings
 
ref TStringArray m_DefaultPlayerRestrictedAreas
 
int m_BadWeatherChance
 weather related
 
int m_ClearWeatherChance
 
bool m_IsSuddenChange
 
float m_WorldWindCoef
 
float m_UniversalTemperatureSourceCapModifier
 
int m_SameWeatherCnt = 0
 
int m_StepValue = 5
 
int m_Chance = 50
 
int m_ChoosenWeather = 1
 
int m_LastWeather = 0
 
float m_DayTemperature = 10
 
float m_NightTemperature = 6
 
const int CLEAR_WEATHER = 1
 DEPRECATED (see WorldDataWeatherConstants)
 
const int CLOUDY_WEATHER = 2
 
const int BAD_WEATHER = 3
 
const int OVERCAST_MIN_TIME = 600
 DEPRECATED (see WorldDataWeatherSettings)
 
const int OVERCAST_MAX_TIME = 900
 
const float RAIN_THRESHOLD = 0.6
 
const int RAIN_TIME_MIN = 60
 
const int RAIN_TIME_MAX = 120
 
const float STORM_THRESHOLD = 0.9
 
int m_clearWeatherChance = m_ClearWeatherChance
 
int m_badWeatherChance = m_BadWeatherChance
 
int m_sameWeatherCnt = m_SameWeatherCnt
 
int m_stepValue = m_StepValue
 
int m_chance = m_Chance
 
int m_choosenWeather = m_ChoosenWeather
 
int m_lastWeather = m_LastWeather
 
- Закрытые статические данные унаследованные от WorldData
static const ref array< vectorCHERNARUS_ARTY_STRIKE_POS
 

Подробное описание

Методы

◆ CalculateVolFog()

override void CalculateVolFog ( float lerpValue,
float windMagnitude,
float changeTime )
inlineprotected
553 {
555 int year, month, day, hour, minute;
556 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
557
558 if ( hour < 6 && hour >= 3 )
559 {
561
562 if ( heightBias == m_WeatherDefaultSettings.m_DefaultHeigthBias ) //verify if the foggy morning check has been done
563 {
565
566 if (foggyMorning)
567 {
568 heightBias = Math.RandomInt(m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit, m_WeatherDefaultSettings.m_DefaultHeigthBias);
569 }
570 else
571 {
572 heightBias = m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit - 1;
573 }
574 }
575
576 if (heightBias == m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit - 1) //not foggy morning
577 {
579 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
580 }
581 else //foggy morning
582 {
584 heigthDensity = Math.Lerp( 0.2, 1, lerpValue);
585 }
586 }
587 else if ( hour < 18 && hour >= 6 )
588 {
590 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
591 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
592 }
593 else
594 {
596 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
597 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
598 }
599
603 }
Definition EnMath.c:7
Definition EntityAI.c:95
proto native float GetDynVolFogHeightBias()
Returns the current 'dynamic' volumetric fog height bias in meters.
proto native void SetDynVolFogHeightBias(float value, float time=0)
Sets the 'dynamic' volumetric height bias. Takes effect only if enabled via world config.
proto native void SetDynVolFogDistanceDensity(float value, float time=0)
Sets the dynamic volumetric fog distance density. Only takes effect if dynamic volumetric fog is enab...
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
proto native void SetDynVolFogHeightDensity(float value, float time=0)
Sets the dynamic volumetric fog height density. Only takes effect if dynamic volumetric fog is enable...
ref WorldDataWeatherSettings m_WeatherDefaultSettings
Definition WorldData.c:31
Weather m_Weather
Definition WorldData.c:18
proto native CGame GetGame()
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки Math::Clamp(), Weather::GetDynVolFogHeightBias(), GetGame(), Weather::GetWindMaximumSpeed(), Math::Lerp(), WorldData::m_Weather, WorldData::m_WeatherDefaultSettings, Math::RandomInt(), Math::RandomIntInclusive(), Weather::SetDynVolFogDistanceDensity(), Weather::SetDynVolFogHeightBias() и Weather::SetDynVolFogHeightDensity().

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

◆ CalculateWind()

override void CalculateWind ( int newWeather,
bool suddenChange,
out float magnitude,
out float direction )
inlineprotected
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 {
495 direction = Math.RandomFloatInclusive( -2.3 , -1.8);
496 }
497 else if ( windChance < 50 )
498 {
500 direction = Math.RandomFloatInclusive( -3.14 , -2.3);
501 }
502 else
503 {
505 direction = Math.RandomFloatInclusive( 2.3 , 3.14);
506 }
507
508 }
509 else if ( newWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
510 {
511 if ( windChance < 45 )
512 {
514 direction = Math.RandomFloatInclusive( -1.8 , -1.0);
515 }
516 else if ( windChance < 90 )
517 {
519 direction = Math.RandomFloatInclusive( -1.0, -0.7);
520 }
521 else
522 {
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 {
532 direction = Math.RandomFloatInclusive( -0.2 , 1.0);
533 }
534 else if ( windChance < 45 )
535 {
538 }
539 else if ( windChance < 90 )
540 {
542 direction = Math.RandomFloatInclusive( 1.3 , 1.9);
543 }
544 else
545 {
547 direction = Math.RandomFloatInclusive( -1.8, -1.3 );
548 }
549 }
550 }
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

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

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

◆ Init()

override void Init ( )
inlineprotected
37 {
38 super.Init();
39
40 // new temperature curve settings
41 m_Sunrise_Jan = 8.4;
42 m_Sunset_Jan = 15.63;
43 m_Sunrise_Jul = 3.65;
44 m_Sunset_Jul = 20.35;
45
46 int tempIdx;
47 m_MinTemps = {-7,-7.4,-4.1,1.5,7,11.3,20.4,19.1,18,5.3,0.8,-3.6}; //{-7,-7.4,-4.1,1.5,7,11.3,13.4,13.1,9.3,5.3,0.8,-3.6} original values, due to altitude of the map, changed the values drastically
49 {
51 {
53 }
54 }
55
56 m_MaxTemps = {-2.5,-2.1,2.3,9,15.5,19.4,25,22,21,10.5,4.2,0.1}; //{-2.5,-2.1,2.3,9,15.5,19.4,20.9,20.4,16,10.5,4.2,0.1} original values
58 {
60 {
62 }
63 }
64
66
68 m_WorldWindCoef = 0.3;
70
72
73 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
74 {
76
77 if (GetGame().IsMultiplayer())
78
79 {
80 float startingOvercast = Math.RandomFloat(0.2,0.75);
81 m_Weather.GetOvercast().Set(startingOvercast,0,5); //forcing a random weather at a clean server start and an instant change for overcast
83 }
84 }
85
86
87 }
@ Count
Definition RandomGeneratorSyncManager.c:8
Definition CfgGameplayHandler.c:2
static array< float > GetEnvironmentMinTemps()
Definition CfgGameplayHandler.c:146
static array< float > GetEnvironmentMaxTemps()
Definition CfgGameplayHandler.c:151
static const ref array< vector > LIVONIA_ARTY_STRIKE_POS
Definition Enoch.c:24
override void CalculateVolFog(float lerpValue, float windMagnitude, float changeTime)
Definition Enoch.c:552
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
float m_Sunrise_Jan
Definition WorldData.c:24
float m_MaxTemps[12]
Definition WorldData.c:22
float m_Sunrise_Jul
Definition WorldData.c:26
float m_UniversalTemperatureSourceCapModifier
Definition WorldData.c:41
float m_CloudsTemperatureEffectModifier
amount of °C reduced for each 100 meteres of height above water level
Definition WorldData.c:9
float m_Sunset_Jul
Definition WorldData.c:27
float m_TemperaturePerHeightReductionModifier
directly accesible (defined/overriden in Init())
Definition WorldData.c:8
float m_Sunset_Jan
Definition WorldData.c:25
float m_MinTemps[12]
Definition WorldData.c:23
float m_WorldWindCoef
Definition WorldData.c:39
ref array< vector > m_FiringPos
Definition WorldData.c:28
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки CalculateVolFog(), Count, CfgGameplayHandler::GetEnvironmentMaxTemps(), CfgGameplayHandler::GetEnvironmentMinTemps(), GetGame(), Weather::GetOvercast(), Weather::GetWindSpeed(), LIVONIA_ARTY_STRIKE_POS, WorldData::m_CloudsTemperatureEffectModifier, WorldData::m_FiringPos, WorldData::m_MaxTemps, WorldData::m_MinTemps, WorldData::m_Sunrise_Jan, WorldData::m_Sunrise_Jul, WorldData::m_Sunset_Jan, WorldData::m_Sunset_Jul, WorldData::m_TemperaturePerHeightReductionModifier, WorldData::m_UniversalTemperatureSourceCapModifier, WorldData::m_Weather, WorldData::m_WeatherDefaultSettings, WorldData::m_WorldWindCoef, Math::RandomFloat() и Weather::SetDynVolFogHeightBias().

◆ InitYieldBank()

override void InitYieldBank ( )
inlineprotected
90 {
91 super.InitYieldBank();
92
93 m_YieldBank.ClearAllRegisteredItems();
94
95 //fishies
96 m_YieldBank.RegisterYieldItem(new YieldItemCarp(15));
97 m_YieldBank.RegisterYieldItem(new YieldItemMackerel(15));
98 m_YieldBank.RegisterYieldItem(new YieldItemSardines(15));
99 m_YieldBank.RegisterYieldItem(new YieldItemBitterlings(15));
100
101 //fishy junk
102 m_YieldBank.RegisterYieldItem(new YieldItemJunk(1,"Wellies_Brown"));
103 m_YieldBank.RegisterYieldItem(new YieldItemJunk(1,"Wellies_Grey"));
104 m_YieldBank.RegisterYieldItem(new YieldItemJunk(1,"Wellies_Green"));
105 m_YieldBank.RegisterYieldItem(new YieldItemJunk(1,"Wellies_Black"));
106 m_YieldBank.RegisterYieldItem(new YieldItemJunkEmpty(1,"Pot"));
107
108 //non-fishies
109 m_YieldBank.RegisterYieldItem(new YieldItemDeadRabbit(4));
110 m_YieldBank.RegisterYieldItem(new YieldItemDeadRooster(1));
111 m_YieldBank.RegisterYieldItem(new YieldItemDeadChicken_White(1));
112 m_YieldBank.RegisterYieldItem(new YieldItemDeadChicken_Spotted(1));
113 m_YieldBank.RegisterYieldItem(new YieldItemDeadChicken_Brown(1));
114 m_YieldBank.RegisterYieldItem(new YieldItemDeadFox(2));
115 }
void YieldItemJunk(int baseWeight, string type)
Definition YieldsFishingJunk.c:37
ref CatchYieldBank m_YieldBank
Definition WorldData.c:30
Definition YieldsLandAnimals.c:183
Definition YieldsLandAnimals.c:165
Definition YieldsLandAnimals.c:18
Definition YieldsFish.c:72
Definition YieldsFish.c:100

Перекрестные ссылки WorldData::m_YieldBank и YieldItemJunk().

◆ LogWeatherData()

bool LogWeatherData ( )
inlineprotected
606 {
607 #ifdef WEATHER_DATA_LOGGING
608 return true;
609 #endif
610 return false;
611 }

◆ SetupLiquidTemperatures()

override void SetupLiquidTemperatures ( )
inlineprotected
127 {
129
130 m_LiquidSettings.m_Temperatures[LIQUID_SALTWATER] = 25;
131 m_LiquidSettings.m_Temperatures[LIQUID_WATER] = 25.0;
132 m_LiquidSettings.m_Temperatures[LIQUID_STILLWATER] = 25.0;
133 m_LiquidSettings.m_Temperatures[LIQUID_RIVERWATER] = 20.0;
134 m_LiquidSettings.m_Temperatures[LIQUID_FRESHWATER] = 20.0;
135 m_LiquidSettings.m_Temperatures[LIQUID_CLEANWATER] = 15.0;
136 }
ref WorldDataLiquidSettings m_LiquidSettings
Definition WorldData.c:32
const int LIQUID_STILLWATER
Definition constants.c:529
const int LIQUID_FRESHWATER
Definition constants.c:528
const int LIQUID_CLEANWATER
Definition constants.c:531
const int LIQUID_WATER
Definition constants.c:518
const int LIQUID_RIVERWATER
Definition constants.c:519
const int LIQUID_SALTWATER
Definition constants.c:527

Перекрестные ссылки LIQUID_CLEANWATER, LIQUID_FRESHWATER, LIQUID_RIVERWATER, LIQUID_SALTWATER, LIQUID_STILLWATER, LIQUID_WATER и WorldData::m_LiquidSettings.

◆ SetupWeatherSettings()

override void SetupWeatherSettings ( )
inlineprotected
118 {
119 super.SetupWeatherSettings();
120
121 m_WeatherDefaultSettings.m_ClearWeatherChance = 50;
122 m_WeatherDefaultSettings.m_BadWeatherChance = 75;
123 m_WeatherDefaultSettings.m_BadWeatherSuddenChance = 0;
124 }

Перекрестные ссылки WorldData::m_WeatherDefaultSettings.

◆ WeatherOnBeforeChange()

override bool WeatherOnBeforeChange ( EWeatherPhenomenon type,
float actual,
float change,
float time )
inlineprotected
139 {
140 #ifdef WEATHER_DATA_LOGGING
141 if ( !dayInit )
142 {
143 GetGame().GetWorld().GetDate(startYear, startMonth, startDay, startHour, startMinute);
144 dayInit = true;
145 }
146 #endif
147
148 float phmnTime = 5;
149 float phmnLength = 10;
150 float phmnValue = 0;
151
152 int year, month, day, hour, minute;
153 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
154
155 m_Weather.SetStorm( 1.0, m_WeatherDefaultSettings.m_StormThreshold, 20 );
156
157 m_Weather.SetRainThresholds( m_WeatherDefaultSettings.m_RainThreshold, 1.0, 60 );
159
160 switch (type)
161 {
162 //-----------------------------------------------------------------------------------------------------------------------------
163 case EWeatherPhenomenon.OVERCAST:
164 {
165 #ifdef WEATHER_DATA_LOGGING
167 #endif
168
169 float windDirection, windMag;
170
171 //went something goes wrong choose some default random weather
172 phmnValue = Math.RandomFloatInclusive( 0.1, 0.4 );
173 phmnTime = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinTime, m_WeatherDefaultSettings.m_OvercastMaxTime );
174 phmnLength = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinLength, m_WeatherDefaultSettings.m_OvercastMaxLength );
175
176 //----
177 //calculate next weather
178 m_Chance = Math.RandomIntInclusive( 0, 100 );
179
180 //--
181 if ( m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
182 {
183 m_ClearWeatherChance -= ( m_StepValue * m_SameWeatherCnt); //decrease the chance of the same weather
184 }
185
186 if ( m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
187 {
188 m_ClearWeatherChance += ( m_StepValue * m_SameWeatherCnt); //increase the chance of the better weather
190 }
191
192 if ( m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
193 {
194 m_ClearWeatherChance += m_StepValue; //increase the chance of the better weather slightly
195 m_BadWeatherChance += ( m_StepValue * m_SameWeatherCnt ); //decrease the chance of the same weather
196 }
197
198 //----
199 if ( m_Chance > m_WeatherDefaultSettings.m_GlobalSuddenChance && !m_IsSuddenChange) //checks if previous weather was a sudden change
200 {
201 m_IsSuddenChange = true;
203 if ( m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
205 }
206 else if ( m_Chance < m_ClearWeatherChance )
207 {
209 m_IsSuddenChange = false;
210 if ( m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
212 }
213 else if ( m_Chance > m_BadWeatherChance )
214 {
216 m_IsSuddenChange = false;
217 if ( m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
219 }
220 else
221 {
223 m_IsSuddenChange = false;
224 if ( m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
226 }
227
230
231 m_ClearWeatherChance = m_WeatherDefaultSettings.m_ClearWeatherChance;
232 m_BadWeatherChance = m_WeatherDefaultSettings.m_BadWeatherChance;
233
234 //----
235 //set choosen weather
236 if ( m_ChoosenWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
237 {
239 #ifdef WEATHER_DATA_LOGGING
241 #endif
242
243 phmnValue = Math.RandomFloatInclusive( 0.0, 0.3 );
244 phmnTime = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinTime, m_WeatherDefaultSettings.m_OvercastMaxTime );
245 phmnLength = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinLength, m_WeatherDefaultSettings.m_OvercastMaxLength );
246 }
247
248 if ( m_ChoosenWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
249 {
251 #ifdef WEATHER_DATA_LOGGING
253 #endif
254
255 phmnValue = Math.RandomFloatInclusive( 0.3, 0.7 );
256 phmnTime = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinTime, m_WeatherDefaultSettings.m_OvercastMaxTime );
258 }
259
260 if ( m_ChoosenWeather == WorldDataWeatherConstants.BAD_WEATHER )
261 {
263
264 phmnValue = Math.RandomFloatInclusive( 0.7, 1.0 );
265 phmnTime = Math.RandomIntInclusive( m_WeatherDefaultSettings.m_OvercastMinTime, m_WeatherDefaultSettings.m_OvercastMaxTime );
267
268 #ifdef WEATHER_DATA_LOGGING
270 #endif
271
272 if ( m_IsSuddenChange )
273 {
274 #ifdef WEATHER_DATA_LOGGING
277 #endif
278
281 }
282
283 #ifdef WEATHER_DATA_LOGGING
284 if ( phmnValue > m_WeatherDefaultSettings.m_StormThreshold )
285 {
286 if ( m_IsSuddenChange )
287 {
290 }
291 else
292 { stormCount++;
294 }
295 }
296 #endif
297 }
298
300
301 //we want to control wind with the overcast calculation and change with it.
303 m_Weather.GetWindMagnitude().Set( windMag, phmnTime * WIND_MAGNITUDE_TIME_MULTIPLIER , phmnTime * (1 - WIND_MAGNITUDE_TIME_MULTIPLIER) ); // magnitude change happens during the overcast change, after overcast change finishes wind will decrease a bit
305
307
308 if( m_IsSuddenChange )
309 {
310 m_Weather.GetRain().Set(Math.RandomFloatInclusive( 0.4, 0.8 ), phmnTime, 0); //forces to rain in the suddenchange.
311 }
312
313 Debug.WeatherLog(string.Format("Enoch::Weather::Overcast:: (%1) overcast: %2", g_Game.GetDayTime(), actual));
314 Debug.WeatherLog(string.Format("Enoch::Weather::Overcast::Rain:: (%1) %2", g_Game.GetDayTime(), m_Weather.GetRain().GetActual()));
315
316 #ifdef WEATHER_DATA_LOGGING
317 int testYear = 0;
318 int testMonth = 0;
319 int testDay = 0;
320 int testHour = 0;
321 int testMinute = 0;
322 GetGame().GetWorld().GetDate(testYear, testMonth, testDay, testHour, testMinute);
323
324 if ( testDay - startDay > currentDay && testHour - startHour >= 0 && testMinute - startMinute >= 0 )
325 {
326 FileHandle file = OpenFile("$profile:OvercastCountsLivonia" + (currentDay + 1) + ".log", FileMode.WRITE);
327 FPrintln(file, "================================================================");
328 FPrintln(file," ================== Day " + (currentDay + 1) + " ================== ");
329 FPrintln(file, "================================================================");
330 FPrintln(file, "Overcast Change Count: " + overcastChangeCount);
331 FPrintln(file, "Bad Weather Change Count: " + badWeatherCount);
332 FPrintln(file, "Sudden Change Count: " + suddenChangeCount);
333 FPrintln(file, "Storm Count: " + stormCount);
334 FPrintln(file, "Sudden Storm Count: " + suddenStormCount);
335 FPrintln(file, "Cloudy Weather Count: " + cloudyWeatherCount);
336 FPrintln(file, "Clear Weather Count: " + clearWeatherCount);
337
338 currentDay++;
340 if ( currentDay == daysToRun )
341 {
342 g_Game.RequestExit(IDC_MAIN_QUIT);
343 }
344
347 stormCount = 0;
349 badWeatherCount = 0;
352 }
353 #endif
354
355 return true;
356 }
357 //-----------------------------------------------------------------------------------------------------------------------------
358 case EWeatherPhenomenon.RAIN:
359 {
360 float actualOvercast = m_Weather.GetOvercast().GetActual();
361
362 m_Chance = Math.RandomIntInclusive( 0, 100 );
363 phmnValue = 0.2;
364 phmnTime = 90;
365 phmnLength = 30;
366
367 if ( actualOvercast <= m_WeatherDefaultSettings.m_RainThreshold)
368 {
369 m_Weather.GetRain().Set( 0.0, m_WeatherDefaultSettings.m_RainTimeMin, m_WeatherDefaultSettings.m_RainTimeMax );
370 Debug.WeatherLog (string.Format("Enoch::Weather::Rain::ForceEnd:: (%1) %2 -> 0", g_Game.GetDayTime(), actual));
371 return true;
372 }
373
374 if ( actualOvercast > m_WeatherDefaultSettings.m_StormThreshold )
375 {
376 if( m_Weather.GetOvercast().GetActual() > m_Weather.GetOvercast().GetForecast() ) //ensure to have a pause to rain after the storm
377 {
378 phmnValue = 0;
379 phmnTime = Math.RandomInt( m_WeatherDefaultSettings.m_RainTimeMin, m_WeatherDefaultSettings.m_RainTimeMax ) * 2;
380 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_CalmAfterStormTimeMin, m_WeatherDefaultSettings.m_CalmAfterStormTimeMax );
381 }
382 else
383 {
384 phmnValue = Math.RandomFloatInclusive( 0.8, 1.0 );
386 phmnLength = 0;
387 }
388
390 Debug.WeatherLog(string.Format("Enoch::Weather::Rain::ForceStorm:: (%1) %2 -> %3", g_Game.GetDayTime(), actual, phmnValue));
391 return true;
392 }
393
394 //make a differnce in "normal rain"
395 if ( actualOvercast < 0.75 )
396 {
397 if ( m_Chance < 30 )
398 {
399 phmnValue = Math.RandomFloatInclusive( 0.1, 0.3 );
401 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_RainLengthMin, m_WeatherDefaultSettings.m_RainLengthMax );
402 }
403 else if ( m_Chance < 60 )
404 {
405 phmnValue = Math.RandomFloatInclusive( 0.2, 0.4 );
407 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_RainLengthMin, m_WeatherDefaultSettings.m_RainLengthMax );
408 }
409 else if ( m_Chance < 85 )
410 {
411 phmnValue = Math.RandomFloatInclusive( 0.05, 0.2 );
413 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_RainLengthMin, m_WeatherDefaultSettings.m_RainLengthMax );
414 }
415 else //also have the chance to not have rain at all
416 {
417 phmnValue = 0;
419 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_RainLengthMin, m_WeatherDefaultSettings.m_RainLengthMax ) * 4;
420 }
421 }
422 else //overcast between storm threshold and 0.75
423 {
424 if ( m_Chance < 15 )
425 {
426 phmnValue = Math.RandomFloatInclusive( 0.4, 0.6 );
428 phmnLength = 0;
429 }
430 else if ( m_Chance < 50 )
431 {
432 phmnValue = Math.RandomFloatInclusive( 0.2, 0.4 );
434 phmnLength = 0;
435 }
436 else if ( m_Chance < 90 )
437 {
438 phmnValue = Math.RandomFloatInclusive( 0.6, 0.8 );
440 phmnLength = 0;
441 }
442 else //also have the chance to not have rain at all
443 {
444 phmnValue = 0;
446 phmnLength = Math.RandomInt( m_WeatherDefaultSettings.m_RainLengthMin, m_WeatherDefaultSettings.m_RainLengthMax ) * 4;
447 }
448 }
449
451
452 Debug.WeatherLog(string.Format("Enoch::Weather::Rain:: (%1) %2", g_Game.GetDayTime(), actual));
453 return true;
454 }
455 //-----------------------------------------------------------------------------------------------------------------------------
456 case EWeatherPhenomenon.FOG:
457 {
458 if (( hour >= 2 ) && ( hour <= 5 ))
459 {
460 m_Weather.GetFog().Set( 0.13, 900, 0 );
461 }
462 else
463 {
464 m_Weather.GetFog().Set( 0.01, 900, 0 );
465 }
466
467 Debug.WeatherLog(string.Format("Enoch::Weather::Fog:: (%1) %2", g_Game.GetDayTime(), actual));
468
469 return true;
470 }
471 //-----------------------------------------------------------------------------------------------------------------------------
472 case EWeatherPhenomenon.WIND_MAGNITUDE:
473 {
475 m_Weather.GetWindMagnitude().Set(m_Weather.GetWindMagnitude().GetActual() * 0.75, phmnTime , m_WeatherDefaultSettings.m_OvercastMaxLength); // next change will be happen with the overcast change
476
477 return true;
478 }
479 }
480 return false;
481 }
DayZGame g_Game
Definition DayZGame.c:3815
EWeatherPhenomenon
Definition Weather.c:11
Definition Debug.c:14
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:209
override void CalculateWind(int newWeather, bool suddenChange, out float magnitude, out float direction)
Definition Enoch.c:483
proto native void SetStorm(float density, float threshold, float timeOut)
Sets the thunderstorm properties.
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second. Equivalent to setting WindMagnitude phenomenon(s) va...
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
proto native void SetRainThresholds(float tMin, float tMax, float tTime)
Sets overcast threshold values for rain phenomena.
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native WindDirection GetWindDirection()
Returns a wind direction phenomenon object.
proto native Fog GetFog()
Returns a fog phenomenon object.
int m_ClearWeatherChance
Definition WorldData.c:37
int m_LastWeather
Definition WorldData.c:48
float SUDDENCHANGE_TIME_MULTIPLIER
how many % of environment temperature can be lowered by clouds
Definition WorldData.c:13
int m_ChoosenWeather
Definition WorldData.c:47
int m_BadWeatherChance
weather related
Definition WorldData.c:36
float WIND_MAGNITUDE_TIME_MULTIPLIER
Definition WorldData.c:15
int m_StepValue
Definition WorldData.c:45
int m_Chance
Definition WorldData.c:46
float WIND_DIRECTION_TIME_MULTIPLIER
Definition WorldData.c:16
int m_SameWeatherCnt
Definition WorldData.c:44
float SUDDENCHANGE_LENGTH_MULTIPLIER
Definition WorldData.c:14
bool m_IsSuddenChange
Definition WorldData.c:38
FileMode
Definition EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.
const int IDC_MAIN_QUIT
Definition constants.c:144

Перекрестные ссылки CalculateVolFog(), CalculateWind(), CloseFile(), FPrintln(), g_Game, Weather::GetFog(), GetGame(), Weather::GetOvercast(), Weather::GetRain(), Weather::GetWindDirection(), Weather::GetWindMagnitude(), IDC_MAIN_QUIT, WorldData::m_BadWeatherChance, WorldData::m_Chance, WorldData::m_ChoosenWeather, WorldData::m_ClearWeatherChance, WorldData::m_IsSuddenChange, WorldData::m_LastWeather, WorldData::m_SameWeatherCnt, WorldData::m_StepValue, WorldData::m_Weather, WorldData::m_WeatherDefaultSettings, OpenFile(), Math::RandomFloatInclusive(), Math::RandomInt(), Math::RandomIntInclusive(), Weather::SetRainThresholds(), Weather::SetStorm(), Weather::SetWindMaximumSpeed(), WorldData::SUDDENCHANGE_LENGTH_MULTIPLIER, WorldData::SUDDENCHANGE_TIME_MULTIPLIER, Debug::WeatherLog(), WorldData::WIND_DIRECTION_TIME_MULTIPLIER и WorldData::WIND_MAGNITUDE_TIME_MULTIPLIER.

Поля

◆ BAD_WEATHER

const int BAD_WEATHER = 3
protected

◆ CLEAR_WEATHER

const int CLEAR_WEATHER = 1
protected

DEPRECATED (see WorldDataWeatherConstants)

◆ CLOUDY_WEATHER

const int CLOUDY_WEATHER = 2
protected

◆ LIVONIA_ARTY_STRIKE_POS

const ref array<vector> LIVONIA_ARTY_STRIKE_POS
staticprotected
Инициализатор
=
{
"7440.00 417.00 -500.00",
"-500.00 276.00 5473.00",
"-500.00 265.00 9852.00",
"4953.00 240.00 13300.00",
"9620.00 188.00 13300.00",
"13300.00 204.00 10322.00",
"13300.00 288.00 6204.00",
"13300.00 296.00 -500.00"
}
25 {
26 "7440.00 417.00 -500.00",
27 "-500.00 276.00 5473.00",
28 "-500.00 265.00 9852.00",
29 "4953.00 240.00 13300.00",
30 "9620.00 188.00 13300.00",
31 "13300.00 204.00 10322.00",
32 "13300.00 288.00 6204.00",
33 "13300.00 296.00 -500.00"
34 };

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

◆ m_badWeatherChance

int m_badWeatherChance = m_BadWeatherChance
protected

◆ m_chance

int m_chance = m_Chance
protected

◆ m_choosenWeather

int m_choosenWeather = m_ChoosenWeather
protected

◆ m_clearWeatherChance

int m_clearWeatherChance = m_ClearWeatherChance
protected

◆ m_lastWeather

int m_lastWeather = m_LastWeather
protected

◆ m_sameWeatherCnt

int m_sameWeatherCnt = m_SameWeatherCnt
protected

◆ m_stepValue

int m_stepValue = m_StepValue
protected

◆ OVERCAST_MAX_TIME

const int OVERCAST_MAX_TIME = 900
protected

◆ OVERCAST_MIN_TIME

const int OVERCAST_MIN_TIME = 600
protected

DEPRECATED (see WorldDataWeatherSettings)

◆ RAIN_THRESHOLD

const float RAIN_THRESHOLD = 0.6
protected

◆ RAIN_TIME_MAX

const int RAIN_TIME_MAX = 120
protected

◆ RAIN_TIME_MIN

const int RAIN_TIME_MIN = 60
protected

◆ STORM_THRESHOLD

const float STORM_THRESHOLD = 0.85
protected

Объявления и описания членов класса находятся в файле: