Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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 {
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
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.IsCorpse() || (!bodyEAI.IsAlive() && (bodyEAI.IsInherited(DayZCreature) || bodyEAI.IsInherited(Man)))) && !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.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 4);
68 }
69};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
Super root of all classes in Enforce script.
Definition enscript.c:11
DayZGame g_Game
Definition dayzgame.c:3868
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()