DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionDestroyPart
+ Граф наследования:ActionDestroyPart:

Защищенные члены

bool DestroyCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
 
override string GetAdminLogMessage (ActionData action_data)
 

Закрытые члены

void ActionDestroyPart ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedLeaning ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
- Закрытые члены унаследованные от ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Закрытые статические данные

static int CYCLES = 4
 

Подробное описание

Конструктор(ы)

◆ ActionDestroyPart()

void ActionDestroyPart ( )
inlineprivate
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DISASSEMBLE;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
19
21 m_Text = "#destroy";
22 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionDestroyPart.c:2
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, ActionBase::m_FullBody, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
42 {
43 //Action not allowed if player has broken legs
44 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
45 return false;
46
47 return DestroyCondition( player, target, item, true );
48 }
eBrokenLegs
Definition EBrokenLegs.c:2
bool DestroyCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
Definition ActionDestroyPart.c:85

Перекрестные ссылки DestroyCondition().

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
51 {
52 return DestroyCondition( action_data.m_Player, action_data.m_Target, action_data.m_MainItem , false );
53 }

Перекрестные ссылки DestroyCondition().

◆ CanBeUsedLeaning()

override bool CanBeUsedLeaning ( )
inlineprivate
37 {
38 return false;
39 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
25 {
28 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTNone.c:2

Перекрестные ссылки ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ DestroyCondition()

bool DestroyCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check )
inlineprotected
86 {
87 Object target_object = target.GetObject();
88 if ( target_object && target_object.CanUseConstruction() )
89 {
90 string part_name = target_object.GetActionComponentName( target.GetComponentIndex() );
91
93 Construction construction = base_building.GetConstruction();
94 ConstructionPart construction_part = construction.GetConstructionPartToDestroy( part_name );
95
97 {
98 //camera and position checks
99 if ( !player.GetInputController().CameraIsFreeLook() && IsInReach(player, target, UAMaxDistances.DEFAULT) && !player.GetInputController().CameraIsFreeLook() )
100 {
101 //Camera check (client-only)
102 if ( camera_check )
103 {
104 if ( GetGame() && ( !GetGame().IsDedicatedServer() ) )
105 {
106 if ( !base_building.IsFacingCamera( part_name ) )
107 {
108 return false;
109 }
110 }
111 }
112
113 ConstructionActionData construction_action_data = player.GetConstructionActionData();
115
116 return true;
117 }
118 }
119 }
120
121 return false;
122 }
void Construction(BaseBuildingBase parent)
Definition Construction.c:26
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:1054
Definition Fence.c:2
Definition ConstructionActionData.c:2
Definition ConstructionPart.c:2
Definition ObjectTyped.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
proto native CGame GetGame()

Перекрестные ссылки Construction(), UAMaxDistances::DEFAULT, GetGame() и ActionBase::IsInReach().

Используется в ActionCondition() и ActionConditionContinue().

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
inlineprotected
125 {
126 return " destroyed " + action_data.m_Target.GetObject().GetDisplayName() + " with " + action_data.m_MainItem.GetDisplayName();
127 }

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
31 {
32 ConstructionActionData construction_action_data = player.GetConstructionActionData();
33 m_Text = "#destroy " + construction_action_data.GetTargetPart();
34 }

Перекрестные ссылки ActionBase::m_Text.

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
56 {
57 BaseBuildingBase base_building = BaseBuildingBase.Cast( action_data.m_Target.GetObject() );
58 Construction construction = base_building.GetConstruction();
59 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
61
62 if ( construction.CanDestroyPart( construction_part.GetPartName() ) )
63 {
64 //build
65 string part_name = construction_part.GetPartName();
66 string zone_name;
67 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
68
69 if (zone_name != "")
70 {
71 base_building.AddHealth(zone_name,"Health",-(base_building.GetMaxHealth(zone_name,"")/CYCLES));
72 if ( base_building.GetHealth(zone_name,"Health") < 1 )
73 construction.DestroyPartServer( action_data.m_Player, construction_part.GetPartName(), AT_DESTROY_PART );
74 }
75 else
76 {
77 construction.DestroyPartServer( action_data.m_Player, construction_part.GetPartName(), AT_DESTROY_PART );
78 }
79
80 //add damage to tool
81 action_data.m_MainItem.DecreaseHealth( UADamageApplied.DESTROY, false );
82 }
83 }
const int AT_DESTROY_PART
Definition _constants.c:8
static int CYCLES
Definition ActionDestroyPart.c:11
Definition ActionConstants.c:142
const float DESTROY
Definition ActionConstants.c:146

Перекрестные ссылки AT_DESTROY_PART, Construction(), CYCLES и UADamageApplied::DESTROY.

Поля

◆ CYCLES

int CYCLES = 4
staticprivate

Объявления и описания членов класса находятся в файле: