Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionwringclothes.c
Go to the documentation of this file.
2 {
3  protected const float QUANTITY_WRINGLED_PER_SECOND = 0.02;
4 
5  override void CreateActionComponent()
6  {
7  //m_ActionData.m_ActionComponent = new CAContinuousWringClothes(QUANTITY_WRINGLED_PER_SECOND, UATimeSpent.WASH_HANDS);
8  m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.WRING);
9  }
10 };
11 
13 {
14  void ActionWringClothes()
15  {
16  m_CallbackClass = ActionWringClothesCB;
17  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WRING;
18  m_FullBody = true;
19  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
21  m_Text = "#wring_clothes";
22  }
23 
24  override void CreateConditionComponents()
25  {
28  }
29 
30  override bool HasTarget()
31  {
32  return false;
33  }
34 
35  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
36  {
37  if (player.IsInWater()) return false;
38 
40  if ( item && item.GetWet() >= GameConstants.STATE_WET )
41  {
42  return true;
43  }
44  else
45  {
46  return false;
47  }
48  }
49 
50  /*override void OnExecuteServer( ActionData action_data )
51  {
52  Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
53  float delta = nacdata.param1;
54  action_data.m_MainItem.AddWet( -delta );
55  }*/
56 
57  override void OnFinishProgressServer( ActionData action_data )
58  {
59  /*Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
60  float delta = nacdata.param1;
61  action_data.m_MainItem.AddWet( -delta );*/
62  float wetness = action_data.m_MainItem.GetWet();
63  float wet_change;
64 
65  if (wetness >= GameConstants.STATE_DRENCHED)
66  {
67  wet_change = Math.RandomFloat(GameConstants.STATE_SOAKING_WET,GameConstants.STATE_DRENCHED);
68  }
69  else if (wetness >= GameConstants.STATE_SOAKING_WET)
70  {
71  wet_change = Math.RandomFloat(GameConstants.STATE_WET,GameConstants.STATE_SOAKING_WET);
72  }
73  else if (wetness >= GameConstants.STATE_WET)
74  {
75  wet_change = Math.RandomFloat(GameConstants.STATE_DAMP,GameConstants.STATE_WET);
76  }
77 
78  //Print(wet_change);
79  action_data.m_MainItem.SetWet(wet_change);
80 
81  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
82  }
83 
84  /*override void OnEndServer( ActionData action_data )
85  {
86  if (action_data.m_MainItem && action_data.m_MainItem.GetWet() < GameConstants.STATE_DAMP)
87  {
88  action_data.m_MainItem.SetWet(Math.RandomFloat(GameConstants.STATE_DAMP,GameConstants.STATE_WET));
89  }
90  }*/
91 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
ActionWringClothesCB
Definition: actionwringclothes.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
GameConstants
Definition: constants.c:612
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
Math
Definition: enmath.c:6
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionWringClothes
Definition: actionwringclothes.c:12