3 proto native
float GetDamage(
string zoneName,
string healthType);
32 if (entity.IsWeapon())
36 else if (entity.IsMagazine())
45 path_base =
string.
Format(
"%1 %2 DamageSystem DamageZones", path_base, entity.GetType());
47 if (!
GetGame().ConfigIsExisting(path_base))
57 entity.GetDamageZones(zone_names);
58 for (
int i = 0; i < zone_names.Count(); i++)
61 zone = zone_names.Get(i);
63 path =
string.Format(
"%1 %2 componentNames ", path_base, zone);
68 zoneMap.Insert(zone,component_names);
80 components = zoneMap.GetValueArray();
81 for (
int i = 0; i < components.Count(); i++)
84 for (
int j = 0; j < inner.Count(); j++)
86 string innerComponentName = inner.Get(j);
90 if ( innerComponentName ==
"" )
95 damageZone = zoneMap.GetKey(i);
108 if (entity.IsWeapon())
112 else if (entity.IsMagazine())
121 path =
string.Format(
"%1 %2 DamageSystem DamageZones %3 componentNames",
path, entity.GetType(), damageZone);
133 string component_name;
134 entity.GetEntityDamageDisplayNameMap().Find(zone.
Hash(), component_name);
135 component_name =
Widget.TranslateString(component_name);
136 return component_name;
142 DamageSystem.GetDamageZoneMap(entity, zonesMap);
144 entity.SetHealth(
"",
"Health", entity.GetMaxHealth(
"",
"Health"));
145 entity.SetHealth(
"",
"Shock", entity.GetMaxHealth(
"",
"Shock"));
146 entity.SetHealth(
"",
"Blood", entity.GetMaxHealth(
"",
"Blood"));
148 foreach (
string zone : zones)
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"));
static string GetDamageDisplayName(EntityAI entity, string zone)
static proto native void CloseCombatDamageName(EntityAI source, Object targetObject, string targetComponentName, string ammoTypeName, vector worldPos, int directDamageFlags=ProcessDirectDamageFlags.ALL_TRANSFER)
static bool GetDamageZoneMap(EntityAI entity, out DamageZoneMap zoneMap)
enum DamageType CloseCombatDamage(EntityAI source, Object targetObject, int targetComponentIndex, string ammoTypeName, vector worldPos, int directDamageFlags=ProcessDirectDamageFlags.ALL_TRANSFER)
static bool GetComponentNamesFromDamageZone(notnull EntityAI entity, string damageZone, out array< string > componentNames)
static proto native void ExplosionDamage(EntityAI source, Object directHitObject, string ammoTypeName, vector worldPos, int damageType)
static bool GetDamageZoneFromComponentName(notnull EntityAI entity, string component, out string damageZone)
Returns damage zone to which the named component belongs.
map< string, ref array< string > > DamageZoneMap
static void ResetAllZones(EntityAI entity)
DamageType
exposed from C++ (do not change)
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native float GetDamage(string zoneName, string healthType)
proto native float GetHighestDamage(string healthType)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto native int Hash()
Returns hash of string.
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.
proto int ToLower()
Changes string to lowercase. Returns length.