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;
65 pEntityInHands.GetInventory().GetCurrentInventoryLocation(loc);
66 m_Player.GetInventory().ClearInventoryReservationEx(pEntityInHands, loc);
68 m_Player.GetHumanInventory().ThrowEntity(pEntityInHands, aimOrientation.AnglesToVector(), c_fThrowingForceMin + m_fThrowingForce01 * (c_fThrowingForceMax - c_fThrowingForceMin));
73 if ( !m_bThrowingAnimationPlaying )
75 if ( pHic.IsAttackButton() )
77 if ( !m_bThrowingInProgress )
78 m_bThrowingInProgress =
true;
80 m_fThrowingForce01 += pDt * c_fThrowingForceCoef;
81 if ( m_fThrowingForce01 > 1.0 )
82 m_fThrowingForce01 = 1.0;
84 pHcw.SetActionProgressParams(m_fThrowingForce01, 0);
88 HumanCommandMove hcm = m_Player.GetCommand_Move();
89 bool standingFromBack = hcm && hcm.IsStandingFromBack();
91 if ( m_bThrowingInProgress && !standingFromBack)
93 m_bThrowingInProgress =
false;
98 itemCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
101 switch ( itemCfg.m_iType )
103 case ItemBehaviorType.TWOHANDED:
104 case ItemBehaviorType.POLEARMS:
107 case ItemBehaviorType.FIREARMS:
112 pHcw.ThrowItem(throwType);
113 m_bThrowingAnimationPlaying =
true;
126 m_fThrowingForce01 = 0;
127 m_bThrowingInProgress =
false;
128 m_bThrowingAnimationPlaying =
false;
131 void SetThrowingModeEnabled(
bool enable)
133 if (enable != m_bThrowingModeEnabled)
135 m_Player.OnThrowingModeChange(enable);
137 m_bThrowingModeEnabled = enable;
140 bool IsThrowingModeEnabled()
142 return m_bThrowingModeEnabled;
146 bool IsThrowingInProgress()
148 return m_bThrowingInProgress;
152 bool IsThrowingAnimationPlaying()
154 return m_bThrowingAnimationPlaying;
160 if( pHic.IsStanceChange() )
164 if( pHic.IsWeaponRaised() )
169 if( itemCfg && itemCfg.m_iType == ItemBehaviorType.HEAVY )
180 if( playerPB.GetEmoteManager().IsEmotePlaying() )
183 if( playerPB.GetActionManager().GetRunningAction() != NULL )
186 if( playerPB.IsRestrained() || playerPB.IsItemsToDelete())
189 if( playerPB.GetDayZPlayerInventory().IsProcessing() )
192 if( playerPB.GetWeaponManager().IsRunning() )
196 if (!CheckFreeSpace() )
206 UAInterface input_interface = m_Player.GetInputInterface();
207 if(input_interface && input_interface.SyncedPress(
"UAGear"))
211 if( boo || pHic.IsWeaponRaised() || (itemInHandsCfg && itemInHandsCfg.m_iType == ItemBehaviorType.HEAVY) )
216 if (!CheckFreeSpace() )
224 if ( pEntityInHands == null )
227 return CanContinueThrowing(pHic);
230 bool CheckFreeSpace()
232 return m_Player.CheckFreeSpace(
vector.Forward, 0.7,
false);
236 private bool m_bThrowingModeEnabled;
237 private bool m_bThrowingInProgress;
238 private bool m_bThrowingAnimationPlaying;
239 private float m_fThrowingForce01;
241 private const float c_fThrowingForceMin = 20.0;
242 private const float c_fThrowingForceMax = 90.0;
243 private const float c_fThrowingForceCoef = 1.0;