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

◆ GetItemHealth()

int ActionTargetsCursor::GetItemHealth ( )
inlineprotected

См. определение в файле ActionTargetsCursor.c строка 853

855 {
856 int health = -1;
857
858 if (m_Interact && !m_Interact.HasTarget())
859 {
860 return health;
861 }
862
864 if (!tgObject && m_Target)
865 {
866 tgObject = m_Target.GetObject();
867 }
868
869 if (tgObject)
870 {
871 Object tgParent = m_Target.GetParent();
872 EntityAI targetEntity;
873
874 //Return specific part health, even if display name is from parent
875 if (!tgObject.IsAlive())
876 {
877 EntityAI ent;
878 if (m_TargetItemFrozen && Class.CastTo(ent,tgObject) && (ent.IsAnimal() || ent.IsMan() || ent.IsZombie()))
879 health = -2; //frozen interaction later
880 else
881 health = tgObject.GetHealthLevel();
882
883 return health;
884 }
885
886 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport()))
887 {
888 targetEntity = EntityAI.Cast(tgParent);
889 }
890
891 if (tgObject.IsItemBase() || tgObject.IsTransport())
892 {
893 targetEntity = EntityAI.Cast(tgObject);
894 }
895
896 if (targetEntity)
897 {
898 if (!targetEntity.IsDamageDestroyed())
899 {
900 string zone = "";
901 array<string> selections = new array<string>();
902
903 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
904 {
905 //This is really specific to tents, as they use proxies. Hence object must be used
906 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
907 {
908 health = targetEntity.GetHealthLevel(zone);
909 }
910 }
911 else
912 {
913 //NOTE: relevant view geometry and view geometry selection names MUST match in order to get a valid damage zone
914 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
915
916 for (int s = 0; s < selections.Count(); s++)
917 {
918 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity , selections[s], zone))
919 {
920 health = targetEntity.GetHealthLevel(zone);
921 break;
922 }
923 }
924 }
925
926 if (zone == "")
927 health = targetEntity.GetHealthLevel();
928 }
929 }
930 else
931 {
932 health = tgObject.GetHealthLevel();
933 }
934 }
935
936 return health;
class LogManager EntityAI
ActionBase m_Interact
Определения ActionTargetsCursor.c:65
bool m_TargetItemFrozen
Определения ActionTargetsCursor.c:83
ActionTarget m_Target
Определения ActionTargetsCursor.c:61
Object m_DisplayInteractTarget
Определения ActionTargetsCursor.c:63
override bool IsMan()
Определения 3_Game/DayZ/Entities/Man.c:48
class LOD Object

Перекрестные ссылки Class::CastTo(), EntityAI::IsMan(), m_DisplayInteractTarget, m_Interact, m_Target, m_TargetItemFrozen, LOD::NAME_FIRE и LOD::NAME_VIEW.

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