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

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

override void SetBuildingAnimation (ItemBase item)
 
override ActionData CreateActionData ()
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
bool RepairCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
 
override string GetAdminLogMessage (ActionData action_data)
 

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

void ActionRepairPart ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override string GetText ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
- Закрытые члены унаследованные от ActionDismantlePart
void SetBuildingAnimation (ItemBase item)
 
bool DismantleCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
 
override string GetAdminLogMessage (ActionData action_data)
 

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

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

◆ ActionRepairPart()

void ActionRepairPart ( )
inlineprivate
42 {
44 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
45 m_FullBody = true;
46 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
47
49 m_Text = "#repair";
50 }
int m_StanceMask
Definition ActionBase.c:33
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
Definition ActionRepairPart.c:19
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, m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
82 {
83 //Action not allowed if player has broken legs
84 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
85 return false;
86
87 return RepairCondition( player, target, item, true );
88 }
eBrokenLegs
Definition EBrokenLegs.c:2
bool RepairCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
Definition ActionRepairPart.c:182

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

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
91 {
92 return RepairCondition( action_data.m_Player, action_data.m_Target, action_data.m_MainItem , false );
93 }

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

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprotected

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
53 {
56 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTNonRuined.c:2
Definition ActionConstants.c:106
const float BASEBUILDING
Definition ActionConstants.c:112

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

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
inlineprotected
236 {
237 return " repaired " + action_data.m_Target.GetObject().GetDisplayName() + " with " + action_data.m_MainItem.GetDisplayName();
238 }

◆ GetText()

override string GetText ( )
inlineprivate
65 {
67 if ( player )
68 {
69 ConstructionActionData construction_action_data = player.GetConstructionActionData();
71
72 if ( constrution_part )
73 {
74 return "#repair" + " " + constrution_part.GetName();
75 }
76 }
77
78 return "";
79 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
Definition ConstructionActionData.c:2
Definition ConstructionPart.c:2
Definition PlayerBaseClient.c:2
proto native CGame GetGame()

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

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprotected
175 {
176 super.HandleReciveData(action_recive_data, action_data);
177
179 RepairPartActionData.Cast(action_data).m_ComponentIndex = recive_data_repair.m_ComponentIndexRecived;
180 }
Definition ActionRepairPart.c:9

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
59 {
60 ConstructionActionData construction_action_data = player.GetConstructionActionData();
61 m_Text = "#repair " + construction_action_data.GetTargetPart().GetName();
62 }

Перекрестные ссылки 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
100 //repairing
101 string part_name = action_data.m_Target.GetObject().GetActionComponentName( RepairPartActionData.Cast(action_data).m_ComponentIndex );
102 string zone_name;
105
106 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
108
109 //consume materials
110 construction.TakeMaterialsServer(part_name,true);
111
112 //add damage to tool
113 action_data.m_MainItem.DecreaseHealth( UADamageApplied.REPAIR, false );
114 }
void Construction(BaseBuildingBase parent)
Definition Construction.c:26
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
Definition Fence.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition ActionConstants.c:142
const float REPAIR
Definition ActionConstants.c:145
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), Construction(), GetPlugin(), ActionBase::m_SpecialtyWeight и UADamageApplied::REPAIR.

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprotected
154 {
156 {
158 }
160
161 super.ReadFromContext(ctx, action_recive_data);
162
163 if( HasTarget() )
164 {
165 int component_index;
166 if ( !ctx.Read(component_index) )
167 return false;
168
169 recive_data_repair.m_ComponentIndexRecived = component_index;
170 }
171 return true;
172 }
bool HasTarget()
Definition ActionBase.c:244

Перекрестные ссылки ActionBase::HasTarget().

◆ RepairCondition()

bool RepairCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check )
inlineprotected
183 {
184 string zone_name;
185
186 Object target_object = target.GetObject();
187 if ( target_object && target_object.CanUseConstruction() )
188 {
189 string part_name = target_object.GetActionComponentName( target.GetComponentIndex() );
190
192 Construction construction = base_building.GetConstruction();
194
195 if ( construction_part )
196 {
197 //camera and position checks
198 if ( !base_building.IsFacingPlayer( player, part_name ) && !player.GetInputController().CameraIsFreeLook() && base_building.HasProperDistance( construction_part.GetMainPartName(), player ) )
199 {
200 //Camera check (client-only)
201 if ( camera_check )
202 {
203 if ( GetGame() && ( !GetGame().IsDedicatedServer() ) )
204 {
205 if ( base_building.IsFacingCamera( part_name ) )
206 {
207 return false;
208 }
209 }
210 }
211
212 //damage check
213 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
215 {
216 return false;
217 }
218
219 //materials check
220 if ( !construction.HasMaterials(part_name,true) )
221 {
222 return false;
223 }
224
225 ConstructionActionData construction_action_data = player.GetConstructionActionData();
227 return true;
228 }
229 }
230 }
231
232 return false;
233 }
Definition constants.c:638
Definition ObjectTyped.c:2
const int STATE_RUINED
Definition constants.c:807
const int STATE_WORN
Definition constants.c:810

Перекрестные ссылки Construction(), GetGame(), GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

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

◆ SetBuildingAnimation()

override void SetBuildingAnimation ( ItemBase item)
inlineprotected
117 {
118 switch( item.Type() )
119 {
120 case Pickaxe:
121 case Shovel:
122 case FarmingHoe:
123 case FieldShovel:
124 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
125 break;
126 case Pliers:
127 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
128 break;
129 default:
130 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
131 break;
132 }
133 }
Definition FarmingHoe.c:2

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

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprotected
142 {
143 super.WriteToContext(ctx, action_data);
145
147 {
148 repair_action_data.m_ComponentIndex = action_data.m_Target.GetComponentIndex();
149 ctx.Write(repair_action_data.m_ComponentIndex);
150 }
151 }

Перекрестные ссылки Class::CastTo() и ActionBase::HasTarget().


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