Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionbuildoven.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime( UATimeSpent.DEFAULT_CONSTRUCT );
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionBuildOvenCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18  m_Text = "#build_oven";
19  }
20 
21  override void CreateConditionComponents()
22  {
23 
26  }
27 
28  override typename GetInputType()
29  {
31  }
32 
33  override bool HasProgress()
34  {
35  return true;
36  }
37 
38  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
39  {
40  //Action not allowed if player has broken legs
41  if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
42  return false;
43 
44  Object target_object = target.GetObject();
45 
46  if ( target_object && target_object.IsFireplace() )
47  {
48  FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
49 
50  if ( fireplace_target.IsBaseFireplace() && fireplace_target.CanBuildOven() )
51  {
52  return true;
53  }
54  }
55 
56  return false;
57  }
58 
59  override void OnFinishProgressServer( ActionData action_data )
60  {
61  Object target_object = action_data.m_Target.GetObject();
62  FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
63 
64  if ( fireplace_target.CanBuildOven() )
65  {
66  ItemBase attached_item = ItemBase.Cast( fireplace_target.GetAttachmentByType( fireplace_target.ATTACHMENT_STONES ) );
67 
68  /*InventoryLocation inventory_location = new InventoryLocation;
69  attached_item.GetInventory().GetCurrentInventoryLocation( inventory_location );
70  fireplace_target.GetInventory().SetSlotLock( inventory_location.GetSlot(), true );*/
71 
72  //set oven state
73  fireplace_target.SetOvenState( true );
74  fireplace_target.SetOrientation( action_data.m_Player.GetOrientation() - "180 0 0" );
75 
76  // extend lifetime
77  fireplace_target.SetLifetimeMax( FireplaceBase.LIFETIME_FIREPLACE_STONE_OVEN );
78 
79  //add specialty to soft skills
80  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
81  }
82  }
83 }
ItemBase
Definition: inventoryitem.c:730
ActionBuildOvenCB
Definition: actionbuildoven.c:1
ActionBuildOven
ActionBuildOvenCB ActionContinuousBaseCB ActionBuildOven()
Definition: actionbuildoven.c:11
CCINotPresent
Definition: ccinotpresent.c:1
CAContinuousTime
Definition: cacontinuoustime.c:1
ContinuousInteractActionInput
Definition: actioninput.c:521
UASoftSkillsWeight
Definition: actionconstants.c:118
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionbuildoven.c:21
FireplaceBase
Definition: barrelholes_colorbase.c:1
UAMaxDistances
Definition: actionconstants.c:104
HasProgress
override bool HasProgress()
Definition: actionbuildoven.c:33
eBrokenLegs
eBrokenLegs
Definition: ebrokenlegs.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionbuildoven.c:38
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionbuildoven.c:59
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
GetInputType
override GetInputType()
Definition: actionbuildoven.c:28
ActionContinuousBase
Definition: actioncontinuousbase.c:132
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