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

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

void SetBuildingAnimation (ItemBase item)
 
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)
 
override string GetAdminLogMessage (ActionData action_data)
 

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

void ActionBuildPart ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
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 string GetSoundCategory (ActionData action_data)
 
override ActionData CreateActionData ()
 
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)
 

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

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

◆ ActionBuildPart()

void ActionBuildPart ( )
inlineprivate
28 {
30 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
31 m_FullBody = true;
32 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
33
35 m_Text = "#build";
36 }
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 ActionBuildPart.c:12
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
66 {
67 if (player.IsPlacingLocal() || player.IsPlacingServer())
68 return false;
69
70 //Action not allowed if player has broken legs
71 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
72 return false;
73
74 //gate..
75 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
76 return false;
77
78 if ((!GetGame().IsDedicatedServer()))
79 {
80 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
81 {
82 return true;
83 }
84 return false;
85 }
86 return true;
87 }
eBrokenLegs
Definition EBrokenLegs.c:2
int m_VariantID
Definition ActionBase.c:68
proto native CGame GetGame()

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

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
90 {
92 Construction construction = base_building.GetConstruction();
93 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
95
96 check_data.m_PartName = part_name;
97 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
98
99 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem, true);
100 if (GetGame().IsServer())
101 {
102 bool collides = construction.IsCollidingEx(check_data);
103
104 return !collides && canBuild;
105 }
106 else
107 {
108 return canBuild;
109 }
110 }
void CollisionCheckData()
Definition Construction.c:1312
void Construction(BaseBuildingBase parent)
Definition Construction.c:26
Definition Fence.c:2

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

◆ CanBeUsedInFreelook()

override bool CanBeUsedInFreelook ( )
inlineprivate
61 {
62 return false;
63 }

◆ CanBeUsedLeaning()

override bool CanBeUsedLeaning ( )
inlineprivate
56 {
57 return false;
58 }

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
138 {
140 return action_data;
141 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
39 {
42 }
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.

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)
inlineprotected
215 {
216 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
217 string partName = BuildPartActionData.Cast(action_data).m_PartType;
218
219 string message = string.Format("Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());
220 return message;
221 }
Definition ConstructionActionData.c:2

◆ GetSoundCategory()

override string GetSoundCategory ( ActionData action_data)
inlineprivate
133 {
134 return "Base_building";
135 }

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprotected
208 {
209 super.HandleReciveData(action_recive_data, action_data);
210
212 }
Definition ActionBuildPart.c:2
string m_PartType
Definition ActionBuildPart.c:3

Перекрестные ссылки BuildPartActionReciveData::m_PartType.

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
45 {
46 ConstructionActionData construction_action_data = player.GetConstructionActionData();
48
50 {
51 m_Text = "#build " + constrution_part.GetName();
52 }
53 }
Definition ConstructionPart.c:2

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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
113 {
114 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
115 Construction construction = base_building.GetConstruction();
116
117 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
119
120 check_data.m_PartName = part_name;
121 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
122
123 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, true)) //redundant at this point?
124 {
125 //build
126 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
127 //add damage to tool
128 action_data.m_MainItem.DecreaseHealth(UADamageApplied.BUILD, false);
129 }
130 }
const int AT_BUILD_PART
Definition _constants.c:6
Definition ActionConstants.c:142
const float BUILD
Definition ActionConstants.c:143

Перекрестные ссылки AT_BUILD_PART, UADamageApplied::BUILD, CollisionCheckData() и Construction().

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprotected
191 {
193 super.ReadFromContext(ctx, action_recive_data);
194
195 string part_type;
196 if (ctx.Read(part_type))
197 {
199 return true;
200 }
201 else
202 {
203 return false;
204 }
205 }

Перекрестные ссылки BuildPartActionReciveData::m_PartType.

◆ SetBuildingAnimation()

void SetBuildingAnimation ( ItemBase item)
inlineprotected
162 {
163 switch (item.Type())
164 {
165 case Pickaxe:
166 case Shovel:
167 case FarmingHoe:
168 case FieldShovel:
169 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
170 break;
171 case Pliers:
172 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
173 break;
174 case SledgeHammer:
175 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
176 break;
177 default:
178 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
179 break;
180 }
181 }
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
145 {
146 if (super.SetupAction(player, target, item, action_data, extra_data))
147 {
149
150 if (!GetGame().IsDedicatedServer())
151 {
152 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
153 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(m_VariantID).GetPartName();
154 }
155 return true;
156 }
157
158 return false;
159 }
void SetBuildingAnimation(ItemBase item)
Definition ActionBuildPart.c:161

Перекрестные ссылки GetGame(), ActionBase::m_VariantID и SetBuildingAnimation().

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprotected
184 {
185 super.WriteToContext(ctx, action_data);
186
187 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
188 }

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