actionwashhandswaterone.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class ActionWashHandsWaterOneCB : ActionInteractLoopBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAInteractLoop(UATimeSpent.WASH_HANDS);
  6. }
  7. };
  8. //!DEPRECATED
  9. class ActionWashHandsWaterOne extends ActionInteractLoopBase
  10. {
  11. void ActionWashHandsWaterOne()
  12. {
  13. m_CallbackClass = ActionWashHandsWaterOneCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHHANDSPOND;
  15. m_FullBody = true;
  16. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  17. m_Text = "#wash_hands";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionItem = new CCINone;
  22. m_ConditionTarget = new CCTWaterSurfaceEx(UAMaxDistances.DEFAULT, LIQUID_GROUP_WATER);
  23. }
  24. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  25. {
  26. // Other conditions are in CCTWaterSurface
  27. return ( GetGame().IsMultiplayer() && GetGame().IsServer() ) || ( player.HasBloodyHands() && !player.GetItemInHands() && !player.GetItemOnSlot("Gloves") );
  28. }
  29. override void OnEndServer( ActionData action_data )
  30. {
  31. super.OnEndServer(action_data);
  32. if (action_data.m_State == UA_FINISHED)
  33. {
  34. PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
  35. module_lifespan.UpdateBloodyHandsVisibility( action_data.m_Player, false );
  36. action_data.m_Player.ClearBloodyHandsPenaltyChancePerAgent(eAgents.SALMONELLA);
  37. }
  38. }
  39. };