30 if ( player && target_entity )
33 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
35 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
37 for(
int i = 0; i < selections.Count(); i++ )
40 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
42 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
44 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
45 return target_slot_id;
56 if (!
GetGame().IsDedicatedServer() )
61 if ( super.SetupAction( player, target, item, action_data, extra_data))
63 if (!
GetGame().IsDedicatedServer())
80 if (
GetGame().IsMultiplayer() &&
GetGame().IsServer() )
return true;
92 return target_entity.GetInventory().FindAttachment(target_slot_id);
99 if (
GetGame().IsDedicatedServer())
113 EntityAI target_entity =
EntityAI.Cast( action_data_a.m_Target.GetObject() );
119 float stackable = attachment.GetTargetQuantityMax();
120 if( stackable == 0 || stackable >= attachment.GetQuantity() )
123 action_data.m_Player.PredictiveTakeEntityToHands( attachment );
125 else if( stackable != 0 && stackable < attachment.GetQuantity() )
128 attachment.SplitIntoStackMaxHandsClient( action_data.m_Player );
142 if ( player && target_entity )
145 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
147 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
149 for(
int i = 0; i < selections.Count(); i++ )
154 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
156 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
158 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
159 return target_slot_id;
177 if ( player && target_entity )
180 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
182 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
184 for(
int i = 0; i < selections.Count(); i++ )
189 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
191 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
193 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
194 return target_slot_id;
ActionDetachFromTarget_SpecificSlot_WoodenPlanks ActionDetachFromTarget_SpecificSlot ActionDetachFromTarget_SpecificSlot_MetalSheets()
ActionDetachFromTarget_SpecificSlotsCategory_Barrel ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget_SpecificSlotsCategory_WoodenCrate()
override int FindSlotIdToDetach(PlayerBase player, ActionTarget target, ItemBase item)
ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget ActionDetachFromTarget_SpecificSlot_WoodenLogs()
ActionDetachFromTarget m_slotToDetach
class ActionTargets ActionTarget
void ClearActionJuncture(ActionData action_data)
ref CCIBase m_ConditionItem
void ClearInventoryReservationEx(ActionData action_data)
ref CCTBase m_ConditionTarget
void ActionDetachFromTarget_SpecificSlot_WoodenPlanks()
void ActionDetachFromTarget_SpecificSlotsCategory_Barrel()
override int FindSlotIdToDetach(PlayerBase player, ActionTarget target, ItemBase item)
void ActionDetachFromTarget()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override ActionData CreateActionData()
override void OnExecute(ActionData action_data)
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override void CreateConditionComponents()
void Process(ActionData action_data)
int FindSlotIdToDetach(PlayerBase player, ActionTarget target, ItemBase item)
override Object GetDisplayInteractObject(PlayerBase player, ActionTarget target)
void ActionInteractBase()
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()