Responsible for damaging crew in a car crash.
1421 {
1422 for ( int c = 0; c < CrewSize(); ++c )
1423 {
1424 Human crew = CrewMember( c );
1425 if ( !crew )
1426 continue;
1427
1430 {
1432 {
1433 #ifdef DIAG_DEVELOPER
1434 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1435 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1436 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1437 {
1438 Debug.
Log(
"--------------------------------------------------");
1440 Debug.
Log(
"Crew DMG Base: " + dmg);
1441 Debug.
Log(
"--------------------------------------------------");
1442
1443 }
1444 #endif
1445 player.SetHealth(0.0);
1446 }
1447 else
1448 {
1451 float shock =
Math.
Lerp( 50, 150, shockTemp );
1452 float hp =
Math.
Lerp( 2, 100, shockTemp );
1453
1454 #ifdef DIAG_DEVELOPER
1455 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1456 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1457 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1458 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1459 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1460 {
1461 Debug.
Log(
"--------------------------------------------------");
1462 Debug.
Log(
"Crew DMG Base: " + dmg);
1463 Debug.
Log(
"Crew shockTemp: " + shockTemp);
1464 Debug.
Log(
"Crew DMG Health: " + hp);
1465 Debug.
Log(
"Crew DMG Shock: " + shock);
1466 Debug.
Log(
"--------------------------------------------------");
1467 }
1468 #endif
1469
1470 player.AddHealth("", "Shock", -shock );
1471 player.AddHealth("", "Health", -hp );
1472 }
1473 }
1474 }
1475 }
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...