Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс DayZPlayerImplementThrowing

Закрытые члены

void DayZPlayerImplementThrowing (DayZPlayer pPlayer)
 
void HandleThrowing (HumanInputController pHic, HumanCommandWeapons pHcw, EntityAI pEntityInHands, float pDt)
 
void ResetState ()
 
void SetThrowingModeEnabled (bool enable)
 
bool IsThrowingModeEnabled ()
 
bool IsThrowingInProgress ()
 Throwing wind-up only (button hold)
 
bool IsThrowingAnimationPlaying ()
 Throwing animation after button release.
 
bool CanChangeThrowingStance (HumanInputController pHic)
 
bool CanContinueThrowing (HumanInputController pHic)
 
bool CanContinueThrowingEx (HumanInputController pHic, EntityAI pEntityInHands)
 
bool CheckFreeSpace ()
 

Закрытые данные

DayZPlayer m_Player
 
bool m_bThrowingModeEnabled
 
bool m_bThrowingInProgress
 
bool m_bThrowingAnimationPlaying
 
float m_fThrowingForce01
 
const float c_fThrowingForceMin = 20.0
 
const float c_fThrowingForceMax = 90.0
 
const float c_fThrowingForceCoef = 1.0
 

Подробное описание

Конструктор(ы)

◆ DayZPlayerImplementThrowing()

void DayZPlayerImplementThrowing ( DayZPlayer pPlayer)
inlineprivate
4 {
7
9 }
DayZPlayer m_Player
Definition DayZPlayerImplementThrowing.c:231
void SetThrowingModeEnabled(bool enable)
Definition DayZPlayerImplementThrowing.c:127
void ResetState()
Definition DayZPlayerImplementThrowing.c:120
Definition EntityAI.c:95

Перекрестные ссылки m_Player, ResetState() и SetThrowingModeEnabled().

Методы

◆ CanChangeThrowingStance()

bool CanChangeThrowingStance ( HumanInputController pHic)
inlineprivate
154 {
155 // basic stance has priority
156 if( pHic.IsStanceChange() )
157 return false;
158
159 // don't change mode in raise
160 if( pHic.IsWeaponRaised() )
161 return false;
162
163 // check if it's not a heavy item
164 HumanItemBehaviorCfg itemCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
165 if( itemCfg && itemCfg.m_iType == ItemBehaviorType.HEAVY )
166 return false;
167
168/* HumanMovementState movementState = new HumanMovementState();
169 m_Player.GetMovementState(movementState);
170 if( movementState.IsInProne() )
171 return false;*/
172
174 if( playerPB )
175 {
176 if( playerPB.GetEmoteManager().IsEmotePlaying() )
177 return false;
178
179 if( playerPB.GetActionManager().GetRunningAction() != NULL )
180 return false;
181
182 if( playerPB.IsRestrained() || playerPB.IsItemsToDelete())
183 return false;
184
185 if( playerPB.GetDayZPlayerInventory().IsProcessing() )
186 return false;
187
188 if( playerPB.GetWeaponManager().IsRunning() )
189 return false;
190 }
191
192 if (!CheckFreeSpace() )
193 return false;
194
195 return true;
196 }
bool CheckFreeSpace()
Definition DayZPlayerImplementThrowing.c:226
Definition humanitems.c:6
Definition PlayerBaseClient.c:2

Перекрестные ссылки CheckFreeSpace() и m_Player.

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

◆ CanContinueThrowing()

bool CanContinueThrowing ( HumanInputController pHic)
inlineprivate
199 {
200 HumanItemBehaviorCfg itemInHandsCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
201 bool boo = false;
202 UAInterface input_interface = m_Player.GetInputInterface();
203 if(input_interface && input_interface.SyncedPress("UAGear"))
204 {
205 boo = true;
206 }
207 if( boo || pHic.IsWeaponRaised() || (itemInHandsCfg && itemInHandsCfg.m_iType == ItemBehaviorType.HEAVY) )
208 {
209 return false;
210 }
211
212 if (!CheckFreeSpace() )
213 return false;
214
215 return true;
216 }
Definition UAInput.c:96

Перекрестные ссылки CheckFreeSpace() и m_Player.

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

◆ CanContinueThrowingEx()

bool CanContinueThrowingEx ( HumanInputController pHic,
EntityAI pEntityInHands )
inlineprivate
219 {
220 if ( pEntityInHands == null )
221 return false;
222
224 }
bool CanContinueThrowing(HumanInputController pHic)
Definition DayZPlayerImplementThrowing.c:198

Перекрестные ссылки CanContinueThrowing().

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

◆ CheckFreeSpace()

bool CheckFreeSpace ( )
inlineprivate
227 {
228 return m_Player.CheckFreeSpace(vector.Forward, 0.7, false);
229 }
Definition EnConvert.c:106
static const vector Forward
Definition EnConvert.c:109

Перекрестные ссылки vector::Forward и m_Player.

Используется в CanChangeThrowingStance() и CanContinueThrowing().

◆ HandleThrowing()

void HandleThrowing ( HumanInputController pHic,
HumanCommandWeapons pHcw,
EntityAI pEntityInHands,
float pDt )
inlineprivate

current state

handle mode change

handle action

cancel throwing in case of raising hands or heavy item in hands

check event for throw

handle throw force

12 {
14 {
16 {
18 pHcw.SetThrowingMode(false);
19 }
20
21 return;
22 }
23
25 SetThrowingModeEnabled(pHcw.IsThrowingMode());
26
28 if ( pHic.IsThrowingModeChange() && CanChangeThrowingStance(pHic) )
29 {
30 ResetState();
31
32 pHcw.SetActionProgressParams(0, 0);
33 pHcw.SetThrowingMode(!m_bThrowingModeEnabled);
34 }
35
38 {
40
42 {
44 ResetState();
45
46 pHcw.SetActionProgressParams(0, 0);
47 pHcw.SetThrowingMode(false);
48
49 return;
50 }
51
53 if ( pHcw.WasItemLeaveHandsEvent() )
54 {
55 float lr = pHcw.GetBaseAimingAngleLR();
56 float ud = pHcw.GetBaseAimingAngleUD();
57 vector aimOrientation = m_Player.GetOrientation();
59
60 //add 5 deg
61 aimOrientation[1] = aimOrientation[1] + ud + 5;
62
63
65 return;
66 }
67
70 {
71 if ( pHic.IsAttackButton() )
72 {
75
77 if ( m_fThrowingForce01 > 1.0 )
79
80 pHcw.SetActionProgressParams(m_fThrowingForce01, 0);
81 }
82 else
83 {
84 HumanCommandMove hcm = m_Player.GetCommand_Move();
85 bool standingFromBack = hcm && hcm.IsStandingFromBack();
86
88 {
90
91 int throwType = 1;
92
93 HumanItemBehaviorCfg itemCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
94 itemCfg = m_Player.GetItemAccessor().GetItemInHandsBehaviourCfg();
95 if ( itemCfg )
96 {
97 switch ( itemCfg.m_iType )
98 {
99 case ItemBehaviorType.TWOHANDED:
100 case ItemBehaviorType.POLEARMS:
101 throwType = 2;
102 break;
103 case ItemBehaviorType.FIREARMS:
104 throwType = 3;
105 }
106 }
107
108 pHcw.ThrowItem(throwType);
110 }
111 }
112 }
113 }
114 else
115 {
116 ResetState();
117 }
118 }
const float c_fThrowingForceMin
Definition DayZPlayerImplementThrowing.c:237
const float c_fThrowingForceCoef
Definition DayZPlayerImplementThrowing.c:239
float m_fThrowingForce01
Definition DayZPlayerImplementThrowing.c:235
bool m_bThrowingInProgress
Definition DayZPlayerImplementThrowing.c:233
bool m_bThrowingModeEnabled
Definition DayZPlayerImplementThrowing.c:232
bool m_bThrowingAnimationPlaying
Definition DayZPlayerImplementThrowing.c:234
bool CanChangeThrowingStance(HumanInputController pHic)
Definition DayZPlayerImplementThrowing.c:153
bool CanContinueThrowingEx(HumanInputController pHic, EntityAI pEntityInHands)
Definition DayZPlayerImplementThrowing.c:218
const float c_fThrowingForceMax
Definition DayZPlayerImplementThrowing.c:238
Definition human.c:434

Перекрестные ссылки c_fThrowingForceCoef, c_fThrowingForceMax, c_fThrowingForceMin, CanChangeThrowingStance(), CanContinueThrowingEx(), m_bThrowingAnimationPlaying, m_bThrowingInProgress, m_bThrowingModeEnabled, m_fThrowingForce01, m_Player, ResetState() и SetThrowingModeEnabled().

◆ IsThrowingAnimationPlaying()

bool IsThrowingAnimationPlaying ( )
inlineprivate

Throwing animation after button release.

149 {
151 }

Перекрестные ссылки m_bThrowingAnimationPlaying.

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

◆ IsThrowingInProgress()

bool IsThrowingInProgress ( )
inlineprivate

Throwing wind-up only (button hold)

143 {
145 }

Перекрестные ссылки m_bThrowingInProgress.

◆ IsThrowingModeEnabled()

bool IsThrowingModeEnabled ( )
inlineprivate
137 {
139 }

Перекрестные ссылки m_bThrowingModeEnabled.

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

◆ ResetState()

void ResetState ( )
inlineprivate
121 {
123 m_bThrowingInProgress = false;
125 }

Перекрестные ссылки m_bThrowingAnimationPlaying, m_bThrowingInProgress и m_fThrowingForce01.

Используется в DayZPlayerImplementThrowing() и HandleThrowing().

◆ SetThrowingModeEnabled()

void SetThrowingModeEnabled ( bool enable)
inlineprivate
128 {
130 {
131 m_Player.OnThrowingModeChange(enable);
132 }
134 }

Перекрестные ссылки m_bThrowingModeEnabled и m_Player.

Используется в DayZPlayerImplementThrowing() и HandleThrowing().

Поля

◆ c_fThrowingForceCoef

const float c_fThrowingForceCoef = 1.0
private

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

◆ c_fThrowingForceMax

const float c_fThrowingForceMax = 90.0
private

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

◆ c_fThrowingForceMin

const float c_fThrowingForceMin = 20.0
private

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

◆ m_bThrowingAnimationPlaying

bool m_bThrowingAnimationPlaying
private

◆ m_bThrowingInProgress

bool m_bThrowingInProgress
private

Используется в HandleThrowing(), IsThrowingInProgress() и ResetState().

◆ m_bThrowingModeEnabled

bool m_bThrowingModeEnabled
private

◆ m_fThrowingForce01

float m_fThrowingForce01
private

Используется в HandleThrowing() и ResetState().

◆ m_Player


Объявления и описания членов класса находятся в файле: