Responsible for damaging crew in a car crash.
1375 {
1376 int crewSize = CrewSize();
1377 for (int c = 0; c < crewSize; ++c)
1378 {
1379 Human crew = CrewMember(c);
1380 if (!crew)
1381 continue;
1382
1383 if (dmg > GameConstants.CARS_CONTACT_DMG_KILLCREW)
1384 {
1385 #ifdef DIAG_DEVELOPER
1386 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1387 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1388 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1389 {
1390 Debug.Log(
"--------------------------------------------------");
1391 Debug.Log(
"Killing the player");
1392 Debug.Log(
"Crew DMG Base: " + dmg);
1393 Debug.Log(
"--------------------------------------------------");
1394
1395 }
1396 #endif
1397 crew.SetHealth(0.0);
1398 }
1399 else
1400 {
1401 float shockTemp = Math.InverseLerp(GameConstants.CARS_CONTACT_DMG_THRESHOLD, GameConstants.CARS_CONTACT_DMG_KILLCREW, dmg);
1402 shockTemp = Math.Clamp(shockTemp,0,1);
1403 float shock = Math.Lerp(50, 150, shockTemp);
1404 float hp = Math.Lerp(2, 100, shockTemp);
1405
1406 #ifdef DIAG_DEVELOPER
1407 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1408 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1409 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1410 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1411 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1412 {
1413 Debug.Log(
"--------------------------------------------------");
1414 Debug.Log(
"Crew DMG Base: " + dmg);
1415 Debug.Log(
"Crew shockTemp: " + shockTemp);
1416 Debug.Log(
"Crew DMG Health: " + hp);
1417 Debug.Log(
"Crew DMG Shock: " + shock);
1418 Debug.Log(
"--------------------------------------------------");
1419 }
1420 #endif
1421
1422 crew.AddHealth("", "Shock", -shock);
1423 crew.AddHealth("", "Health", -hp);
1424 }
1425 }
1426 }