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

◆ OnSound()

override float OffroadHatchback::OnSound ( CarSoundCtrl ctrl,
float oldValue )
inlineprotected

См. определение в файле Vehicles/InheritedCars/OffroadHatchback.c строка 298

299 {
300 float tempCap = 0.0;
301
302 switch (ctrl)
303 {
304 case CarSoundCtrl.DOORS:
305 float newValue = 0;
306 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
307 {
308 newValue += 0.5;
309 }
310
311 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
312 {
313 newValue += 0.5;
314 }
315
316 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
317 {
318 newValue += 0.3;
319 }
320
321 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
322 {
323 newValue -= 0.6;
324 }
325
326 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
327 {
328 newValue -= 0.2;
329 }
330
331 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
332 {
333 newValue -= 0.2;
334 }
335
336 return Math.Clamp(newValue, 0, 1);
337 break;
338 }
339
340 return super.OnSound(ctrl, oldValue);
341 }
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Определения Car.c:4
CarDoorState
Определения CarScript.c:2
override int GetCarDoorsState(string slotType)

Перекрестные ссылки Math::Clamp(), GetCarDoorsState() и GameConstants::STATE_RUINED.