actionbuildpartswitch.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //!DEPRECATED
  2. class ActionBuildPartSwitch: ActionSingleUseBase
  3. {
  4. void ActionBuildPartSwitch()
  5. {
  6. //m_StanceMask = DayZPlayerConstants.STANCEMASK_NOTRAISED;
  7. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
  8. m_FullBody = true;
  9. m_Text = "#switch_to_the_next_part";
  10. }
  11. override void CreateConditionComponents()
  12. {
  13. m_ConditionItem = new CCINonRuined;
  14. m_ConditionTarget = new CCTNonRuined(UAMaxDistances.BASEBUILDING);
  15. }
  16. override bool IsInstant()
  17. {
  18. return true;
  19. }
  20. override bool RemoveForceTargetAfterUse()
  21. {
  22. return false;
  23. }
  24. override bool UseAcknowledgment()
  25. {
  26. return true;
  27. }
  28. override bool CanBeUsedLeaning()
  29. {
  30. return false;
  31. }
  32. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  33. {
  34. return false;
  35. }
  36. //-------------------------------------------------
  37. override void OnStartClient(ActionData action_data)
  38. {
  39. super.OnStartClient( action_data );
  40. SetNextIndex(action_data);
  41. }
  42. override void OnStartServer(ActionData action_data)
  43. {
  44. super.OnStartServer( action_data );
  45. if (!GetGame().IsMultiplayer())
  46. SetNextIndex(action_data);
  47. }
  48. void SetNextIndex(ActionData action_data)
  49. {
  50. ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
  51. construction_action_data.SetNextIndex();
  52. }
  53. }