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

◆ OnAction()

override bool ItemBase::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

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

425 {
426 if (super.OnAction(action_id, player, ctx))
427 return true;
428
429 if (!GetGame().IsServer())
430 return false;
431
432 switch (action_id)
433 {
434 case EActions.GENERIC_FUEL_FULL:
436 return true;
437 case EActions.GENERIC_FUEL_EMPTY:
438 SetFuel(0);
439 return true;
440 case EActions.GENERIC_FUEL_INCREASE:
441 AddFuel(Math.Clamp(GetMaxFuel() * 0.1, 0.0, GetMaxFuel()));
442 return true;
443 case EActions.GENERIC_FUEL_DECREASE:
444 float value = GetMaxFuel() * 0.1;
445 if (value <= 0.0)
446 {
447 SetFuel(0.0);
448 return true;
449 }
450
451 SetFuel(GetFuel() - value);
452 return true;
453 }
454
455 return false;
456 }
EActions
Определения EActions.c:2
void SetFuel(float fuel_amount)
Определения PowerGenerator.c:286
float GetMaxFuel()
Определения PowerGenerator.c:354
float GetFuel()
Определения PowerGenerator.c:348
float AddFuel(float available_fuel)
Определения PowerGenerator.c:309
proto native CGame GetGame()

Перекрестные ссылки AddFuel(), Math::Clamp(), GetFuel(), GetGame(), GetMaxFuel() и SetFuel().