Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionbreaklongwoodenstick.c
Go to the documentation of this file.
2{
3 private const float TIME_TO_BREAK_STICKS = 5.0;
4
5 override void CreateActionComponent()
6 {
7 //float adjusted_time = m_ActionData.m_Player.GetSoftSkillsManager().AdjustCraftingTime(TIME_TO_BREAK_STICKS,UASoftSkillsWeight.ROUGH_HIGH);
8 m_ActionData.m_ActionComponent = new CAContinuousTime(TIME_TO_BREAK_STICKS);
9 }
10};
11
13{
15 {
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BREAKING_STICK;
18 m_FullBody = true;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
21 m_Text = "#STR_split0";
22 }
23
24 override void CreateConditionComponents()
25 {
28 }
29
30 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
31 {
32 if (item.IsEmpty() && (!item.GetCompEM() || !item.GetCompEM().IsWorking()))
33 {
34 return true;
35 }
36 else
37 {
38 return false;
39 }
40 }
41
42 override bool HasTarget()
43 {
44 return false;
45 }
46
47 override void OnFinishProgressServer( ActionData action_data )
48 {
49 ItemBase startingItem = action_data.m_MainItem;
50
51 BreakLongWoodenStick lambda = new BreakLongWoodenStick(action_data.m_MainItem, "WoodenStick", action_data.m_Player, 3);
52 action_data.m_Player.ServerReplaceItemInHandsWithNew(lambda);
53
54 if (LongWoodenStick.Cast(startingItem) == null) // case if it is a broom
55 {
56 EntityAI longStick = action_data.m_Player.SpawnEntityOnGroundRaycastDispersed("LongWoodenStick");
57
58 ItemBase item_result;
59 Class.CastTo(item_result, longStick);
60
61 MiscGameplayFunctions.TransferItemProperties(action_data.m_MainItem, item_result);
62 }
63 }
64};
65
67{
68 int m_ItemCount;
69
70 void BreakLongWoodenStick(EntityAI old_item, string new_item_type, PlayerBase player, int count)
71 {
72 m_ItemCount = count;
73 }
74
75 override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
76 {
77 super.CopyOldPropertiesToNew(old_item, new_item);
78
79 ItemBase sticks;
80 Class.CastTo(sticks, new_item);
81
82 ItemBase ingredient;
83 Class.CastTo(ingredient, old_item);
84
85 MiscGameplayFunctions.TransferItemProperties(ingredient, sticks);
86
87 sticks.SetQuantity(m_ItemCount);
88 }
89};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
Super root of all classes in Enforce script.
Definition enscript.c:11
base class for transformation operations (creating one item from another)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
class SeedPackBase extends Inventory_Base m_ItemCount