6 SetThrowingModeEnabled(
false);
13 if ( !pEntityInHands && !m_bThrowingAnimationPlaying )
15 if ( m_bThrowingModeEnabled )
17 SetThrowingModeEnabled(
false);
18 pHcw.SetThrowingMode(
false);
25 SetThrowingModeEnabled(pHcw.IsThrowingMode());
28 if ( pHic.IsThrowingModeChange() && CanChangeThrowingStance(pHic) )
32 pHcw.SetActionProgressParams(0, 0);
33 pHcw.SetThrowingMode(!m_bThrowingModeEnabled);
37 if ( m_bThrowingModeEnabled )
41 if ( !CanContinueThrowingEx(pHic, pEntityInHands) )
43 SetThrowingModeEnabled(
false);
46 pHcw.SetActionProgressParams(0, 0);
47 pHcw.SetThrowingMode(
false);
53 if ( pHcw.WasItemLeaveHandsEvent() )
55 float lr = pHcw.GetBaseAimingAngleLR();
56 float ud = pHcw.GetBaseAimingAngleUD();
57 vector aimOrientation = m_Player.GetOrientation();
58 aimOrientation[0] = aimOrientation[0] + lr;
61 aimOrientation[1] = aimOrientation[1] + ud + 5;
64 m_Player.GetHumanInventory().ThrowEntity(pEntityInHands, aimOrientation.AnglesToVector(), c_fThrowingForceMin + m_fThrowingForce01 * (c_fThrowingForceMax - c_fThrowingForceMin));
69 if ( !m_bThrowingAnimationPlaying )
71 if ( pHic.IsAttackButton() )
73 if ( !m_bThrowingInProgress )
74 m_bThrowingInProgress =
true;
76 m_fThrowingForce01 += pDt * c_fThrowingForceCoef;
77 if ( m_fThrowingForce01 > 1.0 )
78 m_fThrowingForce01 = 1.0;
80 pHcw.SetActionProgressParams(m_fThrowingForce01, 0);
85 bool standingFromBack = hcm && hcm.IsStandingFromBack();
87 if ( m_bThrowingInProgress && !standingFromBack)
89 m_bThrowingInProgress =
false;
94 itemCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
97 switch ( itemCfg.m_iType )
99 case ItemBehaviorType.TWOHANDED:
100 case ItemBehaviorType.POLEARMS:
103 case ItemBehaviorType.FIREARMS:
108 pHcw.ThrowItem(throwType);
109 m_bThrowingAnimationPlaying =
true;
122 m_fThrowingForce01 = 0;
123 m_bThrowingInProgress =
false;
124 m_bThrowingAnimationPlaying =
false;
127 void SetThrowingModeEnabled(
bool enable)
129 if (enable != m_bThrowingModeEnabled)
131 m_Player.OnThrowingModeChange(enable);
133 m_bThrowingModeEnabled = enable;
136 bool IsThrowingModeEnabled()
138 return m_bThrowingModeEnabled;
142 bool IsThrowingInProgress()
144 return m_bThrowingInProgress;
148 bool IsThrowingAnimationPlaying()
150 return m_bThrowingAnimationPlaying;
156 if( pHic.IsStanceChange() )
160 if( pHic.IsWeaponRaised() )
165 if( itemCfg && itemCfg.m_iType == ItemBehaviorType.HEAVY )
176 if( playerPB.GetEmoteManager().IsEmotePlaying() )
179 if( playerPB.GetActionManager().GetRunningAction() != NULL )
182 if( playerPB.IsRestrained() || playerPB.IsItemsToDelete())
185 if( playerPB.GetDayZPlayerInventory().IsProcessing() )
188 if( playerPB.GetWeaponManager().IsRunning() )
192 if (!CheckFreeSpace() )
202 UAInterface input_interface = m_Player.GetInputInterface();
203 if(input_interface && input_interface.SyncedPress(
"UAGear"))
207 if( boo || pHic.IsWeaponRaised() || (itemInHandsCfg && itemInHandsCfg.m_iType == ItemBehaviorType.HEAVY) )
212 if (!CheckFreeSpace() )
220 if ( pEntityInHands ==
null )
223 return CanContinueThrowing(pHic);
226 bool CheckFreeSpace()
228 return m_Player.CheckFreeSpace(
vector.Forward, 0.7,
false);
232 private bool m_bThrowingModeEnabled;
233 private bool m_bThrowingInProgress;
234 private bool m_bThrowingAnimationPlaying;
235 private float m_fThrowingForce01;
237 private const float c_fThrowingForceMin = 20.0;
238 private const float c_fThrowingForceMax = 90.0;
239 private const float c_fThrowingForceCoef = 1.0;