DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetFallbackHitZone()

string AreaDamageComponentRaycasted::GetFallbackHitZone ( Object victim)
inlineprotected

См. определение в файле AreaDamageComponentRaycasted.c строка 121

122 {
123 Error(string.Format("[WARNING] :: [%1] :: [AreaDamageComponentRaycasted] :: No proper HitZone found for damaging %2, using fallback.",
124 m_Parent, Object.GetDebugName(victim)));
125
126 // Fallbacks, currently are implemented assuming that foot/leg damagezones would be desired to damage
127 if ( victim.IsInherited(DayZPlayer) || victim.IsInherited(DayZInfected) )
128 {
129 // Damage random leg since we don't know what part of player's body was caught in the trap.
130 if ( Math.RandomIntInclusive(0, 1) == 1 )
131 return "RightFoot";
132 return "LeftFoot";
133 }
134 else
135 {
136 array<string> damageZones = new array<string>;
137 victim.GetDamageZones(damageZones);
138
139 int nrOfDmgZones = damageZones.Count();
140
141 if (nrOfDmgZones > 0)
142 {
143 for (int z = 0; z < nrOfDmgZones; ++z)
144 {
145 if ( damageZones[z].Contains("Foot") || damageZones[z].Contains("Leg") )
146 return damageZones[z];
147 }
148
149 return damageZones.GetRandomElement();
150 }
151 else
152 return "";
153 }
154 }
Widget m_Parent
Определения SizeToChild.c:92
class LOD Object
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки Error(), m_Parent и Math::RandomIntInclusive().

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