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 (!
g_Game.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);
66 g_Game.ConfigGetTextArray(
path,component_names);
68 zoneMap.Insert(zone,component_names);
80 components = zoneMap.GetValueArray();
81 int countComponents = components.Count();
82 for (
int i = 0; i < countComponents; ++i)
85 foreach (
string innerComponentName : inner)
88 if (innerComponentName ==
"")
91 innerComponentName.ToLower();
94 damageZone = zoneMap.GetKey(i);
107 if (entity.IsWeapon())
111 else if (entity.IsMagazine())
120 path =
string.Format(
"%1 %2 DamageSystem DamageZones %3 componentNames",
path, entity.GetType(), damageZone);
123 g_Game.ConfigGetTextArray(
path,componentNames);
132 string component_name;
133 entity.GetEntityDamageDisplayNameMap().Find(zone.
Hash(), component_name);
134 component_name =
Widget.TranslateString(component_name);
135 return component_name;
141 DamageSystem.GetDamageZoneMap(entity, zonesMap);
143 entity.SetHealth(
"",
"Health", entity.GetMaxHealth(
"",
"Health"));
144 entity.SetHealth(
"",
"Shock", entity.GetMaxHealth(
"",
"Shock"));
145 entity.SetHealth(
"",
"Blood", entity.GetMaxHealth(
"",
"Blood"));
147 foreach (
string zone : zones)
149 entity.SetHealth(zone,
"Health", entity.GetMaxHealth(zone,
"Health"));
150 entity.SetHealth(zone,
"Shock", entity.GetMaxHealth(zone,
"Shock"));
151 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 float GetDamage(string zoneName, string healthType)
proto native float GetHighestDamage(string healthType)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
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.