Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsetkitchentimer.c
Go to the documentation of this file.
2 {
3  const float TIME_TO_COMPLETE = 24.0;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousRepeat(TIME_TO_COMPLETE);
8  KitchenTimer clock = KitchenTimer.Cast(m_ActionData.m_MainItem);
9  CAContinuousRepeat.Cast(m_ActionData.m_ActionComponent).SetProgress(clock.GetAnimationPhase("ClockAlarm") * TIME_TO_COMPLETE);
10  }
11 };
12 
14 {
16  {
17  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_SET_KITCHENTIMER;
18  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONMOD_SET_KITCHENTIMER;
20 
21  m_CallbackClass = ActionSetKitchenTimerCB;
22  m_Text = "#STR_SetTimer0";
23  }
24 
25  override void CreateConditionComponents()
26  {
29  }
30 
31  override bool HasProneException()
32  {
33  return true;
34  }
35 
36  override bool HasTarget()
37  {
38  return false;
39  }
40 
41 
42  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
43  {
44  return true;
45  }
46 
47  override void OnEndServer(ActionData action_data)
48  {
49  float progress = action_data.m_Callback.GetActionComponentProgress();
50  KitchenTimer clock = KitchenTimer.Cast(action_data.m_MainItem);
51  clock.SetAlarmTimeServer(progress);
52  }
53 
54  override void OnEndAnimationLoopServer( ActionData action_data )
55  {
56 
57  }
58 
59  override void OnUpdate(ActionData action_data)
60  {
61  float progress = action_data.m_Callback.GetActionComponentProgress();
62  KitchenTimer clock = KitchenTimer.Cast(action_data.m_MainItem);
63  clock.SetAnimationPhaseNow("ClockAlarm", progress);
64  }
65 
66 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
KitchenTimer
Definition: kitchentimer.c:1
ActionSetKitchenTimerCB
Definition: actionsetkitchentimer.c:1
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
ActionSetKitchenTimer
Definition: actionsetkitchentimer.c:13
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68