actiontuneradiostation.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. class ActionTuneRadioStationCB : ActionContinuousBaseCB
  2. {
  3. private const float REPEAT_AFTER_SEC = 1.0;
  4. override void CreateActionComponent()
  5. {
  6. m_ActionData.m_ActionComponent = new CAContinuousRepeat(REPEAT_AFTER_SEC);
  7. }
  8. }
  9. class ActionTuneRadioStation: ActionContinuousBase
  10. {
  11. void ActionTuneRadioStation()
  12. {
  13. m_CallbackClass = ActionTuneRadioStationCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_TUNE;
  15. m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_ITEM_TUNE;
  16. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
  17. m_Text = "#tune_radio_station";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionTarget = new CCTNone;
  22. m_ConditionItem = new CCINonRuined;
  23. }
  24. override bool HasProneException()
  25. {
  26. return true;
  27. }
  28. override bool HasTarget()
  29. {
  30. return false;
  31. }
  32. override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
  33. {
  34. Radio radio = Radio.Cast( item );
  35. if ( radio.CanOperate() )
  36. {
  37. return true;
  38. }
  39. return false;
  40. }
  41. override void OnFinishProgressServer( ActionData action_data )
  42. {
  43. Radio radio = Radio.Cast( action_data.m_MainItem );
  44. radio.TuneNextStation();
  45. }
  46. }