Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 {
12  {
13  m_CallbackClass = ActionBuryAshesCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
18  m_Text = "#bury";
19  }
20 
21  override void CreateConditionComponents()
22  {
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  //add soft skill specialty
66  action_data.m_Player.GetSoftSkillsManager().AddSpecialty(UASoftSkillsWeight.ROUGH_LOW);
67  }
68 }
ItemBase
Definition: inventoryitem.c:730
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionburyashes.c:58
GetGame
proto native CGame GetGame()
CAContinuousTime
Definition: cacontinuoustime.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionburyashes.c:27
eBrokenLegs
eBrokenLegs
Definition: ebrokenlegs.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionburyashes.c:21
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionBuryAshesCB
Definition: actionburyashes.c:1
ActionBuryAshes
ActionBuryAshesCB ActionContinuousBaseCB ActionBuryAshes()
Definition: actionburyashes.c:11