DayZ 1.24
Loading...
Searching...
No Matches
ActionDismantleOven.c
Go to the documentation of this file.
2{
7}
8
10{
12 {
13 m_CallbackClass = ActionDismantleOvenCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18
19 m_Text = "#dismantle_oven";
20 }
21
28
29 override typename GetInputType()
30 {
32 }
33
34 /*override bool HasProgress()
35 {
36 return false;
37 }*/
38
39 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
40 {
41 //Action not allowed if player has broken legs
42 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
43 return false;
44
45 Object target_object = target.GetObject();
46
47 if (target_object && target_object.IsFireplace())
48 {
50
51 if (fireplace_target.IsBaseFireplace() && fireplace_target.CanDismantleOven())
52 return true;
53 }
54
55 return false;
56 }
57
59 {
60 Object target_object = action_data.m_Target.GetObject();
62
63 if (fireplace_target.CanDismantleOven())
64 {
65 ItemBase attached_item = ItemBase.Cast(fireplace_target.GetAttachmentByType(fireplace_target.ATTACHMENT_STONES));
66
67 // for backward compatibility - for the cases built before slot locking was commented out for the stone att slot
69 attached_item.GetInventory().GetCurrentInventoryLocation(inventory_location);
70 fireplace_target.GetInventory().SetSlotLock(inventory_location.GetSlot(), false);
71
72 //set oven state
73 fireplace_target.SetOvenState(false);
74
75 // extend lifetime (either back to stone circle lifetime or standard fireplace one)
76 if (fireplace_target.HasStoneCircle())
77 fireplace_target.SetLifetimeMax(FireplaceBase.LIFETIME_FIREPLACE_STONE_CIRCLE);
78 else
79 fireplace_target.SetLifetimeMax(10800);
80
81 //add specialty to soft skills
82 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
83 }
84 }
85}
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
ActionDismantleOvenCB ActionContinuousBaseCB ActionDismantleOven()
eBrokenLegs
Definition EBrokenLegs.c:2
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
InventoryLocation.
const float DEFAULT
const float DEFAULT_DECONSTRUCT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597