7 if ( (dst && dst.GetParent() && !dst.GetParent().GetHierarchyRootPlayer()) || (src && src.GetParent() && !src.GetParent().GetHierarchyRootPlayer()) )
26 if ( invloc1.
GetItem() && invloc1.
GetItem().GetInventoryHandAnimation(invloc1,val) )
42 else if (invloc1.
GetItem() && invloc1.
GetItem().IsOneHandedBehaviour())
54 else if (invloc1.
GetItem() && invloc1.
GetItem().IsOneHandedBehaviour())
65 owner = parent_item.GetHierarchyRootPlayer();
70 EntityAI item2 = parent_item.GetHierarchyParent();
71 if (owner && item1 == item2)
105 else if (invloc1.
GetItem() && invloc1.
GetItem().IsOneHandedBehaviour())
119 if (player.IsInTransport())
124 if (src.GetItem().GetHierarchyRootPlayer() == player)
129 hndDebugPrint(
"[hndfsm] SelectAnimationOfTakeToHands - selected animType=" + animType +
" for item=" + src.GetItem());
133 hndDebugPrint(
"[hndfsm] SelectAnimationOfTakeToHands - no animation");
139 if (player.IsInTransport())
142 if (src.GetItem().GetHierarchyRootPlayer() == player)
147 hndDebugPrint(
"[hndfsm] SelectAnimationOfMoveFromHands guard - selected animType=" + animType +
" for item=" + src.GetItem());
151 hndDebugPrint(
"[hndfsm] SelectAnimationOfMoveFromHands - no animation");
157 if (player.IsInTransport())
162 if (old_src.GetItem().GetHierarchyRootPlayer() == player || new_src.GetItem().GetHierarchyRootPlayer() == player)
168 if (animType1 != -1 && animType2 != -1)
170 hndDebugPrint(
"[hndfsm] SelectAnimationOfForceSwapInHands guard - selected animType1=" + animType1 +
" animType2=" + animType2 +
" for old_item=" + old_src.GetItem() +
" for new_item=" + new_src.GetItem());
180 hndDebugPrint(
"[hndfsm] SelectAnimationOfForceSwapInHands - no animation");
185class HandSelectAnimationOfTakeToHandsEvent
extends HandGuardBase
194 e.m_AnimationID = animType;
201class HandSelectAnimationOfMoveFromHandsEvent
extends HandGuardBase
216 if (eai.GetInventory().GetCurrentInventoryLocation(src))
220 hndDebugPrint(
"[hndfsm] HandSelectAnimationOfMoveFromHandsEvent - rejected");
227 e.m_AnimationID = animType;
248 Error(
"HandSelectAnimationOfForceSwapInHandsEvent - not an swap event");
254 HandEventForceSwap es = HandEventForceSwap.Cast(e);
259 if ( !es.m_Src2.IsValid() || !es.m_Src.IsValid() )
261 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - invalid item source");
284 if (ProcessSwapEvent(e, animType1, animType2))
286 e.m_AnimationID = animType1;
292 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - m_HasRoomGuard.GuardCondition failed");
295 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - not a swap event");
309 if (ProcessSwapEvent(e, animType1, animType2))
311 e.m_AnimationID = animType1;
312 es.m_Animation2ID = animType2;
317 Error(
"[hndfsm] HandSelectAnimationOfSwapInHandsEvent - not a swap event");
bool SelectAnimationOfMoveFromHands(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst, out int animType)
int SlotToAnimType(notnull Man player, notnull InventoryLocation src, InventoryLocation dst=null)
bool SelectAnimationOfTakeToHands(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst, out int animType)
bool SelectAnimationOfForceSwapInHands(notnull Man player, notnull InventoryLocation old_src, notnull InventoryLocation new_src, notnull InventoryLocation old_dst, notnull InventoryLocation new_dst, out int animType1, out int animType2)
void hndDebugPrint(string s)
InventoryLocationType
types of Inventory Location
script counterpart to engine's class Inventory
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
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...
Abstracted event, not to be used, only inherited.
int m_Animation2ID
destination for old item that was in hands
override string DumpToString()
override InventoryLocation GetDst()
override bool GuardCondition(HandEventBase e)
void HandSelectAnimationOfMoveFromHandsEvent(Man p=null)
void HandSelectAnimationOfTakeToHandsEvent(Man p=null)
void HandSelectAnimationOfForceSwapInHandsEvent(Man p=NULL)
bool ProcessSwapEvent(notnull HandEventBase e, out int animType1, out int animType2)
override bool GuardCondition(HandEventBase e)
proto native int GetType()
returns type of InventoryLocation
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native EntityAI GetItem()
returns item of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
static string DumpToStringNullSafe(InventoryLocation loc)
provides access to slot configuration
void Error(string err)
Messagebox with error message.