DayZ 1.24
Loading...
Searching...
No Matches
ActionTakeMaterialToHandsSwitch.c
Go to the documentation of this file.
2{
4 {
5 m_Text = "#switch_to_next_material";
6 }
7
13
14 override bool IsInstant()
15 {
16 return true;
17 }
18
20 {
21 return false;
22 }
23
24 override bool UseAcknowledgment()
25 {
26 return true;
27 }
28
29 override typename GetInputType()
30 {
32 }
33
34 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
35 {
36 EntityAI target_entity = EntityAI.Cast(target.GetObject());
37 if (target_entity && target_entity.CanUseConstruction())
38 {
40 if (!base_building.IsPlayerInside(player, ""))
41 return false;
42
43 ConstructionActionData construction_action_data = player.GetConstructionActionData();
44
45 string main_part_name = target_entity.GetActionComponentName(target.GetComponentIndex());
46 construction_action_data.RefreshAttachmentsToDetach(target_entity, main_part_name);
47
48 if (construction_action_data.GetAttachmentsToDetachCount() > 1)
49 return true;
50 }
51
52 return false;
53 }
54
56 {
57 super.Start(action_data);
58
59 //set next index
60 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
61 construction_action_data.SetNextAttachmentIndex();
62 }
63}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
override void Start(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const float BASEBUILDING