DayZ 1.24
Loading...
Searching...
No Matches
ActionBuildShelter Class Reference
Inheritance diagram for ActionBuildShelter:
[legend]
Collaboration diagram for ActionBuildShelter:
[legend]

Protected Member Functions

void ActionBuildShelter ()
 
void ~ActionBuildShelter ()
 
override void CreateConditionComponents ()
 
override string GetText ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedLeaning ()
 
override GetInputType ()
 
override bool UseMainItem ()
 
override bool HasProgress ()
 
override bool HasAlternativeInterrupt ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
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)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnStart (ActionData action_data)
 
override void OnStartClient (ActionData action_data)
 
override void OnStartAnimationLoopClient (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override void OnEndClient (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 
void DetermineConstructionSounds (ActionData action_data)
 
void PlayActionStartSound (ActionData action_data)
 
void PlayActionLoopSound (ActionData action_data)
 
void StopActionLoopSound ()
 
void DestroyActionLoopSound ()
 
void PlayActionFinishSound (ActionData action_data)
 
override string GetSoundCategory (ActionData action_data)
 

Protected Attributes

EffectSound m_BuildLoopSound
 

Private Attributes

string m_SoundsetBuildStart
 
string m_SoundsetBuildLoop
 
string m_SoundsetBuildFinish
 

Additional Inherited Members

- Private Member Functions inherited from 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)
 

Detailed Description

Definition at line 1 of file ActionBuildShelter.c.

Constructor & Destructor Documentation

◆ ActionBuildShelter()

void ActionBuildShelter::ActionBuildShelter ( )
inlineprotected

Definition at line 8 of file ActionBuildShelter.c.

9 {
11 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_2HD;
12 m_FullBody = true;
13 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
14 m_Text = "#build_shelter_leather";
15 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_FullBody, m_StanceMask, and m_Text.

◆ ~ActionBuildShelter()

void ActionBuildShelter::~ActionBuildShelter ( )
inlineprotected

Definition at line 17 of file ActionBuildShelter.c.

18 {
20 }

References DestroyActionLoopSound().

Member Function Documentation

◆ ActionCondition()

override bool ActionBuildShelter::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

Definition at line 108 of file ActionBuildShelter.c.

109 {
110 //Action not allowed if player has broken legs
111 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
112 return false;
113
114 if (target.GetObject() && !target.GetObject().CanUseConstructionBuild())
115 return false;
116 if (player.IsPlacingLocal() || player.IsPlacingServer())
117 return false;
118
119 if ((!GetGame().IsDedicatedServer()))
120 {
121 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item, m_VariantID))
122 return true;
123 return false;
124 }
125 return true;
126 }
int m_VariantID
Definition ActionBase.c:59
eBrokenLegs
Definition EBrokenLegs.c:2
proto native CGame GetGame()

References GetGame(), and m_VariantID.

◆ ActionConditionContinue()

override bool ActionBuildShelter::ActionConditionContinue ( ActionData action_data)
inlineprotected

Definition at line 179 of file ActionBuildShelter.c.

180 {
181 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
182 Construction construction = base_building.GetConstruction();
183 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
185
186 check_data.m_PartName = part_name;
187 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
188
189 return !construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem, false);
190 }
void CollisionCheckData()
void Construction(BaseBuildingBase parent)

References CollisionCheckData(), and Construction().

◆ CanBeUsedLeaning()

override bool ActionBuildShelter::CanBeUsedLeaning ( )
inlineprotected

Definition at line 83 of file ActionBuildShelter.c.

84 {
85 return false;
86 }

◆ CreateActionData()

override ActionData ActionBuildShelter::CreateActionData ( )
inlineprotected

Definition at line 144 of file ActionBuildShelter.c.

145 {
147 return action_data;
148 }

◆ CreateConditionComponents()

override void ActionBuildShelter::CreateConditionComponents ( )
inlineprotected

Definition at line 22 of file ActionBuildShelter.c.

23 {
26 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ DestroyActionLoopSound()

void ActionBuildShelter::DestroyActionLoopSound ( )
inlineprotected

Definition at line 306 of file ActionBuildShelter.c.

307 {
309 }
EffectSound m_BuildLoopSound
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.

References SEffectManager::DestroyEffect(), and m_BuildLoopSound.

Referenced by ~ActionBuildShelter().

◆ DetermineConstructionSounds()

void ActionBuildShelter::DetermineConstructionSounds ( ActionData action_data)
inlineprotected

Definition at line 250 of file ActionBuildShelter.c.

251 {
252 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
255 {
256 switch (constrution_part.GetName())
257 {
258 case "leather":
259 m_SoundsetBuildStart = "Shelter_Leather_Build_Start_SoundSet";
260 m_SoundsetBuildLoop = "Shelter_Leather_Build_Loop_SoundSet";
261 m_SoundsetBuildFinish = "Shelter_Leather_Build_Finish_SoundSet";
262 break;
263
264 case "fabric":
265 m_SoundsetBuildStart = "Shelter_Fabric_Build_Start_SoundSet";
266 m_SoundsetBuildLoop = "Shelter_Fabric_Build_Loop_SoundSet";
267 m_SoundsetBuildFinish = "Shelter_Fabric_Build_Finish_SoundSet";
268 break;
269
270 case "stick":
271 m_SoundsetBuildStart = "Shelter_Wooden_Stick_Build_Start_SoundSet";
272 m_SoundsetBuildLoop = "Shelter_Wooden_Stick_Build_Loop_SoundSet";
273 m_SoundsetBuildFinish = "Shelter_Wooden_Stick_Build_Finish_SoundSet";
274 break;
275
276 default:
280 break;
281 }
282 }
283 }

References m_SoundsetBuildFinish, m_SoundsetBuildLoop, m_SoundsetBuildStart, and m_VariantID.

Referenced by OnStartClient().

◆ GetInputType()

override ActionBuildShelter::GetInputType ( )
inlineprotected

Definition at line 88 of file ActionBuildShelter.c.

◆ GetSoundCategory()

override string ActionBuildShelter::GetSoundCategory ( ActionData action_data)
inlineprotected

Definition at line 317 of file ActionBuildShelter.c.

318 {
319 return "Base_building";
320 }

◆ GetText()

override string ActionBuildShelter::GetText ( )
inlineprotected

Definition at line 28 of file ActionBuildShelter.c.

29 {
31 if (player)
32 {
33 ConstructionActionData construction_action_data = player.GetConstructionActionData();
35
37 {
38 string ret = "";
39 switch (constrution_part.GetName())
40 {
41 case "leather":
42 ret = "#build_shelter_leather";
43 break;
44
45 case "fabric":
46 ret = "#build_shelter_fabric";
47 break;
48
49 case "stick":
50 ret = "#build_shelter_stick";
51 break;
52 }
53 }
54 }
55
56 return ret;
57 }
PlayerBase GetPlayer()

References GetGame(), GetPlayer(), and m_VariantID.

◆ HandleReciveData()

override void ActionBuildShelter::HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprotected

◆ HasAlternativeInterrupt()

override bool ActionBuildShelter::HasAlternativeInterrupt ( )
inlineprotected

Definition at line 103 of file ActionBuildShelter.c.

104 {
105 return false;
106 }

◆ HasProgress()

override bool ActionBuildShelter::HasProgress ( )
inlineprotected

Definition at line 98 of file ActionBuildShelter.c.

99 {
100 return true;
101 }

◆ OnActionInfoUpdate()

override void ActionBuildShelter::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

Definition at line 59 of file ActionBuildShelter.c.

60 {
61 ConstructionActionData construction_action_data = player.GetConstructionActionData();
63
65 {
66 switch (constrution_part.GetName())
67 {
68 case "leather":
69 m_Text = "#build_shelter_leather";
70 break;
71
72 case "fabric":
73 m_Text = "#build_shelter_fabric";
74 break;
75
76 case "stick":
77 m_Text = "#build_shelter_stick";
78 break;
79 }
80 }
81 }

References m_Text, and m_VariantID.

◆ OnEnd()

override void ActionBuildShelter::OnEnd ( ActionData action_data)
inlineprotected

Definition at line 213 of file ActionBuildShelter.c.

214 {
215 super.OnEnd(action_data);
216 action_data.m_Player.TryHideItemInHands(false);
217 }

◆ OnEndClient()

override void ActionBuildShelter::OnEndClient ( ActionData action_data)
inlineprotected

Definition at line 219 of file ActionBuildShelter.c.

220 {
221 super.OnEndClient(action_data);
222
224 //DestroyActionLoopSound();
225 }

References StopActionLoopSound().

◆ OnFinishProgressClient()

override void ActionBuildShelter::OnFinishProgressClient ( ActionData action_data)
inlineprotected

Definition at line 243 of file ActionBuildShelter.c.

244 {
245 super.OnFinishProgressClient(action_data);
246
248 }
void PlayActionFinishSound(ActionData action_data)

References PlayActionFinishSound().

◆ OnFinishProgressServer()

override void ActionBuildShelter::OnFinishProgressServer ( ActionData action_data)
inlineprotected

Definition at line 227 of file ActionBuildShelter.c.

228 {
229 BaseBuildingBase base_building = BaseBuildingBase.Cast(action_data.m_Target.GetObject());
230 Construction construction = base_building.GetConstruction();
231
232 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
233
234 if (!construction.IsColliding(part_name) && construction.CanBuildPart(part_name, action_data.m_MainItem, false))
235 {
236 //build
237 construction.BuildPartServer(action_data.m_Player, part_name, AT_BUILD_PART);
238 }
239
240 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
241 }
const int AT_BUILD_PART
Definition _constants.c:6
float m_SpecialtyWeight
Definition ActionBase.c:68

References AT_BUILD_PART, Construction(), and m_SpecialtyWeight.

◆ OnStart()

override void ActionBuildShelter::OnStart ( ActionData action_data)
inlineprotected

Definition at line 192 of file ActionBuildShelter.c.

193 {
194 super.OnStart(action_data);
195 action_data.m_Player.TryHideItemInHands(true);
196 }

◆ OnStartAnimationLoopClient()

override void ActionBuildShelter::OnStartAnimationLoopClient ( ActionData action_data)
inlineprotected

Definition at line 206 of file ActionBuildShelter.c.

207 {
208 super.OnStartAnimationLoopClient(action_data);
209
211 }
void PlayActionLoopSound(ActionData action_data)

References PlayActionLoopSound().

◆ OnStartClient()

override void ActionBuildShelter::OnStartClient ( ActionData action_data)
inlineprotected

Definition at line 198 of file ActionBuildShelter.c.

199 {
200 super.OnStartClient(action_data);
201
204 }
void DetermineConstructionSounds(ActionData action_data)
void PlayActionStartSound(ActionData action_data)

References DetermineConstructionSounds(), and PlayActionStartSound().

◆ PlayActionFinishSound()

void ActionBuildShelter::PlayActionFinishSound ( ActionData action_data)
inlineprotected

Definition at line 311 of file ActionBuildShelter.c.

312 {
313 EffectSound sound = SEffectManager.PlaySound(m_SoundsetBuildFinish, action_data.m_Target.GetObject().GetPosition());
314 sound.SetAutodestroy(true);
315 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.

References m_SoundsetBuildFinish, and SEffectManager::PlaySound().

Referenced by OnFinishProgressClient().

◆ PlayActionLoopSound()

void ActionBuildShelter::PlayActionLoopSound ( ActionData action_data)
inlineprotected

Definition at line 291 of file ActionBuildShelter.c.

292 {
294 m_BuildLoopSound = SEffectManager.PlaySound(m_SoundsetBuildLoop, action_data.m_Target.GetObject().GetPosition(), 0, 0, true);
295 }
bool IsSoundPlaying()
Get whether EffectSound is currently playing.

References EffectSound::IsSoundPlaying(), m_BuildLoopSound, m_SoundsetBuildLoop, and SEffectManager::PlaySound().

Referenced by OnStartAnimationLoopClient().

◆ PlayActionStartSound()

void ActionBuildShelter::PlayActionStartSound ( ActionData action_data)
inlineprotected

Definition at line 285 of file ActionBuildShelter.c.

286 {
287 EffectSound sound = SEffectManager.PlaySound(m_SoundsetBuildStart, action_data.m_Target.GetObject().GetPosition());
288 sound.SetAutodestroy(true);
289 }

References m_SoundsetBuildStart, and SEffectManager::PlaySound().

Referenced by OnStartClient().

◆ ReadFromContext()

override bool ActionBuildShelter::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprotected

Definition at line 157 of file ActionBuildShelter.c.

158 {
160 super.ReadFromContext(ctx, action_recive_data);
161
162 string part_type;
163 if (ctx.Read(part_type))
164 {
166 return true;
167 }
168 else
169 return false;
170 }

References BuildPartActionReciveData::m_PartType.

◆ SetupAction()

override bool ActionBuildShelter::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprotected

Definition at line 129 of file ActionBuildShelter.c.

130 {
131 if (super.SetupAction(player, target, item, action_data, extra_data))
132 {
133 if (!GetGame().IsDedicatedServer())
134 {
135 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
136 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartNoToolAtIndex(m_VariantID).GetPartName();
137 }
138 return true;
139 }
140
141 return false;
142 }

References GetGame(), and m_VariantID.

◆ StopActionLoopSound()

void ActionBuildShelter::StopActionLoopSound ( )
inlineprotected

Definition at line 297 of file ActionBuildShelter.c.

298 {
300 {
303 }
304 }
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
void SoundStop()
Stops sound.

References m_BuildLoopSound, EffectSound::SetSoundFadeOut(), and EffectSound::SoundStop().

Referenced by OnEndClient().

◆ UseMainItem()

override bool ActionBuildShelter::UseMainItem ( )
inlineprotected

Definition at line 93 of file ActionBuildShelter.c.

94 {
95 return false;
96 }

◆ WriteToContext()

override void ActionBuildShelter::WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprotected

Definition at line 150 of file ActionBuildShelter.c.

151 {
152 super.WriteToContext(ctx, action_data);
153
154 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
155 }

Member Data Documentation

◆ m_BuildLoopSound

EffectSound ActionBuildShelter::m_BuildLoopSound
protected

◆ m_SoundsetBuildFinish

string ActionBuildShelter::m_SoundsetBuildFinish
private

Definition at line 5 of file ActionBuildShelter.c.

Referenced by DetermineConstructionSounds(), and PlayActionFinishSound().

◆ m_SoundsetBuildLoop

string ActionBuildShelter::m_SoundsetBuildLoop
private

Definition at line 4 of file ActionBuildShelter.c.

Referenced by DetermineConstructionSounds(), and PlayActionLoopSound().

◆ m_SoundsetBuildStart

string ActionBuildShelter::m_SoundsetBuildStart
private

Definition at line 3 of file ActionBuildShelter.c.

Referenced by DetermineConstructionSounds(), and PlayActionStartSound().


The documentation for this class was generated from the following file: