Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
weather.c
Go to the documentation of this file.
1 
6 //-----------------------------------------------------------------------------
11 {
13  FOG,
15 };
16 
17 
18 //-----------------------------------------------------------------------------
23 {
24  private void WeatherPhenomenon() {}
25  private void ~WeatherPhenomenon() {}
26 
28  proto native EWeatherPhenomenon GetType();
29 
31  proto native float GetActual();
32 
34  proto native float GetForecast();
35 
42  proto native void Set( float forecast, float time = 0, float minDuration = 0 );
43 
45  proto native float GetNextChange();
47  proto native void SetNextChange( float time );
48 
54  proto void GetLimits( out float fnMin, out float fnMax );
67  proto native void SetLimits( float fnMin, float fnMax );
68 
74  proto void GetForecastChangeLimits( out float fcMin, out float fcMax );
88  proto native void SetForecastChangeLimits( float fcMin, float fcMax );
89 
95  proto void GetForecastTimeLimits( out float ftMin, out float ftMax );
106  proto native void SetForecastTimeLimits( float ftMin, float ftMax );
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  {
134  return worldData.WeatherOnBeforeChange( GetType(), GetActual(), change, time );
135  }
136  }
137 
138  return false;
139  }
140 };
141 
142 
146 
147 
148 
149 
150 //-----------------------------------------------------------------------------
154 class Weather
155 {
156  protected bool m_missionWeather;
157 
158  private void Weather()
159  {
160  m_missionWeather = false;
161  }
162 
163  private void ~Weather() {}
164 
166  proto native float GetTime();
167 
169  proto native Overcast GetOvercast();
170 
172  proto native Fog GetFog();
173 
175  proto native Rain GetRain();
176 
184  proto native void SetStorm( float density, float threshold, float timeOut );
185 
187  proto native void SuppressLightningSimulation(bool state);
188 
190  proto native vector GetWind();
192  proto native void SetWind( vector wind );
197  proto native float GetWindSpeed();
203  proto native void SetWindSpeed( float speed );
208  proto native float GetWindMaximumSpeed();
210  proto native void SetWindMaximumSpeed( float maxSpeed );
217  proto void GetWindFunctionParams( out float fnMin, out float fnMax, out float fnSpeed );
224  proto native void SetWindFunctionParams( float fnMin, float fnMax, float fnSpeed );
225 
242  proto native void SetRainThresholds( float tMin, float tMax, float tTime );
243 
244  void MissionWeather( bool use )
245  {
246  m_missionWeather = use;
247  }
248 
249  bool GetMissionWeather()
250  {
251  return m_missionWeather;
252  }
253 
254 };
OVERCAST
@ OVERCAST
Definition: weather.c:12
Mission
Mission class.
Definition: gameplay.c:670
FOG
@ FOG
Definition: weather.c:13
WeatherPhenomenon
Definition: weather.c:22
Rain
WeatherPhenomenon Rain
Definition: weather.c:145
vector
Definition: enconvert.c:105
Fog
WeatherPhenomenon Fog
Definition: weather.c:144
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
WorldData
Keeps information about currently loaded world, like temperature.
Definition: worlddata.c:2
EWeatherPhenomenon
EWeatherPhenomenon
Definition: weather.c:10
RAIN
@ RAIN
Definition: weather.c:14
Overcast
WeatherPhenomenon Overcast
Definition: weather.c:143
Weather
Definition: weather.c:154
GetType
override int GetType()
Definition: huddebugwincharagents.c:49