Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
cacontinuouscraft.c
Go to the documentation of this file.
2{
3 override void Setup( ActionData action_data )
4 {
6 m_AdjustedTimeToComplete = 1000; //indication of arror if somting will be craft 1000 sec
7 if ( !m_SpentUnits )
8 {
9 m_SpentUnits = new Param1<float>(0);
10 }
11 else
12 {
13 m_SpentUnits.param1 = 0;
14 }
15
16 WorldCraftActionData action_data_wc = WorldCraftActionData.Cast(action_data);
17
18 PluginRecipesManager module_recipes_manager;
19 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
20 if( module_recipes_manager )
21 {
22 m_AdjustedTimeToComplete = module_recipes_manager.GetRecipeLengthInSecs( action_data_wc.m_RecipeID );
23 if( module_recipes_manager.GetIsInstaRecipe( action_data_wc.m_RecipeID) || module_recipes_manager.IsEnableDebugCrafting() )
24 {
26 }
27 float specialty_weight = module_recipes_manager.GetRecipeSpecialty( action_data_wc.m_RecipeID );
29
30 //PrintString("ttc:" + m_AdjustedTimeToComplete.ToString());
31 }
32 }
33
34 override int Execute( ActionData action_data )
35 {
36 if ( !action_data.m_Player )
37 {
38 return UA_ERROR;
39 }
40
42 {
43 m_TimeElpased += action_data.m_Player.GetDeltaT();
44 }
45 else
46 {
47 if ( m_SpentUnits )
48 {
51 }
53
54 OnCompletePogress(action_data);
55
56 WorldCraftActionData action_data_wc = WorldCraftActionData.Cast(action_data);
57 PluginRecipesManager module_recipes_manager;
58 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
59 if (module_recipes_manager)
60 {
61 if(module_recipes_manager.GetIsRepeatable(action_data_wc.m_RecipeID))
62 {
63 return UA_PROCESSING;
64 }
65 }
66 return UA_FINISHED;
67 }
68 return UA_PROCESSING;
69 }
70
71 override float GetProgress()
72 {
74 {
75 //float progress = m_TimeElpased/m_AdjustedTimeToComplete;
77 }
78 return 1;
79 }
80};
void SetACData(Param units)
Definition cabase.c:40
ref Param1< float > m_SpentUnits
Super root of all classes in Enforce script.
Definition enscript.c:11
class Test Setup
Stage definition used in conjunction with Step attribute.
const int UA_FINISHED
Definition constants.c:466
const int UA_ERROR
Definition constants.c:485
const int UA_PROCESSING
Definition constants.c:464
PluginBase GetPlugin(typename plugin_type)