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

◆ ProcessHit()

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

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

168 {
169 float dmg_max = m_Player.GetMaxHealth(zone, "Blood");
170 float bleed_threshold = GetGame().ConfigGetFloat("CfgAmmo " + ammo + " DamageApplied bleedThreshold");
171 string damageTypeString = GetGame().ConfigGetTextOut("CfgAmmo " + ammo + " DamageApplied type");
172 bleed_threshold = Math.Clamp(bleed_threshold,0,1);
173 float bleedingChance;
174 bool createBleedingSource = false;
175
176 // 'true' only when the damageTypeString is handled there
177 if (BleedChanceData.CalculateBleedChance(damageTypeString, damage, bleed_threshold,bleedingChance))
178 {
179 float roll = Math.RandomFloat01();
180 createBleedingSource = bleedingChance != 0 && bleedingChance >= roll;
181
182 #ifdef ENABLE_LOGGING
183 if (LogManager.IsBleedingChancesLogEnable())
184 {
185 Debug.BleedingChancesLog(roll.ToString(), "BleedingSourcesManagerServer" , "n/a", "bleeding random roll:");
186 }
187 #endif
188 }
189 else if (source && source.IsZombie())
190 {
191 int chance = Math.RandomInt(0,100);
192 if (chance <= damage)
193 {
194 createBleedingSource = true;
195 }
196 }
197 else if (damage > (dmg_max * (1 - bleed_threshold)))
198 {
199 createBleedingSource = true;
200 }
201
202 if (createBleedingSource)
203 {
204 #ifdef ENABLE_LOGGING
205 if (LogManager.IsBleedingChancesLogEnable())
206 {
207 Debug.BleedingChancesLog("true", "BleedingSourcesManagerServer" , "n/a", "Attempting to create bleeding source");
208 }
209 #endif
211 }
212 }
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.
Определения Global/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().