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

◆ OnSound()

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

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

307 {
308 switch (ctrl)
309 {
310 case CarSoundCtrl.DOORS:
311 float newValue = 0;
312 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
313 {
314 newValue += 0.25;
315 }
316
317 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
318 {
319 newValue += 0.25;
320 }
321
322 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
323 {
324 newValue += 0.25;
325 }
326
327 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
328 {
329 newValue += 0.25;
330 }
331
332 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
333 {
334 newValue -= 0.6;
335 }
336
337 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
338 {
339 newValue -= 0.6;
340 }
341
342 return Math.Clamp(newValue, 0, 1);
343 break;
344 }
345
346 return super.OnSound(ctrl, oldValue);
347 }
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.