Dayz 1.25
Dayz Code 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

672 {
674
677 {
678 return;
679 }
680
682 {
683 return;
684 }
685
687 {
688 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
689 {
691 }
692
694
695 return;
696 }
697
700 {
701 return;
702 }
703
705 {
706 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
707 {
709 }
710 return;
711 }
712
713 if (currentCommandID == DayZAnimalConstants.COMMANDID_MOVE)
714 {
715 if (inputController.IsJump())
716 {
718 return;
719 }
720
721 if (inputController.IsAttack())
722 {
725 return;
726 }
727 }
728
731 {
732 return;
733 }
734 }
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:131
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:126
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:136
Definition DayZAnimalInputController.c:50
proto native void SignalAIAttackEnded()
proto native void StartCommand_Attack()
bool HandleDeath(int currentCommandID, DayZAnimalInputController inputController)
Definition DayZAnimal.c:740
proto native DayZAnimalInputController GetInputController()
bool HandleDamageHit(int currentCommandID)
Definition DayZAnimal.c:766
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
815 {
816 type = 0; // not used right now
817
820
822
823 return true;
824 }
int FindComponentDirectionOffset(string component)
Definition DayZAnimal.c:861
float ComputeHitDirectionAngleDeg(EntityAI source)
Definition DayZAnimal.c:826
int TranslateHitAngleDegToDirectionIndex(float angleDeg)
Definition DayZAnimal.c:847

◆ ComputeHitDirectionAngleDeg()

float ComputeHitDirectionAngleDeg ( EntityAI source)
inlineprotected
827 {
828 vector targetDirection = GetDirection();
829 vector toSourceDirection = (source.GetPosition() - GetPosition());
830
831 targetDirection[1] = 0;
832 toSourceDirection[1] = 0;
833
834 targetDirection.Normalize();
835 toSourceDirection.Normalize();
836
839
841 if ( cross[1] < 0 )
843
844 return dirAngleDeg;
845 }
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
951 {
952 switch (damageType)
953 {
954 case DamageType.CLOSE_COMBAT:
956 case DamageType.FIRE_ARM:
958 }
959
960 return super.ConvertNonlethalDamage(damage, damageType);
961 }
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
Definition constants.c:615
const float NL_DAMAGE_FIREARM_CONVERSION_ANIMALS
Definition constants.c:862
const float NL_DAMAGE_CLOSECOMBAT_CONVERSION_ANIMALS
Definition constants.c:866

Перекрестные ссылки 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)

632 {
633 // testing: animals have no inventory by default
634 //GetInventory().LockInventory(LOCK_FROM_SCRIPT); // Hides animals from vicinity in inventory. Remove this if wanted otherwise.
635
637
639
642 }
vector SetDefaultHitPosition(string pSelection)
Definition DayZAnimal.c:945
void RegisterHitComponentsForAI()
register hit components for AI melee (used by attacking AI)
Definition DayZAnimal.c:907
ref array< ref DayZAIHitComponent > m_HitComponentsForAI
Melee hit components (AI targeting)
Definition DayZAnimal.c:610
vector m_DefaultHitPosition
Definition DayZAnimal.c:613
override string GetDefaultHitPositionComponent()
Definition DayZAnimal.c:935

Перекрестные ссылки 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
782 {
784 m_TransportHitRegistered = false;
785
786 int transferShockToDamageCoef = g_Game.ConfigGetInt(string.Format("%1 %2 DamageApplied transferShockToDamage", CFG_AMMO, ammo));
788 {
789 //Print("DayZAnimal | EEHitBy | nonlethal hit");
790 AddHealth("", "Health", -ConvertNonlethalDamage(damageResult.GetDamage(dmgZone, "Shock"), damageType));
791 }
792 else
793 {
795 animal_bleeding.CreateWound( damageResult, dmgZone, ammo );
796 }
797
798 int type = 0;
799 int direction = 0;
800 if (ComputeDamageHitParams(source, dmgZone, ammo, type, direction) == true)
801 {
803 }
804
805 }
DayZGame g_Game
Definition DayZGame.c:3746
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
Definition ComponentAnimalBleeding.c:9
void QueueDamageHit(int type, int direction)
Definition DayZAnimal.c:807
bool ComputeDamageHitParams(EntityAI source, string dmgZone, string ammo, out int type, out int direction)
Definition DayZAnimal.c:814
float ConvertNonlethalDamage(float damage, DamageType damageType)
Definition DayZAnimal.c:950
const int COMP_TYPE_ANIMAL_BLEEDING
Definition Component.c:11
const string CFG_AMMO
Definition constants.c:212

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

◆ EOnContact()

void EOnContact ( IEntity other,
Contact extra )
inlineprotected

Phx contact event

892 {
893 if( !IsAlive() )
894 return;
895
897 if( transport )
898 {
899 if ( GetGame().IsServer() )
900 {
901 RegisterTransportHit(transport);
902 }
903 }
904 }
Base native class for all motorized wheeled vehicles.
Definition Car.c:80
proto native CGame GetGame()

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

◆ FindComponentDirectionOffset()

int FindComponentDirectionOffset ( string component)
inlineprotected
862 {
863 const int directionCount = 4;
864
865 int offset = 0;
866 if (component.Length() == 0)
867 {
868 offset = 0;
869 }
870 else if (component == "Zone_Head")
871 {
873 }
874 else if (component == "Zone_Chest" || component == "Zone_Legs_Front" || component == "Zone_Spine_Front" || component == "Zone_Neck")
875 {
877 }
878 else
879 {
881 }
882
883 return offset;
884 }

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

◆ GetCommand_Script()

proto native DayZAnimalCommandScript GetCommand_Script ( )
protected

◆ GetDefaultHitComponent()

override string GetDefaultHitComponent ( )
inlineprotected
931 {
933 }
string m_DefaultHitComponent
Definition DayZAnimal.c:611

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

◆ GetDefaultHitPosition()

override vector GetDefaultHitPosition ( )
inlineprotected
941 {
943 }

◆ GetDefaultHitPositionComponent()

override string GetDefaultHitPositionComponent ( )
inlineprotected
936 {
938 }
string m_DefaultHitPositionComponent
Definition DayZAnimal.c:612

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

◆ GetHideIconMask()

override int GetHideIconMask ( )
inlineprotected
660 {
661 return EInventoryIconVisibility.HIDE_VICINITY;
662 /*
663 if (IsAlive())
664 {
665 return EInventoryIconVisibility.HIDE_VICINITY;
666 }
667 return super.GetHideIconMask();
668 */
669 }

◆ GetHitComponentForAI()

override string GetHitComponentForAI ( )
inlineprotected
919 {
920 string hitComp;
921
923 {
924 return hitComp;
925 }
926
927 return GetDefaultHitComponent();
928 }
Definition DayZAIHitComponents.c:9
static bool SelectMostProbableHitComponent(array< ref DayZAIHitComponent > pHitComponents, out string pHitComponent)
Definition DayZAIHitComponents.c:40
override string GetDefaultHitComponent()
Definition DayZAnimal.c:930

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

◆ GetInputController()

proto native DayZAnimalInputController GetInputController ( )
protected

◆ HandleDamageHit()

bool HandleDamageHit ( int currentCommandID)
inlineprotected
767 {
769 {
770 m_DamageHitToProcess = false;
771
772 if (currentCommandID != DayZAnimalConstants.COMMANDID_HIT)
773 {
775 }
776 return true;
777 }
778 return false;
779 }
proto native void StartCommand_Hit(int pType, int pDirection)
bool m_DamageHitToProcess
Definition DayZAnimal.c:736
int m_DamageHitType
Definition DayZAnimal.c:737
int m_DamageHitDirection
Definition DayZAnimal.c:738

◆ HandleDeath()

bool HandleDeath ( int currentCommandID,
DayZAnimalInputController inputController )
inlineprotected
741 {
742 if (inputController.IsDead())
743 {
744 if (currentCommandID == DayZAnimalConstants.COMMANDID_DEATH)
745 {
746 return true;
747 }
748
750 {
751 m_DamageHitToProcess = false;
752
754 }
755 else
756 {
757 StartCommand_Death(0, 0);
758 }
759
760 return true;
761 }
762
763 return false;
764 }
proto native void StartCommand_Death(int pType, int pDirection)

◆ IsAnimal()

override bool IsAnimal ( )
inlineprotected
650 {
651 return true;
652 }

◆ IsHealthVisible()

override bool IsHealthVisible ( )
inlineprotected
645 {
646 return false;
647 }

◆ IsInventoryVisible()

override bool IsInventoryVisible ( )
inlineprotected
655 {
656 return false;
657 }

◆ QueueDamageHit()

void QueueDamageHit ( int type,
int direction )
inlineprotected
808 {
810 m_DamageHitType = type;
812 }

◆ 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

908 {
910 m_DefaultHitComponent = "Zone_Chest";
913
916 }
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
946 {
947 return GetSelectionPositionMS(pSelection);
948 }

◆ 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
848 {
849 if (angleDeg >= -20 && angleDeg <= 20) // front
850 {
851 return 1;
852 }
853 else if (angleDeg < 0) // left
854 {
855 return 2;
856 }
857
858 return 3; // right
859 }

Поля

◆ 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)


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