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

Go to the source code of this file.

Classes

class  ActionBuildOvenCB
 

Functions

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

Function Documentation

◆ ActionBuildOven()

Definition at line 1 of file ActionBuildOven.c.

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 }
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().

◆ ActionCondition()

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

Definition at line 38 of file ActionBuildOven.c.

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

◆ CreateActionComponent()

override void ActionBuildOven::CreateActionComponent ( )

Definition at line 12 of file ActionBuildOven.c.

12 {
13 m_CallbackClass = ActionBuildOvenCB;
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 21 of file ActionBuildOven.c.

22 {
23
26 }
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 ( )

Definition at line 28 of file ActionBuildOven.c.

◆ HasProgress()

override bool HasProgress ( )

Definition at line 33 of file ActionBuildOven.c.

34 {
35 return true;
36 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 57 of file ActionBuildOven.c.

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 }

References m_SpecialtyWeight.