DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
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);
9 }
10};
11
13{
15 {
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WRING;
18 m_FullBody = true;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
21 m_Text = "#wring_clothes";
22 }
23
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 {
68 }
69 else if (wetness >= GameConstants.STATE_SOAKING_WET)
70 {
72 }
73 else if (wetness >= GameConstants.STATE_WET)
74 {
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};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
protected const float QUANTITY_WRINGLED_PER_SECOND
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasTarget()
Definition EnMath.c:7
const float WRING
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const float STATE_SOAKING_WET
Definition constants.c:767
const float STATE_WET
Definition constants.c:768
const float STATE_DRENCHED
Definition constants.c:766
const float STATE_DAMP
Definition constants.c:769
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].