26 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
62 return !GetIsFrozen();
98 GetTransform(parentTransMat);
105 parentTransMat[0] = rotMatrix[0];
106 parentTransMat[1] = rotMatrix[1];
107 parentTransMat[2] = rotMatrix[2];
108 parentTransMat[3] = closeBonePosWS;
111 arrow.GetTransform(arrowTransMat);
115 arrow.SetTransform(arrowTransMat);
127 super.GetDebugActions(outputList);
130 if (Gizmo_IsSupported())
138 if (super.OnAction(action_id, player, ctx))
197 proto native
void DebugDisableAIControl();
198 proto native
void DebugRestoreAIControl();
200 proto native
void AddDamageSphere(
string bone_name,
string ammo_name,
float radius,
float duration,
bool invertTeams);
234 AddDamageSphere(damage_params.m_sBoneName, damage_params.m_sAmmoName, damage_params.m_fRadius, damage_params.m_fDuration, damage_params.m_bInvertTeams);
239 super.EEKilled(killer);
263 if(sound_event != NULL)
271 AnimSoundVoiceEvent voice_event =
GetCreatureAIType().GetSoundVoiceEvent(event_id);
272 if(voice_event != NULL)
281 if(step_event != NULL)
290 if(damage_event != NULL)
300 Print(
"Error registering anim. event (Sound)");
305 Print(
"Error registering anim. event (SoundVoice)");
308 if(!
g_Game.IsDedicatedServer())
312 Print(
"Error registering anim. event (Step)");
318 Print(
"Error registering anim. event (Damage)");
324 if(!
g_Game.IsDedicatedServer())
327 if(NULL != objectBuilder)
330 SoundObject soundObject = objectBuilder.BuildSoundObject();
337 if(sound_event.m_NoiseParams != NULL)
338 g_Game.GetNoiseSystem().AddNoise(
this, sound_event.m_NoiseParams,
g_Game.GetWeather().GetNoiseReductionByWeather());
344 if(!
g_Game.IsDedicatedServer())
347 if(NULL != objectBuilder)
350 SoundObject soundObject = objectBuilder.BuildSoundObject();
358 if(sound_event.m_NoiseParams != NULL)
359 g_Game.GetNoiseSystem().AddNoise(
this, sound_event.m_NoiseParams,
g_Game.GetWeather().GetNoiseReductionByWeather());
365 SoundObjectBuilder soundBuilder = step_event.GetSoundBuilder(GetSurfaceType().Hash());
366 if(soundBuilder == NULL)
370 SoundObject soundObject = soundBuilder.BuildSoundObject();
437 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
443 g_Game.GameScript.CallFunction(
this,
"GetInputController", controller, 0);
445 if (!input || !controller)
447 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
452 float maxTurnSpeed = 100.0;
453 movementX =
Math.
Clamp(movementX * maxTurnSpeed * pDt, -180, 180);
480 bool isWalk = !isSprint && !isJog;
521 if (iSpeed > 0 && lowVel)
529 if (animalController)
562enum DayZAnimalConstants
712 return EInventoryIconVisibility.HIDE_VICINITY;
732 if (
HandleDeath(currentCommandID, inputController))
737 if (currentCommandFinished)
739 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
757 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
764 if (currentCommandID == DayZAnimalConstants.COMMANDID_MOVE)
766 if (inputController.
IsJump())
793 if (inputController.
IsDead())
795 if (currentCommandID == DayZAnimalConstants.COMMANDID_DEATH)
823 if (currentCommandID != DayZAnimalConstants.COMMANDID_HIT)
834 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
835 m_TransportHitRegistered =
false;
837 int transferShockToDamageCoef =
g_Game.ConfigGetInt(
string.Format(
"%1 %2 DamageApplied transferShockToDamage",
CFG_AMMO, ammo));
838 if (transferShockToDamageCoef == 1)
846 animal_bleeding.
CreateWound( damageResult, dmgZone, ammo );
879 vector targetDirection = GetDirection();
882 targetDirection[1] = 0;
883 toSourceDirection[1] = 0;
888 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
889 vector cross = targetDirection * toSourceDirection;
893 dirAngleDeg = -dirAngleDeg;
900 if (angleDeg >= -20 && angleDeg <= 20)
904 else if (angleDeg < 0)
914 const int directionCount = 4;
923 offset = directionCount;
927 offset = 2 * directionCount;
931 offset = 3 * directionCount;
952 RegisterTransportHit(transport);
998 return GetSelectionPositionMS(pSelection);
1011 return super.ConvertNonlethalDamage(damage, damageType);
Param4< int, int, string, int > TSelectableActionInfoWithColor
class AnimalBase extends DayZAnimal RegisterHitComponentsForAI()
base class of all commands exposed to script to provide common functionality over animations
static ref TStringArray ARRAY_STRING
Super root of all classes in Enforce script.
void CreateWound(TotalDamageResult damage_result, string zone_name, string ammo)
static bool SelectMostProbableHitComponent(array< ref DayZAIHitComponent > pHitComponents, out string pHitComponent)
static void RegisterHitComponent(array< ref DayZAIHitComponent > pHitComponents, string pName, float pWeight)
do not process rotations !
override bool IsInventoryVisible()
int FindComponentDirectionOffset(string component)
proto native void SignalAIAttackEnded()
vector SetDefaultHitPosition(string pSelection)
void QueueDamageHit(int type, int direction)
void RegisterHitComponentsForAI()
register hit components for AI melee (used by attacking AI)
float ComputeHitDirectionAngleDeg(EntityAI source)
override string GetHitComponentForAI()
void EOnContact(IEntity other, Contact extra)
Phx contact event.
ref array< ref DayZAIHitComponent > m_HitComponentsForAI
Melee hit components (AI targeting).
proto native void StartCommand_Attack()
proto native void StartCommand_Hit(int pType, int pDirection)
bool ComputeDamageHitParams(EntityAI source, string dmgZone, string ammo, out int type, out int direction)
vector m_DefaultHitPosition
bool m_DamageHitToProcess
override string GetDefaultHitComponent()
proto native DayZAnimalCommandScript GetCommand_Script()
override string GetDefaultHitPositionComponent()
string m_DefaultHitComponent
bool HandleDeath(int currentCommandID, DayZAnimalInputController inputController)
override vector GetDefaultHitPosition()
int TranslateHitAngleDegToDirectionIndex(float angleDeg)
proto native DayZAnimalCommandScript StartCommand_Script(DayZAnimalCommandScript pInfectedCommand)
scripted commands
proto native DayZAnimalInputController GetInputController()
override bool IsHealthVisible()
bool HandleDamageHit(int currentCommandID)
override int GetHideIconMask()
proto native void StartCommand_Move()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
proto native DayZAnimalCommandScript StartCommand_ScriptInst(typename pCallbackClass)
void CommandHandler(float dt, int currentCommandID, bool currentCommandFinished)
proto native void SignalAIAttackStarted()
proto native void StartCommand_Jump()
string m_DefaultHitPositionComponent
float ConvertNonlethalDamage(float damage, DamageType damageType)
proto native void StartCommand_Death(int pType, int pDirection)
proto native TAnimGraphVariable BindVariableFloat(string pVariable)
proto native TAnimGraphEvent BindEvent(string pEventName)
proto native TAnimGraphVariable BindVariableBool(string pVariable)
proto native TAnimGraphCommand BindCommand(string pCommandName)
returns command index -
void DayZCreatureAnimInterface()
void ~DayZCreatureAnimInterface()
proto native TAnimGraphTag BindTag(string pTagName)
proto native TAnimGraphVariable BindVariableInt(string pVariable)
void OnSoundEvent(int event_id, string event_user_string)
void ProcessDamageEvent(AnimDamageEvent damage_event)
void DecreaseEffectTriggerCount()
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
void OnSoundVoiceEvent(int event_id, string event_user_string)
void OnStepEvent(int event_id, string event_user_string)
override void EEKilled(Object killer)
bool ResistContaminatedEffect()
void ProcessStepEvent(AnimStepEvent step_event)
void ProcessSoundEvent(AnimSoundEvent sound_event)
void IncreaseEffectTriggerCount()
DayZPlayer m_CinematicPlayer
proto native bool IsSoundInsideBuilding()
void ProcessSoundVoiceEvent(AnimSoundVoiceEvent sound_event)
proto native void AddDamageSphere(string bone_name, string ammo_name, float radius, float duration, bool invertTeams)
void AttenuateSoundIfNecessary(SoundObject soundObject)
void OnDamageEvent(int event_id, string event_user_string)
override bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
proto native void InitAIAgent(AIGroup group)
AIAgent initialization.
proto native void DestroyAIAgent()
void CinematicTakeControl(DayZPlayer player)
AnimBootsType GetBootsType()
void RegisterAnimEvents()
proto native AIAgent GetAIAgent()
proto native DayZCreatureAIType GetCreatureAIType()
void AddDamageSphere(AnimDamageParams damage_params)
proto void SelectPhysics(Physics physics)
Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene.
proto void SelectObject(Object object)
Sets the transform of the object directly.
Internal ancestor of all Entity implementations.
proto native float GetDamage(string zoneName, string healthType)
Native class for boats - handles physics simulation.
proto native float SyncedValue_ID(int action, bool check_focus=true)
Get action state.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto float Normalize()
Normalizes vector.
proto native float Length()
Returns length of vector (magnitude).
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
DamageType
exposed from C++ (do not change)
override bool DisableVicinityIcon()
proto native DayZCreatureAnimInterface GetAnimInterface()
proto native void PrePhys_SetRotation(float pInRot[4])
bool PostPhysUpdate(float pDt)
override this ! final adjustment of physics state (after physics was applied) returns true if command...
class DayZCreatureAI extends DayZCreature COMMANDID_ATTACK
proto native void SetAnimationInstanceByName(string animation_instance_name, int instance_uuid, float duration)
proto native void PostPhys_SetPosition(vector pInTransl)
quaternion in world space
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
class DayZCreatureAI extends DayZCreature COMMANDID_HIT
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
class DayZAnimalCommandMove extends AnimCommandBase SetFlagFinished(bool pFinished)
DayZAnimalCommandScript fully scriptable command.
override bool HasFixedActionTargetCursorPosition()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
proto native void UpdateSimulationPrecision(int simLOD)
proto native bool PrePhys_GetRotation(out float pOutRot[4])
proto native int GetCurrentAnimationInstanceUUID()
proto native bool IsDeathProcessed()
proto native void PostPhys_GetRotation(out float pOutRot[4])
vec3 in world space
override void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
proto native bool PrePhys_GetTranslation(out vector pOutTransl)
script function usable in PrePhysUpdate
proto native void PostPhys_SetRotation(float pInRot[4])
vec3 in world space
override bool IsIgnoredByConstruction()
proto native void PrePhys_SetTranslation(vector pInTransl)
proto native void ResetDeath()
proto native void StartDeath()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
class DayZCreatureAI extends DayZCreature COMMANDID_JUMP
proto native void PostPhys_LockRotation()
quaternion in world space
override bool CanBeSkinned()
proto native void ResetDeathCooldown()
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
ModOverrides.
override bool IsManagingArrows()
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override bool IsDayZCreature()
proto native void PostPhys_GetPosition(out vector pOutTransl)
script function usable in PostPhysUpdate
proto native bool IsDeathConditionMet()
string GetDefaultHitComponent()
string GetDefaultHitPositionComponent()
Serializer ParamsReadContext
proto GizmoApi GetGizmoApi()
const int COMP_TYPE_ANIMAL_BLEEDING
const int COMP_TYPE_BODY_STAGING
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetFlags(ShapeFlags flags)
const float NL_DAMAGE_FIREARM_CONVERSION_ANIMALS
const float NL_DAMAGE_CLOSECOMBAT_CONVERSION_ANIMALS
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
EntityEvent
Entity events for event-mask, or throwing event from code.
static proto void MatrixOrthogonalize4(vector mat[4])
Orthogonalizes matrix.
static proto void MatrixInvMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Invert-transforms matrix.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Acos(float c)
Returns angle in radians from cosinus.
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 RAD2DEG
static const float DEG2RAD
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
const int SAT_DEBUG_ACTION
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.
vector GetPosition()
Get the world position of the Effect.
proto native void SetKind(WaveKind kind)
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
class HumanInputController TAnimGraphCommand
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.