Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionraisemegaphone.c
Go to the documentation of this file.
2 {
3  private const float REPEAT_AFTER_SEC = -1.0;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousTime( -1 );
8  }
9 }
10 
12 {
14  {
15  m_CallbackClass = ActionRaiseMegaphoneCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_RAISEITEM;
17  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_RAISEITEM;
18  m_Text = "#raise_megaphone";
19  }
20 
21  override void CreateConditionComponents()
22  {
25  }
26 
27  override bool HasProneException()
28  {
29  return true;
30  }
31 
32  override bool HasProgress()
33  {
34  return false;
35  }
36 
37  override bool HasTarget()
38  {
39  return false;
40  }
41 
42  override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
43  {
44  if ( item.IsTransmitter() )
45  {
46  ItemMegaphone megaphone = ItemMegaphone.Cast( item );
47 
48  if ( megaphone && megaphone.GetCompEM().IsWorking() )
49  {
50  return true;
51  }
52  }
53 
54  return false;
55  }
56 
57  override void OnStartServer( ActionData action_data )
58  {
59  ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
60  megaphone.SetCanSpeak( true );
61  }
62 
63  override void OnEndServer( ActionData action_data )
64  {
65  ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
66  megaphone.SetCanSpeak( false );
67  }
68 
69  override void OnStartClient( ActionData action_data )
70  {
71  ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
72  megaphone.SetCanSpeak( true );
73  }
74 
75  override void OnEndClient( ActionData action_data )
76  {
77  ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
78  megaphone.SetCanSpeak( false );
79  }
80 
81 }
ItemBase
Definition: inventoryitem.c:730
HasProgress
override bool HasProgress()
Definition: actionraisemegaphone.c:32
OnStartServer
override void OnStartServer(ActionData action_data)
Definition: actionraisemegaphone.c:57
CAContinuousTime
Definition: cacontinuoustime.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionraisemegaphone.c:42
CCTNone
Definition: cctnone.c:1
OnEndServer
override void OnEndServer(ActionData action_data)
Definition: actionraisemegaphone.c:63
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionraisemegaphone.c:21
ActionRaiseMegaphone
ActionRaiseMegaphoneCB ActionContinuousBaseCB ActionRaiseMegaphone()
Definition: actionraisemegaphone.c:13
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ItemMegaphone
Definition: megaphone.c:1
HasProneException
override bool HasProneException()
Definition: actionraisemegaphone.c:27
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionRaiseMegaphoneCB
Definition: actionraisemegaphone.c:1
OnEndClient
override void OnEndClient(ActionData action_data)
Definition: actionraisemegaphone.c:75
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
OnStartClient
override void OnStartClient(ActionData action_data)
Definition: actionraisemegaphone.c:69
HasTarget
override bool HasTarget()
Definition: actionraisemegaphone.c:37