DayZ 1.24
Loading...
Searching...
No Matches
ActionMineTree.c File Reference

Go to the source code of this file.

Classes

class  MineActionData
 
class  ActionMineBase
 

Functions

override void CreateActionComponent ()
 
ActionMineBase ActionContinuousBase ActionMineTree ()
 
override ActionData CreateActionData ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
string GetYieldName (PlayerBase player, ActionTarget target, ItemBase item)
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanContinue (ActionData action_data)
 not checking target damage anymore, callback takes care of that
 
override void OnFinishProgressServer (ActionData action_data)
 

Variables

MineActionData TIME_BETWEEN_MATERIAL_DROPS_DEFAULT = 4
 
EHarvestType m_HarvestType = EHarvestType.NORMAL
 

Function Documentation

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 71 of file ActionMineTree.c.

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 }
eBrokenLegs
Definition EBrokenLegs.c:2

◆ ActionMineTree()

Definition at line 10 of file ActionMineTree.c.

57 {
58 m_CallbackClass = ActionMineTreeCB;
59 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_HACKTREE;
60 m_FullBody = true;
61 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
63 }
bool m_FullBody
Definition ActionBase.c:52
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References TIME_BETWEEN_MATERIAL_DROPS_DEFAULT.

◆ CanContinue()

override bool CanContinue ( ActionData action_data)

not checking target damage anymore, callback takes care of that

Definition at line 83 of file ActionMineTree.c.

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 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
bool ActionConditionContinue(ActionData action_data)
Definition ActionBase.c:345

References ActionConditionContinue(), and m_ConditionItem.

◆ CreateActionComponent()

override void CreateActionComponent ( )

Definition at line 10 of file ActionMineTree.c.

11 {
12 m_ActionData.m_ActionComponent = new CAContinuousMineWood(TIME_BETWEEN_MATERIAL_DROPS_DEFAULT);
13 }
MineActionData TIME_BETWEEN_MATERIAL_DROPS_DEFAULT

◆ CreateActionData()

override ActionData ActionMineTree::CreateActionData ( )

Definition at line 59 of file ActionMineTree.c.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 65 of file ActionMineTree.c.

◆ GetYieldName()

string ActionMineTree::GetYieldName ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 71 of file ActionMineTree.c.

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 }
override bool CanContinue(ActionData action_data)
not checking target damage anymore, callback takes care of that

◆ OnActionInfoUpdate()

override void ActionMineTree::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 91 of file ActionMineTree.c.

92 {
93 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
94 }

References m_SpecialtyWeight.

Variable Documentation

◆ m_HarvestType

Definition at line 57 of file ActionMineTree.c.

Referenced by ActionMineTreeBark::ActionMineTreeBark().

◆ TIME_BETWEEN_MATERIAL_DROPS_DEFAULT

MineActionData TIME_BETWEEN_MATERIAL_DROPS_DEFAULT = 4

Referenced by ActionMineTree().