Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiontakematerialtohandsswitch.c
Go to the documentation of this file.
1
3{
5 {
6 m_Text = "#switch_to_next_material";
7 }
8
9 override void CreateConditionComponents()
10 {
12 m_ConditionTarget = new CCTNonRuined( UAMaxDistances.BASEBUILDING );
13 }
14
15 override bool IsInstant()
16 {
17 return true;
18 }
19
20 override bool RemoveForceTargetAfterUse()
21 {
22 return false;
23 }
24
25 override bool UseAcknowledgment()
26 {
27 return true;
28 }
29
30 override typename GetInputType()
31 {
33 }
34
35 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
36 {
37 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
38 if ( target_entity && target_entity.CanUseConstruction() )
39 {
40 BaseBuildingBase base_building = BaseBuildingBase.Cast( target_entity );
41 if(!base_building.IsPlayerInside(player,""))
42 return false;
43
44 ConstructionActionData construction_action_data = player.GetConstructionActionData();
45
46 string main_part_name = target_entity.GetActionComponentName( target.GetComponentIndex() );
47 construction_action_data.RefreshAttachmentsToDetach( target_entity, main_part_name );
48
49 if ( construction_action_data.GetAttachmentsToDetachCount() > 1 )
50 {
51 return true;
52 }
53 }
54
55 return false;
56 }
57
58 override void Start( ActionData action_data )
59 {
60 super.Start( action_data );
61
62 //set next index
63 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
64 construction_action_data.SetNextAttachmentIndex();
65 }
66}
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
override bool IsPlayerInside(PlayerBase player, string selection)
Definition fence.c:615
void RefreshAttachmentsToDetach(EntityAI target, string main_part_name)
void Start()
Plays all elements this effects consists of.
Definition effect.c:157