22 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionCreated", e.m_Player.ToString() );
26 e.m_Player.OnItemInHandsChanged();
35 if ( LogManager.IsInventoryHFSMLogEnable() )
37 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionTake", e.m_Player.ToString() );
41 GameInventory.LocationSyncMoveEntity(e.GetSrc(), e.GetDst());
42 e.m_Player.OnItemInHandsChanged();
51 if ( LogManager.IsInventoryHFSMLogEnable() )
53 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionDrop", e.m_Player.ToString() );
57 GameInventory.LocationSyncMoveEntity(e.GetSrc(), e.GetDst());
58 e.m_Player.OnItemInHandsChanged();
67 if ( LogManager.IsInventoryHFSMLogEnable() )
69 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionThrow", e.m_Player.ToString() );
72 HandEventThrow throwEvent = HandEventThrow.Cast(e);
74 GameInventory.LocationSyncMoveEntity(e.GetSrc(), e.GetDst());
76 DayZPlayer player = DayZPlayer.Cast(e.m_Player);
79 InventoryItem item = InventoryItem.Cast(e.GetSrcEntity());
81 item.ThrowPhysically(player, throwEvent.GetForce());
83 Error(
"[hndfsm] HandActionThrow - src entity null!");
95 if ( LogManager.IsInventoryHFSMLogEnable() )
97 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionMoveTo", e.m_Player.ToString() );
101 HandEventMoveTo es = HandEventMoveTo.Cast(e);
104 GameInventory.LocationSyncMoveEntity(e.GetSrc(), es.m_Dst);
105 e.m_Player.OnItemInHandsChanged();
108 Error(
"[hndfsm] HandActionMoveTo - this is no HandEventMoveTo");
116 if (e.m_Player.GetEntityInHands() != e.GetSrcEntity())
118 #ifdef ENABLE_LOGGING
119 if (LogManager.IsInventoryHFSMLogEnable())
121 Error(
"[hndfsm] HandActionDestroy - item is not in player hands");
128 #ifdef ENABLE_LOGGING
129 if ( LogManager.IsInventoryHFSMLogEnable() )
131 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionDestroy", e.m_Player.ToString() );
135 g_Game.ObjectDelete(e.GetSrcEntity());
136 e.m_Player.OnItemInHandsChanged();
144 #ifdef ENABLE_LOGGING
145 if ( LogManager.IsInventoryHFSMLogEnable() )
147 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionDestroyed", e.m_Player.ToString() );
150 e.m_Player.OnItemInHandsChanged();
158 #ifdef ENABLE_LOGGING
159 if ( LogManager.IsInventoryHFSMLogEnable() )
161 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionDestroyAndReplaceWithNew", e.m_Player.ToString() );
164 Man player = e.m_Player;
165 EntityAI itemInHands = player.GetEntityInHands();
167 InventoryLocation src =
new InventoryLocation;
168 if (itemInHands.GetInventory().GetCurrentInventoryLocation(src))
170 HandEventDestroyAndReplaceWithNew edr = HandEventDestroyAndReplaceWithNew.Cast(e);
173 edr.m_Lambda.Execute();
177 Error(
"[hndfsm] HandActionDestroyAndReplaceWithNew - not a HandEventDestroyAndReplaceWithNew event");
180 Error(
"[hndfsm] HandActionDestroyAndReplaceWithNew - itemInHands has no InventoryLocation");
196 #ifdef ENABLE_LOGGING
199 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionReplaced", e.m_Player.ToString() );
202 Man player = e.m_Player;
204 player.OnItemInHandsChanged();
212 #ifdef ENABLE_LOGGING
213 if ( LogManager.IsInventoryHFSMLogEnable() )
215 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionSwap", e.m_Player.ToString() );
218 HandEventSwap es = HandEventSwap.Cast(e);
221 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
222 e.m_Player.OnItemInHandsChanged();
225 Error(
"[hndfsm] HandActionSwap - this is no HandEventSwap");
233 #ifdef ENABLE_LOGGING
234 if ( LogManager.IsInventoryHFSMLogEnable() )
236 Debug.InventoryHFSMLog(
"Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() ,
"n/a",
"HandActionForceSwap", e.m_Player.ToString() );
239 HandEventForceSwap es = HandEventForceSwap.Cast(e);
242 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
243 e.m_Player.OnItemInHandsChanged();
246 Error(
"[hndfsm] HandActionForceSwap - this is no HandEventForceSwap");
override void OnItemInHandsChanged()
Abstracted event, not to be used, only inherited.
DayZPlayerInstanceType
defined in C++
void Error(string err)
Messagebox with error message.
void HandEventBase(Man p=null, InventoryLocation src=null)