3 const float TIME_DAMAGE_THRESHOLD = 5.0;
5 protected float m_LocalTimeElpased;
6 protected float m_TimeElapsed;
7 protected float m_TimeElapsedRepeat;
8 protected float m_TimeElapsedDamage;
9 protected ref Param1<float> m_SpentUnits;
11 protected float m_TimeToCook;
12 protected float m_AdjustedTimeToCook;
13 protected Cooking m_CookingProcess;
15 protected float m_CookingUpdateTime;
16 protected float m_AdjustedCookingUpdateTime;
20 m_CookingUpdateTime = cooking_update_time;
25 m_TimeElapsedRepeat = 0;
26 m_TimeElapsedDamage = 0;
30 m_SpentUnits =
new Param1<float>(0);
34 m_SpentUnits.param1 = 0;
44 m_TimeElapsed = m_ItemToCook.GetFoodStage().GetCookingTime();
47 m_AdjustedCookingUpdateTime = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_CookingUpdateTime,
m_Action.GetSpecialtyWeight(),
true);
48 m_AdjustedTimeToCook = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_TimeToCook,
m_Action.GetSpecialtyWeight(),
true);
53 if ( !action_data.m_Player )
58 int cooking_state_update = 0;
59 float cooking_time = m_ItemToCook.GetFoodStage().GetCookingTime();
60 if (m_TimeToCook > cooking_time)
62 m_TimeElapsed += action_data.m_Player.GetDeltaT();
63 m_TimeElapsedRepeat += action_data.m_Player.GetDeltaT();
65 if (m_TimeElapsedRepeat >= m_AdjustedCookingUpdateTime)
67 cooking_state_update =
m_CookingProcess.CookOnStick(m_ItemToCook, m_CookingUpdateTime);
71 m_TimeElapsedDamage += m_TimeElapsedRepeat;
73 if (m_TimeElapsedDamage >= TIME_DAMAGE_THRESHOLD)
75 m_TimeElapsedDamage = 0;
76 action_data.m_MainItem.DecreaseHealth(
GameConstants.FIRE_ATTACHMENT_DAMAGE_PER_SECOND * TIME_DAMAGE_THRESHOLD,
false);
80 if (cooking_state_update == 1)
86 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(
m_Action.GetSpecialtyWeight());
90 if (m_ItemToCook.IsMeat() && m_ItemToCook.GetFoodStage().GetFoodStageType() ==
FoodStageType.BAKED)
92 GetGame().GetAnalyticsClient().OnActionCookedSteak();
97 m_TimeElapsedRepeat = 0;
106 m_SpentUnits.param1 = m_TimeElapsed;
107 SetACData(m_SpentUnits);
109 OnCompletePogress(action_data);
114 override float GetProgress()
116 if (m_AdjustedTimeToCook != 0)
118 return m_TimeElapsed/m_AdjustedTimeToCook;