DayZ 1.24
Loading...
Searching...
No Matches
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
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
39 {
40 if (action_data.m_State != UA_INTERRUPT)
41 {
43 module_lifespan.UpdateBloodyHandsVisibility(action_data.m_Player, false);
44 action_data.m_MainItem.AddQuantity(-action_data.m_MainItem.GetDisinfectQuantity(), false);
45 }
46 }
47};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
void PluginLifespan()
PluginBase GetPlugin(typename plugin_type)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnEndServer(ActionData action_data)
override void CreateConditionComponents()
override bool HasTarget()
override bool HasProneException()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int UA_INTERRUPT
Definition constants.c:438