27 bool result = m_arg0.GuardCondition(e) && m_arg1.GuardCondition(e);
32 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - " + m_arg0.Type() +
" && " + m_arg1.Type(),
"HandGuardAnd" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
44 void HandGuardNot(
HandGuardBase arg0 =
null) { m_arg0 = arg0; }
48 bool result = !m_arg0.GuardCondition(e);
53 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - " + m_arg0.Type(),
"HandGuardNot" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
69 bool result = m_arg0.GuardCondition(e) || m_arg1.GuardCondition(e);
74 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - " + m_arg0.Type() +
" || " + m_arg1.Type(),
"HandGuardOr" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
94 Debug.InventoryHFSMLog(
"GuardCondition result: true - " + eai,
"HandGuardHasItemInEvent" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
103 Debug.InventoryHFSMLog(
"GuardCondition result: false - " + eai,
"HandGuardHasItemInEvent" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
113 void HandGuardHasWeapoonInEvent (Man p =
null) { }
129 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardHasWeaponInEvent",
"n/a",
"GuardCondition", e.m_Player.ToString() );
139 void HandGuardIsSameItemInHands(Man p =
null) {
m_Player = p; }
144 if (e.GetSrcEntity() ==
m_Player.GetHumanInventory().GetEntityInHands())
152 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - srcItem = " + e.GetSrcEntity() +
" hnd= " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardIsSameItemInHands" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
162 void HandGuardHasDestroyedItemInHands(Man p =
null) {
m_Player = p; }
167 if (e.GetSrcEntity())
169 if (e.GetSrcEntity() == hnd)
174 Debug.InventoryHFSMLog(
"GuardCondition result: true - has same entity in hands " + hnd,
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
185 Debug.InventoryHFSMLog(
"GuardCondition result: true - hands already empty",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
196 Debug.InventoryHFSMLog(
"GuardCondition result: true - hands already empty and item destroyed",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
204 Debug.InventoryHFSMLog(
"GuardCondition result: false - destroyed entity not in hands",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
214 void HandGuardHasItemInHands(Man p =
null) {
m_Player = p; }
219 if (
m_Player.GetHumanInventory().GetEntityInHands())
227 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardHasItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
238 void HandGuardHasRoomForItem(Man p =
null) {
m_Player = p; }
242 if (e.GetDst() && e.GetDst().IsValid())
244 if ( !
GetGame().IsDedicatedServer())
247 m_Player.GetHumanInventory().ClearInventoryReservationEx(e.GetDst().GetItem(),e.GetDst());
250 if (!
GameInventory.LocationTestAddEntity(e.GetDst(),
false,
true,
true,
true,
true,
false))
255 Debug.InventoryHFSMLog(
"GuardCondition result: false - no room at dst=" +
InventoryLocation.DumpToStringNullSafe(e.GetDst()),
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
264 if ( !
GetGame().IsDedicatedServer())
267 m_Player.GetHumanInventory().AddInventoryReservationEx(e.GetDst().GetItem(), e.GetDst(),
GameInventory.c_InventoryReservationTimeoutShortMS);
273 Debug.InventoryHFSMLog(
"GuardCondition result: true",
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
282 Debug.InventoryHFSMLog(
"GuardCondition result: false - e.m_Dst is null",
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
293 void HandGuardCanMove(Man p =
null) {
m_Player = p; }
297 HandEventMoveTo es = HandEventMoveTo.Cast(e);
299 bool result = e.m_IsJuncture || e.m_IsRemote;
302 result =
GameInventory.LocationCanMoveEntity(es.GetSrc(), es.GetDst());
308 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanMove" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
319 void HandGuardCanSwap(Man p = NULL) {
m_Player = p; }
325 bool result = e.m_IsJuncture || e.m_IsRemote;
328 result =
GameInventory.CanSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Src2.GetItem());
334 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
345 void HandGuardCanForceSwap(Man p = NULL) {
m_Player = p; }
349 HandEventForceSwap es = HandEventForceSwap.Cast(e);
351 bool result = e.m_IsJuncture || e.m_IsRemote;
354 result =
GameInventory.CanSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Src2.GetItem());
356 if (result ==
false && es.m_Dst2)
358 result =
GameInventory.CanForceSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Dst, es.m_Src2.GetItem(), es.m_Dst2);
365 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanForceSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
376 void HandGuardInstantForceSwap(Man p = NULL) {
m_Player = p; }
380 HandEventForceSwap es = HandEventForceSwap.Cast(e);
388 if (src1.GetParent() == dst2.GetParent())
397 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardInstantForceSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );