14 string cfg_access =
"CfgHorticulture";
17 for (
int i = 0; i < cfg_horticulture_count; i++ )
19 string cfg_class_name =
"";
21 string cfg_class_access = cfg_access +
" " + cfg_class_name;
25 for (
int j = 0; j < cfg_class_count; j++ )
27 string cfg_subclass_name =
"";
29 string cfg_subclass_access = cfg_class_access +
" " + cfg_subclass_name;
35 if ( cfg_class_name ==
"Plants" )
41 for (
int k = 0; k < cfg_subclass_count; k++ )
43 string cfg_variable_name =
"";
45 string cfg_variable_access = cfg_subclass_access +
" " + cfg_variable_name;
47 if ( cfg_class_name ==
"Plants" )
49 string string_param =
"";
52 if ( cfg_variable_name ==
"infestedTex" )
56 else if ( cfg_variable_name ==
"infestedMat" )
60 else if ( cfg_variable_name ==
"healthyTex" )
64 else if ( cfg_variable_name ==
"healthyMat" )
76 string seed_type = obj.GetType();
78 string plant_type =
"";
86 float fertility = 0.8;
87 if ( surface_type ==
"hlina" || surface_type ==
"CRGrass1" || surface_type ==
"CRGrass2" || surface_type ==
"CRForest1" || surface_type ==
"CRForest2" || surface_type ==
"CRGrit1" )
99 ItemBase item =
ItemBase.Cast( player.GetHumanInventory().CreateInInventory(
"Food_Worm") );
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
bool GiveWormsToPlayer(PlayerBase player, float chance)
string GetPlantType(Object obj)
ref map< string, ref PlantMaterialHealth > m_PlantMaterials
PlantMaterialHealth GetPlantMaterial(string plant_type)
float GetSurfaceFertility(string surface_type)
void PluginHorticulture()
proto native CGame GetGame()
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].