actionwashhandswellone.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class ActionWashHandsWellOneCB : ActionInteractLoopBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAInteractLoop(UATimeSpent.WASH_HANDS);
  6. }
  7. }
  8. //!DEPRECATED
  9. class ActionWashHandsWellOne extends ActionInteractLoopBase
  10. {
  11. void ActionWashHandsWellOne()
  12. {
  13. m_CallbackClass = ActionWashHandsWellOneCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHHANDSWELL;
  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 CCTObject(UAMaxDistances.DEFAULT);
  23. }
  24. override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item )
  25. {
  26. return player.HasBloodyHands() && !player.GetItemInHands() && !player.GetItemOnSlot("Gloves") && target.GetObject() && (target.GetObject().GetWaterSourceObjectType() == EWaterSourceObjectType.WELL || target.GetObject().IsWell());
  27. }
  28. override void OnEndServer(ActionData action_data)
  29. {
  30. super.OnEndServer(action_data);
  31. if (action_data.m_State == UA_FINISHED)
  32. {
  33. PluginLifespan moduleLifespan = PluginLifespan.Cast(GetPlugin(PluginLifespan));
  34. moduleLifespan.UpdateBloodyHandsVisibility(action_data.m_Player, false);
  35. }
  36. }
  37. }