actionshave.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. class ActionShaveCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.SHAVE);
  6. }
  7. };
  8. class ActionShave: ActionContinuousBase
  9. {
  10. void ActionShave()
  11. {
  12. m_CallbackClass = ActionShaveCB;
  13. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_SHAVE;
  15. m_FullBody = false;
  16. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
  17. m_Text = "#shave_myself";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionItem = new CCINonRuined;
  22. m_ConditionTarget = new CCTSelf;
  23. }
  24. override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
  25. {
  26. if ( player.CanShave() )
  27. {
  28. return true;
  29. }
  30. return false;
  31. }
  32. override bool HasTarget()
  33. {
  34. return false;
  35. }
  36. override bool IsShaveSelf()
  37. {
  38. return true;
  39. }
  40. override void OnFinishProgressServer( ActionData action_data )
  41. {
  42. action_data.m_Player.ShavePlayer();
  43. }
  44. override void OnFinishProgressClient( ActionData action_data )
  45. {
  46. super.OnFinishProgressClient( action_data );
  47. GetGame().GetAnalyticsClient().OnActionFinishedShaveSelf();
  48. }
  49. };