Enumerations | |
enum | EFightLogicCooldownCategory { EVADE = 0 } |
Light / Heavy punches. More... | |
Functions | |
void | DayZPlayerMeleeFightLogic_LightHeavy (DayZPlayerImplement player) |
void | Init (DayZPlayerImplement player) |
void | ~DayZPlayerMeleeFightLogic_LightHeavy () |
bool | IsInBlock () |
void | SetBlock (bool block) |
bool | IsEvading () |
bool | GetCurrentHitType () |
bool | CanFight () |
protected void | RegisterCooldowns () |
protected EMeleeHitType | GetAttackTypeFromInputs (HumanInputController pInputs) |
protected EMeleeHitType | GetAttackTypeByWeaponAttachments (EntityAI pEntity) |
protected float | GetAttackTypeByDistanceToTarget (EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE) |
bool | HandleFightLogic (int pCurrentCommandID, HumanInputController pInputs, EntityAI pEntityInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
protected bool | HandleHitEvent (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
Handle the event that our melee hit something. | |
protected bool | HandleInitialFirearmMelee (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
NOTE: Only singular (or first) hits, combo attacks are handled in combo. | |
protected bool | HandleInitialMeleeErc (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
First attack in raised erc (light or heavy if modifier is used). Also added support for finishers. | |
protected bool | HandleProneKick (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
kick from raised pne | |
protected bool | HandleSprintAttack (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
sprint attack in erc stance | |
protected bool | HandleComboHit (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack) |
combo hits - when we are already in Melee command and clicking UseButton | |
protected void | EvaluateHit (InventoryItem weapon) |
protected void | EvaluateHit_Player (InventoryItem weapon, Object target) |
protected void | EvaluateHit_Infected (InventoryItem weapon, Object target) |
protected bool | EvaluateFinisherAttack (InventoryItem weapon, Object target) |
Check and evaluate stealth kill, if applicable. | |
protected void | EvaluateHit_Common (InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1) |
protected void | EvaluateHit_NonAlignableObjects (InventoryItem weapon, Object target) |
bool | WeaponDestroyedCheck (InventoryItem weapon, out string ammo) |
protected void | GetTargetData (out EntityAI target, out EMeleeTargetType targetType) |
protected bool | DummyHitSelector (EMeleeHitType hitType, out string ammoType) |
evaluation of hit player vs. player | |
protected bool | IsBehindEntity (int angle, DayZPlayer source, Object target) |
DEPRECATED - moved into DayZPlayerImplementMeleeCombat. | |
protected void | SetCooldown (float time, EFightLogicCooldownCategory cooldownCategory) |
protected void | ResetCooldown (EFightLogicCooldownCategory cooldownCategory) |
protected void | EnableControls () |
protected void | DisableControls () |
protected void | DamageHands (DayZPlayer DZPlayer, ClothingBase gloves, InventoryItem itemInHands) |
int | DetermineFinisherAnimation (int finisher_type) |
Picks a specific finisher animation. Not used for mounted bayonet stabs. | |
string | DetermineFinisherAmmo (int finisher_type) |
Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour of the target. | |
protected bool | IsShortDistance (EntityAI pTarget, float pDistanceSq) |
int | GetFinisherType (InventoryItem weapon, EntityAI target) |
bool | IsHitTypeFinisher (int type) |
int | DetermineSpecificFinisherType (ItemBase weapon, int component) |
Variables | |
enum EFightLogicCooldownCategory | EVADE_COOLDOWN = 0.5 |
cooldown timers settings | |
const float | CLOSE_TARGET_DISTANCE = 1.5 |
const string | DUMMY_LIGHT_AMMO = "Dummy_Light" |
dummy ammo types | |
const string | DUMMY_HEAVY_AMMO = "Dummy_Heavy" |
protected PlayerBase | m_Player |
protected ref DayZPlayerImplementMeleeCombat | m_MeleeCombat |
protected EMeleeHitType | m_HitType |
protected ref map< int, ref Timer > | m_CooldownTimers |
protected Mission | m_Mission |
protected bool | m_IsInBlock |
protected bool | m_IsEvading |
protected bool | m_IsInComboRange |
protected bool | m_WasPreviousHitProcessed |
protected DayZPlayerImplement | m_DZPlayer |
protected bool | m_IsFinisher |
protected void DamageHands | ( | DayZPlayer | DZPlayer, |
ClothingBase | gloves, | ||
InventoryItem | itemInHands | ||
) |
References GetGame(), m_HitType, m_MeleeCombat, m_Player, Math::RandomIntInclusive(), and GameConstants::STATE_RUINED.
Referenced by HandleHitEvent().
void DayZPlayerMeleeFightLogic_LightHeavy | ( | DayZPlayerImplement | player | ) |
References Init().
Referenced by DayZPlayer::DayZPlayerImplement().
Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour of the target.
Referenced by EvaluateFinisherAttack().
Picks a specific finisher animation. Not used for mounted bayonet stabs.
References HumanCommandMelee2::HIT_TYPE_FINISHER, and HumanCommandMelee2::HIT_TYPE_FINISHER_NECK.
Referenced by HandleInitialMeleeErc().
protected void DisableControls | ( | ) |
Referenced by HandleComboHit(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), and HandleSprintAttack().
protected bool DummyHitSelector | ( | EMeleeHitType | hitType, |
out string | ammoType | ||
) |
evaluation of hit player vs. player
in case of kick (on back or push from erc) change the ammo type to dummy
References DUMMY_HEAVY_AMMO, and DUMMY_LIGHT_AMMO.
Referenced by EvaluateHit_Common().
protected void EnableControls | ( | ) |
Referenced by HandleHitEvent().
protected bool EvaluateFinisherAttack | ( | InventoryItem | weapon, |
Object | target | ||
) |
Check and evaluate stealth kill, if applicable.
References DetermineFinisherAmmo(), GetGame(), m_MeleeCombat, and m_Player.
Referenced by EvaluateHit_Infected().
protected void EvaluateHit | ( | InventoryItem | weapon | ) |
References EvaluateHit_Common(), EvaluateHit_Infected(), EvaluateHit_NonAlignableObjects(), EvaluateHit_Player(), EntityAI::GetMeleeTargetType(), and m_MeleeCombat.
Referenced by HandleHitEvent().
protected void EvaluateHit_Common | ( | InventoryItem | weapon, |
Object | target, | ||
bool | forcedDummy = false , |
||
int | forcedWeaponMode = -1 |
||
) |
check if we need to use dummy hit
normal hit with applied damage to targeted component
play hit animation for dummy hits
override hit pos by pos defined in type
References DummyHitSelector(), GetGame(), m_HitType, m_MeleeCombat, m_Player, and WeaponDestroyedCheck().
Referenced by EvaluateHit(), EvaluateHit_Infected(), and EvaluateHit_Player().
protected void EvaluateHit_Infected | ( | InventoryItem | weapon, |
Object | target | ||
) |
References EvaluateFinisherAttack(), and EvaluateHit_Common().
Referenced by EvaluateHit().
protected void EvaluateHit_NonAlignableObjects | ( | InventoryItem | weapon, |
Object | target | ||
) |
References m_MeleeCombat, m_Player, and WeaponDestroyedCheck().
Referenced by EvaluateHit().
protected void EvaluateHit_Player | ( | InventoryItem | weapon, |
Object | target | ||
) |
Melee Hit/Impact modifiers
if the oponnent is in Melee Block shift the damage down
References Math::AbsFloat(), Math3D::AngleFromPosition(), EvaluateHit_Common(), m_MeleeCombat, m_Player, GameConstants::PVP_MAX_BLOCKABLE_ANGLE, and Math::RAD2DEG.
Referenced by EvaluateHit().
protected float GetAttackTypeByDistanceToTarget | ( | EntityAI | pTarget, |
EMeleeTargetType | pTargetType = EMeleeTargetType.ALIGNABLE |
||
) |
target in short distance - in place attack
target is far from the player - forward movement attack
References CLOSE_TARGET_DISTANCE, IsShortDistance(), and Math::SqrFloat().
Referenced by HandleComboHit(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), and HandleSprintAttack().
protected EMeleeHitType GetAttackTypeByWeaponAttachments | ( | EntityAI | pEntity | ) |
use stabbing if the bayonet/knife is attached to firearm
References DayZPlayer::CanConsumeStamina(), and m_Player.
Referenced by HandleComboHit(), and HandleInitialFirearmMelee().
protected EMeleeHitType GetAttackTypeFromInputs | ( | HumanInputController | pInputs | ) |
References DayZPlayer::CanConsumeStamina(), HumanInputController::IsMeleeFastAttackModifier(), and m_Player.
Referenced by HandleComboHit(), and HandleInitialMeleeErc().
int GetFinisherType | ( | InventoryItem | weapon, |
EntityAI | target | ||
) |
protected void GetTargetData | ( | out EntityAI | target, |
out EMeleeTargetType | targetType | ||
) |
default
nullify target for nonalignable objects (big objects)
References m_MeleeCombat.
Referenced by HandleComboHit(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), and HandleSprintAttack().
protected bool HandleComboHit | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
combo hits - when we are already in Melee command and clicking UseButton
select if the next attack will be light or heavy (based on input/attachment modifier)
no suitable attack - skip that
No combos for the finisher command
wait for the previous hit commit before hitting again if the next attack is heavy and the previous wasn't - otherwise the previous light attack will turn into heavy
targetting
continue 'combo' - left hand attacks
broken legs shock
stamina depletion per attack
References PlayerConstants::BROKEN_LEGS_HEAVY_MELEE_SHOCK, PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetAttackTypeByWeaponAttachments(), GetAttackTypeFromInputs(), GetTargetData(), m_HitType, m_MeleeCombat, m_Player, and m_WasPreviousHitProcessed.
Referenced by HandleFightLogic().
bool HandleFightLogic | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
EntityAI | pEntityInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
Check if we need to damage
Actually pressing a button to start a melee attack
do not perform attacks when blocking
if the item in hands cannot be used as melee weapon
Currently not performing any attacks, so here we start the initial
melee with firearm
first attack in raised erc (light or heavy if modifier is used). Also added support for finishers
kick from raised pne
sprint attack in erc stance
combo hits - when we are already in Melee command and clicking UseButton
evade and blocking logic
evades in raised erc stance while moving
not enough stamina to do evades
stand up when crouching and raised pressed
blocks in raised erc/pro stance (bare hand or with melee weapon only)
References PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::CanConsumeStamina(), DayZPlayerUtils(), DayZPlayer::DepleteStamina(), EVADE_COOLDOWN, HumanCommandMove::ForceStance(), HumanCommandMove::GetCurrentInputAngle(), HandleComboHit(), HandleHitEvent(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), HandleSprintAttack(), HumanInputController::IsAttackButtonDown(), HumanInventoryWithFSM::IsIdle(), HumanInputController::IsMeleeLREvade(), HumanInputController::IsMeleeWeaponAttack(), DayZPlayer::IsSprintFull(), HumanInputController::IsWeaponRaised(), m_IsEvading, m_IsInBlock, m_IsInComboRange, HumanMovementState::m_iStanceIdx, m_Player, SetBlock(), SetCooldown(), HumanCommandMove::SetMeleeBlock(), and HumanCommandMove::StartMeleeEvadeA().
protected bool HandleHitEvent | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
Handle the event that our melee hit something.
Check if we need to damage
on anim event Hit received
re-target (enemy can have moved out of range or disappeared)
evaluate hit - selection of cfg 'ammo' type
References DamageHands(), EnableControls(), EvaluateHit(), m_HitType, m_MeleeCombat, m_Player, m_WasPreviousHitProcessed, and HumanCommandMelee2::WasHit().
Referenced by HandleFightLogic().
protected bool HandleInitialFirearmMelee | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
NOTE: Only singular (or first) hits, combo attacks are handled in combo.
don't allow bash to interfere with actions like chambering or ejecting bullets
perform firearm melee from raised erect or continue with attack after character stand up from crouch
exit if there is no suitable attack
char stand up when performing firearm melee from crouch
References DayZPlayer::DepleteStamina(), DisableControls(), HumanCommandMove::ForceStance(), GetAttackTypeByDistanceToTarget(), GetAttackTypeByWeaponAttachments(), HumanCommandMove::GetCurrentMovementSpeed(), GetTargetData(), DayZPlayer::IsFighting(), m_HitType, HumanMovementState::m_iStanceIdx, m_MeleeCombat, and m_Player.
Referenced by HandleFightLogic().
protected bool HandleInitialMeleeErc | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
First attack in raised erc (light or heavy if modifier is used). Also added support for finishers.
References PlayerConstants::BROKEN_LEGS_HEAVY_MELEE_SHOCK, PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::DepleteStamina(), DetermineFinisherAnimation(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetAttackTypeFromInputs(), GetTargetData(), m_HitType, m_MeleeCombat, m_Player, and m_WasPreviousHitProcessed.
Referenced by HandleFightLogic().
protected bool HandleProneKick | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
kick from raised pne
check if player is on back (situation where the player is raised in prone and on back is not in anim graph)
References DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), HumanCommandWeapons::GetBaseAimingAngleLR(), GetTargetData(), m_HitType, m_MeleeCombat, and m_Player.
Referenced by HandleFightLogic().
protected bool HandleSprintAttack | ( | int | pCurrentCommandID, |
HumanInputController | pInputs, | ||
InventoryItem | itemInHands, | ||
HumanMovementState | pMovementState, | ||
out bool | pContinueAttack | ||
) |
sprint attack in erc stance
targetting
command
References DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetTargetData(), m_HitType, m_MeleeCombat, and m_Player.
Referenced by HandleFightLogic().
void Init | ( | DayZPlayerImplement | player | ) |
protected bool IsBehindEntity | ( | int | angle, |
DayZPlayer | source, | ||
Object | target | ||
) |
DEPRECATED - moved into DayZPlayerImplementMeleeCombat.
bool IsEvading | ( | ) |
References m_IsEvading.
bool IsInBlock | ( | ) |
References m_IsInBlock.
References vector::DistanceSq(), m_MeleeCombat, and m_Player.
Referenced by GetAttackTypeByDistanceToTarget().
protected void RegisterCooldowns | ( | ) |
References CALL_CATEGORY_SYSTEM, and m_CooldownTimers.
Referenced by Init().
protected void ResetCooldown | ( | EFightLogicCooldownCategory | cooldownCategory | ) |
References m_IsEvading.
void SetBlock | ( | bool | block | ) |
References m_IsInBlock.
Referenced by HandleFightLogic().
protected void SetCooldown | ( | float | time, |
EFightLogicCooldownCategory | cooldownCategory | ||
) |
stops currently running cooldown timer (for specific category)
param for ResetCooldown
References m_CooldownTimers.
bool WeaponDestroyedCheck | ( | InventoryItem | weapon, |
out string | ammo | ||
) |
Referenced by EvaluateHit_Common(), and EvaluateHit_NonAlignableObjects().
void ~DayZPlayerMeleeFightLogic_LightHeavy | ( | ) |
const float CLOSE_TARGET_DISTANCE = 1.5 |
Referenced by GetAttackTypeByDistanceToTarget().
const string DUMMY_HEAVY_AMMO = "Dummy_Heavy" |
Referenced by DummyHitSelector().
const string DUMMY_LIGHT_AMMO = "Dummy_Light" |
dummy ammo types
Referenced by DummyHitSelector().
enum EFightLogicCooldownCategory EVADE_COOLDOWN = 0.5 |
cooldown timers settings
Referenced by HandleFightLogic().
Referenced by RegisterCooldowns(), and SetCooldown().
protected DayZPlayerImplement m_DZPlayer |
DEPRECATED
protected EMeleeHitType m_HitType |
protected bool m_IsEvading |
Referenced by HandleFightLogic(), Init(), IsEvading(), and ResetCooldown().
protected bool m_IsFinisher |
protected bool m_IsInBlock |
Referenced by HandleFightLogic(), Init(), IsInBlock(), and SetBlock().
protected bool m_IsInComboRange |
Referenced by HandleFightLogic().
protected ref DayZPlayerImplementMeleeCombat m_MeleeCombat |
Referenced by DamageHands(), DayZPlayer::DayZPlayerImplement(), EvaluateFinisherAttack(), EvaluateHit(), EvaluateHit_Common(), EvaluateHit_NonAlignableObjects(), EvaluateHit_Player(), DayZPlayer::GetMeleeCombat(), GetTargetData(), HandleComboHit(), HandleHitEvent(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), HandleSprintAttack(), Init(), IsShortDistance(), and DayZPlayer::OnInputUserDataProcess().
protected Mission m_Mission |
Referenced by UIScriptedMenu::Init(), Init(), and UIScriptedMenu::OpenCredits().
protected PlayerBase m_Player |
protected bool m_WasPreviousHitProcessed |
Referenced by HandleComboHit(), HandleHitEvent(), HandleInitialMeleeErc(), and Init().