DayZ 1.27
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 строка 598

599 {
600 int hitZoneIdx = m_MeleeCombat.GetHitZoneIdx();
601 int weaponMode = m_MeleeCombat.GetWeaponMode();
602 int forcedWeaponMode = -1;
603 vector hitPosWS;
604 bool forcedDummy = false;
605
606 PlayerBase targetPlayer = PlayerBase.Cast(target);
608 if (targetPlayer)
609 {
610 vector targetPos = targetPlayer.GetPosition();
611 vector agressorPos = m_Player.GetPosition();
612
613 // We get the angle from which an infected hit the blocking player
614 float hitAngle = Math.RAD2DEG * Math.AbsFloat(Math3D.AngleFromPosition(targetPos, MiscGameplayFunctions.GetHeadingVector(targetPlayer), agressorPos));
615
617 if (targetPlayer.GetMeleeFightLogic() && targetPlayer.GetMeleeFightLogic().IsInBlock() && hitAngle <= GameConstants.PVP_MAX_BLOCKABLE_ANGLE)
618 {
619 if (weaponMode > 0)
620 {
621 forcedWeaponMode = --weaponMode; // Heavy -> Light shift
622 }
623 else
624 forcedDummy = true; // dummy hits, cannot shift lower than 0
625 }
626 }
627
628 EvaluateHit_Common(weapon, target, forcedDummy, forcedWeaponMode);
629 }
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
void EvaluateHit_Common(InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1)
DayZPlayer m_Player
Определения Hand_Events.c:42
Определения constants.c:659
Определения EnMath3D.c:28
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
Определения EnConvert.c:106
const float PVP_MAX_BLOCKABLE_ANGLE
Определения constants.c:1084
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().