62 string plant_type = this.
GetType();
63 m_GrowthStagesCount =
GetGame().
ConfigGetInt(
"cfgVehicles " + plant_type +
" Horticulture GrowthStagesCount" );
80 RegisterNetSyncVariableBool(
"m_HasCrops");
81 RegisterNetSyncVariableInt(
"m_PlantState");
82 RegisterNetSyncVariableInt(
"m_PlantStateIndex");
102 void Init(
GardenBase garden_base,
float fertility,
float harvesting_efficiency,
float water )
124 float count =
m_CropsCount * fertility * harvesting_efficiency;
137 if (rain_intensity <= 0.0)
179 if ( !super.OnStoreLoad( ctx, version ) )
185 if (!ctx.
Read(slot_index))
188 Slot slot = garden.GetSlotByIndex(slot_index);
200 super.OnStoreSave( ctx );
206 int slot_index = slot.GetSlotIndex();
209 ctx.
Write( slot_index );
215 ErrorEx(
"[Warning] A plant existed without a garden. Therefore it was deleted from the world to prevent issues! Position: " +
GetPosition(),
ErrorExSeverity.INFO);
276 if (!ctx.
Read(loadBool))
279 float loadFloat = 0.0;
280 if (!ctx.
Read(loadFloat))
284 if (ctx.
Read(loadFloat))
295 if (ctx.
Read(loadFloat))
306 if (ctx.
Read(loadFloat))
308 if ( loadFloat > 0.0 )
351 bool saveBool =
false;
352 ctx.
Write( saveBool );
354 float saveFloat = 0.0;
355 ctx.
Write( saveFloat );
362 ctx.
Write( saveFloat );
369 ctx.
Write( saveFloat );
376 ctx.
Write( saveFloat );
383 Print(
"PRINT ALL VALUES OF PLANT...");
399 Print(
"----------------------------------------------------------");
404 return super.CanPutInCargo(parent);
409 return super.CanPutIntoHands(parent);
456 ShowSelection(
"plantStage_" + plant_state_index );
457 HideSelection(
"plantStage_" + prev_plant_state_index );
463 ShowSelection(
"plantStage_" + plant_state_index +
"_crops" );
464 HideSelection(
"plantStage_" + prev_plant_state_index +
"_crops" );
468 HideSelection(
"plantStage_" + plant_state_index +
"_crops" );
469 HideSelection(
"plantStage_" + prev_plant_state_index +
"_crops" );
473 ShowSelection(
"plantStage_" + plant_state_index +
"_shadow" );
474 HideSelection(
"plantStage_" + prev_plant_state_index +
"_shadow" );
573 vector pos = player.GetPosition();
615 return GetSlot().GetWaterUsage();
645 garden.RemoveSlotPlant(
this );
711 if (spoilRemove != 0)
eBleedingSourceType GetType()
void AddAction(typename actionName)
const int ECE_PLACE_ON_SURFACE
string ToStringLen(int len)
Integer to string with fixed length, padded with zeroes.
override bool CanPutInCargo(EntityAI parent)
override bool CanPutIntoHands(EntityAI parent)
override bool CanRemoveFromHands(EntityAI parent)
override void SetTakeable(bool pState)
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
static const int STATE_GROWING
void SetGarden(GardenBase gardenBase)
void OnStoreSaveCustom(ParamsWriteContext ctx)
PluginHorticulture m_ModuleHorticulture
void InfestationTimerTick()
ref Timer m_InfestationTimer
float m_InfestationChance
enum EPlantState m_SprayUsage
void SprayPlant(float consumed_quantity)
void ChangeInfestation(bool is_infested)
float m_PlantMaterialMultiplier
static int m_DebugFullMaturityTime
void DebugSetTimes(int maturity, int spoil, int spoilRemove, int dryDelete)
const float SPOIL_AFTER_MATURITY_TIME
ref Timer m_SpoiledRemoveTimer
static int m_DebugDeleteDryTime
ref Timer m_DeleteDryPlantTimer
void SpoiledRemoveTimerTick()
void RemovePlantEx(vector pos)
static int m_DebugSpoilTime
static void DebugSetTickSpeedMultiplier(float multiplier)
static const int STATE_SPOILED
static void DebugSetGlobalTimes(int maturity, int spoil, int spoilRemove, int dryDelete)
EPlantState GetPlantState()
static float m_DebugTickSpeedMultiplier
static int m_DebugSpoilRemoveTime
float m_CurrentPlantMaterialQuantity
static const int STATE_DRY
ref Timer m_SpoilAfterFullMaturityTimer
static const int STATE_MATURE
void DeleteDryPlantTick()
bool OnStoreLoadCustom(ParamsReadContext ctx, int version)
int m_SpoilAfterFullMaturityTime
void SetPlantState(int state)
void Harvest(PlayerBase player)
string StopInfestation(float consumed_quantity)
PluginBase GetPlugin(typename plugin_type)
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.
proto native Weather GetWeather()
Returns weather controller object.
proto native void ObjectDelete(Object obj)
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native float GetActual()
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
proto void Print(void var)
Prints content of variable to console/log.
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float Ceil(float f)
Returns ceil of value.
class JsonUndergroundAreaTriggerData GetPosition