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

◆ GetAttackPitch()

int DayZInfected::GetAttackPitch ( EntityAI target)
inlineprotected

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

769 {
770 const float CENTER_EPS = 0.3;
771 const float TORSO_TO_HEAD_OFFSET = 0.55; // for non-player fallback
772
773 // Approximate infected head height
774 float myHeadY = GetPosition()[1] + 1.8;
775
776 float targetY;
777 PlayerBase playerTarget = PlayerBase.Cast(target);
778 if (playerTarget)
779 {
780 // Stance-aware head pos
781 targetY = MiscGameplayFunctions.GetPlayerHeadPosition(playerTarget)[1];
782 }
783 else
784 {
785 // Non-player: use torso default hit pos, lift toward head
786 vector def = target.GetDefaultHitPosition();
787 if (def != vector.Zero)
788 targetY = target.ModelToWorld(def)[1] + TORSO_TO_HEAD_OFFSET;
789 else
790 targetY = target.GetPosition()[1] + 1.0; // last resort
791 }
792
793 float diff = Math.AbsFloat(targetY - myHeadY);
794 if (diff < CENTER_EPS)
795 return 0;
796
797 if(myHeadY > targetY)
798 return -1;
799 else
800 return 1;
801 }
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки Math::AbsFloat(), GetPosition() и vector::Zero.

Используется в ChaseAttackLogic() и FightAttackLogic().