Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс WorldData

Keeps information about currently loaded world, like temperature. Подробнее...

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

void WorldData ()
 
void Init ()
 
float GetApproxSunriseTime (float monthday)
 
float GetApproxSunsetTime (float monthday)
 
float CalcBaseEnvironmentTemperature (float monthday, float daytime)
 
void UpdateBaseEnvTemperature (float timeslice)
 
float GetBaseEnvTemperature ()
 
float GetBaseEnvTemperatureExact (int month, int day, int hour, int minute)
 
float GetDayTemperature ()
 
float GetNightTemperature ()
 
bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 
array< vectorGetArtyFiringPos ()
 
void BaseTempDebug (int month, int day)
 
override void Init ()
 
override bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 
override void Init ()
 
override bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
 

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

float m_DayTemperature
 
float m_NightTemperature
 
Weather m_Weather
 
float m_EnvironmentTemperature
 
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
 
int m_clearWeatherChance = CLEAR_WEATHER_CHANCE
 
int m_badWeatherChance = BAD_WEATHER_CHANCE
 
int m_sameWeatherCnt = 0
 
int m_stepValue = 5
 
int m_chance = 50
 
int m_choosenWeather = 1
 
int m_lastWeather = 0
 

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

static const ref array< vectorCHERNARUS_ARTY_STRIKE_POS
 
static const ref array< vectorLIVONIA_ARTY_STRIKE_POS
 

Закрытые данные

const float RAIN_THRESHOLD = 0.6
 
const float STORM_THRESHOLD = 0.9
 
const int OVERCAST_MIN_TIME = 600
 
const int OVERCAST_MAX_TIME = 900
 
const int RAIN_TIME_MIN = 60
 
const int RAIN_TIME_MAX = 120
 
const int CLEAR_WEATHER = 1
 
const int CLOUDY_WEATHER = 2
 
const int BAD_WEATHER = 3
 
const int CLEAR_WEATHER_CHANCE = 30
 
const int BAD_WEATHER_CHANCE = 80
 

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

Keeps information about currently loaded world, like temperature.

Конструктор(ы)

◆ WorldData()

void WorldData ( )
inlineprotected
18 {
19 Init();
20 }
void Init()
Definition WorldData.c:22

Перекрестные ссылки Init().

Методы

◆ BaseTempDebug()

void BaseTempDebug ( int month,
int day )
inlineprotected
140 {
141 Print("--------------------");
142 for ( int i = 0; i < 24; i++ )
143 {
144 for ( int j = 0; j < 6; j++ )
145 {
146 int minute = ( j * 10 );
147 Print(string.Format( "%1:%2 %3", i, minute, GetBaseEnvTemperatureExact( month, day, i, minute ) ) );
148 }
149 }
150 }
Definition EntityAI.c:95
float GetBaseEnvTemperatureExact(int month, int day, int hour, int minute)
Definition WorldData.c:110
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки GetBaseEnvTemperatureExact() и Print().

◆ CalcBaseEnvironmentTemperature()

float CalcBaseEnvironmentTemperature ( float monthday,
float daytime )
inlineprotected
52 {
56 float nightTime = 24.0 - dayLight;
59 if ( tempArrayIndexToLerp >= 12 )
66 float eveningMinA = minTempA + ( 0.5 * Math.AbsFloat( minTempA - maxTempA ) );
67 float eveningMinB = minTempB + ( 0.5 * Math.AbsFloat( minTempB - maxTempB ) );
68
69 if ( ( daytime >= approxSunrise ) && ( daytime <= approxSunset ) ) {
70 if ( daytime <= ( approxSunrise + ( dayLight * 0.75 ) ) )
71 return Math.Lerp(
74 ( ( daytime - approxSunrise ) / ( dayLight * 0.75 ) ) );
75 else
76 return Math.Lerp(
79 ( ( ( daytime - approxSunrise ) - ( dayLight * 0.75 ) ) / ( dayLight - ( dayLight * 0.75 ) ) ) );
80 } else {
81 if ( ( daytime > approxSunset ) && ( daytime < 24 ) )
82 return Math.Lerp(
85 ( ( daytime - approxSunset ) / ( 24 - approxSunset ) ) / 2.0 );
86 else
87 return Math.Lerp(
90 ( ( ( daytime + ( 24 - approxSunset ) ) / nightTime ) / 2.0 ) + 0.5 );
91 }
92 }
Definition EnMath.c:7
float GetApproxSunsetTime(float monthday)
Definition WorldData.c:44
float m_MaxTemps[12]
Definition WorldData.c:9
float GetApproxSunriseTime(float monthday)
Definition WorldData.c:37
float m_MinTemps[12]
Definition WorldData.c:10
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float Floor(float f)
Returns floor of value.

Перекрестные ссылки Math::AbsFloat(), Math::Floor(), GetApproxSunriseTime(), GetApproxSunsetTime(), Math::Lerp(), m_MaxTemps и m_MinTemps.

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

◆ GetApproxSunriseTime()

float GetApproxSunriseTime ( float monthday)
inlineprotected
38 {
39 if ( monthday <= 8.0 )
40 return ( ( m_Sunrise_Jan - m_Sunrise_Jul ) / ( 8 - 1 ) ) * ( 1 - monthday ) + m_Sunrise_Jan;
41 else
42 return ( ( ( monthday - 8 ) * ( m_Sunrise_Jan - m_Sunrise_Jul ) ) / ( 13 - 8 ) ) + m_Sunrise_Jul;
43 }
float m_Sunrise_Jan
Definition WorldData.c:11
float m_Sunrise_Jul
Definition WorldData.c:13

Перекрестные ссылки m_Sunrise_Jan и m_Sunrise_Jul.

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

◆ GetApproxSunsetTime()

float GetApproxSunsetTime ( float monthday)
inlineprotected
45 {
46 if ( monthday <= 8.0 )
47 return ( ( m_Sunset_Jan - m_Sunset_Jul ) / (8 - 1) ) * ( 1 - monthday ) + m_Sunset_Jan;
48 else
49 return ( ( ( monthday - 8 ) * ( m_Sunset_Jan - m_Sunset_Jul ) ) / ( 13 - 8 ) ) + m_Sunset_Jul;
50 }
float m_Sunset_Jul
Definition WorldData.c:14
float m_Sunset_Jan
Definition WorldData.c:12

Перекрестные ссылки m_Sunset_Jan и m_Sunset_Jul.

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

◆ GetArtyFiringPos()

array< vector > GetArtyFiringPos ( )
inlineprotected
134 {
135 return m_FiringPos;
136 }
ref array< vector > m_FiringPos
Definition WorldData.c:15

Перекрестные ссылки m_FiringPos.

◆ GetBaseEnvTemperature()

float GetBaseEnvTemperature ( )
inlineprotected
107 {
109 }
float m_EnvironmentTemperature
Definition WorldData.c:7

Перекрестные ссылки m_EnvironmentTemperature.

◆ GetBaseEnvTemperatureExact()

float GetBaseEnvTemperatureExact ( int month,
int day,
int hour,
int minute )
inlineprotected
111 {
112 return CalcBaseEnvironmentTemperature( month + ( day / 32.0 ), hour + ( minute / 60.0 ) );
113 }
float CalcBaseEnvironmentTemperature(float monthday, float daytime)
Definition WorldData.c:51

Перекрестные ссылки CalcBaseEnvironmentTemperature().

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

◆ GetDayTemperature()

float GetDayTemperature ( )
inlineprotected
117 {
118 return m_DayTemperature;
119 }
float m_DayTemperature
Definition WorldData.c:4

Перекрестные ссылки m_DayTemperature.

◆ GetNightTemperature()

float GetNightTemperature ( )
inlineprotected
122 {
123 return m_NightTemperature;
124 }
float m_NightTemperature
Definition WorldData.c:5

Перекрестные ссылки m_NightTemperature.

◆ Init() [1/3]

void Init ( )
inlineprotected
23 {
24 m_DayTemperature = 10; // legacy, no longer used
25 m_NightTemperature = 6; // legacy, no longer used
26 m_Weather = g_Game.GetWeather();
28 m_Timer = 0.0;
29 m_Sunrise_Jan = 8.54;
30 m_Sunset_Jan = 15.52;
31 m_Sunrise_Jul = 3.26;
32 m_Sunset_Jul = 20.73;
33 m_MaxTemps = {3,5,7,14,19,24,26,25,21,16,10,5};
34 m_MinTemps = {-3,-2,0,4,9,14,18,17,12,7,4,0};
35 }
DayZGame g_Game
Definition DayZGame.c:3746
float m_Timer
Definition WorldData.c:8
Weather m_Weather
Definition WorldData.c:6

Перекрестные ссылки g_Game, m_DayTemperature, m_EnvironmentTemperature, m_MaxTemps, m_MinTemps, m_NightTemperature, m_Sunrise_Jan, m_Sunrise_Jul, m_Sunset_Jan, m_Sunset_Jul, m_Timer и m_Weather.

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

◆ Init() [2/3]

override void Init ( )
inlineprotected
42 {
43 super.Init();
44
45 // new temperature curve settings
46 m_Sunrise_Jan = 8.54;
47 m_Sunset_Jan = 15.52;
48 m_Sunrise_Jul = 3.26;
49 m_Sunset_Jul = 20.73;
50
51 int tempIdx;
52 m_MinTemps = {-3,-2,0,4,9,14,18,17,12,7,4,0};
54 {
56 {
58 }
59 }
60
61 m_MaxTemps = {3,5,7,14,19,24,26,25,21,16,10,5};
63 {
65 {
67 }
68 }
69
71 }
@ Count
Definition RandomGeneratorSyncManager.c:7
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 > CHERNARUS_ARTY_STRIKE_POS
Definition ChernarusPlus.c:32

Перекрестные ссылки Count, CfgGameplayHandler::GetEnvironmentMaxTemps() и CfgGameplayHandler::GetEnvironmentMinTemps().

◆ Init() [3/3]

override void Init ( )
inlineprotected
44 {
45 super.Init();
46
47 // new temperature curve settings
48 m_Sunrise_Jan = 8.4;
49 m_Sunset_Jan = 15.63;
50 m_Sunrise_Jul = 3.65;
51 m_Sunset_Jul = 20.35;
52
53 int tempIdx;
54 m_MinTemps = {-7,-7.4,-4.1,1.5,7,11.3,13.4,13.1,9.3,5.3,0.8,-3.6};
56 {
58 {
60 }
61 }
62
63 m_MaxTemps = {-2.5,-2.1,2.3,9,15.5,19.4,20.9,20.4,16,10.5,4.2,0.1};
65 {
67 {
69 }
70 }
71
73 }
static const ref array< vector > LIVONIA_ARTY_STRIKE_POS
Definition Enoch.c:31

Перекрестные ссылки Count, CfgGameplayHandler::GetEnvironmentMaxTemps() и CfgGameplayHandler::GetEnvironmentMinTemps().

◆ UpdateBaseEnvTemperature()

void UpdateBaseEnvTemperature ( float timeslice)
inlineprotected
94 {
96 if ( m_Timer > 30 )
97 {
98 int year, month, day, hour, minute;
99 GetGame().GetWorld().GetDate( year, month, day, hour, minute );
101 m_Timer = 0;
102 }
103 }
proto native CGame GetGame()

Перекрестные ссылки CalcBaseEnvironmentTemperature(), GetGame(), m_EnvironmentTemperature и m_Timer.

◆ WeatherOnBeforeChange() [1/3]

bool WeatherOnBeforeChange ( EWeatherPhenomenon type,
float actual,
float change,
float time )
inlineprotected
127 {
128 // default behaviour is same like setting MissionWeather (in Weather) to true
129 return false;
130 }

◆ WeatherOnBeforeChange() [2/3]

override bool WeatherOnBeforeChange ( EWeatherPhenomenon type,
float actual,
float change,
float time )
inlineprotected
74 {
75 int phmnTime = 5;
76 int phmnLength = 10;
77 float phmnValue = 0;
78
80
81 m_Weather.SetRainThresholds( 0.0, 1.0, 60 );
83 m_Weather.SetWindFunctionParams( 0.1, 1.0, 20 );
84
85 switch (type)
86 {
87 //-----------------------------------------------------------------------------------------------------------------------------
88 case EWeatherPhenomenon.OVERCAST:
89
90 //went something goes wrong choose some default random weather
94
95 //----
96 //calculate next weather
98
99 //--
101 {
102 m_clearWeatherChance -= ( m_stepValue * m_sameWeatherCnt); //decrease the chance of the same weather
103 }
104
106 {
107 m_clearWeatherChance += ( m_stepValue * m_sameWeatherCnt); //increase the chance of the better weather
108 //m_badWeatherChance += ( m_stepValue * m_sameWeatherCnt);
109 }
110
111 if ( m_lastWeather == BAD_WEATHER )
112 {
113 m_clearWeatherChance += m_stepValue; //increase the chance of the better weather slightly
114 m_badWeatherChance += (( m_stepValue * m_sameWeatherCnt ) + m_stepValue ); //decrease the chance of the same weather rapidly
115 }
116
117 //----
119 {
123 }
124 else if ( m_chance > m_badWeatherChance )
125 {
127 if ( m_lastWeather == BAD_WEATHER )
129 }
130 else
131 {
135 }
136
139
142
143 //----
144 //set choosen weather
146 {
148
149 phmnValue = Math.RandomFloatInclusive( 0.0, 0.3 );
152 }
153
155 {
157
158 phmnValue = Math.RandomFloatInclusive( 0.3, 0.6 );
161 }
162
164 {
166
167 phmnValue = Math.RandomFloatInclusive( 0.6, 1.0 );
170 }
171
173
174 Debug.WeatherLog(string.Format("Chernarus::Weather::Overcast:: (%1) overcast: %2", g_Game.GetDayTime(), actual));
175 Debug.WeatherLog(string.Format("Chernarus::Weather::Overcast::Rain:: (%1) %2", g_Game.GetDayTime(), m_Weather.GetRain().GetActual()));
176
177 return true;
178
179 //-----------------------------------------------------------------------------------------------------------------------------
180 case EWeatherPhenomenon.RAIN:
181
182 float actualOvercast = m_Weather.GetOvercast().GetActual();
183
184 m_chance = Math.RandomIntInclusive( 0, 100 );
185 phmnValue = 0.2;
186 phmnTime = 90;
187 phmnLength = 30;
188
190 {
192 Debug.WeatherLog(string.Format("Chernarus::Weather::Rain::ForceEnd:: (%1) %2 -> 0", g_Game.GetDayTime(), actual));
193 return true;
194 }
195
197 {
198 phmnValue = Math.RandomFloatInclusive( 0.8, 1.0 );
200 phmnLength = 0;
201
203 Debug.WeatherLog(string.Format("Chernarus::Weather::Rain::ForceStorm:: (%1) %2 -> %3", g_Game.GetDayTime(), actual, phmnValue));
204 return true;
205 }
206
207 //make a differnce in "normal rain"
208 if ( actualOvercast < 0.75 )
209 {
210 if ( m_chance < 30 )
211 {
212 phmnValue = Math.RandomFloatInclusive( 0.1, 0.3 );
214 phmnLength = 0;
215 }
216 else if ( m_chance < 60 )
217 {
218 phmnValue = Math.RandomFloatInclusive( 0.2, 0.5 );
220 phmnLength = 0;
221 }
222 else if ( m_chance < 80 )
223 {
224 phmnValue = Math.RandomFloatInclusive( 0.0, 0.2 );
226 phmnLength = 0;
227 }
228 else //also have the chance to not have rain at all
229 {
230 phmnValue = 0;
232 phmnLength = 120;
233 }
234 }
235 else
236 {
237 if ( m_chance < 25 )
238 {
239 phmnValue = Math.RandomFloatInclusive( 0.5, 0.7 );
241 phmnLength = 0;
242 }
243 else if ( m_chance < 50 )
244 {
245 phmnValue = Math.RandomFloatInclusive( 0.2, 0.4 );
247 phmnLength = 0;
248 }
249 else if ( m_chance < 75 )
250 {
251 phmnValue = Math.RandomFloatInclusive( 0.4, 0.6 );
253 phmnLength = 0;
254 }
255 else //also have the chance to not have rain at all
256 {
257 phmnValue = 0;
259 phmnLength = 120;
260 }
261 }
262
264
265 Debug.WeatherLog(string.Format("Chernarus::Weather::Rain:: (%1) %2", g_Game.GetDayTime(), actual));
266
267 return true;
268
269 //-----------------------------------------------------------------------------------------------------------------------------
270 case EWeatherPhenomenon.FOG:
271
272 float fogMin = 0.0;
273 float fogMax = 0.15;
274 float fogTime = 1800.0;
275
276 float fogyMorning = Math.RandomFloatInclusive( 0.0, 1.0 );
277
278 if ( fogyMorning > 0.85 )
279 {
280 if ( (g_Game.GetDayTime() > 4 && g_Game.GetDayTime() < 7 ) )
281 {
282 fogMin = 0.10;
283 fogMax = 0.35;
284 fogTime = 300;
285 }
286 }
287
288 if ( m_Weather.GetOvercast().GetActual() < 0.3 )
289 {
290 fogMin = 0.0;
291 fogMax = 0.08;
292 fogTime = 900.0;
293 }
294
296
297 Debug.WeatherLog(string.Format("Chernarus::Weather::Fog:: (%1) %2", g_Game.GetDayTime(), actual));
298
299 return true;
300 }
301
302 return false;
303 }
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:307
proto native void SetStorm(float density, float threshold, float timeOut)
Sets the thunderstorm properties.
proto native void SetWindFunctionParams(float fnMin, float fnMax, float fnSpeed)
Sets function parameters that controls the wind behaviour (change in time).
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second.
proto native Overcast GetOvercast()
Returns an overcast 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 Fog GetFog()
Returns a fog phenomenon object.
int m_sameWeatherCnt
Definition ChernarusPlus.c:24
const int BAD_WEATHER_CHANCE
Definition ChernarusPlus.c:18
int m_choosenWeather
Definition ChernarusPlus.c:28
const int RAIN_TIME_MAX
Definition ChernarusPlus.c:11
const float STORM_THRESHOLD
Definition ChernarusPlus.c:5
const float RAIN_THRESHOLD
Definition ChernarusPlus.c:4
int m_lastWeather
Definition ChernarusPlus.c:29
const int RAIN_TIME_MIN
Definition ChernarusPlus.c:10
const int OVERCAST_MIN_TIME
Definition ChernarusPlus.c:7
const int CLEAR_WEATHER_CHANCE
Definition ChernarusPlus.c:17
int m_stepValue
Definition ChernarusPlus.c:25
const int OVERCAST_MAX_TIME
Definition ChernarusPlus.c:8
int m_clearWeatherChance
Definition ChernarusPlus.c:20
const int BAD_WEATHER
Definition ChernarusPlus.c:15
int m_badWeatherChance
Definition ChernarusPlus.c:22
const int CLOUDY_WEATHER
Definition ChernarusPlus.c:14
int m_chance
Definition ChernarusPlus.c:26
const int CLEAR_WEATHER
Definition ChernarusPlus.c:13
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки g_Game, Math::RandomFloatInclusive(), Math::RandomInt(), Math::RandomIntInclusive() и Debug::WeatherLog().

◆ WeatherOnBeforeChange() [3/3]

override bool WeatherOnBeforeChange ( EWeatherPhenomenon type,
float actual,
float change,
float time )
inlineprotected
76 {
77 int phmnTime = 5;
78 int phmnLength = 10;
79 float phmnValue = 0;
80
82
83 m_Weather.SetRainThresholds( 0.0, 1.0, 60 );
85 m_Weather.SetWindFunctionParams( 0.1, 1.0, 20 );
86
87 switch (type)
88 {
89 //-----------------------------------------------------------------------------------------------------------------------------
90 case EWeatherPhenomenon.OVERCAST:
91
92 //went something goes wrong choose some default random weather
96
97 //----
98 //calculate next weather
100
101 //--
103 {
104 m_clearWeatherChance -= ( m_stepValue * m_sameWeatherCnt); //decrease the chance of the same weather
105 }
106
108 {
109 m_clearWeatherChance += ( m_stepValue * m_sameWeatherCnt); //increase the chance of the better weather
111 }
112
113 if ( m_lastWeather == BAD_WEATHER )
114 {
115 m_clearWeatherChance += m_stepValue; //increase the chance of the better weather slightly
116 m_badWeatherChance += ( m_stepValue * m_sameWeatherCnt ); //decrease the chance of the same weather
117 }
118
119 //----
121 {
125 }
126 else if ( m_chance > m_badWeatherChance )
127 {
129 if ( m_lastWeather == BAD_WEATHER )
131 }
132 else
133 {
137 }
138
141
144
145 //----
146 //set choosen weather
148 {
150
151 phmnValue = Math.RandomFloatInclusive( 0.0, 0.3 );
154 }
155
157 {
159
160 phmnValue = Math.RandomFloatInclusive( 0.3, 0.7 );
163 }
164
166 {
168
169 phmnValue = Math.RandomFloatInclusive( 0.7, 1.0 );
172 }
173
175
176 Debug.WeatherLog(string.Format("Enoch::Weather::Overcast:: (%1) overcast: %2", g_Game.GetDayTime(), actual));
177 Debug.WeatherLog(string.Format("Enoch::Weather::Overcast::Rain:: (%1) %2", g_Game.GetDayTime(), m_Weather.GetRain().GetActual()));
178
179 return true;
180
181 //-----------------------------------------------------------------------------------------------------------------------------
182 case EWeatherPhenomenon.RAIN:
183 float actualOvercast = m_Weather.GetOvercast().GetActual();
184
185 m_chance = Math.RandomIntInclusive( 0, 100 );
186 phmnValue = 0.2;
187 phmnTime = 90;
188 phmnLength = 30;
189
191 {
193 Debug.WeatherLog (string.Format("Enoch::Weather::Rain::ForceEnd:: (%1) %2 -> 0", g_Game.GetDayTime(), actual));
194 return true;
195 }
196
198 {
199 phmnValue = Math.RandomFloatInclusive( 0.8, 1.0 );
201 phmnLength = 0;
202
204 Debug.WeatherLog(string.Format("Enoch::Weather::Rain::ForceStorm:: (%1) %2 -> %3", g_Game.GetDayTime(), actual, phmnValue));
205 return true;
206 }
207
208 //make a differnce in "normal rain"
209 if ( actualOvercast < 0.75 )
210 {
211 if ( m_chance < 30 )
212 {
213 phmnValue = Math.RandomFloatInclusive( 0.1, 0.3 );
215 phmnLength = 0;
216 }
217 else if ( m_chance < 60 )
218 {
219 phmnValue = Math.RandomFloatInclusive( 0.2, 0.4 );
221 phmnLength = 0;
222 }
223 else if ( m_chance < 85 )
224 {
225 phmnValue = Math.RandomFloatInclusive( 0.0, 0.2 );
227 phmnLength = 0;
228 }
229 else //also have the chance to not have rain at all
230 {
231 phmnValue = 0;
233 phmnLength = 120;
234 }
235 }
236 else if ( actualOvercast < STORM_THRESHOLD )
237 {
238 if ( m_chance < 15 )
239 {
240 phmnValue = Math.RandomFloatInclusive( 0.4, 0.6 );
242 phmnLength = 0;
243 }
244 else if ( m_chance < 50 )
245 {
246 phmnValue = Math.RandomFloatInclusive( 0.2, 0.4 );
248 phmnLength = 0;
249 }
250 else if ( m_chance < 90 )
251 {
252 phmnValue = Math.RandomFloatInclusive( 0.6, 0.8 );
254 phmnLength = 0;
255 }
256 else //also have the chance to not have rain at all
257 {
258 phmnValue = 0;
260 phmnLength = 120;
261 }
262 }
263 else
264 {
265 if ( m_chance < 50 )
266 {
267 phmnValue = Math.RandomFloatInclusive( 0.9, 1.0 );
269 phmnLength = 0;
270 }
271 else
272 {
273 phmnValue = Math.RandomFloatInclusive( 0.8, 0.9 );
275 phmnLength = 0;
276 }
277 }
278
280
281 Debug.WeatherLog(string.Format("Enoch::Weather::Rain:: (%1) %2", g_Game.GetDayTime(), actual));
282 return true;
283
284 //-----------------------------------------------------------------------------------------------------------------------------
285 case EWeatherPhenomenon.FOG:
286 int year, month, day, hour, minute;
287 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
288 if (( hour >= 1 ) && ( hour <= 5 ))
289 {
290 m_Weather.GetFog().Set( 0.1, 1800, 0 );
291 } else {
292 m_Weather.GetFog().Set( 0.0, 1800, 0 );
293 }
294
295 Debug.WeatherLog(string.Format("Enoch::Weather::Fog:: (%1) %2", g_Game.GetDayTime(), actual));
296
297 return true;
298 }
299 return false;
300 }

Перекрестные ссылки g_Game, GetGame(), Math::RandomFloatInclusive(), Math::RandomInt(), Math::RandomIntInclusive() и Debug::WeatherLog().

Поля

◆ BAD_WEATHER

const int BAD_WEATHER = 3
private

◆ BAD_WEATHER_CHANCE

const int BAD_WEATHER_CHANCE = 80
private

◆ CHERNARUS_ARTY_STRIKE_POS

const ref array<vector> CHERNARUS_ARTY_STRIKE_POS
staticprotected
Инициализатор
=
{
"-500.00 165.00 5231.69",
"-500.00 300.00 9934.41",
"10406.86 192.00 15860.00",
"4811.75 370.00 15860.00",
"-500.00 453.00 15860.00"
}
33 {
34 "-500.00 165.00 5231.69",
35 "-500.00 300.00 9934.41",
36 "10406.86 192.00 15860.00",
37 "4811.75 370.00 15860.00",
38 "-500.00 453.00 15860.00"
39 };

◆ CLEAR_WEATHER

const int CLEAR_WEATHER = 1
private

◆ CLEAR_WEATHER_CHANCE

const int CLEAR_WEATHER_CHANCE = 30
private

◆ CLOUDY_WEATHER

const int CLOUDY_WEATHER = 2
private

◆ 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"
}
32 {
33 "7440.00 417.00 -500.00",
34 "-500.00 276.00 5473.00",
35 "-500.00 265.00 9852.00",
36 "4953.00 240.00 13300.00",
37 "9620.00 188.00 13300.00",
38 "13300.00 204.00 10322.00",
39 "13300.00 288.00 6204.00",
40 "13300.00 296.00 -500.00"
41 };

◆ m_badWeatherChance

int m_badWeatherChance = BAD_WEATHER_CHANCE
protected

◆ m_chance

int m_chance = 50
protected

◆ m_choosenWeather

int m_choosenWeather = 1
protected

◆ m_clearWeatherChance

int m_clearWeatherChance = CLEAR_WEATHER_CHANCE
protected

◆ m_DayTemperature

float m_DayTemperature
protected

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

◆ m_EnvironmentTemperature

float m_EnvironmentTemperature
protected

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

◆ m_FiringPos

ref array<vector> m_FiringPos
protected

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

◆ m_lastWeather

int m_lastWeather = 0
protected

◆ m_MaxTemps

float m_MaxTemps[12]
protected

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

◆ m_MinTemps

float m_MinTemps[12]
protected

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

◆ m_NightTemperature

float m_NightTemperature
protected

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

◆ m_sameWeatherCnt

int m_sameWeatherCnt = 0
protected

◆ m_stepValue

int m_stepValue = 5
protected

◆ m_Sunrise_Jan

float m_Sunrise_Jan
protected

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

◆ m_Sunrise_Jul

float m_Sunrise_Jul
protected

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

◆ m_Sunset_Jan

float m_Sunset_Jan
protected

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

◆ m_Sunset_Jul

float m_Sunset_Jul
protected

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

◆ m_Timer

float m_Timer
protected

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

◆ m_Weather

Weather m_Weather
protected

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

◆ OVERCAST_MAX_TIME

const int OVERCAST_MAX_TIME = 900
private

◆ OVERCAST_MIN_TIME

const int OVERCAST_MIN_TIME = 600
private

◆ RAIN_THRESHOLD

const float RAIN_THRESHOLD = 0.6
private

◆ RAIN_TIME_MAX

const int RAIN_TIME_MAX = 120
private

◆ RAIN_TIME_MIN

const int RAIN_TIME_MIN = 60
private

◆ STORM_THRESHOLD

const float STORM_THRESHOLD = 0.9
private

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