DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousTimeCooking Class Reference
Inheritance diagram for CAContinuousTimeCooking:
[legend]
Collaboration diagram for CAContinuousTimeCooking:
[legend]

Protected Member Functions

void CAContinuousTimeCooking (float cooking_update_time)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override float GetProgress ()
 

Protected Attributes

float m_LocalTimeElpased
 
float m_TimeElapsed
 
float m_TimeElapsedRepeat
 
float m_TimeElapsedDamage
 
ref Param1< floatm_SpentUnits
 
float m_TimeToCook
 
float m_AdjustedTimeToCook
 
Cooking m_CookingProcess
 
Edible_Base m_ItemToCook
 
float m_CookingUpdateTime
 
float m_AdjustedCookingUpdateTime
 

Private Attributes

const float TIME_DAMAGE_THRESHOLD = 5.0
 

Detailed Description

Definition at line 1 of file CAContinuousTimeCooking.c.

Constructor & Destructor Documentation

◆ CAContinuousTimeCooking()

void CAContinuousTimeCooking::CAContinuousTimeCooking ( float cooking_update_time)
inlineprotected

Member Function Documentation

◆ Execute()

override int CAContinuousTimeCooking::Execute ( ActionData action_data)
inlineprotected

Definition at line 47 of file CAContinuousTimeCooking.c.

48 {
49 if (!action_data.m_Player)
50 return UA_ERROR;
51
53 float cooking_time = m_ItemToCook.GetFoodStage().GetCookingTime();
55 {
56 m_TimeElapsed += action_data.m_Player.GetDeltaT();
57 m_TimeElapsedRepeat += action_data.m_Player.GetDeltaT();
58
60 {
62
63 if (GetGame().IsServer())
64 {
66
68 {
71 }
72 }
73
74 if (cooking_state_update == 1)
75 {
77
78 if (GetGame().IsServer())
79 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_Action.GetSpecialtyWeight());
80 else
81 {
82 if (m_ItemToCook.IsMeat() && m_ItemToCook.GetFoodStage().GetFoodStageType() == FoodStageType.BAKED)
83 GetGame().GetAnalyticsClient().OnActionCookedSteak();
84 }
85 }
86
88 }
89
90 return UA_PROCESSING;
91 }
92 else
93 {
94 if (m_SpentUnits)
95 {
98 }
100 return UA_FINISHED;
101 }
102 }
FoodStageType
Definition FoodStage.c:2
void SetACData(Param units)
Definition CABase.c:38
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
override void Setup(ActionData action_data)
ref Param1< float > m_SpentUnits
override bool IsMeat()
FoodStage GetFoodStage()
proto native CGame GetGame()
const float FIRE_ATTACHMENT_DAMAGE_PER_SECOND
various damage per second constants
Definition constants.c:727
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434

References GameConstants::FIRE_ATTACHMENT_DAMAGE_PER_SECOND, Edible_Base::GetFoodStage(), GetGame(), Edible_Base::IsMeat(), CABase::m_Action, m_AdjustedCookingUpdateTime, m_CookingProcess, m_CookingUpdateTime, m_ItemToCook, m_SpentUnits, m_TimeElapsed, m_TimeElapsedDamage, m_TimeElapsedRepeat, m_TimeToCook, CAContinuousBase::OnCompletePogress(), CABase::SetACData(), Setup(), TIME_DAMAGE_THRESHOLD, UA_ERROR, UA_FINISHED, and UA_PROCESSING.

◆ GetProgress()

override float CAContinuousTimeCooking::GetProgress ( )
inlineprotected

Definition at line 104 of file CAContinuousTimeCooking.c.

105 {
106 if (m_AdjustedTimeToCook != 0)
108
109 return 1;
110 }

References m_AdjustedTimeToCook, and m_TimeElapsed.

◆ Setup()

override void CAContinuousTimeCooking::Setup ( ActionData action_data)
inlineprotected

Definition at line 23 of file CAContinuousTimeCooking.c.

24 {
27
28 if (!m_SpentUnits)
30 else
31 m_SpentUnits.param1 = 0;
32
33 //fireplace & cooking process
34 FireplaceBase fireplace = FireplaceBase.Cast(action_data.m_Target.GetObject());
35 m_CookingProcess = fireplace.GetCookingProcess();
36 m_ItemToCook = m_CookingProcess.GetFoodOnStick(action_data.m_MainItem);
38
39 //update elapsed time
40 m_TimeElapsed = m_ItemToCook.GetFoodStage().GetCookingTime();
41
42 //SoftSkill implementation to hasten Cooking
43 m_AdjustedCookingUpdateTime = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_CookingUpdateTime, m_Action.GetSpecialtyWeight(), true);
44 m_AdjustedTimeToCook = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_TimeToCook, m_Action.GetSpecialtyWeight(), true);
45 }
CookingMethodType
Definition Cooking.c:2

References Edible_Base::GetFoodStage(), CABase::m_Action, m_AdjustedCookingUpdateTime, m_AdjustedTimeToCook, m_CookingProcess, m_CookingUpdateTime, m_ItemToCook, m_SpentUnits, m_TimeElapsed, m_TimeElapsedDamage, m_TimeElapsedRepeat, and m_TimeToCook.

Referenced by Execute().

Member Data Documentation

◆ m_AdjustedCookingUpdateTime

float CAContinuousTimeCooking::m_AdjustedCookingUpdateTime
protected

Definition at line 16 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_AdjustedTimeToCook

float CAContinuousTimeCooking::m_AdjustedTimeToCook
protected

Definition at line 12 of file CAContinuousTimeCooking.c.

Referenced by GetProgress(), and Setup().

◆ m_CookingProcess

Cooking CAContinuousTimeCooking::m_CookingProcess
protected

Definition at line 13 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_CookingUpdateTime

float CAContinuousTimeCooking::m_CookingUpdateTime
protected

Definition at line 15 of file CAContinuousTimeCooking.c.

Referenced by CAContinuousTimeCooking(), Execute(), and Setup().

◆ m_ItemToCook

Edible_Base CAContinuousTimeCooking::m_ItemToCook
protected

Definition at line 14 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_LocalTimeElpased

float CAContinuousTimeCooking::m_LocalTimeElpased
protected

Definition at line 5 of file CAContinuousTimeCooking.c.

◆ m_SpentUnits

ref Param1<float> CAContinuousTimeCooking::m_SpentUnits
protected

Definition at line 9 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_TimeElapsed

float CAContinuousTimeCooking::m_TimeElapsed
protected

Definition at line 6 of file CAContinuousTimeCooking.c.

Referenced by Execute(), GetProgress(), and Setup().

◆ m_TimeElapsedDamage

float CAContinuousTimeCooking::m_TimeElapsedDamage
protected

Definition at line 8 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_TimeElapsedRepeat

float CAContinuousTimeCooking::m_TimeElapsedRepeat
protected

Definition at line 7 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ m_TimeToCook

float CAContinuousTimeCooking::m_TimeToCook
protected

Definition at line 11 of file CAContinuousTimeCooking.c.

Referenced by Execute(), and Setup().

◆ TIME_DAMAGE_THRESHOLD

const float CAContinuousTimeCooking::TIME_DAMAGE_THRESHOLD = 5.0
private

Definition at line 3 of file CAContinuousTimeCooking.c.

Referenced by Execute().


The documentation for this class was generated from the following file: