DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ PlantBase()

void PlantBase ( )
private

См. определение в файле PlantBase.c строка 54

55 {
56 m_ModuleHorticulture = PluginHorticulture.Cast( GetPlugin( PluginHorticulture ) );
57
58 m_SprayUsage = 5;
59 m_DeleteDryPlantTime = (60 * 10) + Math.RandomInt(0, 60 * 2);
60 m_SpoiledRemoveTime = (60 * 20) + Math.RandomInt(0, 60 * 5);
61
62 string plant_type = this.GetType();
63 m_GrowthStagesCount = GetGame().ConfigGetInt( "cfgVehicles " + plant_type + " Horticulture GrowthStagesCount" );
64 m_CropsCount = GetGame().ConfigGetInt( "cfgVehicles " + plant_type + " Horticulture CropsCount" );
65 GetGame().ConfigGetText( "cfgVehicles " + plant_type + " Horticulture CropsType", m_CropsType );
66
67 if (m_GrowthStagesCount == 0)
69
70 m_InfestationChance = 0.2 / m_GrowthStagesCount; //Must be between 0 and 1
71
74 m_IsInfested = false;
75 m_SprayQuantity = 0.0;
76 m_HasCrops = true;
77
78 SetTakeable( false );
79
80 RegisterNetSyncVariableBool("m_HasCrops");
81 RegisterNetSyncVariableInt("m_PlantState");
82 RegisterNetSyncVariableInt("m_PlantStateIndex");
83
84 if (GetGame().IsServer())
85 {
87 m_TimeTicker.Run(TICK_FREQUENCY, this, "Tick", NULL, true);
88 }
89 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
override void SetTakeable(bool pState)
Определения ItemBase.c:9042
PluginHorticulture m_ModuleHorticulture
Определения PlantBase.c:42
float m_InfestationChance
Определения PlantBase.c:14
ref Timer m_TimeTicker
Определения PlantBase.c:36
int m_PlantStateIndex
Определения PlantBase.c:22
enum EPlantState m_SprayUsage
bool m_HasCrops
Определения PlantBase.c:18
int m_CropsCount
Определения PlantBase.c:17
int m_SpoiledRemoveTime
Определения PlantBase.c:31
float m_SprayQuantity
Определения PlantBase.c:27
int m_GrowthStagesCount
Определения PlantBase.c:16
float m_CurrentPlantMaterialQuantity
Определения PlantBase.c:23
string m_CropsType
Определения PlantBase.c:19
bool m_IsInfested
Определения PlantBase.c:26
int m_DeleteDryPlantTime
Определения PlantBase.c:30
const int TICK_FREQUENCY
Определения PlantBase.c:45
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
Определения EnMath.c:7
Определения DayZPlayerImplement.c:63
proto native CGame GetGame()
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8

Перекрестные ссылки CALL_CATEGORY_SYSTEM, CGame::ConfigGetInt(), CGame::ConfigGetText(), GetGame(), GetPlugin(), GetType(), m_CropsCount, m_CropsType, m_CurrentPlantMaterialQuantity, m_DeleteDryPlantTime, m_GrowthStagesCount, m_HasCrops, m_InfestationChance, m_IsInfested, m_ModuleHorticulture, m_PlantStateIndex, m_SpoiledRemoveTime, m_SprayQuantity, m_SprayUsage, m_TimeTicker, Math::RandomInt(), SetTakeable() и TICK_FREQUENCY.

Используется в ActionDisinfectPlant::ActionCondition(), ActionDisinfectPlantBit::ActionCondition(), ActionHarvestCrops::ActionCondition(), ActionRemovePlant::ActionCondition(), ActionWaterPlant::ActionCondition(), ItemBase::CreatePlant(), ItemBase::EEItemAttached(), CAContinuousWaterPlant::Execute(), ItemBase::GetSlotIndexByPlant(), ActionHarvestCrops::OnActionInfoUpdate(), ActionDisinfectPlantBit::OnExecuteServer(), ActionWaterPlant::OnFinishProgressClient(), ActionWaterPlant::OnFinishProgressServer(), PluginBase::OnRPCHorticultUpdate(), PluginBase::OnRPCHorticultureSpeed(), ItemBase::RemoveSlot(), HudDebugWinHorticulture::SendRPCSpeed(), HudDebugWinHorticulture::SendRPCUpdate(), CAContinuousDisinfectPlant::Setup() и CAContinuousWaterPlant::Setup().