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

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

void DayZCreatureAI ()
 
void IncreaseEffectTriggerCount ()
 
void DecreaseEffectTriggerCount ()
 
void AddDamageSphere (AnimDamageParams damage_params)
 
override void EEKilled (Object killer)
 
AnimBootsType GetBootsType ()
 
AbstractWave PlaySound (SoundObject so, SoundObjectBuilder sob)
 
void OnSoundEvent (int event_id, string event_user_string)
 
void OnSoundVoiceEvent (int event_id, string event_user_string)
 
void OnStepEvent (int event_id, string event_user_string)
 
void OnDamageEvent (int event_id, string event_user_string)
 
void RegisterAnimEvents ()
 
void AttenuateSoundIfNecessary (SoundObject soundObject)
 
bool ResistContaminatedEffect ()
 
bool IsDanger ()
 
string CaptureSound ()
 
string ReleaseSound ()
 
void CinematicTakeControl (DayZPlayer player)
 
bool CinematicCanJump ()
 
override bool ModCommandHandlerBefore (float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
 

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

DayZPlayer m_CinematicPlayer
 

Закрытые члены

proto native AIAgent GetAIAgent ()
 
proto native bool IsSoundInsideBuilding ()
 
proto native void AddDamageSphere (string bone_name, string ammo_name, float radius, float duration, bool invertTeams)
 
proto native DayZCreatureAIType GetCreatureAIType ()
 
proto native void InitAIAgent (AIGroup group)
 
proto native void DestroyAIAgent ()
 
void ProcessSoundEvent (AnimSoundEvent sound_event)
 
void ProcessSoundVoiceEvent (AnimSoundVoiceEvent sound_event)
 
void ProcessStepEvent (AnimStepEvent step_event)
 
void ProcessDamageEvent (AnimDamageEvent damage_event)
 

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

int m_EffectTriggerCount
 

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

Методы

◆ AddDamageSphere() [1/2]

void AddDamageSphere ( AnimDamageParams damage_params)
inlineprotected
189 {
190 AddDamageSphere(damage_params.m_sBoneName, damage_params.m_sAmmoName, damage_params.m_fRadius, damage_params.m_fDuration, damage_params.m_bInvertTeams);
191 }
proto native void AddDamageSphere(string bone_name, string ammo_name, float radius, float duration, bool invertTeams)
Definition EntityAI.c:95

◆ AddDamageSphere() [2/2]

proto native void AddDamageSphere ( string bone_name,
string ammo_name,
float radius,
float duration,
bool invertTeams )
private

◆ AttenuateSoundIfNecessary()

void AttenuateSoundIfNecessary ( SoundObject soundObject)
inlineprotected
339 {
340 if (GetGame().GetPlayer() != NULL && (IsSoundInsideBuilding() != GetGame().GetPlayer().IsSoundInsideBuilding() || GetGame().GetPlayer().IsCameraInsideVehicle()))
341 {
342 soundObject.SetKind(WaveKind.WAVEATTALWAYS);
343 }
344 else
345 {
346 soundObject.SetKind(WaveKind.WAVEEFFECTEX);
347 }
348 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
WaveKind
Definition Sound.c:2
proto native bool IsSoundInsideBuilding()
proto native CGame GetGame()

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

◆ CaptureSound()

string CaptureSound ( )
inlineprotected
366 {
367 return "";
368 }

◆ CinematicCanJump()

bool CinematicCanJump ( )
inlineprotected
385 {
386 return true;
387 }

◆ CinematicTakeControl()

void CinematicTakeControl ( DayZPlayer player)
inlineprotected
380 {
382 }
DayZPlayer m_CinematicPlayer
Definition DayZAnimal.c:168

◆ DayZCreatureAI()

void DayZCreatureAI ( )
inlineprotected
172 {
174 SetFlags(EntityFlags.TOUCHTRIGGERS, false);
175 }
void RegisterAnimEvents()
Definition DayZAnimal.c:252
proto native void SetFlags(ShapeFlags flags)
EntityFlags
Entity flags.
Definition EnEntity.c:115

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

◆ DecreaseEffectTriggerCount()

void DecreaseEffectTriggerCount ( )
inlineprotected
184 {
186 }
int m_EffectTriggerCount
Definition DayZAnimal.c:166

◆ DestroyAIAgent()

proto native void DestroyAIAgent ( )
private

◆ EEKilled()

override void EEKilled ( Object killer)
inlineprotected
194 {
195 super.EEKilled(killer);
196 CreateComponent(COMP_TYPE_BODY_STAGING); // TO DO: This is never called on clients in multiplayer! That's why skinning doesn't work properly in MP. DAYZ-28269
197 }
const int COMP_TYPE_BODY_STAGING
Definition Component.c:10

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

◆ GetAIAgent()

proto native AIAgent GetAIAgent ( )
private

◆ GetBootsType()

AnimBootsType GetBootsType ( )
inlineprotected
200 {
201 return AnimBootsType.None;
202 }
AnimBootsType
Definition DayZAnimEvents.c:98

◆ GetCreatureAIType()

proto native DayZCreatureAIType GetCreatureAIType ( )
private

◆ IncreaseEffectTriggerCount()

void IncreaseEffectTriggerCount ( )
inlineprotected
179 {
181 }

◆ InitAIAgent()

proto native void InitAIAgent ( AIGroup group)
private

AIAgent initialization. Manual ai initialization for creatures created with CreateObject(... init_ai = false...).

◆ IsDanger()

bool IsDanger ( )
inlineprotected
361 {
362 return false;
363 }

◆ IsSoundInsideBuilding()

proto native bool IsSoundInsideBuilding ( )
private

◆ ModCommandHandlerBefore()

override bool ModCommandHandlerBefore ( float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished )
inlineprotected

sprint

jog

walk

390 {
392 {
393 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
394 }
395
396 UAInterface input = m_CinematicPlayer.GetInputInterface();
397
399 GetGame().GameScript.CallFunction(this, "GetInputController", controller, 0);
400
401 if (!input || !controller)
402 {
403 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
404 }
405
406 float movementX = input.SyncedValue_ID(UAAimRight) - input.SyncedValue_ID(UAAimLeft);
407
408 float maxTurnSpeed = 100.0;
409 movementX = Math.Clamp(movementX * maxTurnSpeed * pDt, -180, 180);
410
411 if (input.SyncedValue_ID(UALookAround) > 0)
412 {
413 movementX = 0;
414 }
415
416 bool isJump = input.SyncedValue_ID(UAGetOver) > 0;
417 bool isMove = input.SyncedValue_ID(UAMoveForward) > 0;
418
419 bool isRest = input.SyncedValue_ID(UAMoveBack) > 0;
420 bool isSleep = input.SyncedValue_ID(UAReloadMagazine) > 0;
421
422 float heading = GetOrientation()[0] + movementX;
423
424 int iAlert = 0;
425 float fAlert = 0;
426 int iSpeed = 0;
427 float fSpeed = 0;
428
429 if (isMove)
430 {
431 iAlert = 1;
432 fAlert = 0.2;
433
434 bool isSprint = input.SyncedValue_ID(UATurbo) > 0;
435 bool isJog = input.SyncedValue_ID(UAWalkRunTemp) > 0;
436 bool isWalk = !isSprint && !isJog;
437 if (isSprint)
438 {
440 iSpeed = 3;
441 }
442 else if (isJog)
443 {
445 iSpeed = 2;
446 }
447 else if (isWalk)
448 {
450 iSpeed = 1;
451 }
452 }
453
456 {
457 animalController.OverrideBehaviourSlot(true, DayZAnimalBehaviourSlot.NON_SPECIFIC_THREAT);
458 animalController.OverrideBehaviourAction(true, DayZAnimalBehaviourAction.TRAVELING_INPUT);
459
460 if (!isMove)
461 {
462 if (isRest)
463 {
464 iSpeed = 0;
465 animalController.OverrideBehaviourAction(true, DayZAnimalBehaviourAction.IDLE1_INPUT);
466 }
467
468 if (isSleep)
469 {
470 iSpeed = 0;
471 animalController.OverrideBehaviourAction(true, DayZAnimalBehaviourAction.WALKING_INPUT);
472 }
473 }
474 }
475
476 bool lowVel = GetVelocity(this).Length() < 0.5;
477 if (iSpeed > 0 && lowVel)
478 {
479 iAlert = 4;
480 fAlert = 1.0;
481
482 iSpeed = 3;
483 }
484
486 {
487 switch (iSpeed)
488 {
489 case 0:
490 fSpeed = 0;
491 break;
492 case 1:
493 fSpeed = 2;
494 break;
495 case 2:
496 fSpeed = 3;
497 break;
498 case 3:
499 fSpeed = 5;
500 break;
501 }
502 }
503
504 controller.OverrideTurnSpeed(true, Math.PI2 / pDt);
505 controller.OverrideMovementSpeed(true, fSpeed);
506 controller.OverrideHeading(true, heading * Math.DEG2RAD);
507 controller.OverrideAlertLevel(true, true, iAlert, fAlert);
508
509 if (CinematicCanJump() && isJump)
510 {
511 controller.OverrideJump(true, 101, 2.0);
512 }
513
514 return true;
515 }
vector GetOrientation()
Definition AreaDamageManager.c:306
DayZAnimalBehaviourSlot
defined in C++
Definition DayZAnimalInputController.c:3
DayZAnimalBehaviourAction
defined in C++
Definition DayZAnimalInputController.c:27
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition DayZAnimalInputController.c:50
Definition DayZCreatureAIInputController.c:2
bool CinematicCanJump()
Definition DayZAnimal.c:384
Definition EnMath.c:7
Definition UAInput.c:96
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static const float PI2
Definition EnMath.c:13
static const float DEG2RAD
Definition EnMath.c:17
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки Class::CastTo(), Math::Clamp(), Math::DEG2RAD, GetGame(), GetOrientation(), GetVelocity() и Math::PI2.

◆ OnDamageEvent()

void OnDamageEvent ( int event_id,
string event_user_string )
inlineprotected
244 {
246 if(damage_event != NULL)
247 {
249 }
250 }
void ProcessDamageEvent(AnimDamageEvent damage_event)
Definition DayZAnimal.c:333
proto native DayZCreatureAIType GetCreatureAIType()

◆ OnSoundEvent()

void OnSoundEvent ( int event_id,
string event_user_string )
inlineprotected
217 {
219 if(sound_event != NULL)
220 {
222 }
223 }
void ProcessSoundEvent(AnimSoundEvent sound_event)
Definition DayZAnimal.c:278

◆ OnSoundVoiceEvent()

void OnSoundVoiceEvent ( int event_id,
string event_user_string )
inlineprotected
226 {
228 if(voice_event != NULL)
229 {
231 }
232 }
void ProcessSoundVoiceEvent(AnimSoundVoiceEvent sound_event)
Definition DayZAnimal.c:298

◆ OnStepEvent()

void OnStepEvent ( int event_id,
string event_user_string )
inlineprotected
235 {
237 if(step_event != NULL)
238 {
240 }
241 }
void ProcessStepEvent(AnimStepEvent step_event)
Definition DayZAnimal.c:319

◆ PlaySound()

AbstractWave PlaySound ( SoundObject so,
SoundObjectBuilder sob )
inlineprotected
205 {
206 if(so == NULL)
207 {
208 return NULL;
209 }
210
211 so.SetPosition(GetPosition());
212 AbstractWave wave = GetGame().GetSoundScene().Play3D(so, sob);
213 return wave;
214 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition Sound.c:119

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

◆ ProcessDamageEvent()

void ProcessDamageEvent ( AnimDamageEvent damage_event)
inlineprivate
334 {
335 AddDamageSphere(damage_event.m_DamageParams);
336 }

◆ ProcessSoundEvent()

void ProcessSoundEvent ( AnimSoundEvent sound_event)
inlineprivate
279 {
280 if(!GetGame().IsDedicatedServer())
281 {
282 SoundObjectBuilder objectBuilder = sound_event.GetSoundBuilder();
283 if(NULL != objectBuilder)
284 {
285 objectBuilder.AddEnvSoundVariables(GetPosition());
286 SoundObject soundObject = objectBuilder.BuildSoundObject();
288 }
289 }
290
291 if(GetGame().IsServer())
292 {
293 if(sound_event.m_NoiseParams != NULL)
294 GetGame().GetNoiseSystem().AddNoise(this, sound_event.m_NoiseParams, GetGame().GetWeather().GetNoiseReductionByWeather());
295 }
296 }
void PlaySound()
Definition HungerSoundHandler.c:38
class SoundObjectBuilder SoundObject(SoundParams soundParams)
Definition Sound.c:46

Перекрестные ссылки GetGame(), GetPosition, PlaySound() и SoundObject().

◆ ProcessSoundVoiceEvent()

void ProcessSoundVoiceEvent ( AnimSoundVoiceEvent sound_event)
inlineprivate
299 {
300 if(!GetGame().IsDedicatedServer())
301 {
302 SoundObjectBuilder objectBuilder = sound_event.GetSoundBuilder();
303 if(NULL != objectBuilder)
304 {
305 objectBuilder.AddEnvSoundVariables(GetPosition());
306 SoundObject soundObject = objectBuilder.BuildSoundObject();
309 }
310 }
311
312 if(GetGame().IsServer())
313 {
314 if(sound_event.m_NoiseParams != NULL)
315 GetGame().GetNoiseSystem().AddNoise(this, sound_event.m_NoiseParams, GetGame().GetWeather().GetNoiseReductionByWeather());
316 }
317 }
void AttenuateSoundIfNecessary(SoundObject soundObject)
Definition DayZAnimal.c:338

Перекрестные ссылки GetGame(), GetPosition, PlaySound() и SoundObject().

◆ ProcessStepEvent()

void ProcessStepEvent ( AnimStepEvent step_event)
inlineprivate
320 {
321 SoundObjectBuilder soundBuilder = step_event.GetSoundBuilder(GetSurfaceType().Hash());
322 if(soundBuilder == NULL)
323 return;
324
325 soundBuilder.AddEnvSoundVariables(GetPosition());
326 SoundObject soundObject = soundBuilder.BuildSoundObject();
329
330 //TODO effects
331 }

Перекрестные ссылки GetPosition, PlaySound() и SoundObject().

◆ RegisterAnimEvents()

void RegisterAnimEvents ( )
inlineprotected
253 {
254 if(!RegisterAnimationEvent("Sound", "OnSoundEvent"))
255 {
256 Print("Error registering anim. event (Sound)");
257 }
258
259 if(!RegisterAnimationEvent("SoundVoice", "OnSoundVoiceEvent"))
260 {
261 Print("Error registering anim. event (SoundVoice)");
262 }
263
264 if(!GetGame().IsDedicatedServer())
265 {
266 if(!RegisterAnimationEvent("Step", "OnStepEvent"))
267 {
268 Print("Error registering anim. event (Step)");
269 }
270 }
271
272 if(!RegisterAnimationEvent("Damage", "OnDamageEvent"))
273 {
274 Print("Error registering anim. event (Damage)");
275 }
276 }
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки GetGame(), Print() и RegisterAnimationEvent().

◆ ReleaseSound()

string ReleaseSound ( )
inlineprotected
371 {
372 return "";
373 }

◆ ResistContaminatedEffect()

bool ResistContaminatedEffect ( )
inlineprotected
351 {
352 return false;
353 }

Поля

◆ m_CinematicPlayer

DayZPlayer m_CinematicPlayer
protected

◆ m_EffectTriggerCount

int m_EffectTriggerCount
private

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