Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actioncraftstoneknifeenv.c
Go to the documentation of this file.
2 {
3  private const float TIME_TO_CRAFT_KNIFE = 5;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousTime(TIME_TO_CRAFT_KNIFE);
8  }
9 };
10 
12 {
14  {
15 
16  m_CallbackClass = ActionCraftStoneKnifeEnvCB;
17  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
18  m_FullBody = true;
19  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
21  m_Text = "#STR_CraftStoneKnife0";
22  }
23 
24  override void CreateConditionComponents()
25  {
28  }
29 
30  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
31  {
32  //Action not allowed if player has broken legs
33  if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
34  return false;
35 
36  Object targetObject = target.GetObject();
37  if ( targetObject.IsRock() )
38  {
39  return true;
40  }
41  return false;
42 
43  }
44 
45  override void OnFinishProgressServer( ActionData action_data )
46  {
47  EntityAI item_ingredient = action_data.m_MainItem;
48  EntityAI knife;
49 
50  knife = action_data.m_Player.SpawnEntityOnGroundPos("StoneKnife", action_data.m_Player.GetPosition());
51  action_data.m_MainItem.Delete();
52 
53  MiscGameplayFunctions.TransferItemProperties(item_ingredient, knife);
54 
55  }
56 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
ActionCraftStoneKnifeEnv
Definition: actioncraftstoneknifeenv.c:11
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
ActionCraftStoneKnifeEnvCB
Definition: actioncraftstoneknifeenv.c:1
eBrokenLegs
eBrokenLegs
Definition: ebrokenlegs.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
Object
Definition: objecttyped.c:1
CCTCursor
Definition: cctcursor.c:1
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
EntityAI
Definition: building.c:5