DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл AreaDamageManager.c

См. исходные тексты.

Структуры данных

class  AreaDamageComponentTypes
 

Функции

void AreaDamageManager (EntityAI parent)
 
void ~AreaDamageManager ()
 
void SetDamageComponentType (int type)
 
void Spawn ()
 spawn damage trigger
 
void Destroy ()
 destroy damage trigger
 
AreaDamageEvents Implementation

Implementation for handling AreaDamageEvents Pass them on to the AreaDamageComponent Calling of the events that are the same in TriggerEvents will come from AreaDamageTriggerBase

override void OnTriggerCreated ()
 
override void OnTriggerDestroyed ()
 Called when a trigger is destroyed.
 
override void OnEnterBeginEvent (TriggerInsider insider)
 Called when an object enters the trigger.
 
override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnEnterClientEvent (TriggerInsider insider)
 
override void OnEnterEndEvent (TriggerInsider insider)
 
override void OnStayStartBeginEvent (int nrOfInsiders)
 Called at the beginning of an update loop.
 
override void OnStayStartServerEvent (int nrOfInsiders)
 
override void OnStayStartClientEvent (int nrOfInsiders)
 
override void OnStayStartEndEvent (int nrOfInsiders)
 
override void OnStayBeginEvent (TriggerInsider insider, float deltaTime)
 Called in the update loop.
 
override void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
override void OnStayClientEvent (TriggerInsider insider, float deltaTime)
 
override void OnStayEndEvent (TriggerInsider insider, float deltaTime)
 
override void OnStayFinishBeginEvent ()
 Called at the end of an update loop.
 
override void OnStayFinishServerEvent ()
 
override void OnStayFinishClientEvent ()
 
override void OnStayFinishEndEvent ()
 
override void OnLeaveBeginEvent (TriggerInsider insider)
 Called when an object leaves the trigger.
 
override void OnLeaveServerEvent (TriggerInsider insider)
 
override void OnLeaveClientEvent (TriggerInsider insider)
 
override void OnLeaveEndEvent (TriggerInsider insider)
 
override bool OnEvaluateDamage (TriggerInsider insider, float damageCoef)
 Tell the AreaDamageComponent to calculate and apply the damage to the Object.
 
override void PreDamageActions ()
 Usually called from AreaDamageComponent.
 
override void PostDamageActions ()
 Usually called from AreaDamageComponent.
 
bool OnEvaluateDamageEx (TriggerInsider insider, float deltaTime)
 
float CalculateDamageScale (TriggerInsider insider, float deltaTime)
 Helper for calculating damageCoeff when using OnEvaluateDamageEx.
 
void SetExtents (vector mins, vector maxs)
 
void GetExtents (out vector mins, out vector maxs)
 
void GetWorldExtents (out vector mins, out vector maxs)
 
void SetAmmoName (string ammo_name)
 
string GetAmmoName ()
 
void SetDamageType (int pDamageType)
 
int GetDamageType ()
 
void SetParentObject (EntityAI obj)
 
EntityAI GetParentObject ()
 
void SetAreaPosition (vector position)
 
vector GetPosition ()
 Get the world position of the Effect.
 
void SetAreaOrientation (vector orientation)
 
vector GetOrientation ()
 
void SetDamageableTypes (array< typename > damageableTypes)
 
array< typenameGetDamageableTypes ()
 
void AddDamageableType (typename damageableType)
 
void RemoveAddDamageableType (typename damageableType)
 
void SetLoopInterval (float time)
 
void SetDeferDuration (float time)
 
void SetHitZones (array< string > hitzones)
 
void SetRaycastSources (array< string > raycast_sources)
 
void SetRaycastSourcesVector (array< vector > raycast_sources)
 
AreaDamageTriggerBase GetTrigger ()
 
bool CreateDamageTriggerEx ()
 
void CreateDamageTrigger ()
 
bool DestroyDamageTriggerEx ()
 
void DestroyDamageTrigger ()
 

Переменные

class AreaDamageComponentTypes m_ParentObject
 
AreaDamageTriggerBase m_AreaDamageTrigger
 
ref AreaDamageComponent m_DamageComponent
 
vector m_ExtentMin
 
vector m_ExtentMax
 
vector m_AreaPosition
 
vector m_AreaOrientation
 
string m_TriggerBaseClass
 

Функции

◆ AddDamageableType()

void AddDamageableType ( typename damageableType )
protected
321 {
322 if (m_DamageComponent.m_DamageableTypes.Find(damageableType) != -1)
323 m_DamageComponent.m_DamageableTypes.Insert(damageableType);
324 }
ref AreaDamageComponent m_DamageComponent
Definition AreaDamageManager.c:13
Definition EntityAI.c:95

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

◆ AreaDamageManager()

void AreaDamageManager ( EntityAI parent)
protected
23 {
24 m_ParentObject = parent;
25
27
30 m_AreaPosition = parent.GetPosition();
31 m_AreaOrientation = parent.GetOrientation();
32
33 m_TriggerBaseClass = "AreaDamageTriggerBase";
34 }
ref array< typename > m_DamageableTypes void AreaDamageComponent(AreaDamageManager parent)
Definition AreaDamageComponent.c:16
vector m_AreaPosition
Definition AreaDamageManager.c:17
vector m_ExtentMin
Definition AreaDamageManager.c:15
vector m_ExtentMax
Definition AreaDamageManager.c:16
string m_TriggerBaseClass
Definition AreaDamageManager.c:20
vector m_AreaOrientation
Definition AreaDamageManager.c:18
class AreaDamageComponentTypes m_ParentObject
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки AreaDamageComponent(), m_AreaOrientation, m_AreaPosition, m_DamageComponent, m_ExtentMax, m_ExtentMin, m_ParentObject, m_TriggerBaseClass и vector::Zero.

◆ CalculateDamageScale()

float CalculateDamageScale ( TriggerInsider insider,
float deltaTime )
protected

Helper for calculating damageCoeff when using OnEvaluateDamageEx.

225 {
226 return deltaTime;
227 }

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

◆ CreateDamageTrigger()

void CreateDamageTrigger ( )
protected
398 {
400 }
bool CreateDamageTriggerEx()
Definition AreaDamageManager.c:377

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

◆ CreateDamageTriggerEx()

bool CreateDamageTriggerEx ( )
protected

create damage trigger with basic set of params

378 {
379 int flags;
380
381 if ( GetGame().IsMultiplayer() && GetGame().IsServer() )
382 flags = ECE_CREATEPHYSICS;
383 else
384 flags = ECE_LOCAL;
385
387 {
388 m_AreaDamageTrigger.SetOrientation( m_AreaOrientation );
391 return true;
392 }
393
394 return false;
395 }
AreaDamageTriggerBase m_AreaDamageTrigger
Definition AreaDamageManager.c:11
const int ECE_LOCAL
Definition CentralEconomy.c:24
const int ECE_CREATEPHYSICS
Definition CentralEconomy.c:16
override void SetAreaDamageManager(AreaDamageManager adType)
Definition AreaDamageTrigger.c:48
override void SetExtents(vector mins, vector maxs)
Definition AreaDamageTrigger.c:38
Super root of all classes in Enforce script.
Definition EnScript.c:11
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), ECE_CREATEPHYSICS, ECE_LOCAL, GetGame(), m_AreaDamageTrigger, m_AreaOrientation, m_AreaPosition, m_ExtentMax, m_ExtentMin, m_TriggerBaseClass, AreaDamageTriggerBase::SetAreaDamageManager() и AreaDamageTriggerBase::SetExtents().

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

◆ DestroyDamageTrigger()

void DestroyDamageTrigger ( )
protected
419 {
421 }
bool DestroyDamageTriggerEx()
Definition AreaDamageManager.c:406

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

◆ DestroyDamageTriggerEx()

bool DestroyDamageTriggerEx ( )
protected

destroys damage trigger

407 {
408 if ( GetGame() && m_AreaDamageTrigger ) // It's necesarry to check if the game exists. Otherwise a crash occurs while quitting.
409 {
410 GetGame().ObjectDelete( m_AreaDamageTrigger );
412 return true;
413 }
414
415 return false;
416 }

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

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

◆ GetAmmoName()

string GetAmmoName ( )
protected
261 {
262 return m_DamageComponent.m_AmmoName;
263 }

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

◆ GetDamageableTypes()

array< typename > GetDamageableTypes ( )
protected
316 {
317 return m_DamageComponent.m_DamageableTypes;
318 }

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

◆ GetDamageType()

int GetDamageType ( )
protected
270 {
271 return m_DamageComponent.m_DamageType;
272 }

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

◆ GetExtents()

void GetExtents ( out vector mins,
out vector maxs )
protected
244 {
247 }

Перекрестные ссылки m_ExtentMax и m_ExtentMin.

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

◆ GetOrientation()

◆ GetParentObject()

EntityAI GetParentObject ( )
protected
279 {
280 return m_ParentObject;
281 }

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

◆ GetPosition()

vector GetPosition ( )
protected

Get the world position of the Effect.

Предупреждения
Only gets the cached variable, for immediate effect use GetCurrent variant
Возвращает
vector The world position of the Effect
293 {
294 return m_AreaPosition;
295 }

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

◆ GetTrigger()

AreaDamageTriggerBase GetTrigger ( )
protected
369 {
370 return m_AreaDamageTrigger;
371 }

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

◆ GetWorldExtents()

void GetWorldExtents ( out vector mins,
out vector maxs )
protected
249 {
251
254 }
void GetExtents(out vector mins, out vector maxs)
Definition AreaDamageManager.c:243

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

◆ OnEnterBeginEvent()

override void OnEnterBeginEvent ( TriggerInsider insider)
protected

Called when an object enters the trigger.

104 {
105 m_DamageComponent.OnEnterBeginEvent(insider);
106 }

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

◆ OnEnterClientEvent()

override void OnEnterClientEvent ( TriggerInsider insider)
protected
112 {
113 m_DamageComponent.OnEnterClientEvent(insider);
114 }

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

◆ OnEnterEndEvent()

override void OnEnterEndEvent ( TriggerInsider insider)
protected
116 {
117 m_DamageComponent.OnEnterEndEvent(insider);
118 }

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

◆ OnEnterServerEvent()

void OnEnterServerEvent ( TriggerInsider insider)
protected
108 {
109 m_DamageComponent.OnEnterServerEvent(insider);
110 }

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

◆ OnEvaluateDamage()

override bool OnEvaluateDamage ( TriggerInsider insider,
float damageCoef )
protected

Tell the AreaDamageComponent to calculate and apply the damage to the Object.

194 {
195 return m_DamageComponent.OnEvaluateDamage(insider, damageCoef);
196 }

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

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

◆ OnEvaluateDamageEx()

bool OnEvaluateDamageEx ( TriggerInsider insider,
float deltaTime )
protected

Some event extensions

Alternative OnEvaluateDamage, using CalculateDamageScale

219 {
220 return OnEvaluateDamage( insider, CalculateDamageScale( insider, deltaTime ) );
221 }
override bool OnEvaluateDamage(TriggerInsider insider, float damageCoef)
Tell the AreaDamageComponent to calculate and apply the damage to the Object.
Definition AreaDamageManager.c:193
float CalculateDamageScale(TriggerInsider insider, float deltaTime)
Helper for calculating damageCoeff when using OnEvaluateDamageEx.
Definition AreaDamageManager.c:224

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

Используется в AreaDamageLooped::OnEnterServerEvent(), AreaDamageOnce::OnEnterServerEvent(), AreaDamageLooped::OnStayServerEvent() и OnStayServerEvent().

◆ OnLeaveBeginEvent()

override void OnLeaveBeginEvent ( TriggerInsider insider)
protected

Called when an object leaves the trigger.

176 {
177 m_DamageComponent.OnLeaveBeginEvent(insider);
178 }

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

◆ OnLeaveClientEvent()

override void OnLeaveClientEvent ( TriggerInsider insider)
protected
184 {
185 m_DamageComponent.OnLeaveClientEvent(insider);
186 }

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

◆ OnLeaveEndEvent()

override void OnLeaveEndEvent ( TriggerInsider insider)
protected
188 {
189 m_DamageComponent.OnLeaveEndEvent(insider);
190 }

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

◆ OnLeaveServerEvent()

override void OnLeaveServerEvent ( TriggerInsider insider)
protected
180 {
181 m_DamageComponent.OnLeaveServerEvent(insider);
182 }

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

◆ OnStayBeginEvent()

override void OnStayBeginEvent ( TriggerInsider insider,
float deltaTime )
protected

Called in the update loop.

140 {
141 m_DamageComponent.OnStayBeginEvent(insider, deltaTime);
142 }

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

◆ OnStayClientEvent()

override void OnStayClientEvent ( TriggerInsider insider,
float deltaTime )
protected
148 {
149 m_DamageComponent.OnStayClientEvent(insider, deltaTime);
150 }

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

◆ OnStayEndEvent()

override void OnStayEndEvent ( TriggerInsider insider,
float deltaTime )
protected
152 {
153 m_DamageComponent.OnStayEndEvent(insider, deltaTime);
154 }

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

◆ OnStayFinishBeginEvent()

override void OnStayFinishBeginEvent ( )
protected

Called at the end of an update loop.

158 {
159 m_DamageComponent.OnStayFinishBeginEvent();
160 }

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

◆ OnStayFinishClientEvent()

override void OnStayFinishClientEvent ( )
protected
166 {
167 m_DamageComponent.OnStayFinishClientEvent();
168 }

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

◆ OnStayFinishEndEvent()

override void OnStayFinishEndEvent ( )
protected
170 {
171 m_DamageComponent.OnStayFinishEndEvent();
172 }

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

◆ OnStayFinishServerEvent()

override void OnStayFinishServerEvent ( )
protected
162 {
163 m_DamageComponent.OnStayFinishServerEvent();
164 }

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

◆ OnStayServerEvent()

override void OnStayServerEvent ( TriggerInsider insider,
float deltaTime )
protected
144 {
145 m_DamageComponent.OnStayServerEvent(insider, deltaTime);
146 }

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

◆ OnStayStartBeginEvent()

override void OnStayStartBeginEvent ( int nrOfInsiders)
protected

Called at the beginning of an update loop.

122 {
123 m_DamageComponent.OnStayStartBeginEvent(nrOfInsiders);
124 }

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

◆ OnStayStartClientEvent()

override void OnStayStartClientEvent ( int nrOfInsiders)
protected
130 {
131 m_DamageComponent.OnStayStartClientEvent(nrOfInsiders);
132 }

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

◆ OnStayStartEndEvent()

override void OnStayStartEndEvent ( int nrOfInsiders)
protected
134 {
135 m_DamageComponent.OnStayStartEndEvent(nrOfInsiders);
136 }

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

◆ OnStayStartServerEvent()

override void OnStayStartServerEvent ( int nrOfInsiders)
protected
126 {
127 m_DamageComponent.OnStayStartServerEvent(nrOfInsiders);
128 }

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

◆ OnTriggerCreated()

override void OnTriggerCreated ( )
protected

Called when a trigger is created

92 {
93 m_DamageComponent.OnTriggerCreated();
94 }

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

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

◆ OnTriggerDestroyed()

override void OnTriggerDestroyed ( )
protected

Called when a trigger is destroyed.

98 {
99 m_DamageComponent.OnTriggerDestroyed();
100 }

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

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

◆ PostDamageActions()

override void PostDamageActions ( )
protected

Usually called from AreaDamageComponent.

207 {
208 if ( m_ParentObject )
209 m_ParentObject.PostAreaDamageActions();
210 }

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

Используется в AreaDamageBase::EvaluateDamage_Common() и EvaluateDamageInternal().

◆ PreDamageActions()

override void PreDamageActions ( )
protected

Usually called from AreaDamageComponent.

200 {
201 if ( m_ParentObject )
202 m_ParentObject.PreAreaDamageActions();
203 }

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

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

◆ RemoveAddDamageableType()

void RemoveAddDamageableType ( typename damageableType )
protected
327 {
328 m_DamageComponent.m_DamageableTypes.RemoveItem(damageableType);
329 }

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

◆ SetAmmoName()

void SetAmmoName ( string ammo_name)
protected
257 {
258 m_DamageComponent.m_AmmoName = ammo_name;
259 }

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

◆ SetAreaOrientation()

void SetAreaOrientation ( vector orientation)
protected
298 {
300
302 {
304 }
305 }

Перекрестные ссылки m_AreaDamageTrigger и m_AreaOrientation.

◆ SetAreaPosition()

void SetAreaPosition ( vector position)
protected
284 {
286
288 {
290 }
291 }

Перекрестные ссылки m_AreaDamageTrigger и m_AreaPosition.

◆ SetDamageableTypes()

void SetDamageableTypes ( array< typename > damageableTypes)
protected
312 {
313 m_DamageComponent.m_DamageableTypes = damageableTypes;
314 }

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

◆ SetDamageComponentType()

void SetDamageComponentType ( int type)
protected
42 {
43 switch (type)
44 {
46 {
48 break;
49 }
51 {
53 break;
54 }
56 {
58 break;
59 }
60
61 default:
62 {
63 Error(string.Format("[ERROR] :: [AreaDamageManager] :: Unknown DamageComponentType: %1", type));
64 break;
65 }
66 }
67 }
Newer implementation equivalent of "AreaDamageRegular", hitzone selection only.
Definition AreaDamageComponentRandomHitzone.c:3
Newer implementation equivalent of "AreaDamageRegularRaycasted", hitzone selection only.
Definition AreaDamageComponentRaycasted.c:3
Definition AreaDamageManager.c:2
const int RAYCASTED
Definition AreaDamageManager.c:5
const int HITZONE
Definition AreaDamageManager.c:4
const int BASE
Definition AreaDamageManager.c:3
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки AreaDamageComponent(), AreaDamageComponentTypes::BASE, Error(), AreaDamageComponentTypes::HITZONE, m_DamageComponent и AreaDamageComponentTypes::RAYCASTED.

◆ SetDamageType()

void SetDamageType ( int pDamageType)
protected
266 {
267 m_DamageComponent.m_DamageType = pDamageType;
268 }

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

◆ SetDeferDuration()

void SetDeferDuration ( float time)
protected
337 {
338 Error("SetDeferDuration not implemented - usable in Deferred area damage objects only");
339 }

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

◆ SetExtents()

void SetExtents ( vector mins,
vector maxs )
protected

script configuration

234 {
237
239 {
241 }
242 }

Перекрестные ссылки m_AreaDamageTrigger, m_ExtentMax, m_ExtentMin и AreaDamageTriggerBase::SetExtents().

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

◆ SetHitZones()

void SetHitZones ( array< string > hitzones)
protected
342 {
344 if ( CastTo( adc, m_DamageComponent ) )
345 adc.SetHitZones( hitzones );
346 else
347 Error("SetHitZones not implemented - override for non raycasted versions of area damage objects only");
348 }

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

◆ SetLoopInterval()

void SetLoopInterval ( float time)
protected
332 {
333 Error("SetLoopInterval not implemented - usable in Regular(looped) area damage objects only");
334 }

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

◆ SetParentObject()

void SetParentObject ( EntityAI obj)
protected
275 {
276 m_ParentObject = obj;
277 }

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

◆ SetRaycastSources()

void SetRaycastSources ( array< string > raycast_sources)
protected
351 {
353 if ( CastTo( adc, m_DamageComponent ) )
354 adc.SetRaycastSources( raycast_sources );
355 else
356 Error("SetRaycastSources not implemented - override for raycasted versions of area damage objects only");
357 }

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

◆ SetRaycastSourcesVector()

void SetRaycastSourcesVector ( array< vector > raycast_sources)
protected
360 {
362 if ( CastTo( adc, m_DamageComponent ) )
363 adc.SetRaycastSourcesVector( raycast_sources );
364 else
365 Error("SetRaycastSources not implemented - override for raycasted versions of area damage objects only");
366 }

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

◆ Spawn()

void Spawn ( )
protected

spawn damage trigger

71 {
74 }
override void OnTriggerCreated()
Definition AreaDamageManager.c:91

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

Используется в ActionConstructor::ConstructActions(), EmoteConstructor::ConstructEmotes() и ImpactMaterials::EvaluateImpactEffect().

◆ ~AreaDamageManager()

void ~AreaDamageManager ( )
protected
37 {
38 Destroy();
39 }
void Destroy()
destroy damage trigger
Definition AreaDamageManager.c:77

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

Переменные

◆ m_AreaDamageTrigger

◆ m_AreaOrientation

vector m_AreaOrientation
protected

◆ m_AreaPosition

vector m_AreaPosition
protected

◆ m_DamageComponent

◆ m_ExtentMax

◆ m_ExtentMin

◆ m_ParentObject

◆ m_TriggerBaseClass

string m_TriggerBaseClass
protected