Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondecraftdrysackbag.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DEFAULT_DECRAFT);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionDeCraftDrysackBagCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18  m_Text = "#dismantle";
19  }
20 
21  override void CreateConditionComponents()
22  {
24  m_ConditionTarget = new CCTNone();
25  }
26 
27  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item )
28  {
29  return item.IsEmpty();
30  }
31 
32  override bool HasTarget()
33  {
34  return false;
35  }
36 
37  override void OnFinishProgressServer(ActionData action_data )
38  {
39  EntityAI mainItem = action_data.m_MainItem;
40 
41  string color = mainItem.ConfigGetString("color");
42  string className = "WaterproofBag_" + color;
43 
44  EntityAI result1 = action_data.m_Player.SpawnEntityOnGroundPos(className, action_data.m_Player.GetPosition());
45  EntityAI result2 = action_data.m_Player.SpawnEntityOnGroundPos("Rope", action_data.m_Player.GetPosition());
46 
47  if (!result1 || !result2)
48  return;
49 
50  MiscGameplayFunctions.TransferItemProperties(mainItem, result1);
51  MiscGameplayFunctions.TransferItemProperties(mainItem, result2);
52 
53  action_data.m_MainItem.Delete();
54  }
55 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondecraftdrysackbag.c:27
CCTNone
Definition: cctnone.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondecraftdrysackbag.c:37
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
HasTarget
override bool HasTarget()
Definition: actiondecraftdrysackbag.c:32
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondecraftdrysackbag.c:21
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionDeCraftDrysackBag
ActionDeCraftDrysackBagCB ActionContinuousBaseCB ActionDeCraftDrysackBag()
Definition: actiondecraftdrysackbag.c:11
ActionDeCraftDrysackBagCB
Definition: actiondecraftdrysackbag.c:1
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