DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Weather.c
См. документацию.
1
4
5
6//-----------------------------------------------------------------------------
22
23
24//-----------------------------------------------------------------------------
29{
30 private void WeatherPhenomenon() {}
31 private void ~WeatherPhenomenon() {}
32
35
38 proto native float GetActual();
39
41 proto native float GetForecast();
42
49 proto native void Set( float forecast, float time = 0, float minDuration = 0 );
50
52 proto native float GetNextChange();
54 proto native void SetNextChange( float time );
55
61 proto void GetLimits( out float fnMin, out float fnMax );
74 proto native void SetLimits( float fnMin, float fnMax );
75
81 proto void GetForecastChangeLimits( out float fcMin, out float fcMax );
95 proto native void SetForecastChangeLimits( float fcMin, float fcMax );
96
102 proto void GetForecastTimeLimits( out float ftMin, out float ftMax );
113 proto native void SetForecastTimeLimits( float ftMin, float ftMax );
114
124
125 bool OnBeforeChange( float change, float time )
126 {
127 // check if mission forces use of custom weather
128 Weather weather = g_Game.GetWeather();
129
130 if ( weather.GetMissionWeather() )
131 return false;
132
133 if (weather.GetWeatherUpdateFrozen())
134 return true;
135
136 // check for active worlddata with custom onbeforechange behaviour
137 Mission currentMission = g_Game.GetMission();
138
139 if ( currentMission )
140 {
141 WorldData worldData = currentMission.GetWorldData();
142 if ( worldData )
143 {
144 return worldData.WeatherOnBeforeChange( GetType(), GetActual(), change, time );
145 }
146 }
147
148 return false;
149 }
150};
151
152
159
160
161
162
163//-----------------------------------------------------------------------------
168{
169 protected bool m_missionWeather;
170 protected bool m_UpdateFrozen;
171
172 private void Weather()
173 {
174 m_missionWeather = false;
175 }
176
177 private void ~Weather() {}
178
180 proto native float GetTime();
181
183 proto native Overcast GetOvercast();
184
186 proto native Fog GetFog();
187
189 proto native Rain GetRain();
190
192 proto native Snowfall GetSnowfall();
193
200
206
214 proto native void SetStorm( float density, float threshold, float timeOut );
215
217 proto native void SuppressLightningSimulation(bool state);
218
220 proto native vector GetWind();
221
236 proto native void SetWind( vector wind );
237
243 proto native float GetWindSpeed();
244
251 proto native void SetWindSpeed( float speed );
252
258 proto native float GetWindMaximumSpeed();
259
264 proto native void SetWindMaximumSpeed( float maxSpeed );
265
272 proto void GetWindFunctionParams( out float fnMin, out float fnMax, out float fnSpeed );
273
280 proto native void SetWindFunctionParams( float fnMin, float fnMax, float fnSpeed );
281
298 proto native void SetRainThresholds( float tMin, float tMax, float tTime );
299
316 proto native void SetSnowfallThresholds( float tMin, float tMax, float tTime );
317
323 proto native void SetSnowflakeScale(float scale);
324
328 proto native float GetSnowflakeScale();
329
335 static proto float WindDirectionToAngle( vector dir );
336
342 static proto vector AngleToWindDirection( float angle );
343
344
349 proto native bool IsDynVolFogEnabled();
355 proto native void SetDynVolFogDistanceDensity(float value, float time = 0);
359 proto native float GetDynVolFogDistanceDensity();
365 proto native void SetDynVolFogHeightDensity(float value, float time = 0);
369 proto native float GetDynVolFogHeightDensity();
376 proto native void SetDynVolFogHeightBias(float value, float time = 0);
380 proto native float GetDynVolFogHeightBias();
381
382
383 void MissionWeather( bool use )
384 {
385 m_missionWeather = use;
386 }
387
389 {
390 return m_missionWeather;
391 }
392
393 void SetWeatherUpdateFreeze(bool state)
394 {
395 m_UpdateFrozen = state;
396 }
397
399 {
400 return m_UpdateFrozen;
401 }
402
403 // Noise reduction due to environmental conditions, used for AI noise evaluation
405 {
408
409 if (rainReduction == 0 && snowfallReduction == 0)
410 return 1;
411
412 if (rainReduction > snowfallReduction) // combined phenomenons dont need to have multiplicative effects
413 return 1 - rainReduction;
414 else
415 return 1 - snowfallReduction;
416 }
417};
DayZGame g_Game
Определения DayZGame.c:3868
@ OVERCAST
@ FOG
WeatherPhenomenon Fog
Определения Weather.c:154
WeatherPhenomenon Rain
Определения Weather.c:155
EWeatherPhenomenon
Определения Weather.c:11
@ VOLFOG_HEIGHT_DENSITY
Определения Weather.c:18
@ SNOWFALL
Определения Weather.c:15
@ WIND_MAGNITUDE
Определения Weather.c:17
@ RAIN
Определения Weather.c:14
@ VOLFOG_DISTANCE_DENSITY
Определения Weather.c:19
@ WIND_DIRECTION
Определения Weather.c:16
@ VOLFOG_HEIGHT_BIAS
Определения Weather.c:20
WeatherPhenomenon WindDirection
Определения Weather.c:157
WeatherPhenomenon Overcast
Определения Weather.c:153
WeatherPhenomenon Snowfall
Определения Weather.c:156
WeatherPhenomenon WindMagnitude
Определения Weather.c:158
WorldData GetWorldData()
Определения gameplay.c:743
Mission class.
Определения gameplay.c:687
proto native Fog GetFog()
Returns a fog phenomenon object.
void Weather()
Определения Weather.c:172
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.
float GetNoiseReductionByWeather()
Определения Weather.c:404
bool m_missionWeather
Определения Weather.c:169
proto native void SetWind(vector wind)
Sets the wind vector (direction and speed as length of the vector).
proto native void SetSnowflakeScale(float scale)
Sets the overall scale of snowflakes during snowfall phenomenon. This value is not synchronized and s...
proto native void SetStorm(float density, float threshold, float timeOut)
Sets the thunderstorm properties.
proto native void SetWindSpeed(float speed)
Sets the actual wind speed in metre per second.
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
bool GetMissionWeather()
Определения Weather.c:388
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 bool IsDynVolFogEnabled()
Dynamic volumetric fog only takes effect if enabled in the world config.
proto native Snowfall GetSnowfall()
Returns a snowfall phenomenon object.
proto native float GetSnowflakeScale()
Returns the overall scale of snowflakes during snowfall phenomenon.
proto native void SetRainThresholds(float tMin, float tMax, float tTime)
Sets overcast threshold values for rain phenomena.
proto native void SetWindFunctionParams(float fnMin, float fnMax, float fnSpeed)
Sets function parameters that controls the wind behaviour (change in time).
proto void GetWindFunctionParams(out float fnMin, out float fnMax, out float fnSpeed)
Reads function parameters that controls the wind behaviour (change in time).
static proto float WindDirectionToAngle(vector dir)
Returns the xz angle of the provided wind vector.
proto native vector GetWind()
Returns wind vector (direction and speed as length of the vector).
bool m_UpdateFrozen
Определения Weather.c:170
proto native float GetTime()
Returns actual time from start of a server (how many seconds elapsed from server start).
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
proto native WindDirection GetWindDirection()
Returns a wind direction phenomenon object.
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...
bool GetWeatherUpdateFrozen()
Определения Weather.c:398
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
void SetWeatherUpdateFreeze(bool state)
Определения Weather.c:393
void MissionWeather(bool use)
Определения Weather.c:383
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native void SetSnowfallThresholds(float tMin, float tMax, float tTime)
Sets overcast threshold values for snowfall phenomena.
proto native void SuppressLightningSimulation(bool state)
enables/disables thunderbolt simulation on client (together with sounds)
static proto vector AngleToWindDirection(float angle)
Returns wind direction from the provided wind angle.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native float GetDynVolFogHeightDensity()
Returns the current 'dynamic' volumetric fog height density.
void ~Weather()
Определения Weather.c:177
proto native float GetDynVolFogDistanceDensity()
Returns the current 'dynamic' volumetric fog distance density.
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second. Equivalent to setting WindMagnitude phenomenon(s) va...
Определения Weather.c:168
proto void GetLimits(out float fnMin, out float fnMax)
Reads limits of this phenomenon.
proto native void Set(float forecast, float time=0, float minDuration=0)
Sets the forecast.
proto native float GetActual()
proto native void SetNextChange(float time)
Sets the time in seconds when the next forecast will be computed.
proto native void SetLimits(float fnMin, float fnMax)
Sets limits of this phenomenon.
proto native void SetForecastChangeLimits(float fcMin, float fcMax)
Sets limits of change when forecast is computed.
bool OnBeforeChange(float change, float time)
Is called every time the Phenomenon computes new forecast.
Определения Weather.c:125
proto void GetForecastTimeLimits(out float ftMin, out float ftMax)
Reads time range in which next forecast can be computed.
proto native EWeatherPhenomenon GetType()
Returns type of this phenomenon.
void ~WeatherPhenomenon()
Определения Weather.c:31
proto native float GetNextChange()
Reads the time in seconds when the next forecast will be computed.
void WeatherPhenomenon()
Определения Weather.c:30
proto void GetForecastChangeLimits(out float fcMin, out float fcMax)
Reads limits of change when forecast is computed.
proto native float GetForecast()
Returns a forecast value the phenomenon is heading towards.
proto native void SetForecastTimeLimits(float ftMin, float ftMax)
Sets time range in which next forecast can be computed.
Определения Weather.c:29
bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
Определения WorldData.c:240
Keeps information about currently loaded world, like temperature.
Определения WorldData.c:3
Определения EnConvert.c:106
static float RAIN_NOISE_REDUCTION_WEIGHT
Определения 3_Game/constants.c:1079
static float SNOWFALL_NOISE_REDUCTION_WEIGHT
Определения 3_Game/constants.c:1080