DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionWetClothingInHandsBase.c
См. документацию.
2{
4
5 override void CreateActionComponent()
6 {
7 float wetMax = 1.0;
8 float remaining = 1.0;
9 ItemBase clothing = ItemBase.Cast(m_ActionData.m_MainItem);
10 if (clothing)
11 {
12 wetMax = clothing.GetWetMax();
13 remaining = wetMax - clothing.GetWet();
14 }
15
16 float stepTime = Math.Clamp(wetMax * 0.2, 0.1, remaining) * UATimeSpent.WRING;
18 m_ActionData.m_ActionComponent = new CAContinuousRepeat(stepTime);
19 }
20}
21
23{
25 {
26 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_WASHFACEPOND;
27 m_FullBody = true;
28 m_Text = "#STR_Wet_Clothing";
29 }
30
31 override typename GetInputType()
32 {
34 }
35
36 override void OnFinishProgressServer(ActionData action_data)
37 {
39 if (!cb) return;
40
41 ItemBase clothing = action_data.m_MainItem;
42 if (!clothing) return;
43
44 clothing.SetWet(Math.Clamp(clothing.GetWet() + cb.m_WetGainPerStep, 0.0, clothing.GetWetMax()));
45 action_data.m_Player.GetThermalBiasHandler().Add(-PlayerConstants.THERMAL_BIAS_WASH_HEAD_DECREMENT * cb.m_WetGainPerStep);
46 }
47
48 override void OnEndServer(ActionData action_data)
49 {
51 if (!cb) return;
52
53 float partial = cb.m_WetGainPerStep * action_data.m_ActionComponent.GetProgress();
54 if (partial <= 0) return;
55
56 ItemBase clothing = action_data.m_MainItem;
57 if (!clothing) return;
58
59 clothing.SetWet(Math.Clamp(clothing.GetWet() + partial, 0.0, clothing.GetWetMax()));
60 action_data.m_Player.GetThermalBiasHandler().Add(-PlayerConstants.THERMAL_BIAS_WASH_HEAD_DECREMENT * partial);
61 }
62
63 override bool IsLockTargetOnUse()
64 {
65 return false;
66 }
67}
override void OnFinishProgressServer(ActionData action_data)
Определения ActionActivateTrap.c:131
bool m_FullBody
Определения ActionBase.c:60
string m_Text
Определения ActionBase.c:57
void OnEndServer(ActionData action_data)
Определения ActionBase.c:1409
bool IsLockTargetOnUse()
Определения ActionBase.c:102
GetInputType()
Определения ActionBase.c:230
ActionWetClothingInHandsBaseCB ActionContinuousBaseCB ActionWetClothingInHandsBase()
Определения ActionWetClothingInHandsBase.c:24
ActionData m_ActionData
Определения AnimatedActionBase.c:3
PlayerBase m_Player
Определения ActionBase.c:40
ActionBaseCB m_Callback
Определения ActionBase.c:36
ref CABase m_ActionComponent
Определения ActionBase.c:37
ItemBase m_MainItem
Определения ActionBase.c:35
Определения ActionBase.c:22
override void CreateActionComponent()
Определения ActionWetClothingInHandsBase.c:5
float GetProgress()
Определения CABase.c:62
Определения EnMath.c:7
static const float THERMAL_BIAS_WASH_HEAD_DECREMENT
Определения PlayerConstants.c:203
Определения PlayerConstants.c:2
const float WRING
Определения ActionConstants.c:89
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.