DayZ 1.24
Loading...
Searching...
No Matches
Weather.c
Go to the documentation of this file.
1
6//-----------------------------------------------------------------------------
16
17
18//-----------------------------------------------------------------------------
23{
24 private void WeatherPhenomenon() {}
25 private void ~WeatherPhenomenon() {}
26
29
32
35
42 proto native void Set(float forecast, float time = 0, float minDuration = 0);
43
48
54 proto void GetLimits(out float fnMin, out float fnMax);
67 proto native void SetLimits(float fnMin, float fnMax);
68
89
107
118 bool OnBeforeChange(float change, float time)
119 {
120 // check if mission forces use of custom weather
121 Weather weather = g_Game.GetWeather();
122
123 if (weather.GetMissionWeather())
124 return false;
125
126 // check for active worlddata with custom onbeforechange behaviour
127 Mission currentMission = g_Game.GetMission();
128
129 if (currentMission)
130 {
131 WorldData worldData = currentMission.GetWorldData();
132 if (worldData)
133 return worldData.WeatherOnBeforeChange(GetType(), GetActual(), change, time);
134 }
135
136 return false;
137 }
138};
139
140
144
145
146//-----------------------------------------------------------------------------
151{
152 protected bool m_missionWeather;
153
154 private void Weather()
155 {
156 m_missionWeather = false;
157 }
158
159 private void ~Weather() {}
160
163
166
169
172
180 proto native void SetStorm(float density, float threshold, float timeOut);
181
184
199 proto native void SetWindSpeed(float speed);
221
238 proto native void SetRainThresholds(float tMin, float tMax, float tTime);
239
241 {
243 }
244
246 {
247 return m_missionWeather;
248 }
249
250};
DayZGame g_Game
Definition DayZGame.c:3528
WeatherPhenomenon Fog
Definition Weather.c:142
WeatherPhenomenon Rain
Definition Weather.c:143
EWeatherPhenomenon
Definition Weather.c:11
@ OVERCAST
Definition Weather.c:12
@ FOG
Definition Weather.c:13
@ RAIN
Definition Weather.c:14
WeatherPhenomenon Overcast
Definition Weather.c:141
Mission class.
Definition gameplay.c:668
proto native Fog GetFog()
Returns a fog phenomenon object.
void Weather()
Definition Weather.c:154
bool m_missionWeather
Definition Weather.c:152
proto native void SetWind(vector wind)
Sets the wind vector (direction and speed as length of the vector).
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.
bool GetMissionWeather()
Definition Weather.c:245
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).
proto native vector GetWind()
Returns wind vector (direction and speed as length of the vector).
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 float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
void MissionWeather(bool use)
Definition Weather.c:240
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native void SuppressLightningSimulation(bool state)
enables/disables thunderbolt simulation on client (together with sounds)
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
void ~Weather()
Definition Weather.c:159
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second.
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()
Returns actual value of phenomenon in range <0, 1>.
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.
Definition Weather.c:118
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()
Definition Weather.c:25
proto native float GetNextChange()
Reads the time in seconds when the next forecast will be computed.
void WeatherPhenomenon()
Definition Weather.c:24
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.
Keeps information about currently loaded world, like temperature.
Definition WorldData.c:3