DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл SpookyAreaMisc.c

См. исходные тексты.

Структуры данных

class  SpookyEventWind
 
class  SpookyEventSteps
 
class  SpookyEventBase
 
class  SpookyPlayerStalker
 this entity gets attached to each player while present in the spooky area Подробнее...
 

Функции

SpookyEventWind SpookyEventBase Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
bool CanDo (PlayerBase player, TStringVectorMap surfaceTypes)
 
void Do (PlayerBase player)
 
void SpookyTriggerEventsHandler (notnull PlayerBase player)
 
void ~SpookyTriggerEventsHandler ()
 
void RegisterEvents ()
 
void Update (float deltaTime)
 
void GatherSurfaces (notnull TStringVectorMap gatheredGurfaces)
 
bool SelectEvent ()
 

Переменные

class SpookyEventBase m_SoundEvents
 
PlayerBase m_Player
 
float m_TimeAccu
 
const float CONSECUTIVE_EVENTS_COOLDOWN = 20
 
const float EVENT_CHECK_FREQUENCY = 2
 
const float FIRST_EVENT_CHECK_DELAY = 15
 
const float SURFACE_CHECK_POINT_DISTANCE = 2
 
float m_NextEventCheck = FIRST_EVENT_CHECK_DELAY
 

Функции

◆ CanDo()

bool CanDo ( PlayerBase player,
TStringVectorMap surfaceTypes )
protected
30 {
31 //put additional code here
32 }
33

◆ Do()

void Do ( PlayerBase player)
protected
37{
38 override protected void Init()
SpookyEventWind SpookyEventBase Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition SpookyAreaMisc.c:23
Definition SpookyAreaMisc.c:87

◆ GatherSurfaces()

void GatherSurfaces ( notnull TStringVectorMap gatheredGurfaces)
protected
247 {
248 gatheredGurfaces.Clear();
249
250 vector playerPos = m_Player.GetPosition();
252
253 positions.Insert(playerPos);
255 positions.Insert(playerPos + ("0 0 -1" * SURFACE_CHECK_POINT_DISTANCE));
257 positions.Insert(playerPos + ("-1 0 0" * SURFACE_CHECK_POINT_DISTANCE));
258
259 foreach (vector pos : positions)
260 {
261 string surfaceType;
262 GetGame().SurfaceGetType3D(pos[0],pos[1], pos[2], surfaceType);
263
264 if (!gatheredGurfaces.Contains(surfaceType))
265 gatheredGurfaces.Insert(surfaceType, pos);
266 }
267
268 #ifdef DIAG_DEVELOPER
269 if (DiagMenu.GetBool(DiagMenuIDs.TRIGGER_DEBUG))
270 {
271 foreach (vector p:positions)
272 Debug.DrawLine(p, p + "0 10 0", COLOR_BLUE,ShapeFlags.NOZBUFFER);
273 }
274 #endif
275
276 }
DiagMenuIDs
Definition EDiagMenuIDs.c:2
const float SURFACE_CHECK_POINT_DISTANCE
Definition SpookyAreaMisc.c:205
PlayerBase m_Player
Definition SpookyAreaMisc.c:200
Definition Debug.c:14
Definition EnDebug.c:233
Definition EntityAI.c:95
Definition EnConvert.c:106
proto native CGame GetGame()
const int COLOR_BLUE
Definition constants.c:66
ShapeFlags
Definition EnDebug.c:126
@ NOZBUFFER
Definition EnDebug.c:127
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
array< vector > TVectorArray
Definition EnScript.c:692

Перекрестные ссылки COLOR_BLUE, Debug::DrawLine(), DiagMenu::GetBool(), GetGame(), m_Player и SURFACE_CHECK_POINT_DISTANCE.

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

◆ Init()

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

24 {
25 SetCoolDown(80);
26 m_SoundSet = "SpookyArea_Whispering_SoundSet";
27 }
string m_SoundSet
Definition DynamicMusicPlayer.c:41

◆ RegisterEvents()

void RegisterEvents ( )
protected
225 {
226 m_SoundEvents.Insert(new SpookyEventWind());
227 m_SoundEvents.Insert(new SpookyEventWhisper());
228 m_SoundEvents.Insert(new SpookyEventSteps());
229 m_SoundEvents.Insert(new SpookyEventRustle());
230
231 }
class SpookyEventBase m_SoundEvents
Definition SpookyAreaMisc.c:37
Definition SpookyAreaMisc.c:3

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

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

◆ SelectEvent()

bool SelectEvent ( )
protected
279 {
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));
290
291 }
292 Print("--------------------------------------------------------------------");
293 }
294 #endif
295
297 float currentTime = GetGame().GetTime();
299 {
301 validEvents.Insert(spookyEvent);
302 }
303
304 //validEvents.Debug();
306
307 if (validEvents.Count() > 0)
308 {
309 int randIndex = Math.RandomIntInclusive(0, validEvents.Count() - 1);
311 }
312 if (selectedEvent)
313 {
315 return true;
316 }
317 return false;
318
319 }
void GatherSurfaces(notnull TStringVectorMap gatheredGurfaces)
Definition SpookyAreaMisc.c:246
Definition EnMath.c:7
proto void Print(void var)
Prints content of variable to console/log.
map< string, vector > TStringVectorMap
Definition EnScript.c:965
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

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

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

◆ SpookyTriggerEventsHandler()

void SpookyTriggerEventsHandler ( notnull PlayerBase player)
protected
209 {
210 if (!m_SoundEvents)
211 {
214 }
215
217 }
void RegisterEvents()
Definition SpookyAreaMisc.c:224

Перекрестные ссылки m_Player, m_SoundEvents и RegisterEvents().

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

◆ Update()

void Update ( float deltaTime)
protected
234 {
237 {
238 if (SelectEvent())
240 else
242 m_TimeAccu = 0;
243 }
244 }
const float EVENT_CHECK_FREQUENCY
Definition SpookyAreaMisc.c:203
bool SelectEvent()
Definition SpookyAreaMisc.c:278
float m_TimeAccu
Definition SpookyAreaMisc.c:201
float m_NextEventCheck
Definition SpookyAreaMisc.c:206
const float CONSECUTIVE_EVENTS_COOLDOWN
Definition SpookyAreaMisc.c:202

Перекрестные ссылки CONSECUTIVE_EVENTS_COOLDOWN, EVENT_CHECK_FREQUENCY, m_NextEventCheck, m_TimeAccu и SelectEvent().

◆ ~SpookyTriggerEventsHandler()

220 {
222 }

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

Переменные

◆ CONSECUTIVE_EVENTS_COOLDOWN

const float CONSECUTIVE_EVENTS_COOLDOWN = 20
protected

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

◆ EVENT_CHECK_FREQUENCY

const float EVENT_CHECK_FREQUENCY = 2
protected

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

◆ FIRST_EVENT_CHECK_DELAY

const float FIRST_EVENT_CHECK_DELAY = 15
protected

◆ m_NextEventCheck

float m_NextEventCheck = FIRST_EVENT_CHECK_DELAY
protected

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

◆ m_Player

PlayerBase m_Player
protected

◆ m_SoundEvents

◆ m_TimeAccu

float m_TimeAccu
protected

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

◆ SURFACE_CHECK_POINT_DISTANCE

const float SURFACE_CHECK_POINT_DISTANCE = 2
protected

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