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

◆ DamageCrew()

void Car::DamageCrew ( float dmg)
inlineprotected

Responsible for damaging crew in a car crash.

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

1593 {
1594 for ( int c = 0; c < CrewSize(); ++c )
1595 {
1596 Human crew = CrewMember( c );
1597 if ( !crew )
1598 continue;
1599
1600 PlayerBase player;
1601 if ( Class.CastTo(player, crew ) )
1602 {
1603 if ( dmg > GameConstants.CARS_CONTACT_DMG_KILLCREW )
1604 {
1605 #ifdef DIAG_DEVELOPER
1606 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1607 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1608 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1609 {
1610 Debug.Log("--------------------------------------------------");
1611 Debug.Log("Killing the player");
1612 Debug.Log("Crew DMG Base: " + dmg);
1613 Debug.Log("--------------------------------------------------");
1614
1615 }
1616 #endif
1617 player.SetHealth(0.0);
1618 }
1619 else
1620 {
1621 float shockTemp = Math.InverseLerp(GameConstants.CARS_CONTACT_DMG_THRESHOLD, GameConstants.CARS_CONTACT_DMG_KILLCREW, dmg);
1622 shockTemp = Math.Clamp(shockTemp,0,1);
1623 float shock = Math.Lerp( 50, 150, shockTemp );
1624 float hp = Math.Lerp( 2, 100, shockTemp );
1625
1626 #ifdef DIAG_DEVELOPER
1627 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1628 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1629 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1630 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1631 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1632 {
1633 Debug.Log("--------------------------------------------------");
1634 Debug.Log("Crew DMG Base: " + dmg);
1635 Debug.Log("Crew shockTemp: " + shockTemp);
1636 Debug.Log("Crew DMG Health: " + hp);
1637 Debug.Log("Crew DMG Shock: " + shock);
1638 Debug.Log("--------------------------------------------------");
1639 }
1640 #endif
1641
1642 player.AddHealth("", "Shock", -shock );
1643 player.AddHealth("", "Health", -hp );
1644 }
1645 }
1646 }
1647 }
string Debug()
Определения CachedEquipmentStorageBase.c:29

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

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