32 if (!super.Post_SetupAction(action_data))
35 if (!
g_Game.IsDedicatedServer())
48 if (targetEntity && targetEntity.CanUseConstruction())
72 ItemBase attachment =
ItemBase.Cast(targetEntity.GetInventory().FindAttachment(slotId));
77 attachment.CombineItemsClient(action_data.
m_MainItem);
81 float stackable = action_data.
m_MainItem.GetTargetQuantityMax(slotId);
83 if (stackable == 0 || stackable >= action_data.
m_MainItem.GetQuantity())
85 action_data.
m_Player.PredictiveTakeEntityToTargetAttachmentEx(targetEntity, action_data.
m_MainItem, slotId);
87 else if (stackable != 0 && stackable < action_data.
m_MainItem.GetQuantity())
103 if (!
g_Game.IsMultiplayer())
127 if (item.IsExternalLockType())
139 string selection = baseBuilding.GetActionComponentName(target.GetComponentIndex());
151 else if (
Class.
CastTo(building, targetEntity) && building.CanUseConstruction())
153 if (item.IsExternalLockType())
155 int doorIndex = building.
GetDoorIndex(target.GetComponentIndex());
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="")
PlayerSpawnPreset slotName
FindInventoryLocationType
flags for searching locations in inventory
override void OnStartClient(ActionData action_data)
void OnExecuteImpl(ActionData action_data)
override ActionData CreateActionData()
ref array< string > m_ComponentNames
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
int FindAndTranslateAttachmentSlot(PlayerBase player, ActionTarget target, ItemBase item)
where appropriate, returns valid attachment slot ID even without proper selection
override bool Post_SetupAction(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
override void CreateConditionComponents()
void ActionAttachToConstruction()
override void OnExecuteClient(ActionData action_data)
ref ActionTarget m_Target
void ActionSingleUseBase()
ref TStringArray m_RelatedInventorySlotNames
Lock compatibility type, now in door config. Lockpick enabled by default if undefined.
override bool IsPlayerInside(PlayerBase player, string selection)
override bool CheckSlotVerticalDistance(int slot_id, PlayerBase player)
AdditionalDoorInfo GetDoorInfo(int doorIdx)
proto native bool IsDoorLocked(int index)
When the door is locked.
proto native bool IsDoorOpen(int index)
When the door is requested to be fully open (animation wanted phase is greater than 0....
proto native int GetDoorIndex(int componentIndex)
Gets the index of the door based on the view geometry component index.
Super root of all classes in Enforce script.
int GetAttachmentSlotFromSelection(PlayerBase player, EntityAI target, ItemBase item_to_attach, string selection)
void SetActionInitiator(PlayerBase action_initiator)
proto native bool CanAddAttachmentEx(notnull EntityAI e, int slot)
Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID!...
script counterpart to engine's class Inventory
proto native int GetSlot()
returns slot id if current type is Attachment
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
static const string NAME_VIEW
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.