23 if (targetEntity && item)
29 int slotsCount = item.GetInventory().GetSlotIdCount();
31 targetEntity.GetActionComponentNameList(target.GetComponentIndex(), selections);
33 foreach (
string selection : selections)
36 if (!targetEntity.TranslateSlotFromSelection(selection, slotId))
42 for (
int i=0; i < slotsCount; ++i)
44 int itemSlotId = item.GetInventory().GetSlotId(i);
45 if (slotId == itemSlotId)
48 if (currentAttachment)
70 if (!
g_Game.IsDedicatedServer() )
75 if (super.SetupAction( player, target, item, action_data, extra_data))
77 if (!
g_Game.IsDedicatedServer())
101 if (target.GetObject() && target.GetObject().CanUseConstruction())
109 if (
g_Game.IsMultiplayer())
146 attachment.CombineItemsClient(itemEntity);
151 float stackable = item_base.GetTargetQuantityMax( action_data_a.
m_AttSlot );
153 if (stackable == 0 || stackable >= item_base.GetQuantity())
155 action_data.
m_Player.PredictiveTakeEntityToTargetAttachmentEx(targetEntity, itemEntity, action_data_a.
m_AttSlot);
157 else if (stackable != 0 && stackable < item_base.GetQuantity())
159 item_base.SplitIntoStackMaxClient(targetEntity, action_data_a.
m_AttSlot);
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearInventoryReservationEx(ActionData action_data)
void ClearActionJuncture(ActionData action_data)
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
override void CreateConditionComponents()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=null)
int FindSlotIdToAttachOrCombine(PlayerBase player, ActionTarget target, ItemBase item)
void ActionAttachOnSelection()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteServer(ActionData action_data)
override ActionData CreateActionData()
override void OnExecuteClient(ActionData action_data)
ref ActionTarget m_Target
void ActionSingleUseBase()
proto native bool CanAddAttachment(notnull EntityAI e)
Check if attachment can be added to any slot.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
script counterpart to engine's class Inventory
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.