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

◆ OnAction()

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

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

405 {
406 if (super.OnAction(action_id, player, ctx))
407 return true;
408
409 if (!g_Game.IsServer())
410 return false;
411
412 switch (action_id)
413 {
414 case EActions.GENERIC_FUEL_FULL:
416 return true;
417 case EActions.GENERIC_FUEL_EMPTY:
418 SetFuel(0);
419 return true;
420 case EActions.GENERIC_FUEL_INCREASE:
421 AddFuel(Math.Clamp(GetMaxFuel() * 0.1, 0.0, GetMaxFuel()));
422 return true;
423 case EActions.GENERIC_FUEL_DECREASE:
424 float value = GetMaxFuel() * 0.1;
425 if (value <= 0.0)
426 {
427 SetFuel(0.0);
428 return true;
429 }
430
431 SetFuel(GetFuel() - value);
432 return true;
433 }
434
435 return false;
436 }
DayZGame g_Game
Определения DayZGame.c:4074
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().