Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By ЛОВЕЦ ДУШ aka Equadro!
- class ActionBlowTempCB : ActionContinuousBaseCB
- {
- override void CreateActionComponent()
- {
- m_ActionData.m_ActionComponent = new CAContinuousTime(2);
- }
- }
- class ActionBlowTemp: ActionContinuousBase
- {
- void ActionBlowTemp()
- {
- m_CallbackClass = ActionBlowTempCB;
- m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BLOWFIREPLACE;
- m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_BLOWFIREPLACE;
- m_FullBody = true;
- m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
- m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
- }
- override string GetText()
- {
- return "Остудить";
- }
- override typename GetInputType()
- {
- return ContinuousInteractActionInput;
- }
- override void CreateConditionComponents()
- {
- m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
- //m_ConditionItem = new CCINonRuined;
- m_ConditionItem = new CCINotPresent;
- }
- override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
- {
- if (player.CheckMaskHeadGear())
- {
- return false;
- }
- Edible_Base food;
- Bottle_Base bottle;
- if(Class.CastTo(food, target.GetObject())
- {
- if(food.GetTemperature() > GameConstants.FOOD_TEMP_NORMAL)
- return true;
- }
- else if(Class.CastTo(bottle, target.GetObject()))
- {
- if(bottle.GetTemperature() > GameConstants.FOOD_TEMP_NORMAL)
- return true;
- }
- return false;
- }
- override void OnFinishProgressServer( ActionData action_data )
- {
- Edible_Base food_target;
- Bottle_Base bottle_target;
- if(Class.CastTo(food_target, action_data.m_Target.GetObject()))
- {
- int f_temp = food_target.GetTemperature();
- food_target.SetTemperature(f_temp - GameConstants.FOOD_TEMP_BLOW);
- food_target.SetSynchDirty();
- }
- else if(Class.CastTo(bottle_target, action_data.m_Target.GetObject()))
- {
- int b_temp = bottle_target.GetTemperature();
- bottle_target.SetTemperature(b_temp - GameConstants.FOOD_TEMP_BLOW);
- bottle_target.SetSynchDirty();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment