Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsetalarmclock.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  AlarmClock_ColorBase alarm = AlarmClock_ColorBase.Cast(m_ActionData.m_MainItem);
9  CAContinuousRepeat.Cast(m_ActionData.m_ActionComponent).SetProgress(alarm.GetAnimationPhase("ClockAlarm") * TIME_TO_COMPLETE);
10  }
11 };
12 
14 {
15  void ActionSetAlarmClock()
16  {
17  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_SET_ALARM;
18  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_SET_ALARM;
20 
21  m_CallbackClass = ActionSetAlarmClockCB;
22  m_Text = "#STR_SetAlarm0";
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  override void OnStart(ActionData action_data)
42  {
43  }
44 
45  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
46  {
47  return true;
48  }
49 
50  override void OnEndServer(ActionData action_data)
51  {
52  float progress = action_data.m_Callback.GetActionComponentProgress();
53  AlarmClock_ColorBase clock = AlarmClock_ColorBase.Cast(action_data.m_MainItem);
54  clock.SetAlarmTimeServer(progress);
55  }
56 
57  override void OnUpdate(ActionData action_data)
58  {
59  if (action_data.m_Callback)
60  {
61  float progress = action_data.m_Callback.GetActionComponentProgress();
62  AlarmClock_ColorBase alarm = AlarmClock_ColorBase.Cast(action_data.m_MainItem);
63  alarm.SetAnimationPhaseNow("ClockAlarm", progress);
64  }
65  }
66 
67 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
ActionSetAlarmClock
Definition: actionsetalarmclock.c:13
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
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
ActionSetAlarmClockCB
Definition: actionsetalarmclock.c:1
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
AlarmClock_ColorBase
Definition: alarmclock.c:1
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68