Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionburyashes.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.BURY_ASHES);
6 }
7}
8
10{
11 void ActionBuryAshes()
12 {
13 m_CallbackClass = ActionBuryAshesCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
17 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
18 m_Text = "#bury";
19 }
20
22 {
23 m_ConditionTarget = new CCTNonRuined(UAMaxDistances.DEFAULT);
24 m_ConditionItem = new CCINonRuined();
25 }
26
27 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
28 {
29 if (player.IsPlacingLocal())
30 {
31 return false;
32 }
33
34 //Action not allowed if player has broken legs
35 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
36 {
37 return false;
38 }
39
40 Fireplace fireplaceTarget = Fireplace.Cast(target.GetObject());
41 if (fireplaceTarget)
42 {
43 if (fireplaceTarget.HasAshes() && !fireplaceTarget.IsBurning() && fireplaceTarget.IsEmpty())
44 {
45 int liquidType;
46 string surfaceType;
47 GetGame().SurfaceUnderObject(fireplaceTarget, surfaceType, liquidType);
48 if (GetGame().IsSurfaceDigable(surfaceType))
49 {
50 return true;
51 }
52 }
53 }
54
55 return false;
56 }
57
58 override void OnFinishProgressServer(ActionData action_data)
59 {
60 //destroy fireplace with ashes
61 GetGame().ObjectDelete(action_data.m_Target.GetObject());
62
63 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
64 }
65}
int m_CommandUID
Definition actionbase.c:31
int m_StanceMask
Definition actionbase.c:33
ActionBuryAshesCB ActionContinuousBaseCB ActionBuryAshes()
ActionData m_ActionData
void CreateConditionComponents()
Definition actionbase.c:230
void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
eBrokenLegs
Definition ebrokenlegs.c:2
proto native CGame GetGame()