actionfillgeneratortank.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class ActionFillGeneratorTankCB : ActionContinuousBaseCB
  2. {
  3. private const float QUANTITY_FILLED_PER_SEC = 400;
  4. override void CreateActionComponent()
  5. {
  6. m_ActionData.m_ActionComponent = new CAContinuousFillPowerGenerator(QUANTITY_FILLED_PER_SEC, LIQUID_GASOLINE);
  7. }
  8. };
  9. class ActionFillGeneratorTank: ActionContinuousBase
  10. {
  11. void ActionFillGeneratorTank()
  12. {
  13. m_CallbackClass = ActionFillGeneratorTankCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_FullBody = true;
  17. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
  18. m_Text = "#refuel";
  19. }
  20. override void CreateConditionComponents()
  21. {
  22. m_ConditionItem = new CCINonRuined;
  23. m_ConditionTarget = new CCTNonRuined(UAMaxDistances.DEFAULT);
  24. }
  25. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  26. {
  27. PowerGeneratorBase pg;
  28. if ( Class.CastTo(pg,target.GetObject()) )
  29. {
  30. if ( pg.CanAddFuel( item ) )
  31. {
  32. return true;
  33. }
  34. }
  35. return false;
  36. }
  37. };