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

Защищенные члены

void OnStayClientEvent (TriggerInsider insider, float deltaTime)
 
override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnEnterClientEvent (TriggerInsider insider)
 
override void OnLeaveServerEvent (TriggerInsider insider)
 
override void OnLeaveClientEvent (TriggerInsider insider)
 
override bool ShouldRemoveInsider (TriggerInsider insider)
 

Защищенные статические члены

static void TriggerEffect (EntityAI insider, typename triggerType)
 

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

override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnLeaveServerEvent (TriggerInsider insider)
 
override void OnEnterClientEvent (TriggerInsider insider)
 
override void OnLeaveClientEvent (TriggerInsider insider)
 
override void OnStayStartServerEvent (int nrOfInsiders)
 
override void OnStayFinishServerEvent ()
 
override void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
override string GetAmbientSoundsetName ()
 
void EffectTrigger ()
 
void SetLocalEffects (int aroundPartId, int tinyPartId, int ppeRequesterIdx)
 
EffectArea GetEffectArea ()
 
void Init (EffectArea area, int priority)
 
int GetEffectsPriority ()
 
string GetAmbientSoundsetName ()
 
void SetupClientEffects (bool enable, notnull PlayerBase player)
 
override void EOnFrame (IEntity other, float timeSlice)
 
override bool CanAddObjectAsInsider (Object object)
 

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

const float DAMAGE_TICK_RATE = 10
 
int m_AroundPartId
 
int m_TinyPartId
 
int m_PPERequester
 
float m_DeltaTime
 
float m_TimeAccuStay
 
bool m_DealDamageFlag
 
TriggerEffectManager m_Manager
 
EffectArea m_EffectArea
 
int m_EffectsPriority
 

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

Конструктор(ы)

◆ EffectTrigger()

void EffectTrigger ( )
inlineprivate
21 {
22 RegisterNetSyncVariableInt("m_AroundPartId");
23 RegisterNetSyncVariableInt("m_TinyPartId");
24 RegisterNetSyncVariableInt("m_PPERequester");
25 RegisterNetSyncVariableInt("m_EffectsPriority");
26
29 }
TriggerEffectManager m_Manager
Definition EffectTrigger.c:11
Definition TriggerEffectManager.c:4
void RegisterTriggerType(EffectTrigger effectTrigger)
Definition TriggerEffectManager.c:29
static TriggerEffectManager GetInstance()
Definition TriggerEffectManager.c:21

Перекрестные ссылки TriggerEffectManager::GetInstance(), m_Manager и TriggerEffectManager::RegisterTriggerType().

Методы

◆ CanAddObjectAsInsider()

override bool CanAddObjectAsInsider ( Object object)
inlineprivate
91 {
92 #ifdef SERVER
93 DayZCreatureAI creature = DayZCreatureAI.Cast( object );
94 if(creature)
95 {
96 return !creature.ResistContaminatedEffect();
97 }
98 else
99 {
100 PlayerBase player = PlayerBase.Cast(object);
101 return player != null;
102 }
103 #else
104 PlayerBase player = PlayerBase.Cast(object);
105 return (player && player.IsControlledPlayer());
106 #endif
107 }
do not process rotations !
Definition DayZAnimal.c:612
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2

◆ EOnFrame()

override void EOnFrame ( IEntity other,
float timeSlice )
inlineprivate
86 {
88 }
float m_DeltaTime
Definition EffectTrigger.c:8

Перекрестные ссылки m_DeltaTime.

◆ GetAmbientSoundsetName() [1/2]

override string GetAmbientSoundsetName ( )
inlineprivate
80 {
81 return "ContaminatedArea_SoundSet";
82 }

Используется в OnStayClientEvent() и SetupClientEffects().

◆ GetAmbientSoundsetName() [2/2]

string GetAmbientSoundsetName ( )
inlineprivate
61 {
62 return "";
63 }

◆ GetEffectArea()

EffectArea GetEffectArea ( )
inlineprivate
45 {
46 return m_EffectArea;
47 }
EffectArea m_EffectArea
Definition EffectTrigger.c:12

Перекрестные ссылки m_EffectArea.

◆ GetEffectsPriority()

int GetEffectsPriority ( )
inlineprivate
56 {
57 return m_EffectsPriority;
58 }
int m_EffectsPriority
Definition EffectTrigger.c:13

Перекрестные ссылки m_EffectsPriority.

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

◆ Init()

void Init ( EffectArea area,
int priority )
inlineprivate

Перекрестные ссылки m_EffectArea и m_EffectsPriority.

◆ OnEnterClientEvent() [1/2]

override void OnEnterClientEvent ( TriggerInsider insider)
inlineprivate
39 {
40 super.OnEnterClientEvent( insider );
41 }

◆ OnEnterClientEvent() [2/2]

override void OnEnterClientEvent ( TriggerInsider insider)
inlineprotected
137 {
138 super.OnEnterClientEvent( insider );
139
140 if ( insider )
141 {
142 PlayerBase playerInsider = PlayerBase.Cast( insider.GetObject() );
143
144 // We will only handle the controlled player, as effects are only relevant to this player instance
145 if (playerInsider && playerInsider.IsControlledPlayer() )
146 {
147 //SetupClientEffects(true, playerInsider);
148 // We then handle the update of player trigger state in manager
150 }
151 }
152 }
void OnPlayerEnter(notnull PlayerBase player, notnull EffectTrigger trigger)
Definition TriggerEffectManager.c:41
Object GetObject()
Definition Trigger.c:28

Перекрестные ссылки TriggerInsider::GetObject(), m_Manager и TriggerEffectManager::OnPlayerEnter().

◆ OnEnterServerEvent() [1/2]

override void OnEnterServerEvent ( TriggerInsider insider)
inlineprivate
11 {
12 super.OnEnterServerEvent( insider );
13 //Print("Entered A " + GetType());
14 if ( insider )
15 {
17
18 if (creature)
19 creature.IncreaseEffectTriggerCount();
20 }
21
22 }

Перекрестные ссылки TriggerInsider::GetObject().

◆ OnEnterServerEvent() [2/2]

override void OnEnterServerEvent ( TriggerInsider insider)
inlineprotected
118 {
119 super.OnEnterServerEvent( insider );
120
121 // We don't need to test the trigger count as Modifiers handle such cases already
122 if ( insider )
123 {
124 PlayerBase playerInsider = PlayerBase.Cast( insider.GetObject() );
125
126 if(playerInsider)
127 {
128
130 }
131
132 }
133
134 }

Перекрестные ссылки TriggerInsider::GetObject(), m_Manager и TriggerEffectManager::OnPlayerEnter().

◆ OnLeaveClientEvent() [1/2]

override void OnLeaveClientEvent ( TriggerInsider insider)
inlineprivate
44 {
45 super.OnLeaveClientEvent( insider );
46 }

◆ OnLeaveClientEvent() [2/2]

override void OnLeaveClientEvent ( TriggerInsider insider)
inlineprotected
171 {
172 super.OnLeaveClientEvent( insider );
173
174 if ( insider )
175 {
176 // Make sure you pass the set variable for PPE effect
177 // It will not remove the correct one if START and STOP don't point to the same Requester
178 PlayerBase playerInsider = PlayerBase.Cast( insider.GetObject() );
179
180 // We will only handle the controlled player, as effects are only relevant to this player instance
181 if ( playerInsider && playerInsider.IsControlledPlayer() )
182 {
183 // We first handle the update of player trigger state in manager
185 //SetupClientEffects(false, playerInsider);
186 }
187 }
188 }
void OnPlayerExit(notnull PlayerBase player, notnull EffectTrigger trigger)
Definition TriggerEffectManager.c:83

Перекрестные ссылки TriggerInsider::GetObject(), m_Manager и TriggerEffectManager::OnPlayerExit().

◆ OnLeaveServerEvent() [1/2]

override void OnLeaveServerEvent ( TriggerInsider insider)
inlineprivate
25 {
26 super.OnLeaveServerEvent( insider );
27 //Print("Left A " + GetType());
28 if ( insider )
29 {
31
32 if (creature)
33 creature.DecreaseEffectTriggerCount();
34
35 }
36 }

Перекрестные ссылки TriggerInsider::GetObject().

◆ OnLeaveServerEvent() [2/2]

override void OnLeaveServerEvent ( TriggerInsider insider)
inlineprotected
156 {
157 super.OnLeaveServerEvent( insider );
158
159 if ( insider )
160 {
161 PlayerBase playerInsider = PlayerBase.Cast( insider.GetObject() );
162
163 if ( playerInsider )
165 }
166 }

Перекрестные ссылки TriggerInsider::GetObject(), m_Manager и TriggerEffectManager::OnPlayerExit().

◆ OnStayClientEvent()

void OnStayClientEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected
110 {
111 super.OnStayClientEvent(insider, deltaTime);
112 PlayerBase player = PlayerBase.Cast(insider.GetObject());
113 if (player)
115 }
int m_PPERequester
Definition EffectTrigger.c:7
int m_AroundPartId
Definition EffectTrigger.c:5
int m_TinyPartId
Definition EffectTrigger.c:6
override string GetAmbientSoundsetName()
Definition ContaminatedTrigger.c:79

Перекрестные ссылки GetAmbientSoundsetName(), TriggerInsider::GetObject(), m_AroundPartId, m_PPERequester и m_TinyPartId.

◆ OnStayFinishServerEvent()

override void OnStayFinishServerEvent ( )
inlineprivate
61 {
62 if(m_DealDamageFlag)//the flag was previously set to true, the insiders have been updated at this point, reset the flag and the timer as well
63 {
65 m_DealDamageFlag = false;
66 }
67 }
bool m_DealDamageFlag
Definition EffectTrigger.c:10
float m_TimeAccuStay
Definition EffectTrigger.c:9

◆ OnStayServerEvent()

override void OnStayServerEvent ( TriggerInsider insider,
float deltaTime )
inlineprivate
70 {
71 if ( m_DealDamageFlag )
72 {
74 if(creature && creature.m_EffectTriggerCount != 0)
75 creature.DecreaseHealth("", "", GameConstants.AI_CONTAMINATION_DMG_PER_SEC * m_TimeAccuStay / creature.m_EffectTriggerCount);// we devide by m_EffectTriggerCount for multiple trigger presence(overlapping triggers)
76 }
77 }
Definition constants.c:638
const float AI_CONTAMINATION_DMG_PER_SEC
Definition constants.c:1021

Перекрестные ссылки GameConstants::AI_CONTAMINATION_DMG_PER_SEC и TriggerInsider::GetObject().

◆ OnStayStartServerEvent()

override void OnStayStartServerEvent ( int nrOfInsiders)
inlineprivate
50 {
53 {
54 m_DealDamageFlag = true;
55 //this is where we would normally reset the m_TimeAccuStay, but we need the value as deltaT when dealing damage to the insiders, so we reset it only after the insider update in OnStayFinishServerEvent
56 }
57
58 }
const float DAMAGE_TICK_RATE
Definition ContaminatedTrigger.c:4

◆ SetLocalEffects()

void SetLocalEffects ( int aroundPartId,
int tinyPartId,
int ppeRequesterIdx )
inlineprivate
36 {
40
41 SetSynchDirty();
42 }

Перекрестные ссылки m_AroundPartId, m_PPERequester и m_TinyPartId.

◆ SetupClientEffects()

void SetupClientEffects ( bool enable,
notnull PlayerBase player )
inlineprivate
66 {
68 {
69 if (enable)
70 {
71 player.SetContaminatedEffectEx( true, m_PPERequester, m_AroundPartId, m_TinyPartId, GetAmbientSoundsetName() );
72 }
73 else
74 {
75 player.SetContaminatedEffectEx( false, m_PPERequester );
76 }
77 }
78 }
bool IsPlayerInTriggerType(notnull PlayerBase player, notnull EffectTrigger trigger)
Definition TriggerEffectManager.c:112

Перекрестные ссылки GetAmbientSoundsetName(), TriggerEffectManager::IsPlayerInTriggerType(), m_AroundPartId, m_Manager, m_PPERequester и m_TinyPartId.

◆ ShouldRemoveInsider()

override bool ShouldRemoveInsider ( TriggerInsider insider)
inlineprotected
192 {
193 return !insider.GetObject().IsAlive();
194 }

Перекрестные ссылки TriggerInsider::GetObject().

◆ TriggerEffect()

static void TriggerEffect ( EntityAI insider,
typename triggerType  )
inlinestaticprotected
198{}

Поля

◆ DAMAGE_TICK_RATE

const float DAMAGE_TICK_RATE = 10
private

◆ m_AroundPartId

int m_AroundPartId
private

◆ m_DealDamageFlag

bool m_DealDamageFlag
private

◆ m_DeltaTime

float m_DeltaTime
private

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

◆ m_EffectArea

EffectArea m_EffectArea
private

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

◆ m_EffectsPriority

int m_EffectsPriority
private

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

◆ m_Manager

◆ m_PPERequester

◆ m_TimeAccuStay

float m_TimeAccuStay
private

◆ m_TinyPartId

int m_TinyPartId
private

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