DayZ 1.24
Loading...
Searching...
No Matches
ActionDetachFromTarget.c File Reference

Go to the source code of this file.

Classes

class  ActionDetachFromTarget
 
class  ActionDetachFromTarget_SpecificSlotsCategory
 
class  ActionDetachFromTarget_SpecificSlot_WoodenPlanks
 
class  ActionDetachFromTarget_SpecificSlotsCategory_Barrel
 

Functions

override int FindSlotIdToDetach (PlayerBase player, ActionTarget target, ItemBase item)
 
ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget ActionDetachFromTarget_SpecificSlot_WoodenLogs ()
 
ActionDetachFromTarget_SpecificSlot_WoodenPlanks ActionDetachFromTarget_SpecificSlot ActionDetachFromTarget_SpecificSlot_MetalSheets ()
 
void ActionDetachFromTarget_SpecificSlot_WoodenPlanks ()
 
ActionDetachFromTarget_SpecificSlotsCategory_Barrel ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget_SpecificSlotsCategory_WoodenCrate ()
 
void ActionDetachFromTarget_SpecificSlotsCategory_Barrel ()
 

Variables

ActionDetachFromTarget m_slotToDetach
 
string m_slotsToDetach
 

Function Documentation

◆ ActionDetachFromTarget_SpecificSlot_MetalSheets()

ActionDetachFromTarget_SpecificSlot_WoodenPlanks ActionDetachFromTarget_SpecificSlot ActionDetachFromTarget_SpecificSlot_MetalSheets ( )

Definition at line 134 of file ActionDetachFromTarget.c.

220 {
221 m_slotToDetach = "truck_01_metalsheets";
222 }
ActionDetachFromTarget m_slotToDetach

References InventorySlots::GetSlotIdFromString(), InventorySlots::INVALID, and m_slotToDetach.

Referenced by ActionConstructor::RegisterActions(), and CarScript::SetActions().

◆ ActionDetachFromTarget_SpecificSlot_WoodenLogs()

ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget ActionDetachFromTarget_SpecificSlot_WoodenLogs ( )

Definition at line 134 of file ActionDetachFromTarget.c.

204 {
205 m_slotToDetach = "truck_01_woodenlogs";
206 }

Referenced by ActionConstructor::RegisterActions(), and CarScript::SetActions().

◆ ActionDetachFromTarget_SpecificSlot_WoodenPlanks()

void ActionDetachFromTarget_SpecificSlot_MetalSheets::ActionDetachFromTarget_SpecificSlot_WoodenPlanks ( )

Definition at line 220 of file ActionDetachFromTarget.c.

220 {
221 m_slotToDetach = "truck_01_metalsheets";
222 }
223}

References m_slotToDetach.

◆ ActionDetachFromTarget_SpecificSlotsCategory_Barrel()

void ActionDetachFromTarget_SpecificSlotsCategory_WoodenCrate::ActionDetachFromTarget_SpecificSlotsCategory_Barrel ( )

Definition at line 236 of file ActionDetachFromTarget.c.

236 {
237 m_slotsToDetach = "truck_01_woodencrate";
238 }
239}
string m_slotsToDetach

References m_slotsToDetach.

◆ ActionDetachFromTarget_SpecificSlotsCategory_WoodenCrate()

ActionDetachFromTarget_SpecificSlotsCategory_Barrel ActionDetachFromTarget_SpecificSlotsCategory ActionDetachFromTarget_SpecificSlotsCategory_WoodenCrate ( )

Definition at line 134 of file ActionDetachFromTarget.c.

236 {
237 m_slotsToDetach = "truck_01_woodencrate";
238 }

Referenced by ActionConstructor::RegisterActions(), and CarScript::SetActions().

◆ FindSlotIdToDetach()

override int FindSlotIdToDetach ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 134 of file ActionDetachFromTarget.c.

135 {
136 EntityAI target_entity = EntityAI.Cast(target.GetObject());
137
138 if (player && target_entity)
139 {
141 target_entity.GetActionComponentNameList(target.GetComponentIndex(), selections);
142
143 if (target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0)
144 {
145 for (int i = 0; i < selections.Count(); i++)
146 {
148 {
150 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
151
152 if (att && player.GetInventory().CanAddEntityIntoHands(att))
153 {
154 if (att.CanDetachAttachment(target_entity) && target_entity.CanReleaseAttachment(att))
155 return target_slot_id;
156 }
157 }
158 }
159 }
160 }
161 return InventorySlots.INVALID;
162 }
provides access to slot configuration
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

Variable Documentation

◆ m_slotsToDetach

string m_slotsToDetach

◆ m_slotToDetach