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() );
100 #ifdef ENABLE_LOGGING
103 Debug.InventoryHFSMLog(
"GuardCondition result: false - " + eai,
"HandGuardHasItemInEvent" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
113 void HandGuardHasWeapoonInEvent (Man p = null) { }
126 #ifdef ENABLE_LOGGING
129 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardHasWeaponInEvent",
"n/a",
"GuardCondition", e.m_Player.ToString() );
144 if (e.GetSrcEntity() ==
m_Player.GetHumanInventory().GetEntityInHands())
149 #ifdef ENABLE_LOGGING
152 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - srcItem = " + e.GetSrcEntity() +
" hnd= " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardIsSameItemInHands" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
167 if (e.GetSrcEntity())
169 if (e.GetSrcEntity() == hnd)
171 #ifdef ENABLE_LOGGING
174 Debug.InventoryHFSMLog(
"GuardCondition result: true - has same entity in hands " + hnd,
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
182 #ifdef ENABLE_LOGGING
185 Debug.InventoryHFSMLog(
"GuardCondition result: true - hands already empty",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
193 #ifdef ENABLE_LOGGING
196 Debug.InventoryHFSMLog(
"GuardCondition result: true - hands already empty and item destroyed",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
201 #ifdef ENABLE_LOGGING
204 Debug.InventoryHFSMLog(
"GuardCondition result: false - destroyed entity not in hands",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
219 if (
m_Player.GetHumanInventory().GetEntityInHands())
224 #ifdef ENABLE_LOGGING
227 Debug.InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardHasItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
242 if (e.GetDst() && e.GetDst().IsValid())
244 if ( !
GetGame().IsDedicatedServer())
247 m_Player.GetHumanInventory().ClearInventoryReservationEx(e.GetDst().GetItem(),e.GetDst());
252 #ifdef ENABLE_LOGGING
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())
270 #ifdef ENABLE_LOGGING
273 Debug.InventoryHFSMLog(
"GuardCondition result: true",
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
279 #ifdef ENABLE_LOGGING
282 Debug.InventoryHFSMLog(
"GuardCondition result: false - e.m_Dst is null",
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
297 HandEventMoveTo es = HandEventMoveTo.Cast(e);
299 bool result = e.m_IsJuncture || e.m_IsRemote;
305 #ifdef ENABLE_LOGGING
308 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanMove" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
325 bool result = e.m_IsJuncture || e.m_IsRemote;
331 #ifdef ENABLE_LOGGING
334 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
349 HandEventForceSwap es = HandEventForceSwap.Cast(e);
351 bool result = e.m_IsJuncture || e.m_IsRemote;
356 if (result ==
false && es.m_Dst2)
362 #ifdef ENABLE_LOGGING
365 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardCanForceSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
380 HandEventForceSwap es = HandEventForceSwap.Cast(e);
388 if (src1.GetParent() == dst2.GetParent())
394 #ifdef ENABLE_LOGGING
397 Debug.InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardInstantForceSwap" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
script counterpart to engine's class Inventory
static proto native bool LocationTestAddEntity(notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
const int c_InventoryReservationTimeoutShortMS
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
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 bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Abstracted event, not to be used, only inherited.
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
void HandGuardIsSameItemInHands(Man p=null)
void HandGuardInstantForceSwap(Man p=NULL)
void HandGuardCanMove(Man p=null)
void HandGuardHasRoomForItem(Man p=null)
void HandGuardCanSwap(Man p=NULL)
void HandGuardHasDestroyedItemInHands(Man p=null)
void HandGuardHasItemInEvent(Man p=null)
void HandGuardCanForceSwap(Man p=NULL)
void HandGuardHasItemInHands(Man p=null)
override bool GuardCondition(HandEventBase e)
proto native CGame GetGame()
override bool GuardCondition(WeaponEventBase e)
InventoryLocationType
types of Inventory Location