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

◆ ProcessHit()

void BleedingSourcesManagerBase::ProcessHit ( float damage,
EntityAI source,
int component,
string zone,
string ammo,
vector modelPos )
inlineprotected

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

161 {
162 float dmg_max = m_Player.GetMaxHealth(zone, "Blood");
163 float bleed_threshold = GetGame().ConfigGetFloat("CfgAmmo " + ammo + " DamageApplied bleedThreshold");
164 string damageTypeString = GetGame().ConfigGetTextOut("CfgAmmo " + ammo + " DamageApplied type");
165 bleed_threshold = Math.Clamp(bleed_threshold,0,1);
166 float bleedingChance;
167 bool createBleedingSource = false;
168
169 // 'true' only when the damageTypeString is handled there
170 if (BleedChanceData.CalculateBleedChance(damageTypeString, damage, bleed_threshold,bleedingChance))
171 {
172 float roll = Math.RandomFloat01();
173 createBleedingSource = bleedingChance != 0 && bleedingChance >= roll;
174
175 #ifdef ENABLE_LOGGING
176 if (LogManager.IsBleedingChancesLogEnable())
177 {
178 Debug.BleedingChancesLog(roll.ToString(), "BleedingSourcesManagerServer" , "n/a", "bleeding random roll:");
179 }
180 #endif
181 }
182 else if (source && source.IsZombie())
183 {
184 int chance = Math.RandomInt(0,100);
185 if (chance <= damage)
186 {
187 createBleedingSource = true;
188 }
189 }
190 else if (damage > (dmg_max * (1 - bleed_threshold)) )
191 {
192 createBleedingSource = true;
193 }
194
195 if (createBleedingSource)
196 {
197 #ifdef ENABLE_LOGGING
198 if (LogManager.IsBleedingChancesLogEnable())
199 {
200 Debug.BleedingChancesLog("true", "BleedingSourcesManagerServer" , "n/a", "Attempting to create bleeding source");
201 }
202 #endif
204 }
205 }
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void Debug()
Определения UniversalTemperatureSource.c:349
bool AttemptAddBleedingSource(int component)
Определения BleedingSourcesManagerBase.c:194
proto native float ConfigGetFloat(string path)
Get float value from config on path.
string ConfigGetTextOut(string path)
Get string value from config on path.
Определения Game.c:463
proto string ToString(bool simple=true)
proto native CGame GetGame()

Перекрестные ссылки AttemptAddBleedingSource(), Debug::BleedingChancesLog(), BleedChanceData::CalculateBleedChance(), Math::Clamp(), component, CGame::ConfigGetFloat(), CGame::ConfigGetTextOut(), GetGame(), LogManager::IsBleedingChancesLogEnable(), m_Player, Math::RandomFloat01(), Math::RandomInt() и float::ToString().