Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionturnonalarmclock.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CASingleUseTurnOnPlugged;
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionTurnOnAlarmClockCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_STOP_ALARM;
15  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_STOP_ALARM;
16  m_Text = "#turn_on";
17  }
18 
19  override bool HasProneException()
20  {
21  return true;
22  }
23 
24  override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
25  {
26  AlarmClock_ColorBase alarm = AlarmClock_ColorBase.Cast(item);
27  return (!alarm.IsAlarmOn() && !alarm.IsRinging());
28  }
29 
30  /*
31  override void OnExecuteClient( ActionData action_data )
32  {
33  AlarmClock_ColorBase alarm = AlarmClock_ColorBase.Cast(action_data.m_MainItem);
34  if (alarm)
35  alarm.TurnOnClient();
36  }
37  */
38 
39  override void OnExecuteServer( ActionData action_data )
40  {
41  AlarmClock_ColorBase alarm = AlarmClock_ColorBase.Cast(action_data.m_MainItem);
42  if (alarm)
43  alarm.TurnOn();
44  }
45 }
ItemBase
Definition: inventoryitem.c:730
ActionTurnOnWhileInHands
Definition: actionturnonwhileinhands.c:1
HasProneException
override bool HasProneException()
Definition: actionturnonalarmclock.c:19
ActionSingleUseBaseCB
Definition: actionsingleusebase.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionturnonalarmclock.c:24
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition: actionturnonalarmclock.c:39
ActionTurnOnAlarmClockCB
Definition: actionturnonalarmclock.c:1
ActionTurnOnAlarmClock
ActionTurnOnAlarmClockCB ActionSingleUseBaseCB ActionTurnOnAlarmClock()
Definition: actionturnonalarmclock.c:11
CASingleUseTurnOnPlugged
Definition: casingleuseturnonplugged.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
AlarmClock_ColorBase
Definition: alarmclock.c:1