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

◆ GetItemHealth()

int ActionTargetsCursor::GetItemHealth ( )
inlineprotected

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

816 {
817 int health = -1;
818
819 if (m_Interact && !m_Interact.HasTarget())
820 {
821 return health;
822 }
823
825 if (!tgObject && m_Target)
826 {
827 tgObject = m_Target.GetObject();
828 }
829
830 if (tgObject)
831 {
832 Object tgParent = m_Target.GetParent();
833 EntityAI targetEntity;
834
835 //Return specific part health, even if display name is from parent
836 if (!tgObject.IsAlive())
837 {
838 EntityAI ent;
839 if (m_TargetItemFrozen && Class.CastTo(ent,tgObject) && (ent.IsAnimal() || ent.IsMan() || ent.IsZombie()))
840 health = -2; //frozen interaction later
841 else
842 health = tgObject.GetHealthLevel();
843
844 return health;
845 }
846
847 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport() || tgParent.CanUseConstruction()))
848 {
849 targetEntity = EntityAI.Cast(tgParent);
850 }
851
852 if (tgObject.IsItemBase() || tgObject.IsTransport() || tgObject.CanUseConstruction())
853 {
854 targetEntity = EntityAI.Cast(tgObject);
855 }
856
857 if (targetEntity)
858 {
859 if (!targetEntity.IsDamageDestroyed())
860 {
861 string zone = "";
862 array<string> selections = new array<string>();
863
864 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
865 {
866 //This is really specific to tents, as they use proxies. Hence object must be used
867 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
868 {
869 health = targetEntity.GetHealthLevel(zone);
870 }
871 }
872 else
873 {
874 //NOTE: relevant view geometry and view geometry selection names MUST match in order to get a valid damage zone
875 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
876
877 for (int s = 0; s < selections.Count(); s++)
878 {
879 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity , selections[s], zone))
880 {
881 health = targetEntity.GetHealthLevel(zone);
882 break;
883 }
884 }
885 }
886
887 if (zone == "")
888 health = targetEntity.GetHealthLevel();
889 }
890 }
891 else
892 {
893 health = tgObject.GetHealthLevel();
894 }
895 }
896
897 return health;
898 }
class LogManager EntityAI
ActionBase m_Interact
Определения ActionTargetsCursor.c:69
bool m_TargetItemFrozen
Определения ActionTargetsCursor.c:88
ActionTarget m_Target
Определения ActionTargetsCursor.c:65
Object m_DisplayInteractTarget
Определения ActionTargetsCursor.c:67
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().