actionwashhandswell.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. class ActionWashHandsWellCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.WASH_HANDS);
  6. }
  7. }
  8. class ActionWashHandsWell: ActionContinuousBase
  9. {
  10. void ActionWashHandsWell()
  11. {
  12. m_CallbackClass = ActionWashHandsWellCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHHANDSWELL;
  14. m_FullBody = true;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_Text = "#wash_hands";
  17. }
  18. override typename GetInputType()
  19. {
  20. return ContinuousInteractActionInput;
  21. }
  22. override void CreateConditionComponents()
  23. {
  24. m_ConditionItem = new CCINone();
  25. m_ConditionTarget = new CCTObject(UAMaxDistances.DEFAULT);
  26. }
  27. override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
  28. {
  29. return player.HasBloodyHands() && !player.GetItemInHands() && target.GetObject() && (target.GetObject().GetWaterSourceObjectType() != EWaterSourceObjectType.NONE || target.GetObject().IsWell()) && !player.GetItemOnSlot("Gloves");
  30. }
  31. override void OnFinishProgressServer(ActionData action_data)
  32. {
  33. PluginLifespan moduleLifespan = PluginLifespan.Cast(GetPlugin(PluginLifespan));
  34. moduleLifespan.UpdateBloodyHandsVisibility(action_data.m_Player, false);
  35. }
  36. override bool IsLockTargetOnUse()
  37. {
  38. return false;
  39. }
  40. }