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

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

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

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

void ActionDismantlePart ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override string GetText ()
 
override bool CanBeUsedLeaning ()
 
override bool CanBeUsedInFreelook ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
- Закрытые члены унаследованные от 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)
 

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

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

◆ ActionDismantlePart()

void ActionDismantlePart ( )
inlineprivate
29 {
31 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DISASSEMBLE;
32 m_FullBody = true;
33 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
34
36 m_Text = "#dismantle";
37 }
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 ActionDismantlePart.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
79 {
80 if ( player.IsPlacingLocal() )
81 return false;
82
83 //Action not allowed if player has broken legs
84 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
85 return false;
86
87 return DismantleCondition( player, target, item, true ) && player.m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_PRONE;
88 }
eBrokenLegs
Definition EBrokenLegs.c:2
bool DismantleCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
Definition ActionDismantlePart.c:144

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

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
91 {
92 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;
93 }

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

◆ CanBeUsedInFreelook()

override bool CanBeUsedInFreelook ( )
inlineprivate
74 {
75 return false;
76 }

◆ CanBeUsedLeaning()

override bool CanBeUsedLeaning ( )
inlineprivate
69 {
70 return false;
71 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
40 {
42 m_ConditionTarget = new CCTNone;//CCTNonRuined( UAMaxDistances.BASEBUILDING );
43 }
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.

◆ DismantleCondition()

bool DismantleCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check )
inlineprotected
145 {
146 if (player && !player.IsPlacingLocal() && !player.IsPlacingServer())
147 {
148 Object targetObject = target.GetObject();
150 if (targetObject && targetObject.CanUseConstruction())
151 {
152 //invalid if is gate and is locked
153 if (Class.CastTo(targetEntity, targetObject) && (targetEntity.FindAttachmentBySlotName("Att_CombinationLock") || targetEntity.FindAttachmentBySlotName("Material_FPole_Flag")) )
154 return false;
155
156 string partName = targetObject.GetActionComponentName(target.GetComponentIndex());
157
159 Construction construction = baseBuilding.GetConstruction();
160 ConstructionPart constructionPart = construction.GetConstructionPartToDismantle(partName, item);
161
163 {
164
165 //invalid on gate if the gate is opened
166 if (constructionPart.IsGate() && baseBuilding.IsOpened())
167 return false;
168
169 //camera and position checks
170 bool checked = false;
171
172 if (constructionPart.IsBase())
173 checked = true;
174
175 if (!checked && baseBuilding.IsPlayerInside(player, partName))
176 {
177 //Camera check (client-only)
178 if (camera_check)
179 {
180 if (GetGame() && (!GetGame().IsDedicatedServer()))
181 {
182 if (baseBuilding.IsFacingCamera(partName))
183 return false;
184 }
185 }
186
187 checked = true;
188 }
189
190 if (checked)
191 {
192 ConstructionActionData constructionActionData = player.GetConstructionActionData();
194
195 return true;
196 }
197 }
198 }
199 }
200
201 return false;
202 }
void Construction(BaseBuildingBase parent)
Definition Construction.c:26
Definition Fence.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition ConstructionActionData.c:2
Definition ConstructionPart.c:2
Definition Building.c:6
Definition ObjectTyped.c:2
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), Construction() и GetGame().

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

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
inlineprotected
205 {
206 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
208
209 string message = string.Format("Dismantled %1 from %2 with %3", construction_part.GetName(), action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName() );
210 return message;
211 }

◆ GetText()

override string GetText ( )
inlineprivate
52 {
54 if ( player )
55 {
56 ConstructionActionData construction_action_data = player.GetConstructionActionData();
58
59 if ( constrution_part )
60 {
61 return "#dismantle" + " " + constrution_part.GetName();
62 }
63 }
64
65 return "";
66 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
Definition PlayerBaseClient.c:2

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

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
46 {
47 ConstructionActionData construction_action_data = player.GetConstructionActionData();
48 m_Text = "#dismantle " + construction_action_data.GetTargetPart().GetName();
49 }

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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
96 {
97 BaseBuildingBase base_building = BaseBuildingBase.Cast( action_data.m_Target.GetObject() );
98 Construction construction = base_building.GetConstruction();
99 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
101
102 if ( construction.CanDismantlePart( construction_part.GetPartName(), action_data.m_MainItem ) )
103 {
104 //build
105 construction.DismantlePartServer( action_data.m_Player, construction_part.GetPartName(), AT_DISMANTLE_PART );
106
107 //add damage to tool
108 action_data.m_MainItem.DecreaseHealth( UADamageApplied.DISMANTLE, false );
109 }
110 }
const int AT_DISMANTLE_PART
Definition _constants.c:7
Definition ActionConstants.c:142
const float DISMANTLE
Definition ActionConstants.c:144

Перекрестные ссылки AT_DISMANTLE_PART, Construction() и UADamageApplied::DISMANTLE.

◆ SetBuildingAnimation()

void SetBuildingAnimation ( ItemBase item)
inlineprotected
126 {
127 switch ( item.Type() )
128 {
129 case Pickaxe:
130 case Shovel:
131 case FarmingHoe:
132 case FieldShovel:
133 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
134 break;
135 case Pliers:
136 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
137 break;
138 default:
139 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DISASSEMBLE;
140 break;
141 }
142 }
Definition FarmingHoe.c:2

Перекрестные ссылки AnimatedActionBase::m_CommandUID.

Используется в SetupAction().

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate
114 {
115 if ( super.SetupAction( player, target, item, action_data, extra_data ) )
116 {
118
119 return true;
120 }
121
122 return false;
123 }
void SetBuildingAnimation(ItemBase item)
Definition ActionDismantlePart.c:125

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


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