9 Man player = e.m_Player;
10 if (m_Dst && m_Dst.IsValid())
14 if (item.GetInventory().GetCurrentInventoryLocation(src))
19 player.OnItemInHandsChanged();
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)
73 e.m_Player.OnItemInHandsChanged();
81 Error(
"[hndfsm] HandForceSwappingAnimated_Show is not properly configured!");
117 ref HandAnimatedMoveToDst_W4T_Basic
m_Hide;
122 m_Start =
new HandStartHidingAnimated(player,
this,
WeaponActions.HIDE, -1);
123 m_Show =
new HandAnimatedMoveToDst_W4T(player,
this,
WeaponActions.SHOW, -1);
124 m_Hide =
new HandAnimatedMoveToDst_W4T_Basic(player,
this);
127 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
133 m_FSM.AddTransition(
new HandTransition( m_Start, _AEh_, m_Hide ));
140 m_FSM.SetInitialState(m_Start);
145 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
150 m_Start.m_ActionType = efs.m_AnimationID;
152 m_Src1 = efs.GetSrc();
154 m_Dst1 = efs.GetDst();
157 m_Show.m_ActionType = efs.m_Animation2ID;
161 m_Start.m_ActionType = efs.m_Animation2ID;
164 m_Src2 = efs.GetSrc();
166 m_Dst2 = efs.GetDst();
168 m_Show.m_ActionType = efs.m_AnimationID;
174 if (!
GetGame().IsDedicatedServer())
186 if ( !
GetGame().IsDedicatedServer())
188 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
189 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
207 if ( !
GetGame().IsDedicatedServer())
209 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
210 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
234 ref HandStartHidingAnimated
m_Start;
240 m_Start =
new HandStartHidingAnimated(player,
this,
WeaponActions.HIDE, -1);
244 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
250 m_FSM.AddTransition(
new HandTransition( m_Start, _AEh_, m_Swap ));
254 m_FSM.SetInitialState(m_Start);
259 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
264 m_Start.m_ActionType = efs.m_AnimationID;
266 m_Src1 = efs.GetSrc();
268 m_Dst1 = efs.GetDst();
271 m_Swap.m_ActionType = efs.m_Animation2ID;
275 m_Start.m_ActionType = efs.m_Animation2ID;
278 m_Src2 = efs.GetSrc();
280 m_Dst2 = efs.GetDst();
282 m_Swap.m_ActionType = efs.m_AnimationID;
290 if (!
GetGame().IsDedicatedServer())
302 if ( !
GetGame().IsDedicatedServer())
304 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
305 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
323 if ( !
GetGame().IsDedicatedServer())
325 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
326 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
InventoryLocationType
types of Inventory Location
proto native bool ClearJuncture(Man player, notnull EntityAI item)
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
script counterpart to engine's class Inventory
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
const int c_InventoryReservationTimeoutShortMS
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
Abstracted event, not to be used, only inherited.
Hand finite state machine.
simple class starting animation action specified by m_action and m_actionType
override void OnAbort(HandEventBase e)
override void OnEntry(HandEventBase e)
override void OnExit(HandEventBase e)
void HandForceSwapingAnimated_Show(Man player=null, HandStateBase parent=null, WeaponActions action=WeaponActions.NONE, int actionType=-1)
override bool IsWaitingForActionFinish()
represent hand state base
void HandAnimatedForceSwapping_Inst(Man player=null, HandStateBase parent=null)
override void OnAbort(HandEventBase e)
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
override void OnEntry(HandEventBase e)
ref InventoryLocation m_Dst
ref HandStartHidingAnimated m_Start
ref HandForceSwappingAnimated_Show m_Swap
void HandAnimatedForceSwapping(Man player=null, HandStateBase parent=null)
ref InventoryLocation m_Src2
override void OnExit(HandEventBase e)
ref InventoryLocation m_Dst1
ref InventoryLocation m_Dst2
ref HandAnimatedMoveToDst_W4T_Basic m_Hide
ref HandAnimatedMoveToDst_W4T m_Show
ref InventoryLocation m_Src1
static bool IsInventoryHFSMLogEnable()
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.