actionwringclothes.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. class ActionWringClothesCB : ActionContinuousBaseCB
  2. {
  3. protected const float QUANTITY_WRINGLED_PER_SECOND = 0.02;
  4. override void CreateActionComponent()
  5. {
  6. //m_ActionData.m_ActionComponent = new CAContinuousWringClothes(QUANTITY_WRINGLED_PER_SECOND, UATimeSpent.WASH_HANDS);
  7. m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.WRING);
  8. }
  9. };
  10. class ActionWringClothes: ActionContinuousBase
  11. {
  12. void ActionWringClothes()
  13. {
  14. m_CallbackClass = ActionWringClothesCB;
  15. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WRING;
  16. m_FullBody = true;
  17. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  18. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
  19. m_Text = "#wring_clothes";
  20. }
  21. override void CreateConditionComponents()
  22. {
  23. m_ConditionItem = new CCINonRuined;
  24. m_ConditionTarget = new CCTSelf;
  25. }
  26. override bool HasTarget()
  27. {
  28. return false;
  29. }
  30. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  31. {
  32. if (player.IsInWater()) return false;
  33. //! wet+ items (so they will stay damp after wringing)
  34. if ( item && item.GetWet() >= GameConstants.STATE_WET )
  35. {
  36. return true;
  37. }
  38. else
  39. {
  40. return false;
  41. }
  42. }
  43. /*override void OnExecuteServer( ActionData action_data )
  44. {
  45. Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
  46. float delta = nacdata.param1;
  47. action_data.m_MainItem.AddWet( -delta );
  48. }*/
  49. override void OnFinishProgressServer( ActionData action_data )
  50. {
  51. /*Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
  52. float delta = nacdata.param1;
  53. action_data.m_MainItem.AddWet( -delta );*/
  54. float wetness = action_data.m_MainItem.GetWet();
  55. float wet_change;
  56. if (wetness >= GameConstants.STATE_DRENCHED)
  57. {
  58. wet_change = Math.RandomFloat(GameConstants.STATE_SOAKING_WET,GameConstants.STATE_DRENCHED);
  59. }
  60. else if (wetness >= GameConstants.STATE_SOAKING_WET)
  61. {
  62. wet_change = Math.RandomFloat(GameConstants.STATE_WET,GameConstants.STATE_SOAKING_WET);
  63. }
  64. else if (wetness >= GameConstants.STATE_WET)
  65. {
  66. wet_change = Math.RandomFloat(GameConstants.STATE_DAMP,GameConstants.STATE_WET);
  67. }
  68. //Print(wet_change);
  69. action_data.m_MainItem.SetWet(wet_change);
  70. }
  71. /*override void OnEndServer( ActionData action_data )
  72. {
  73. if (action_data.m_MainItem && action_data.m_MainItem.GetWet() < GameConstants.STATE_DAMP)
  74. {
  75. action_data.m_MainItem.SetWet(Math.RandomFloat(GameConstants.STATE_DAMP,GameConstants.STATE_WET));
  76. }
  77. }*/
  78. };