DayZ 1.24
Loading...
Searching...
No Matches
ActionBuryBody.c
Go to the documentation of this file.
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
18 m_Text = "#bury";
19 }
20
22 {
23
26 }
27
28 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
29 {
30 if (player.IsPlacingLocal())
31 return false;
32
34 Class.CastTo(bodyEAI, target.GetObject());
35
36 if (bodyEAI && !bodyEAI.IsAlive() && (bodyEAI.IsInherited(DayZCreature) || bodyEAI.IsInherited(Man) || bodyEAI.IsInherited(DeadChicken_ColorBase)) && !bodyEAI.GetParent())
37 {
38 int liquidType;
39 string surfaceType;
40 GetGame().SurfaceUnderObject(bodyEAI, surfaceType, liquidType);
41
42 if (GetGame().IsSurfaceDigable(surfaceType))
43 return true;
44 }
45
46 return false;
47 }
48
49 override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
50 {
52 return false;
53
54 return player.CheckFreeSpace(vector.Forward, 1.0, false);
55 }
56
57
59 {
60 Object targetObject = action_data.m_Target.GetObject();
61 g_Game.ObjectDelete(targetObject);
62
63 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
64
65 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
66 }
67};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
DayZGame g_Game
Definition DayZGame.c:3528
ActionData m_ActionData
override void CreateActionComponent()
override void CreateConditionComponents()
override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float BURY_BODY
static const vector Forward
Definition EnConvert.c:109
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.