Responsible for damaging crew in a car crash.
1463 {
1464 for ( int c = 0; c < CrewSize(); ++c )
1465 {
1466 Human crew = CrewMember( c );
1467 if ( !crew )
1468 continue;
1469
1470 PlayerBase player;
1471 if ( Class.CastTo(player, crew ) )
1472 {
1473 if ( dmg > GameConstants.CARS_CONTACT_DMG_KILLCREW )
1474 {
1475 #ifdef DIAG_DEVELOPER
1476 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1477 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1478 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1479 {
1480 Debug.Log(
"--------------------------------------------------");
1481 Debug.Log(
"Killing the player");
1482 Debug.Log(
"Crew DMG Base: " + dmg);
1483 Debug.Log(
"--------------------------------------------------");
1484
1485 }
1486 #endif
1487 player.SetHealth(0.0);
1488 }
1489 else
1490 {
1491 float shockTemp = Math.InverseLerp(GameConstants.CARS_CONTACT_DMG_THRESHOLD, GameConstants.CARS_CONTACT_DMG_KILLCREW, dmg);
1492 shockTemp = Math.Clamp(shockTemp,0,1);
1493 float shock = Math.Lerp( 50, 150, shockTemp );
1494 float hp = Math.Lerp( 2, 100, shockTemp );
1495
1496 #ifdef DIAG_DEVELOPER
1497 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1498 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1499 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1500 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1501 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1502 {
1503 Debug.Log(
"--------------------------------------------------");
1504 Debug.Log(
"Crew DMG Base: " + dmg);
1505 Debug.Log(
"Crew shockTemp: " + shockTemp);
1506 Debug.Log(
"Crew DMG Health: " + hp);
1507 Debug.Log(
"Crew DMG Shock: " + shock);
1508 Debug.Log(
"--------------------------------------------------");
1509 }
1510 #endif
1511
1512 player.AddHealth("", "Shock", -shock );
1513 player.AddHealth("", "Health", -hp );
1514 }
1515 }
1516 }
1517 }