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

◆ EvaluateHit_Player()

void EvaluateHit_Player ( InventoryItem weapon,
Object target )
protected

Melee Hit/Impact modifiers

if the oponnent is in Melee Block shift the damage down

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

605 {
606 int hitZoneIdx = m_MeleeCombat.GetHitZoneIdx();
607 int weaponMode = m_MeleeCombat.GetWeaponMode();
608 int forcedWeaponMode = -1;
609 vector hitPosWS;
610 bool forcedDummy = false;
611
612 PlayerBase targetPlayer = PlayerBase.Cast(target);
614 if (targetPlayer)
615 {
616 vector targetPos = targetPlayer.GetPosition();
617 vector agressorPos = m_Player.GetPosition();
618
619 // We get the angle from which an infected hit the blocking player
620 float hitAngle = Math.RAD2DEG * Math.AbsFloat(Math3D.AngleFromPosition(targetPos, MiscGameplayFunctions.GetHeadingVector(targetPlayer), agressorPos));
621
623 if (targetPlayer.GetMeleeFightLogic() && targetPlayer.GetMeleeFightLogic().IsInBlock() && hitAngle <= GameConstants.PVP_MAX_BLOCKABLE_ANGLE)
624 {
625 if (weaponMode > 0)
626 {
627 forcedWeaponMode = --weaponMode; // Heavy -> Light shift
628 }
629 else
630 forcedDummy = true; // dummy hits, cannot shift lower than 0
631 }
632 }
633
634 EvaluateHit_Common(weapon, target, forcedDummy, forcedWeaponMode);
635 }
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
void EvaluateHit_Common(InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1)
DayZPlayer m_Player
Определения Hand_Events.c:42
Определения EnMath3D.c:28
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
Определения EnConvert.c:106
const float PVP_MAX_BLOCKABLE_ANGLE
Определения 3_Game/constants.c:1086
static proto float AngleFromPosition(vector origin, vector originDir, vector target)
Angle that a target is from the direction of an origin.
static const float RAD2DEG
Определения EnMath.c:16
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), Math3D::AngleFromPosition(), EvaluateHit_Common(), m_MeleeCombat, m_Player, GameConstants::PVP_MAX_BLOCKABLE_ANGLE и Math::RAD2DEG.

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