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

◆ DamageCrew()

void DamageCrew ( float dmg)
protected

Responsible for damaging crew in a car crash.

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

1421 {
1422 for ( int c = 0; c < CrewSize(); ++c )
1423 {
1424 Human crew = CrewMember( c );
1425 if ( !crew )
1426 continue;
1427
1428 PlayerBase player;
1429 if ( Class.CastTo(player, crew ) )
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("--------------------------------------------------");
1439 Debug.Log("Killing the player");
1440 Debug.Log("Crew DMG Base: " + dmg);
1441 Debug.Log("--------------------------------------------------");
1442
1443 }
1444 #endif
1445 player.SetHealth(0.0);
1446 }
1447 else
1448 {
1450 shockTemp = Math.Clamp(shockTemp,0,1);
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.
Определения EnScript.c:11
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.
Определения Debug.c:122
Определения Debug.c:2
Определения constants.c:659
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
const float CARS_CONTACT_DMG_THRESHOLD
Определения constants.c:836
const float CARS_CONTACT_DMG_KILLCREW
Определения constants.c:838
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,...

Перекрестные ссылки GameConstants::CARS_CONTACT_DMG_KILLCREW, GameConstants::CARS_CONTACT_DMG_THRESHOLD, Class::CastTo(), Math::Clamp(), Math::InverseLerp(), Math::Lerp() и Debug::Log().

Используется в CheckContactCache().