DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
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 {
8 }
9};
10
12{
14 {
15
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
18 m_FullBody = true;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
21 m_Text = "#STR_CraftStoneKnife0";
22 }
23
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};
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
class ActionTargets ActionTarget
eBrokenLegs
Definition EBrokenLegs.c:2
protected ActionData m_ActionData
private const float TIME_TO_CRAFT_KNIFE
override void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602