actionupgradetorchfromgaspump.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. class ActionUpgradeTorchFromGasPumpCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.ADD_FUEL_TO_TORCH);
  6. }
  7. };
  8. class ActionUpgradeTorchFromGasPump: ActionContinuousBase
  9. {
  10. void ActionUpgradeTorchFromGasPump()
  11. {
  12. m_CallbackClass = ActionUpgradeTorchFromGasPumpCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
  14. m_FullBody = true;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
  17. m_Text = "#str_upgrade_torch_fuel";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionTarget = new CCTDummy;
  22. m_ConditionItem = new CCINonRuined;
  23. }
  24. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  25. {
  26. Land_FuelStation_Feed fuelstation = Land_FuelStation_Feed.Cast(target.GetObject());
  27. FlammableBase flammable = FlammableBase.Cast(item);
  28. if ( flammable && fuelstation && fuelstation.HasFuelToGive() )
  29. {
  30. return flammable.CanReceiveUpgrade();
  31. }
  32. return false;
  33. }
  34. override void OnFinishProgressServer( ActionData action_data )
  35. {
  36. Torch torch = Torch.Cast(action_data.m_MainItem);
  37. if (torch)
  38. {
  39. //torch.ConsumeRag();
  40. torch.Upgrade(null);
  41. }
  42. }
  43. override bool IsLockTargetOnUse()
  44. {
  45. return false;
  46. }
  47. };