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

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

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

class  TotalDamageResult
 

Определения типов

typedef map< string, ref array< string > > DamageZoneMap
 

Перечисления

enum  DamageType
 exposed from C++ (do not change) Подробнее...
 

Функции

enum DamageType CloseCombatDamage (EntityAI source, Object targetObject, int targetComponentIndex, string ammoTypeName, vector worldPos, int directDamageFlags=ProcessDirectDamageFlags.ALL_TRANSFER)
 
static proto native void CloseCombatDamageName (EntityAI source, Object targetObject, string targetComponentName, string ammoTypeName, vector worldPos, int directDamageFlags=ProcessDirectDamageFlags.ALL_TRANSFER)
 
static proto native void ExplosionDamage (EntityAI source, Object directHitObject, string ammoTypeName, vector worldPos, int damageType)
 
static bool GetDamageZoneMap (EntityAI entity, out DamageZoneMap zoneMap)
 
static bool GetDamageZoneFromComponentName (notnull EntityAI entity, string component, out string damageZone)
 Returns damage zone to which the named component belongs.
 
static bool GetComponentNamesFromDamageZone (notnull EntityAI entity, string damageZone, out array< string > componentNames)
 
static string GetDamageDisplayName (EntityAI entity, string zone)
 
static void ResetAllZones (EntityAI entity)
 

Переменные

 CLOSE_COMBAT
 
 FIRE_ARM
 
 EXPLOSION
 
 STUN
 
 CUSTOM
 

Типы

◆ DamageZoneMap

Перечисления

◆ DamageType

exposed from C++ (do not change)

11{
12 CLOSE_COMBAT, // 0
13 FIRE_ARM, // 1
15 STUN,
16 CUSTOM
17}
FIRE_ARM
Definition DamageSystem.c:1
EXPLOSION
Definition DamageSystem.c:2
CLOSE_COMBAT
Definition DamageSystem.c:0
CUSTOM
Definition DamageSystem.c:5
STUN
Definition DamageSystem.c:3

Функции

◆ CloseCombatDamage()

enum DamageType CloseCombatDamage ( EntityAI source,
Object targetObject,
int targetComponentIndex,
string ammoTypeName,
vector worldPos,
int directDamageFlags = ProcessDirectDamageFlags.ALL_TRANSFER )

◆ CloseCombatDamageName()

static proto native void CloseCombatDamageName ( EntityAI source,
Object targetObject,
string targetComponentName,
string ammoTypeName,
vector worldPos,
int directDamageFlags = ProcessDirectDamageFlags.ALL_TRANSFER )
static

◆ ExplosionDamage()

static proto native void ExplosionDamage ( EntityAI source,
Object directHitObject,
string ammoTypeName,
vector worldPos,
int damageType )
static

◆ GetComponentNamesFromDamageZone()

static bool GetComponentNamesFromDamageZone ( notnull EntityAI entity,
string damageZone,
out array< string > componentNames )
static
105 {
106 string path;
107
108 if (entity.IsWeapon())
109 {
111 }
112 else if (entity.IsMagazine())
113 {
115 }
116 else
117 {
119 }
120
121 path = string.Format("%1 %2 DamageSystem DamageZones %3 componentNames", path, entity.GetType(), damageZone);
122 if (GetGame().ConfigIsExisting(path))
123 {
124 GetGame().ConfigGetTextArray(path,componentNames);
125 return true;
126 }
127
128 return false;
129 }
string path
Definition OptionSelectorMultistate.c:142
Definition EntityAI.c:95
proto native CGame GetGame()
const string CFG_VEHICLESPATH
Definition constants.c:217
const string CFG_WEAPONSPATH
Definition constants.c:218
const string CFG_MAGAZINESPATH
Definition constants.c:219
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, string::Format(), GetGame() и path.

◆ GetDamageDisplayName()

static string GetDamageDisplayName ( EntityAI entity,
string zone )
static
132 {
133 string component_name;
134 entity.GetEntityDamageDisplayNameMap().Find(zone.Hash(), component_name);
135 component_name = Widget.TranslateString(component_name);
136 return component_name;
137 }
Definition EnWidgets.c:190

◆ GetDamageZoneFromComponentName()

static bool GetDamageZoneFromComponentName ( notnull EntityAI entity,
string component,
out string damageZone )
static

Returns damage zone to which the named component belongs.

77 {
78 DamageZoneMap zoneMap = entity.GetEntityDamageZoneMap();
80 components = zoneMap.GetValueArray();
81 for (int i = 0; i < components.Count(); i++)
82 {
84 for (int j = 0; j < inner.Count(); j++)
85 {
86 string innerComponentName = inner.Get(j);
87 innerComponentName.ToLower();
88
89 //We don't have a component name, no need to proceed
90 if ( innerComponentName == "" )
91 break;
92
94 {
95 damageZone = zoneMap.GetKey(i);
96 return true;
97 }
98 }
99 }
100 damageZone = "";
101 return false;
102 }
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.

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

◆ GetDamageZoneMap()

static bool GetDamageZoneMap ( EntityAI entity,
out DamageZoneMap zoneMap )
static
28 {
29 string path_base;
30 string path;
31
32 if (entity.IsWeapon())
33 {
35 }
36 else if (entity.IsMagazine())
37 {
39 }
40 else
41 {
43 }
44
45 path_base = string.Format("%1 %2 DamageSystem DamageZones", path_base, entity.GetType());
46
47 if (!GetGame().ConfigIsExisting(path_base))
48 {
49 return false;
50 }
51 else
52 {
53 string zone;
56
57 entity.GetDamageZones(zone_names);
58 for (int i = 0; i < zone_names.Count(); i++)
59 {
61 zone = zone_names.Get(i);
62
63 path = string.Format("%1 %2 componentNames ", path_base, zone);
64 if (GetGame().ConfigIsExisting(path))
65 {
66 GetGame().ConfigGetTextArray(path,component_names);
67 }
69 }
70
71 return true;
72 }
73 }

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, string::Format(), GetGame() и path.

◆ ResetAllZones()

static void ResetAllZones ( EntityAI entity)
static
140 {
142 DamageSystem.GetDamageZoneMap(entity, zonesMap);
143 array<string> zones = zonesMap.GetKeyArray();
144 entity.SetHealth("", "Health", entity.GetMaxHealth("","Health"));
145 entity.SetHealth("", "Shock", entity.GetMaxHealth("","Shock"));
146 entity.SetHealth("", "Blood", entity.GetMaxHealth("","Blood"));
147
148 foreach (string zone : zones)
149 {
150 entity.SetHealth(zone, "Health", entity.GetMaxHealth(zone,"Health"));
151 entity.SetHealth(zone, "Shock", entity.GetMaxHealth(zone,"Shock"));
152 entity.SetHealth(zone, "Blood", entity.GetMaxHealth(zone,"Blood"));
153 }
154 }
map< string, ref array< string > > DamageZoneMap
Definition DamageSystem.c:157

Переменные

◆ CLOSE_COMBAT

CLOSE_COMBAT

◆ CUSTOM

CUSTOM

◆ EXPLOSION

EXPLOSION

◆ FIRE_ARM

FIRE_ARM

◆ STUN

STUN