Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionwashhandsitem.c
Go to the documentation of this file.
2 {
3  protected const float WASH_HANDS_AMOUNT = 250; //ml
4 
6  {
7  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_CLEANHANDSBOTTLE;
8  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_CLEANHANDSBOTTLE;
9  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
10  m_Text = "#wash_hands";
11  }
12 
13  override void CreateConditionComponents()
14  {
17  }
18 
19  override bool HasTarget()
20  {
21  return false;
22  }
23 
24  override bool HasProneException()
25  {
26  return true;
27  }
28 
29  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
30  {
31  //Print(item.GetQuantity());
32  if ( player.GetItemOnSlot("Gloves") )
33  return false;
34 
35  return player.HasBloodyHands() && ( item.GetQuantity() >= item.GetDisinfectQuantity() );
36  }
37 
38  override void OnEndServer( ActionData action_data )
39  {
40  if (action_data.m_State != UA_INTERRUPT)
41  {
42  PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
43  module_lifespan.UpdateBloodyHandsVisibility( action_data.m_Player, false );
44  action_data.m_MainItem.AddQuantity( -action_data.m_MainItem.GetDisinfectQuantity(), false );
45  }
46  }
47 };
ItemBase
Definition: inventoryitem.c:730
UA_INTERRUPT
const int UA_INTERRUPT
Definition: constants.c:438
CCTNone
Definition: cctnone.c:1
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
PluginLifespan
void PluginLifespan()
Definition: pluginlifespan.c:45
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionWashHandsItem
Definition: actionwashhandsitem.c:1
CCINotRuinedAndEmpty
Definition: ccinotruinedandempty.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53