Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionburybody.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.BURY_BODY);
6  }
7 };
8 
10 {
11  void ActionBuryBody()
12  {
13  m_CallbackClass = ActionBuryBodyCB;
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  {
23 
26  }
27 
28  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
29  {
30  if (player.IsPlacingLocal())
31  {
32  return false;
33  }
34 
35  EntityAI bodyEAI;
36  Class.CastTo(bodyEAI, target.GetObject());
37 
38  if (bodyEAI && !bodyEAI.IsAlive() && (bodyEAI.IsInherited(DayZCreature) || bodyEAI.IsInherited(Man) || bodyEAI.IsInherited(DeadChicken_ColorBase) ) && !bodyEAI.GetParent())
39  {
40  int liquidType;
41  string surfaceType;
42  GetGame().SurfaceUnderObject(bodyEAI, surfaceType, liquidType);
43 
44  if (GetGame().IsSurfaceDigable(surfaceType))
45  {
46  return true;
47  }
48  }
49 
50  return false;
51  }
52 
53  override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
54  {
55  if (!super.Can(player, target, item, condition_mask))
56  return false;
57 
58  return player.CheckFreeSpace(vector.Forward, 1.0, false);
59  }
60 
61 
62  override void OnFinishProgressServer(ActionData action_data)
63  {
64  Object targetObject = action_data.m_Target.GetObject();
65  g_Game.ObjectDelete(targetObject);
66 
67  MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
68 
69  action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
70  }
71 };
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
ActionBuryBodyCB
Definition: actionburybody.c:1
CAContinuousTime
Definition: cacontinuoustime.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
DeadChicken_ColorBase
class PurificationTablets extends Edible_Base DeadChicken_ColorBase
CCTDummy
Definition: cctdummy.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
vector
Definition: enconvert.c:105
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionBuryBody
Definition: actionburybody.c:9
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
Object
Definition: objecttyped.c:1
DayZCreature
Definition: dayzanimal.c:142
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
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
EntityAI
Definition: building.c:5