3 proto native
float GetDamage(
string zoneName,
string healthType);
4 proto native
float GetHighestDamage(
string healthType);
25 static proto native
void ExplosionDamage(
EntityAI source,
Object directHitObject,
string ammoTypeName,
vector worldPos,
int damageType);
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);
76 static bool GetDamageZoneFromComponentName(notnull
EntityAI entity,
string component, out
string damageZone)
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);
87 innerComponentName.ToLower();
90 if ( innerComponentName ==
"" )
95 damageZone = zoneMap.GetKey(i);
104 static bool GetComponentNamesFromDamageZone(notnull
EntityAI entity,
string damageZone, out
array<string> componentNames)
108 if (entity.IsWeapon())
112 else if (entity.IsMagazine())
121 path =
string.Format(
"%1 %2 DamageSystem DamageZones %3 componentNames",
path, entity.GetType(), damageZone);
131 static string GetDamageDisplayName(
EntityAI entity,
string zone)
133 string component_name;
134 entity.GetEntityDamageDisplayNameMap().Find(zone.Hash(), component_name);
135 component_name =
Widget.TranslateString(component_name);
136 return component_name;
139 static void ResetAllZones(
EntityAI entity)
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"));