DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс MaskMdfr
+ Граф наследования:MaskMdfr:

Закрытые члены

override void Init ()
 
override bool ActivateCondition (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 
void HandleSounds (PlayerBase player, float deltaT, MaskBase mask)
 
override void OnReconnect (PlayerBase player)
 
override void OnActivate (PlayerBase player)
 
override void OnDeactivate (PlayerBase player)
 

Закрытые данные

const float IN_AREA_CONSUME_FILTER_QUANTITY_PER_SEC = 0.3
 
const float OUT_AREA_CONSUME_FILTER_QUANTITY_PER_SEC = 0.03
 
const float STAMINA_RECOVERY_MODIFIER = 0.5
 
const float STAMINA_DEPLETION_MODIFIER = 1.25
 
const float LOW_FILTER_SOUND_EVENT_MIN = 3
 
const float LOW_FILTER_SOUND_EVENT_MAX = 9
 
const float LOW_FILTER_SOUND_THRESHOLD = 0.2
 
float m_SoundTimeAccu1
 
float m_NextSoundEventTime
 

Подробное описание

Методы

◆ ActivateCondition()

override bool ActivateCondition ( PlayerBase player)
inlineprivate
27 {
28 return MaskBase.Cast(player.GetInventory().FindAttachment(InventorySlots.MASK)) != null;
29 }
provides access to slot configuration
Definition InventorySlots.c:6
Definition AirborneMask.c:2
Definition EntityAI.c:95

Используется в DeactivateCondition().

◆ DeactivateCondition()

override bool DeactivateCondition ( PlayerBase player)
inlineprivate
32 {
33 return !ActivateCondition( player);
34 }
override bool ActivateCondition(PlayerBase player)
Definition Mask.c:26

Перекрестные ссылки ActivateCondition().

◆ HandleSounds()

void HandleSounds ( PlayerBase player,
float deltaT,
MaskBase mask )
inlineprivate
70 {
71 float filter_quantity_01 = mask.GetFilterQuantity01();
72
73 if(mask.CanHaveExternalFilter() && !mask.IsExternalFilterAttached())
74 return;
75
77 return;
78
79 float low_quantity_norm = Math.InverseLerp(0, LOW_FILTER_SOUND_THRESHOLD, filter_quantity_01);//should give us 0..1 based on normalized quantity between 0 and LOW_FILTER_SOUND_THRESHOLD
80
83 {
85
86 EPlayerSoundEventID event_type = EPlayerSoundEventID.STAMINA_LOW_FILTER_UPPER;
87 //under 50% of low filter quantity (not overall filter quantity!!)
88 if (low_quantity_norm < 0.5)
89 {
90 event_type = EPlayerSoundEventID.STAMINA_LOW_FILTER_MID;
91 }
92 if (low_quantity_norm < 0.25)
93 {
94 event_type = EPlayerSoundEventID.STAMINA_LOW_FILTER_LOWER;
95 }
96 player.RequestSoundEventEx(event_type, false, EPlayerSoundEventParam.HIGHEST_PRIORITY);
98 }
99 }
EPlayerSoundEventID
Definition PlayerSoundEventHandler.c:2
const float LOW_FILTER_SOUND_THRESHOLD
Definition Mask.c:12
float m_NextSoundEventTime
Definition Mask.c:15
const float LOW_FILTER_SOUND_EVENT_MIN
Definition Mask.c:9
float m_SoundTimeAccu1
Definition Mask.c:14
const float LOW_FILTER_SOUND_EVENT_MAX
Definition Mask.c:10
Definition EnMath.c:7
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки Math::InverseLerp(), Math::Lerp(), LOW_FILTER_SOUND_EVENT_MAX, LOW_FILTER_SOUND_EVENT_MIN, LOW_FILTER_SOUND_THRESHOLD, m_NextSoundEventTime и m_SoundTimeAccu1.

Используется в OnTick().

◆ Init()

override void Init ( )
inlineprivate
18 {
21 m_ID = eModifiers.MDF_MASK;
24 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
overall time this modifier was active
Definition ModifierBase.c:14
bool m_AnalyticsStatsEnabled
Definition ModifierBase.c:31
float m_TickIntervalActive
Definition ModifierBase.c:18
float m_TickIntervalInactive
Definition ModifierBase.c:17
const int DEFAULT_TICK_TIME_INACTIVE
Definition ModifiersManager.c:29
const int DEFAULT_TICK_TIME_ACTIVE_SHORT
Definition ModifiersManager.c:28
eModifiers
Definition eModifiers.c:2

Перекрестные ссылки DEFAULT_TICK_TIME_ACTIVE_SHORT, DEFAULT_TICK_TIME_INACTIVE, m_AnalyticsStatsEnabled, m_ID, m_TickIntervalActive, m_TickIntervalInactive и m_TrackActivatedTime.

◆ OnActivate()

override void OnActivate ( PlayerBase player)
inlineprivate
107 {
108 //m_NextSoundEventTime = Math.RandomFloat(LOW_FILTER_SOUND_EVENT_MIN, LOW_FILTER_SOUND_EVENT_MAX);
109 }

◆ OnDeactivate()

override void OnDeactivate ( PlayerBase player)
inlineprivate
112 {
113 StaminaSoundHandlerServer.Cast(player.GetPlayerSoundManagerServer().GetHandler(eSoundHandlers.STAMINA)).SetStaminaZoneOffset(0);
114 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.MASK);
115 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.MASK);
116 }
eSoundHandlers
Definition PlayerSoundManager.c:5
EStaminaMultiplierTypes
Definition StaminaHandler.c:2

◆ OnReconnect()

override void OnReconnect ( PlayerBase player)
inlineprivate
102 {
104 }
void OnActivate()
Definition Trap_LandMine.c:67

Перекрестные ссылки OnActivate().

◆ OnTick()

override void OnTick ( PlayerBase player,
float deltaT )
inlineprivate
37 {
38 MaskBase mask = MaskBase.Cast(player.GetInventory().FindAttachment(InventorySlots.MASK));
39
41
42 bool inside_area = m_Manager.IsModifierActive(eModifiers.MDF_AREAEXPOSURE);
43
44 if(inside_area)
45 {
47 }
48
49 if ( mask && !mask.IsDamageDestroyed())
50 {
51 bool consuming_filter = mask.ConsumeQuantity(consume_quantity * deltaT, player);
52 StaminaSoundHandlerServer.Cast(player.GetPlayerSoundManagerServer().GetHandler(eSoundHandlers.STAMINA)).SetStaminaZoneOffset(1);
53
54 if (mask.HasValidFilter())
55 {
56 player.GetStaminaHandler().ActivateRecoveryModifier(EStaminaMultiplierTypes.MASK);
57 player.GetStaminaHandler().ActivateDepletionModifier(EStaminaMultiplierTypes.MASK);
58
59 }
60 else
61 {
62 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.MASK);
63 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.MASK);
64 }
66 }
67 }
ModifiersManager m_Manager
Definition ModifierBase.c:11
const float IN_AREA_CONSUME_FILTER_QUANTITY_PER_SEC
Definition Mask.c:3
void HandleSounds(PlayerBase player, float deltaT, MaskBase mask)
Definition Mask.c:69
const float OUT_AREA_CONSUME_FILTER_QUANTITY_PER_SEC
Definition Mask.c:4

Перекрестные ссылки HandleSounds(), IN_AREA_CONSUME_FILTER_QUANTITY_PER_SEC, m_Manager и OUT_AREA_CONSUME_FILTER_QUANTITY_PER_SEC.

Поля

◆ IN_AREA_CONSUME_FILTER_QUANTITY_PER_SEC

const float IN_AREA_CONSUME_FILTER_QUANTITY_PER_SEC = 0.3
private

Используется в OnTick().

◆ LOW_FILTER_SOUND_EVENT_MAX

const float LOW_FILTER_SOUND_EVENT_MAX = 9
private

Используется в HandleSounds().

◆ LOW_FILTER_SOUND_EVENT_MIN

const float LOW_FILTER_SOUND_EVENT_MIN = 3
private

Используется в HandleSounds().

◆ LOW_FILTER_SOUND_THRESHOLD

const float LOW_FILTER_SOUND_THRESHOLD = 0.2
private

Используется в HandleSounds().

◆ m_NextSoundEventTime

float m_NextSoundEventTime
private

Используется в HandleSounds().

◆ m_SoundTimeAccu1

float m_SoundTimeAccu1
private

Используется в HandleSounds().

◆ OUT_AREA_CONSUME_FILTER_QUANTITY_PER_SEC

const float OUT_AREA_CONSUME_FILTER_QUANTITY_PER_SEC = 0.03
private

Используется в OnTick().

◆ STAMINA_DEPLETION_MODIFIER

const float STAMINA_DEPLETION_MODIFIER = 1.25
private

Используется в StaminaHandler::Init().

◆ STAMINA_RECOVERY_MODIFIER

const float STAMINA_RECOVERY_MODIFIER = 0.5
private

Используется в StaminaHandler::Init().


Объявления и описания членов класса находятся в файле: