DeAmouSE

Untitled

May 12th, 2021
438
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // By ЛОВЕЦ ДУШ aka Equadro!
  2.  
  3. class ActionBlowTempCB : ActionContinuousBaseCB
  4. {
  5.     override void CreateActionComponent()
  6.     {
  7.         m_ActionData.m_ActionComponent = new CAContinuousTime(2);
  8.     }
  9. }
  10.  
  11. class ActionBlowTemp: ActionContinuousBase
  12. {
  13.     void ActionBlowTemp()
  14.     {
  15.         m_CallbackClass = ActionBlowTempCB;
  16.         m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BLOWFIREPLACE;
  17.         m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_BLOWFIREPLACE;
  18.         m_FullBody = true;
  19.         m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  20.         m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
  21.     }
  22.    
  23.     override string GetText()
  24.     {
  25.         return "Остудить";
  26.     }
  27.    
  28.     override typename GetInputType()
  29.     {
  30.         return ContinuousInteractActionInput;
  31.     }
  32.    
  33.     override void CreateConditionComponents()  
  34.     {  
  35.         m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
  36.         //m_ConditionItem = new CCINonRuined;
  37.         m_ConditionItem = new CCINotPresent;
  38.     }
  39.    
  40.     override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  41.     {  
  42.         if (player.CheckMaskHeadGear())
  43.         {
  44.              return false;
  45.         }
  46.         Edible_Base food;
  47.         Bottle_Base bottle;
  48.         if(Class.CastTo(food, target.GetObject())
  49.         {
  50.             if(food.GetTemperature() > GameConstants.FOOD_TEMP_NORMAL)
  51.             return true;
  52.         }
  53.         else if(Class.CastTo(bottle, target.GetObject()))
  54.         {
  55.             if(bottle.GetTemperature() > GameConstants.FOOD_TEMP_NORMAL)
  56.                 return true;
  57.         }
  58.        
  59.         return false;
  60.     }
  61.    
  62.     override void OnFinishProgressServer( ActionData action_data  )
  63.     {
  64.         Edible_Base food_target;
  65.         Bottle_Base bottle_target;
  66.         if(Class.CastTo(food_target, action_data.m_Target.GetObject()))
  67.         {
  68.             int f_temp = food_target.GetTemperature();
  69.             food_target.SetTemperature(f_temp - GameConstants.FOOD_TEMP_BLOW);
  70.             food_target.SetSynchDirty();
  71.         }
  72.         else if(Class.CastTo(bottle_target, action_data.m_Target.GetObject()))
  73.         {
  74.             int b_temp = bottle_target.GetTemperature();
  75.             bottle_target.SetTemperature(b_temp - GameConstants.FOOD_TEMP_BLOW);
  76.             bottle_target.SetSynchDirty();
  77.         }
  78.     }
  79. }
RAW Paste Data