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

◆ GetItemHealth()

int ActionTargetsCursor::GetItemHealth ( )
inlineprotected

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

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

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

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