DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousCraft.c
Go to the documentation of this file.
2{
4 {
6 m_AdjustedTimeToComplete = 1000; //indication of arror if somting will be craft 1000 sec
7 if (!m_SpentUnits)
9 else
10 m_SpentUnits.param1 = 0;
11
13
14 PluginRecipesManager module_recipes_manager;
15 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
17 {
18 m_AdjustedTimeToComplete = module_recipes_manager.GetRecipeLengthInSecs(action_data_wc.m_RecipeID);
19 if (module_recipes_manager.GetIsInstaRecipe(action_data_wc.m_RecipeID) || module_recipes_manager.IsEnableDebugCrafting())
21 float specialty_weight = module_recipes_manager.GetRecipeSpecialty(action_data_wc.m_RecipeID);
22 m_AdjustedTimeToComplete = action_data.m_Player.GetSoftSkillsManager().AdjustCraftingTime(m_AdjustedTimeToComplete, specialty_weight);
23
24 //PrintString("ttc:" + m_AdjustedTimeToComplete.ToString());
25 }
26 }
27
29 {
30 if (!action_data.m_Player)
31 return UA_ERROR;
32
34 m_TimeElpased += action_data.m_Player.GetDeltaT();
35 else
36 {
37 if (m_SpentUnits)
38 {
41 }
43 return UA_FINISHED;
44 }
45 return UA_PROCESSING;
46 }
47
48 override float GetProgress()
49 {
51 {
52 //float progress = m_TimeElpased/m_AdjustedTimeToComplete;
54 }
55 return 1;
56 }
57};
PluginBase GetPlugin(typename plugin_type)
void SetACData(Param units)
Definition CABase.c:38
void OnCompletePogress(ActionData action_data)
override float GetProgress()
override void Setup(ActionData action_data)
override int Execute(ActionData action_data)
ref Param1< float > m_SpentUnits
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434