10 if (m_Dst && m_Dst.IsValid())
14 if (
item.GetInventory().GetCurrentInventoryLocation(
src))
19 player.OnItemInHandsChanged();
30 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());
33 Error(
"[hndfsm] HandAnimatedMoveToDst_W4T_Basic - event has no valid m_Dst");
64 if (m_Src1 && m_Src2 && m_Dst1 && m_Dst2)
74 e.m_Player.OnItemInHandsChanged();
82 Error(
"[hndfsm] HandForceSwappingAnimated_Show is not properly configured!");
141 m_FSM.SetInitialState(m_Start);
146 HandEventForceSwap
efs = HandEventForceSwap.Cast(
e);
151 m_Start.m_ActionType =
efs.m_AnimationID;
153 m_Src1 =
efs.GetSrc();
155 m_Dst1 =
efs.GetDst();
158 m_Show.m_ActionType =
efs.m_Animation2ID;
162 m_Start.m_ActionType =
efs.m_Animation2ID;
165 m_Src2 =
efs.GetSrc();
167 m_Dst2 =
efs.GetDst();
169 m_Show.m_ActionType =
efs.m_AnimationID;
175 if (!
GetGame().IsDedicatedServer())
187 if (!
GetGame().IsDedicatedServer())
191 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
192 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
199 GetGame().ClearJuncture(
e.m_Player, m_Dst1.GetItem());
200 GetGame().ClearJuncture(
e.m_Player, m_Dst2.GetItem());
214 if (!
GetGame().IsDedicatedServer())
216 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
217 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
221 GetGame().ClearJuncture(
e.m_Player, m_Dst1.GetItem());
222 GetGame().ClearJuncture(
e.m_Player, m_Dst2.GetItem());
261 m_FSM.SetInitialState(m_Start);
266 HandEventForceSwap
efs = HandEventForceSwap.Cast(
e);
271 m_Start.m_ActionType =
efs.m_AnimationID;
273 m_Src1 =
efs.GetSrc();
275 m_Dst1 =
efs.GetDst();
278 m_Swap.m_ActionType =
efs.m_Animation2ID;
282 m_Start.m_ActionType =
efs.m_Animation2ID;
285 m_Src2 =
efs.GetSrc();
287 m_Dst2 =
efs.GetDst();
289 m_Swap.m_ActionType =
efs.m_AnimationID;
297 if (!
GetGame().IsDedicatedServer())
309 if (!
GetGame().IsDedicatedServer())
312 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
314 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
319 GetGame().ClearJuncture(
e.m_Player, m_Dst1.GetItem());
321 GetGame().ClearJuncture(
e.m_Player, m_Dst2.GetItem());
334 if (!
GetGame().IsDedicatedServer())
336 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
337 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
341 GetGame().ClearJuncture(
e.m_Player, m_Dst1.GetItem());
342 GetGame().ClearJuncture(
e.m_Player, m_Dst2.GetItem());
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
InventoryLocationType
types of Inventory Location
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
const int c_InventoryReservationTimeoutShortMS
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
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...
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...
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 bool IsWaitingForActionFinish()
void HandForceSwapingAnimated_Show(Man player=null, HandStateBase parent=null, WeaponActions action=WeaponActions.NONE, int actionType=-1)
override void OnAbort(HandEventBase e)
override void OnEntry(HandEventBase e)
override void OnExit(HandEventBase e)
represent hand state base
override void OnExit(HandEventBase e)
ref InventoryLocation m_Dst
override void OnEntry(HandEventBase e)
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
ref InventoryLocation m_Dst1
ref InventoryLocation m_Src1
void HandAnimatedForceSwapping_Inst(Man player=null, HandStateBase parent=null)
ref HandAnimatedMoveToDst_W4T_Basic m_Hide
ref HandForceSwappingAnimated_Show m_Swap
ref HandAnimatedMoveToDst_W4T m_Show
override void OnAbort(HandEventBase e)
ref HandStartHidingAnimated m_Start
ref InventoryLocation m_Dst2
void HandAnimatedForceSwapping(Man player=null, HandStateBase parent=null)
ref InventoryLocation m_Src2
static bool IsInventoryHFSMLogEnable()
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.