DayZ 1.24
Loading...
Searching...
No Matches
ActionDismantleOven.c File Reference

Go to the source code of this file.

Classes

class  ActionDismantleOvenCB
 

Functions

ActionDismantleOvenCB ActionContinuousBaseCB ActionDismantleOven ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 39 of file ActionDismantleOven.c.

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 }
eBrokenLegs
Definition EBrokenLegs.c:2

◆ ActionDismantleOven()

Definition at line 1 of file ActionDismantleOven.c.

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 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions(), and FireplaceBase::SetActions().

◆ CreateActionComponent()

override void ActionDismantleOven::CreateActionComponent ( )

Definition at line 12 of file ActionDismantleOven.c.

12 {
13 m_CallbackClass = ActionDismantleOvenCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;

References m_FullBody, m_SpecialtyWeight, m_StanceMask, m_Text, and UASoftSkillsWeight::ROUGH_HIGH.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 22 of file ActionDismantleOven.c.

23 {
24
27 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override GetInputType ( )

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 58 of file ActionDismantleOven.c.

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 }
InventoryLocation.

References m_SpecialtyWeight.