DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SelectEvent()

bool SelectEvent ( )
protected

См. определение в файле SpookyAreaMisc.c строка 278

279 {
280 TStringVectorMap gatheredSurfaces = new TStringVectorMap();
281 GatherSurfaces(gatheredSurfaces);//this can be optimized by calling this on demand from an event, as none events might be eligible at this point, so we might be doing this in vain
282
283 #ifdef DIAG_DEVELOPER
284 if (DiagMenu.GetBool(DiagMenuIDs.TRIGGER_DEBUG))
285 {
286 for(int i = 0; i < gatheredSurfaces.Count(); i++)
287 {
288 Print(gatheredSurfaces.GetKey(i));
289 Print(gatheredSurfaces.Get(gatheredSurfaces.GetKey(i)));
290
291 }
292 Print("--------------------------------------------------------------------");
293 }
294 #endif
295
297 float currentTime = GetGame().GetTime();
298 foreach (SpookyEventBase spookyEvent:m_SoundEvents)
299 {
300 if (spookyEvent.CanPerform(m_Player, currentTime, gatheredSurfaces))
301 validEvents.Insert(spookyEvent);
302 }
303
304 //validEvents.Debug();
305 SpookyEventBase selectedEvent;
306
307 if (validEvents.Count() > 0)
308 {
309 int randIndex = Math.RandomIntInclusive(0, validEvents.Count() - 1);
310 selectedEvent = validEvents[randIndex];
311 }
312 if (selectedEvent)
313 {
314 selectedEvent.Perform(m_Player, currentTime, gatheredSurfaces);
315 return true;
316 }
317 return false;
318
319 }
DiagMenuIDs
Определения EDiagMenuIDs.c:2
DayZPlayer m_Player
Определения Hand_Events.c:42
void GatherSurfaces(notnull TStringVectorMap gatheredGurfaces)
Определения SpookyAreaMisc.c:246
class SpookyEventBase m_SoundEvents
proto int GetTime()
returns mission time in milliseconds
Определения EnDebug.c:233
Определения EnMath.c:7
void Perform(PlayerBase player, float currentTime, TStringVectorMap gatheredSurfaces)
Определения SpookyAreaMisc.c:152
Определения SpookyAreaMisc.c:87
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
map< string, vector > TStringVectorMap
Определения EnScript.c:965
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Определения EnMath.c:54

Перекрестные ссылки GatherSurfaces(), DiagMenu::GetBool(), GetGame(), CGame::GetTime(), m_Player, m_SoundEvents, SpookyEventBase::Perform(), Print() и Math::RandomIntInclusive().

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