DayZ 1.24
Loading...
Searching...
No Matches
ActionBuryAshes.c
Go to the documentation of this file.
2{
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
26
27 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
28 {
29 if (player.IsPlacingLocal())
30 return false;
31
32 //Action not allowed if player has broken legs
33 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
34 return false;
35
36 Fireplace fireplaceTarget = Fireplace.Cast(target.GetObject());
38 {
39 if (fireplaceTarget.HasAshes() && !fireplaceTarget.IsBurning() && fireplaceTarget.IsEmpty())
40 {
41 int liquidType;
42 string surfaceType;
43 GetGame().SurfaceUnderObject(fireplaceTarget, surfaceType, liquidType);
44 if (GetGame().IsSurfaceDigable(surfaceType))
45 return true;
46 }
47 }
48
49 return false;
50 }
51
53 {
54 //destroy fireplace with ashes
55 GetGame().ObjectDelete(action_data.m_Target.GetObject());
56
57 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
58
59 //add soft skill specialty
60 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(UASoftSkillsWeight.ROUGH_LOW);
61 }
62}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
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
ActionBuryAshesCB ActionContinuousBaseCB ActionBuryAshes()
eBrokenLegs
Definition EBrokenLegs.c:2
ActionData m_ActionData
override void CreateActionComponent()
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const float DEFAULT
const float BURY_ASHES
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()