Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionwashhandswaterone.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAInteractLoop(UATimeSpent.WASH_HANDS);
6 }
7};
8
10class ActionWashHandsWaterOne extends ActionInteractLoopBase
11{
12 void ActionWashHandsWaterOne()
13 {
14 m_CallbackClass = ActionWashHandsWaterOneCB;
15 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHHANDSPOND;
16 m_FullBody = true;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_Text = "#wash_hands";
19 }
20
21 override void CreateConditionComponents()
22 {
23 m_ConditionItem = new CCINone;
24 m_ConditionTarget = new CCTWaterSurfaceEx(UAMaxDistances.DEFAULT, LIQUID_GROUP_WATER);
25 }
26
27 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
28 {
29 // Other conditions are in CCTWaterSurface
30 return ( GetGame().IsMultiplayer() && GetGame().IsServer() ) || ( player.HasBloodyHands() && !player.GetItemInHands() && !player.GetItemOnSlot("Gloves") );
31 }
32
33 override void OnEndServer( ActionData action_data )
34 {
35 super.OnEndServer(action_data);
36
37 if (action_data.m_State == UA_FINISHED)
38 {
39 PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
40 module_lifespan.UpdateBloodyHandsVisibility( action_data.m_Player, false );
41 action_data.m_Player.ClearBloodyHandsPenaltyChancePerAgent(eAgents.SALMONELLA);
42 }
43 }
44};
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnEndServer(ActionData action_data)
int m_CommandUID
Definition actionbase.c:31
int m_StanceMask
Definition actionbase.c:33
void CCTWaterSurfaceEx(float maximal_target_distance, int allowedLiquidSource)
ActionData m_ActionData
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
eAgents
Definition eagents.c:3
proto native CGame GetGame()
const int LIQUID_GROUP_WATER
Definition constants.c:557
const int UA_FINISHED
Definition constants.c:466
void PluginLifespan()
PluginBase GetPlugin(typename plugin_type)