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

◆ DamageCrew()

void DamageCrew ( float dmg)
protected

Responsible for damaging crew in a car crash.

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

1361 {
1362 int crewSize = CrewSize();
1363 for (int c = 0; c < crewSize; ++c)
1364 {
1365 Human crew = CrewMember(c);
1366 if (!crew)
1367 continue;
1368
1370 {
1371 #ifdef DIAG_DEVELOPER
1372 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1373 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1374 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1375 {
1376 Debug.Log("--------------------------------------------------");
1377 Debug.Log("Killing the player");
1378 Debug.Log("Crew DMG Base: " + dmg);
1379 Debug.Log("--------------------------------------------------");
1380
1381 }
1382 #endif
1383 crew.SetHealth(0.0);
1384 }
1385 else
1386 {
1388 shockTemp = Math.Clamp(shockTemp,0,1);
1389 float shock = Math.Lerp(50, 150, shockTemp);
1390 float hp = Math.Lerp(2, 100, shockTemp);
1391
1392 #ifdef DIAG_DEVELOPER
1393 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1394 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1395 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1396 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1397 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1398 {
1399 Debug.Log("--------------------------------------------------");
1400 Debug.Log("Crew DMG Base: " + dmg);
1401 Debug.Log("Crew shockTemp: " + shockTemp);
1402 Debug.Log("Crew DMG Health: " + hp);
1403 Debug.Log("Crew DMG Shock: " + shock);
1404 Debug.Log("--------------------------------------------------");
1405 }
1406 #endif
1407
1408 crew.AddHealth("", "Shock", -shock);
1409 crew.AddHealth("", "Health", -hp);
1410 }
1411 }
1412 }
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.
Определения 3_Game/DayZ/tools/Debug.c:183
Определения 3_Game/DayZ/tools/Debug.c:2
Определения human.c:1360
Определения EnMath.c:7
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,...
const float MOTORBIKES_CONTACT_DMG_THRESHOLD_SMALL
Определения 3_Game/DayZ/constants.c:898
const float MOTORBIKES_CONTACT_DMG_KILLCREW
Определения 3_Game/DayZ/constants.c:901

Перекрестные ссылки Math::Clamp(), Math::InverseLerp(), Math::Lerp(), Debug::Log(), GameConstants::MOTORBIKES_CONTACT_DMG_KILLCREW и GameConstants::MOTORBIKES_CONTACT_DMG_THRESHOLD_SMALL.

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