9 Man player = e.m_Player;
10 if (m_Dst && m_Dst.IsValid())
14 if (item.GetInventory().GetCurrentInventoryLocation(src))
19 player.OnItemInHandsChanged();
26 Debug.InventoryHFSMLog(
"[hndfsm] HandAnimatedMoveToDst_W4T_Basic - not allowed");
32 Error(
"[hndfsm] " +
Object.GetDebugName(e.m_Player) +
" STS = " + e.m_Player.GetSimulationTimeStamp() +
" HandAnimatedMoveToDst_W4T_Basic - item " + item +
" has no Inventory or Location, inv=" + item.GetInventory());
35 Error(
"[hndfsm] HandAnimatedMoveToDst_W4T_Basic - event has no valid m_Dst");
66 if (m_Src1 && m_Src2 && m_Dst1 && m_Dst2)
76 e.m_Player.OnItemInHandsChanged();
84 Error(
"[hndfsm] HandForceSwappingAnimated_Show is not properly configured!");
118 ref HandStartHidingAnimated m_Start;
119 ref HandAnimatedMoveToDst_W4T m_Show;
120 ref HandAnimatedMoveToDst_W4T_Basic m_Hide;
122 void HandAnimatedForceSwapping(Man player =
null,
HandStateBase parent =
null)
125 m_Start =
new HandStartHidingAnimated(player,
this,
WeaponActions.HIDE, -1);
126 m_Show =
new HandAnimatedMoveToDst_W4T(player,
this,
WeaponActions.SHOW, -1);
127 m_Hide =
new HandAnimatedMoveToDst_W4T_Basic(player,
this);
130 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
136 m_FSM.AddTransition(
new HandTransition( m_Start, _AEh_, m_Hide ));
143 m_FSM.SetInitialState(m_Start);
148 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
153 m_Start.m_ActionType = efs.m_AnimationID;
155 m_Src1 = efs.GetSrc();
157 m_Dst1 = efs.GetDst();
160 m_Show.m_ActionType = efs.m_Animation2ID;
164 m_Start.m_ActionType = efs.m_Animation2ID;
167 m_Src2 = efs.GetSrc();
169 m_Dst2 = efs.GetDst();
171 m_Show.m_ActionType = efs.m_AnimationID;
174 m_Hide.m_Dst = m_Dst1;
175 m_Show.m_Dst = m_Dst2;
177 if (!
GetGame().IsDedicatedServer())
179 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst1.GetItem(), m_Dst1,
GameInventory.c_InventoryReservationTimeoutShortMS);
180 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2,
GameInventory.c_InventoryReservationTimeoutShortMS);
189 if ( !
GetGame().IsDedicatedServer())
193 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
194 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
201 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
202 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
216 if ( !
GetGame().IsDedicatedServer())
218 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
219 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
223 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
224 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
243 ref HandStartHidingAnimated m_Start;
246 void HandAnimatedForceSwapping_Inst(Man player =
null,
HandStateBase parent =
null)
249 m_Start =
new HandStartHidingAnimated(player,
this,
WeaponActions.HIDE, -1);
253 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
259 m_FSM.AddTransition(
new HandTransition( m_Start, _AEh_, m_Swap ));
263 m_FSM.SetInitialState(m_Start);
268 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
273 m_Start.m_ActionType = efs.m_AnimationID;
275 m_Src1 = efs.GetSrc();
277 m_Dst1 = efs.GetDst();
280 m_Swap.m_ActionType = efs.m_Animation2ID;
284 m_Start.m_ActionType = efs.m_Animation2ID;
287 m_Src2 = efs.GetSrc();
289 m_Dst2 = efs.GetDst();
291 m_Swap.m_ActionType = efs.m_AnimationID;
294 m_Swap.m_Src1 = m_Src1;
295 m_Swap.m_Dst1 = m_Dst1;
296 m_Swap.m_Src2 = m_Src2;
297 m_Swap.m_Dst2 = m_Dst2;
299 if (!
GetGame().IsDedicatedServer())
301 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst1.GetItem(), m_Dst1,
GameInventory.c_InventoryReservationTimeoutShortMS);
302 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2,
GameInventory.c_InventoryReservationTimeoutShortMS);
311 if ( !
GetGame().IsDedicatedServer())
315 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
319 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
326 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
330 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
344 if ( !
GetGame().IsDedicatedServer())
346 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
347 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
351 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
352 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());