actionwashhandswater.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class ActionWashHandsWaterCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.WASH_HANDS);
  6. }
  7. }
  8. class ActionWashHandsWater : ActionContinuousBase
  9. {
  10. void ActionWashHandsWater()
  11. {
  12. m_CallbackClass = ActionWashHandsWaterCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHHANDSPOND;
  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 CCTWaterSurfaceEx(UAMaxDistances.DEFAULT, LIQUID_GROUP_WATER - LIQUID_SNOW);
  26. }
  27. override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
  28. {
  29. // Other conditions are in CCTWaterSurface
  30. return (player.HasBloodyHands() && !player.GetItemInHands() && !player.GetItemOnSlot("Gloves"));
  31. }
  32. override void OnFinishProgressServer( ActionData action_data )
  33. {
  34. PluginLifespan moduleLifespan = PluginLifespan.Cast(GetPlugin(PluginLifespan));
  35. moduleLifespan.UpdateBloodyHandsVisibility(action_data.m_Player, false);
  36. action_data.m_Player.ClearBloodyHandsPenaltyChancePerAgent(eAgents.SALMONELLA);
  37. }
  38. }