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

do not process rotations ! Подробнее...

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

proto native DayZAnimalInputController GetInputController ()
 
proto native void StartCommand_Death (int pType, int pDirection)
 
proto native void StartCommand_Move ()
 
proto native void StartCommand_Jump ()
 
proto native void StartCommand_Attack ()
 
proto native void StartCommand_Hit (int pType, int pDirection)
 
proto native DayZAnimalCommandScript StartCommand_Script (DayZAnimalCommandScript pInfectedCommand)
 scripted commands
 
proto native DayZAnimalCommandScript StartCommand_ScriptInst (typename pCallbackClass)
 
proto native DayZAnimalCommandScript GetCommand_Script ()
 
proto native void SignalAIAttackStarted ()
 
proto native void SignalAIAttackEnded ()
 
void DayZAnimal ()
 
override bool IsHealthVisible ()
 
override bool IsAnimal ()
 
override bool IsInventoryVisible ()
 
override int GetHideIconMask ()
 
void CommandHandler (float dt, int currentCommandID, bool currentCommandFinished)
 
bool HandleDeath (int currentCommandID, DayZAnimalInputController inputController)
 
bool HandleDamageHit (int currentCommandID)
 
override void EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
void QueueDamageHit (int type, int direction)
 
bool ComputeDamageHitParams (EntityAI source, string dmgZone, string ammo, out int type, out int direction)
 
float ComputeHitDirectionAngleDeg (EntityAI source)
 
int TranslateHitAngleDegToDirectionIndex (float angleDeg)
 
int FindComponentDirectionOffset (string component)
 
void EOnContact (IEntity other, Contact extra)
 
void RegisterHitComponentsForAI ()
 register hit components for AI melee (used by attacking AI)
 
override string GetHitComponentForAI ()
 
override string GetDefaultHitComponent ()
 
override string GetDefaultHitPositionComponent ()
 
override vector GetDefaultHitPosition ()
 
vector SetDefaultHitPosition (string pSelection)
 
float ConvertNonlethalDamage (float damage, DamageType damageType)
 

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

ref array< ref DayZAIHitComponentm_HitComponentsForAI
 Melee hit components (AI targeting)
 
string m_DefaultHitComponent
 
string m_DefaultHitPositionComponent
 
vector m_DefaultHitPosition
 
bool m_DamageHitToProcess = false
 
int m_DamageHitType = 0
 
int m_DamageHitDirection = 0
 

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

do not process rotations !

Методы

◆ CommandHandler()

void CommandHandler ( float dt,
int currentCommandID,
bool currentCommandFinished )
inlineprotected

for mods

for mods

677 {
679
682 {
683 return;
684 }
685
687 {
688 return;
689 }
690
692 {
693 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
694 {
696 }
697
699
700 return;
701 }
702
705 {
706 return;
707 }
708
710 {
711 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
712 {
714 }
715 return;
716 }
717
718 if (currentCommandID == DayZAnimalConstants.COMMANDID_MOVE)
719 {
720 if (inputController.IsJump())
721 {
723 return;
724 }
725
726 if (inputController.IsAttack())
727 {
730 return;
731 }
732 }
733
736 {
737 return;
738 }
739 }
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:136
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:131
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:141
Definition DayZAnimalInputController.c:50
proto native void SignalAIAttackEnded()
proto native void StartCommand_Attack()
bool HandleDeath(int currentCommandID, DayZAnimalInputController inputController)
Definition DayZAnimal.c:745
proto native DayZAnimalInputController GetInputController()
bool HandleDamageHit(int currentCommandID)
Definition DayZAnimal.c:771
proto native void StartCommand_Move()
proto native void SignalAIAttackStarted()
proto native void StartCommand_Jump()
Definition EntityAI.c:95

Перекрестные ссылки ModCommandHandlerAfter(), ModCommandHandlerBefore() и ModCommandHandlerInside().

◆ ComputeDamageHitParams()

bool ComputeDamageHitParams ( EntityAI source,
string dmgZone,
string ammo,
out int type,
out int direction )
inlineprotected
820 {
821 type = 0; // not used right now
822
825
827
828 return true;
829 }
int FindComponentDirectionOffset(string component)
Definition DayZAnimal.c:866
float ComputeHitDirectionAngleDeg(EntityAI source)
Definition DayZAnimal.c:831
int TranslateHitAngleDegToDirectionIndex(float angleDeg)
Definition DayZAnimal.c:852

◆ ComputeHitDirectionAngleDeg()

float ComputeHitDirectionAngleDeg ( EntityAI source)
inlineprotected
832 {
833 vector targetDirection = GetDirection();
834 vector toSourceDirection = (source.GetPosition() - GetPosition());
835
836 targetDirection[1] = 0;
837 toSourceDirection[1] = 0;
838
839 targetDirection.Normalize();
840 toSourceDirection.Normalize();
841
844
846 if ( cross[1] < 0 )
848
849 return dirAngleDeg;
850 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition EnMath.c:7
Definition EnConvert.c:106
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
static proto float Acos(float c)
Returns angle in radians from cosinus.
static const float RAD2DEG
Definition EnMath.c:16

Перекрестные ссылки Math::Acos(), vector::Dot(), GetPosition и Math::RAD2DEG.

◆ ConvertNonlethalDamage()

float ConvertNonlethalDamage ( float damage,
DamageType damageType )
inlineprotected
956 {
957 switch (damageType)
958 {
959 case DamageType.CLOSE_COMBAT:
961 case DamageType.FIRE_ARM:
963 }
964
965 return super.ConvertNonlethalDamage(damage, damageType);
966 }
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
Definition constants.c:638
const float NL_DAMAGE_FIREARM_CONVERSION_ANIMALS
Definition constants.c:957
const float NL_DAMAGE_CLOSECOMBAT_CONVERSION_ANIMALS
Definition constants.c:961

Перекрестные ссылки GameConstants::NL_DAMAGE_CLOSECOMBAT_CONVERSION_ANIMALS и GameConstants::NL_DAMAGE_FIREARM_CONVERSION_ANIMALS.

◆ DayZAnimal()

void DayZAnimal ( )
inlineprotected

sets default hit position and cache it here (mainly for impact particles)

637 {
638 // testing: animals have no inventory by default
639 //GetInventory().LockInventory(LOCK_FROM_SCRIPT); // Hides animals from vicinity in inventory. Remove this if wanted otherwise.
640
642
644
647 }
vector SetDefaultHitPosition(string pSelection)
Definition DayZAnimal.c:950
void RegisterHitComponentsForAI()
register hit components for AI melee (used by attacking AI)
Definition DayZAnimal.c:912
ref array< ref DayZAIHitComponent > m_HitComponentsForAI
Melee hit components (AI targeting)
Definition DayZAnimal.c:615
vector m_DefaultHitPosition
Definition DayZAnimal.c:618
override string GetDefaultHitPositionComponent()
Definition DayZAnimal.c:940

Перекрестные ссылки GetDefaultHitPositionComponent(), m_HitComponentsForAI и RegisterHitComponentsForAI().

◆ EEHitBy()

override void EEHitBy ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
inlineprotected
787 {
789 m_TransportHitRegistered = false;
790
791 int transferShockToDamageCoef = g_Game.ConfigGetInt(string.Format("%1 %2 DamageApplied transferShockToDamage", CFG_AMMO, ammo));
793 {
794 //Print("DayZAnimal | EEHitBy | nonlethal hit");
795 AddHealth("", "Health", -ConvertNonlethalDamage(damageResult.GetDamage(dmgZone, "Shock"), damageType));
796 }
797 else
798 {
800 animal_bleeding.CreateWound( damageResult, dmgZone, ammo );
801 }
802
803 int type = 0;
804 int direction = 0;
805 if (ComputeDamageHitParams(source, dmgZone, ammo, type, direction) == true)
806 {
808 }
809
810 }
DayZGame g_Game
Definition DayZGame.c:3815
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
Definition ComponentAnimalBleeding.c:9
void QueueDamageHit(int type, int direction)
Definition DayZAnimal.c:812
bool ComputeDamageHitParams(EntityAI source, string dmgZone, string ammo, out int type, out int direction)
Definition DayZAnimal.c:819
float ConvertNonlethalDamage(float damage, DamageType damageType)
Definition DayZAnimal.c:955
const int COMP_TYPE_ANIMAL_BLEEDING
Definition Component.c:11
const string CFG_AMMO
Definition constants.c:220

Перекрестные ссылки CFG_AMMO, COMP_TYPE_ANIMAL_BLEEDING, component и g_Game.

◆ EOnContact()

void EOnContact ( IEntity other,
Contact extra )
inlineprotected

Phx contact event

897 {
898 if( !IsAlive() )
899 return;
900
902 if( transport )
903 {
904 if ( GetGame().IsServer() )
905 {
906 RegisterTransportHit(transport);
907 }
908 }
909 }
Base native class for all motorized wheeled vehicles.
Definition Boat.c:28
proto native CGame GetGame()

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

◆ FindComponentDirectionOffset()

int FindComponentDirectionOffset ( string component)
inlineprotected
867 {
868 const int directionCount = 4;
869
870 int offset = 0;
871 if (component.Length() == 0)
872 {
873 offset = 0;
874 }
875 else if (component == "Zone_Head")
876 {
878 }
879 else if (component == "Zone_Chest" || component == "Zone_Legs_Front" || component == "Zone_Spine_Front" || component == "Zone_Neck")
880 {
882 }
883 else
884 {
886 }
887
888 return offset;
889 }

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

◆ GetCommand_Script()

proto native DayZAnimalCommandScript GetCommand_Script ( )
protected

◆ GetDefaultHitComponent()

override string GetDefaultHitComponent ( )
inlineprotected
936 {
938 }
string m_DefaultHitComponent
Definition DayZAnimal.c:616

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

◆ GetDefaultHitPosition()

override vector GetDefaultHitPosition ( )
inlineprotected
946 {
948 }

◆ GetDefaultHitPositionComponent()

override string GetDefaultHitPositionComponent ( )
inlineprotected
941 {
943 }
string m_DefaultHitPositionComponent
Definition DayZAnimal.c:617

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

◆ GetHideIconMask()

override int GetHideIconMask ( )
inlineprotected
665 {
666 return EInventoryIconVisibility.HIDE_VICINITY;
667 /*
668 if (IsAlive())
669 {
670 return EInventoryIconVisibility.HIDE_VICINITY;
671 }
672 return super.GetHideIconMask();
673 */
674 }

◆ GetHitComponentForAI()

override string GetHitComponentForAI ( )
inlineprotected
924 {
925 string hitComp;
926
928 {
929 return hitComp;
930 }
931
932 return GetDefaultHitComponent();
933 }
Definition DayZAIHitComponents.c:9
static bool SelectMostProbableHitComponent(array< ref DayZAIHitComponent > pHitComponents, out string pHitComponent)
Definition DayZAIHitComponents.c:40
override string GetDefaultHitComponent()
Definition DayZAnimal.c:935

Перекрестные ссылки GetDefaultHitComponent(), m_HitComponentsForAI и DayZAIHitComponentHelpers::SelectMostProbableHitComponent().

◆ GetInputController()

proto native DayZAnimalInputController GetInputController ( )
protected

◆ HandleDamageHit()

bool HandleDamageHit ( int currentCommandID)
inlineprotected
772 {
774 {
775 m_DamageHitToProcess = false;
776
777 if (currentCommandID != DayZAnimalConstants.COMMANDID_HIT)
778 {
780 }
781 return true;
782 }
783 return false;
784 }
proto native void StartCommand_Hit(int pType, int pDirection)
bool m_DamageHitToProcess
Definition DayZAnimal.c:741
int m_DamageHitType
Definition DayZAnimal.c:742
int m_DamageHitDirection
Definition DayZAnimal.c:743

◆ HandleDeath()

bool HandleDeath ( int currentCommandID,
DayZAnimalInputController inputController )
inlineprotected
746 {
747 if (inputController.IsDead())
748 {
749 if (currentCommandID == DayZAnimalConstants.COMMANDID_DEATH)
750 {
751 return true;
752 }
753
755 {
756 m_DamageHitToProcess = false;
757
759 }
760 else
761 {
762 StartCommand_Death(0, 0);
763 }
764
765 return true;
766 }
767
768 return false;
769 }
proto native void StartCommand_Death(int pType, int pDirection)

◆ IsAnimal()

override bool IsAnimal ( )
inlineprotected
655 {
656 return true;
657 }

◆ IsHealthVisible()

override bool IsHealthVisible ( )
inlineprotected
650 {
651 return false;
652 }

◆ IsInventoryVisible()

override bool IsInventoryVisible ( )
inlineprotected
660 {
661 return false;
662 }

◆ QueueDamageHit()

void QueueDamageHit ( int type,
int direction )
inlineprotected
813 {
815 m_DamageHitType = type;
817 }

◆ RegisterHitComponentsForAI()

void RegisterHitComponentsForAI ( )
inlineprotected

register hit components for AI melee (used by attacking AI)

registers default hit compoent for the entity

registers default hit position component for entity

register hit components that are selected by probability

913 {
915 m_DefaultHitComponent = "Zone_Chest";
918
921 }
static void RegisterHitComponent(array< ref DayZAIHitComponent > pHitComponents, string pName, float pWeight)
Register Hit Component for AI targeting.
Definition DayZAIHitComponents.c:21

Перекрестные ссылки m_DefaultHitComponent, m_DefaultHitPositionComponent, m_HitComponentsForAI и DayZAIHitComponentHelpers::RegisterHitComponent().

◆ SetDefaultHitPosition()

vector SetDefaultHitPosition ( string pSelection)
inlineprotected
951 {
952 return GetSelectionPositionMS(pSelection);
953 }

◆ SignalAIAttackEnded()

proto native void SignalAIAttackEnded ( )
protected

◆ SignalAIAttackStarted()

proto native void SignalAIAttackStarted ( )
protected

◆ StartCommand_Attack()

proto native void StartCommand_Attack ( )
protected

◆ StartCommand_Death()

proto native void StartCommand_Death ( int pType,
int pDirection )
protected

◆ StartCommand_Hit()

proto native void StartCommand_Hit ( int pType,
int pDirection )
protected

◆ StartCommand_Jump()

proto native void StartCommand_Jump ( )
protected

◆ StartCommand_Move()

proto native void StartCommand_Move ( )
protected

◆ StartCommand_Script()

proto native DayZAnimalCommandScript StartCommand_Script ( DayZAnimalCommandScript pInfectedCommand)
protected

scripted commands

◆ StartCommand_ScriptInst()

proto native DayZAnimalCommandScript StartCommand_ScriptInst ( typename pCallbackClass )
protected

◆ TranslateHitAngleDegToDirectionIndex()

int TranslateHitAngleDegToDirectionIndex ( float angleDeg)
inlineprotected
853 {
854 if (angleDeg >= -20 && angleDeg <= 20) // front
855 {
856 return 1;
857 }
858 else if (angleDeg < 0) // left
859 {
860 return 2;
861 }
862
863 return 3; // right
864 }

Поля

◆ m_DamageHitDirection

int m_DamageHitDirection = 0
protected

◆ m_DamageHitToProcess

bool m_DamageHitToProcess = false
protected

◆ m_DamageHitType

int m_DamageHitType = 0
protected

◆ m_DefaultHitComponent

string m_DefaultHitComponent
protected

◆ m_DefaultHitPosition

vector m_DefaultHitPosition
protected

◆ m_DefaultHitPositionComponent

string m_DefaultHitPositionComponent
protected

◆ m_HitComponentsForAI

ref array<ref DayZAIHitComponent> m_HitComponentsForAI
protected

Melee hit components (AI targeting)


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