DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CAContinuousCraft.c
См. документацию.
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};
ActionBase ActionData
Определения ActionBase.c:30
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
void SetACData(Param units)
Определения CABase.c:40
void OnCompletePogress(ActionData action_data)
Определения CAContinuousBase.c:8
override float GetProgress()
Определения CAContinuousCraft.c:71
override void Setup(ActionData action_data)
Определения CAContinuousCraft.c:3
override int Execute(ActionData action_data)
Определения CAContinuousCraft.c:34
ref Param1< float > m_SpentUnits
Определения CAContinuousTime.c:7
void CAContinuousTime(float time_to_complete_action)
Определения CAContinuousTime.c:9
float m_TimeElpased
Определения CAContinuousTime.c:4
float m_AdjustedTimeToComplete
Определения CAContinuousTime.c:5
Super root of all classes in Enforce script.
Определения 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
Определения constants.c:464
const int UA_ERROR
Определения constants.c:483
const int UA_PROCESSING
Определения constants.c:462