DayZ 1.24
Loading...
Searching...
No Matches
ActionMineTree.c
Go to the documentation of this file.
5
7{
8 private const float TIME_BETWEEN_MATERIAL_DROPS_DEFAULT = 4;
9
10 override void CreateActionComponent()
11 {
12 m_ActionData.m_ActionComponent = new CAContinuousMineWood(TIME_BETWEEN_MATERIAL_DROPS_DEFAULT);
13 }
14};
15
17{
19
21 {
23 data.m_HarvestType = m_HarvestType;
24 return data;
25 }
26
28 {
29 m_Text = "#harvest" + " " + GetYieldName(player, target, item);
30 }
31
33 {
34 //given the circumstances, the implementation bellow is the path of least resistance
35 Object targetObject = target.GetObject();
38 string yieldName;
39 if (wood || rock)
40 {
42 if (wood)
43 wood.GetMaterialAndQuantityMapEx(item, output_map, m_HarvestType);
44 else
45 rock.GetMaterialAndQuantityMap(item, output_map);
46 if (output_map.Count() > 0)
47 yieldName = MiscGameplayFunctions.GetItemDisplayName(output_map.GetKey(0));
48 }
49 return yieldName;
50 }
51
52}
53
54class ActionMineTree : ActionMineBase
55{
56 void ActionMineTree()
57 {
58 m_CallbackClass = ActionMineTreeCB;
59 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_HACKTREE;
60 m_FullBody = true;
61 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
63 }
64
70
71 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
72 {
73 //Action not allowed if player has broken legs
74 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
75 return false;
76
77 Object targetObject = target.GetObject();
78
79 return targetObject.IsTree() && targetObject.IsCuttable();
80 }
81
84 {
85 if (!action_data.m_Player.IsPlayerInStance(action_data.m_PossibleStanceMask) || !m_ConditionItem || !m_ConditionItem.CanContinue(action_data.m_Player, action_data.m_MainItem))
86 return false;
87
89 }
90
92 {
93 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
94 }
95};
override void OnFinishProgressServer(ActionData action_data)
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
bool CanContinue(ActionData action_data)
Definition ActionBase.c:686
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:350
bool ActionConditionContinue(ActionData action_data)
Definition ActionBase.c:345
int m_StanceMask
Definition ActionBase.c:53
ActionEmptyMagazine CreateActionComponent
ActionMineBase ActionContinuousBase ActionMineTree()
MineActionData TIME_BETWEEN_MATERIAL_DROPS_DEFAULT
eBrokenLegs
Definition EBrokenLegs.c:2
void WoodBase()
Definition WoodBase.c:30
EHarvestType
Definition WoodBase.c:2
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
string GetYieldName(PlayerBase player, ActionTarget target, ItemBase item)
EHarvestType m_HarvestType
override ActionData CreateActionData()
EHarvestType m_HarvestType
const float SMALL
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597