12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- class ActionRaiseMegaphoneCB : ActionContinuousBaseCB
- {
- private const float REPEAT_AFTER_SEC = -1.0;
-
- override void CreateActionComponent()
- {
- m_ActionData.m_ActionComponent = new CAContinuousTime( -1 );
- }
- }
- class ActionRaiseMegaphone: ActionContinuousBase
- {
- void ActionRaiseMegaphone()
- {
- m_CallbackClass = ActionRaiseMegaphoneCB;
- m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_RAISEITEM;
- m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_RAISEITEM;
- m_Text = "#raise_megaphone";
- }
-
- override void CreateConditionComponents()
- {
- m_ConditionTarget = new CCTNone;
- m_ConditionItem = new CCINonRuined;
- }
-
- override bool HasProneException()
- {
- return true;
- }
- override bool HasProgress()
- {
- return false;
- }
- override bool HasTarget()
- {
- return false;
- }
- override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
- {
- if ( item.IsTransmitter() )
- {
- ItemMegaphone megaphone = ItemMegaphone.Cast( item );
-
- if ( megaphone && megaphone.GetCompEM().IsWorking() )
- {
- return true;
- }
- }
-
- return false;
- }
- override void OnStartServer( ActionData action_data )
- {
- super.OnStartServer(action_data);
-
- ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
- megaphone.SetCanSpeak( true );
- }
-
- override void OnEndServer( ActionData action_data )
- {
- super.OnEndServer(action_data);
-
- ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
- megaphone.SetCanSpeak( false );
- }
-
- override void OnStartClient( ActionData action_data )
- {
- ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
- megaphone.SetCanSpeak( true );
- }
-
- override void OnEndClient( ActionData action_data )
- {
- ItemMegaphone megaphone = ItemMegaphone.Cast( action_data.m_MainItem );
- megaphone.SetCanSpeak( false );
- }
-
- }
|