DayZ 1.24
Loading...
Searching...
No Matches
ActionBuildOven.c
Go to the documentation of this file.
2{
7}
8
10{
11 void ActionBuildOven()
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
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 {
49
50 if (fireplace_target.IsBaseFireplace() && fireplace_target.CanBuildOven())
51 return true;
52 }
53
54 return false;
55 }
56
58 {
59 Object target_object = action_data.m_Target.GetObject();
61
62 if (fireplace_target.CanBuildOven())
63 {
64 ItemBase attached_item = ItemBase.Cast(fireplace_target.GetAttachmentByType(fireplace_target.ATTACHMENT_STONES));
65
66 /*InventoryLocation inventory_location = new InventoryLocation;
67 attached_item.GetInventory().GetCurrentInventoryLocation( inventory_location );
68 fireplace_target.GetInventory().SetSlotLock( inventory_location.GetSlot(), true );*/
69
70 //set oven state
71 fireplace_target.SetOvenState(true);
72 fireplace_target.SetOrientation(action_data.m_Player.GetOrientation() - "180 0 0");
73
74 // extend lifetime
75 fireplace_target.SetLifetimeMax(FireplaceBase.LIFETIME_FIREPLACE_STONE_OVEN);
76
77 //add specialty to soft skills
78 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
79 }
80 }
81}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
bool HasProgress()
For UI: hiding of progress bar.
Definition ActionBase.c:216
ActionBuildOvenCB ActionContinuousBaseCB ActionBuildOven()
eBrokenLegs
Definition EBrokenLegs.c:2
ActionData m_ActionData
override void CreateActionComponent()
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const float DEFAULT
const float DEFAULT_CONSTRUCT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597