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

◆ OnAction()

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

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

410 {
411 if (super.OnAction(action_id, player, ctx))
412 return true;
413
414 if (!g_Game.IsServer())
415 return false;
416
417 switch (action_id)
418 {
419 case EActions.GENERIC_FUEL_FULL:
421 return true;
422 case EActions.GENERIC_FUEL_EMPTY:
423 SetFuel(0);
424 return true;
425 case EActions.GENERIC_FUEL_INCREASE:
426 AddFuel(Math.Clamp(GetMaxFuel() * 0.1, 0.0, GetMaxFuel()));
427 return true;
428 case EActions.GENERIC_FUEL_DECREASE:
429 float value = GetMaxFuel() * 0.1;
430 if (value <= 0.0)
431 {
432 SetFuel(0.0);
433 return true;
434 }
435
436 SetFuel(GetFuel() - value);
437 return true;
438 }
439
440 return false;
441 }
DayZGame g_Game
Определения DayZGame.c:3942
EActions
Определения EActions.c:2
void SetFuel(float fuel_amount)
Определения PowerGenerator.c:271
float GetMaxFuel()
Определения PowerGenerator.c:339
float GetFuel()
Определения PowerGenerator.c:333
float AddFuel(float available_fuel)
Определения PowerGenerator.c:294

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