DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionBuryBody.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
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 {
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 void OnFinishProgressServer(ActionData action_data)
54 {
55 Object targetObject = action_data.m_Target.GetObject();
56 g_Game.ObjectDelete(targetObject);
57
58 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
59
60 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
61 }
62};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
DayZGame g_Game
Definition DayZGame.c:3654
protected ActionData m_ActionData
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float BURY_BODY
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.