DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionBuryAshes.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7}
8
10{
11 void ActionBuryAshes()
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
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}
void CreateConditionComponents()
Definition ActionBase.c:218
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
ActionBuryAshesCB ActionContinuousBaseCB ActionBuryAshes()
class ActionTargets ActionTarget
eBrokenLegs
Definition EBrokenLegs.c:2
protected ActionData m_ActionData
override void CreateActionComponent()
protected void OnFinishProgressServer(ActionData action_data)
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
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native void ObjectDelete(Object obj)
const float DEFAULT
const float BURY_ASHES
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()