3 override void CreateActionComponent()
5 float time = SetCallbackDuration(m_ActionData.m_MainItem);
9 float SetCallbackDuration(
ItemBase item )
39 override void CreateConditionComponents()
48 m_Text =
"#dismantle " + construction_action_data.GetTargetPart().GetName();
51 override string GetText()
57 ConstructionPart constrution_part = construction_action_data.GetTargetPart();
59 if ( constrution_part )
61 return "#dismantle" +
" " + constrution_part.GetName();
68 override bool CanBeUsedLeaning()
75 if ( player.IsPlacingLocal() )
79 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
82 return DismantleCondition( player, target, item,
true ) && player.m_MovementState.m_iStanceIdx !=
DayZPlayerConstants.STANCEIDX_PRONE;
85 override bool ActionConditionContinue(
ActionData action_data )
87 return DismantleCondition( action_data.m_Player, action_data.m_Target, action_data.m_MainItem ,
false ) && action_data.m_Player.m_MovementState.m_iStanceIdx !=
DayZPlayerConstants.STANCEIDX_PRONE;
90 override void OnFinishProgressServer(
ActionData action_data )
93 Construction construction = base_building.GetConstruction();
95 ConstructionPart construction_part = construction_action_data.GetTargetPart();
97 if ( construction.CanDismantlePart( construction_part.GetPartName(), action_data.m_MainItem ) )
100 construction.DismantlePartServer( action_data.m_Player, construction_part.GetPartName(),
AT_DISMANTLE_PART );
103 action_data.m_MainItem.DecreaseHealth(
UADamageApplied.DISMANTLE,
false );
112 if ( super.SetupAction( player, target, item, action_data, extra_data ) )
114 SetBuildingAnimation( item );
122 protected void SetBuildingAnimation(
ItemBase item )
124 switch ( item.Type() )
143 if ( player && !player.IsPlacingLocal() && !player.IsPlacingServer() )
145 Object target_object = target.GetObject();
147 if ( target_object && target_object.CanUseConstruction() )
150 if (
Class.CastTo(target_entity,target_object) && (target_entity.FindAttachmentBySlotName(
"Att_CombinationLock") || target_entity.FindAttachmentBySlotName(
"Material_FPole_Flag")) )
155 string part_name = target_object.GetActionComponentName( target.GetComponentIndex() );
158 Construction construction = base_building.GetConstruction();
159 ConstructionPart construction_part = construction.GetConstructionPartToDismantle( part_name, item );
161 if ( construction_part )
170 if ( construction_part.IsGate() && base_building.IsOpened() )
174 bool checked =
false;
176 if ( construction_part.IsBase() )
179 if ( !checked && base_building.IsPlayerInside( player, part_name ) && !player.GetInputController().CameraIsFreeLook() )
186 if ( base_building.IsFacingCamera( part_name ) )
199 construction_action_data.SetTargetPart( construction_part );
210 override string GetAdminLogMessage(
ActionData action_data)
213 ConstructionPart construction_part = construction_action_data.GetTargetPart();
215 string message =
string.Format(
"Dismantled %1 from %2 with %3", construction_part.GetName(), action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName() );