actionminerock.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. class ActionMineRockCB : ActionContinuousBaseCB
  2. {
  3. private const float TIME_BETWEEN_MATERIAL_DROPS = 8;
  4. override void CreateActionComponent()
  5. {
  6. m_ActionData.m_ActionComponent = new CAContinuousMineRock(TIME_BETWEEN_MATERIAL_DROPS);
  7. }
  8. };
  9. class ActionMineRock: ActionMineBase
  10. {
  11. void ActionMineRock()
  12. {
  13. m_CallbackClass = ActionMineRockCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_MINEROCK;
  15. m_FullBody = true;
  16. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
  17. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
  18. //m_Text = "#mine";
  19. }
  20. override void CreateConditionComponents()
  21. {
  22. m_ConditionTarget = new CCTCursor(UAMaxDistances.DEFAULT);
  23. m_ConditionItem = new CCINonRuined;
  24. }
  25. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  26. {
  27. //Action not allowed if player has broken legs
  28. if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
  29. return false;
  30. Object targetObject = target.GetObject();
  31. if ( targetObject.IsRock() )
  32. {
  33. return true;
  34. }
  35. return false;
  36. }
  37. override string GetSoundCategory(ActionData action_data)
  38. {
  39. ItemBase item = action_data.m_MainItem;
  40. if (item.IsKindOf("Hammer"))
  41. {
  42. return "MinningLight";
  43. }
  44. else if (item.IsKindOf("MeatTenderizer"))
  45. {
  46. return "MinningHard";
  47. }
  48. return "";
  49. }
  50. };
  51. class ActionMineRock1H : ActionMineRock
  52. {
  53. void ActionMineRock1H()
  54. {
  55. m_CallbackClass = ActionMineRockCB;
  56. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_ASSEMBLE;
  57. m_FullBody = true;
  58. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
  59. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
  60. }
  61. }