DayZ 1.24
Loading...
Searching...
No Matches
ActionCookOnStick.c
Go to the documentation of this file.
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_GESTUREFB_CAMPFIRE;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
20
21 m_LockTargetOnUse = false;
22 m_Text = "#cook_on_stick";
23 }
24
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
34 Object targetObject = target.GetObject();
35 Edible_Base item_on_stick = Edible_Base.Cast(item.GetAttachmentByType(Edible_Base));
36 if (fireplace_target && fireplace_target.CanCookOnStick() && item_on_stick && item_on_stick.CanBeCookedOnStick())
37 {
38 //fireplace
39 if (fireplace_target.IsBaseFireplace())
40 {
41 Fireplace fireplace = Fireplace.Cast(fireplace_target);
42 if (!fireplace.IsOven() && fireplace_target.CanCookOnStick())
43 return true;
44 }
45
46 //fireplace indoor
47 if (fireplace_target.IsFireplaceIndoor())
48 {
49 if (fireplace_target.CanCookOnStick())
50 return true;
51 }
52 }
53
54 return false;
55 }
56
58 {
59 super.OnEndServer(action_data);
60
61 ItemBase stick = action_data.m_MainItem;
62 Edible_Base item_on_stick = Edible_Base.Cast(stick.GetAttachmentByType(Edible_Base));
63
64 if (item_on_stick)
65 item_on_stick.MakeSoundsOnClient(false);
66 }
67};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
bool m_LockTargetOnUse
Definition ActionBase.c:51
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
ActionData m_ActionData
override void CreateActionComponent()
const float COOKING_ON_STICK_UPDATE_TIME
override void OnEndServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
ref CABase m_ActionComponent
Definition ActionBase.c:30
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597