Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
plantbase.c File Reference

Go to the source code of this file.

Enumerations

enum  EPlantState {
  PAUSED = 0 , GROWING , MATURE , SPOILED ,
  DRY
}

Functions

void ~PlantBase ()
override bool CanPutInCargo (EntityAI parent)
override bool CanPutIntoHands (EntityAI parent)
override bool CanRemoveFromHands (EntityAI parent)
void ChangeInfestation (bool is_infested)
void CheckWater ()
static void DebugSetGlobalTimes (int maturity, int spoil, int spoilRemove, int dryDelete)
static void DebugSetTickSpeedMultiplier (float multiplier)
void DebugSetTimes (int maturity, int spoil, int spoilRemove, int dryDelete)
void DeleteDryPlantTick ()
void DestroyPlant ()
string GetCropsType ()
GardenBase GetGarden ()
EPlantState GetPlantState ()
int GetPlantStateIndex ()
Slot GetSlot ()
float GetSprayQuantity ()
float GetSprayUsage ()
float GetWater ()
float GetWaterMax ()
void GrowthTimerTick ()
void Harvest (PlayerBase player)
bool HasCrops ()
void InfestationTimerTick ()
void Init (GardenBase garden_base, float fertility, float harvesting_efficiency, float water)
bool IsDry ()
bool IsGrowing ()
bool IsHarvestable ()
bool IsMature ()
bool IsSpoiled ()
bool IsSprayable ()
bool NeedsSpraying ()
bool NeedsWater ()
override bool OnStoreLoad (ParamsReadContext ctx, int version)
bool OnStoreLoadCustom (ParamsReadContext ctx, int version)
override void OnStoreSave (ParamsWriteContext ctx)
void OnStoreSaveCustom (ParamsWriteContext ctx)
void PlantBase ()
void PrintValues ()
void RemovePlant ()
void RemovePlantEx (vector pos)
void RemoveSlot ()
override void SetActions ()
void SetDry ()
void SetGarden (GardenBase gardenBase)
void SetPlantState (int state)
void SetSlot (Slot slot)
void SetSpoiled ()
void SpoiledRemoveTimerTick ()
void SprayPlant (float consumed_quantity)
string StopInfestation (float consumed_quantity)
void Tick ()
void UpdatePlant ()

Variables

int m_CropsCount
string m_CropsType
float m_CurrentPlantMaterialQuantity
static int m_DebugDeleteDryTime
static int m_DebugFullMaturityTime
static int m_DebugSpoilRemoveTime
static int m_DebugSpoilTime
static float m_DebugTickSpeedMultiplier = 1
int m_DeleteDryPlantTime
ref Timer m_DeleteDryPlantTimer
int m_FullMaturityTime
GardenBase m_GardenBase = NULL
int m_GrowthStagesCount
ref Timer m_GrowthTimer
bool m_HasCrops
float m_InfestationChance
ref Timer m_InfestationTimer
bool m_IsInfested
bool m_MarkForDeletion = false
PluginHorticulture m_ModuleHorticulture
float m_PlantMaterialMultiplier
EPlantState m_PlantState
int m_PlantStateIndex
ref Slot m_Slot = NULL
int m_SpoilAfterFullMaturityTime
ref Timer m_SpoilAfterFullMaturityTimer
int m_SpoiledRemoveTime
ref Timer m_SpoiledRemoveTimer
float m_SprayQuantity
enum EPlantState m_SprayUsage
float m_StateChangeTime
ref Timer m_TimeTicker
float m_TimeTracker
const float SPOIL_AFTER_MATURITY_TIME = 14400.0
static const int STATE_DRY = 0
static const int STATE_GROWING = 1
static const int STATE_MATURE = 2
static const int STATE_SPOILED = 3
const int TICK_FREQUENCY = 1

Enumeration Type Documentation

◆ EPlantState

Enumerator
PAUSED 
GROWING 
MATURE 
SPOILED 
DRY 

Definition at line 1 of file plantbase.c.

Function Documentation

◆ ~PlantBase()

void ~PlantBase ( )
private

Definition at line 91 of file plantbase.c.

References DestroyPlant(), IsPendingDeletion(), m_MarkForDeletion, and m_TimeTicker.

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI parent)
private

Definition at line 402 of file plantbase.c.

◆ CanPutIntoHands()

override bool CanPutIntoHands ( EntityAI parent)
private

Definition at line 407 of file plantbase.c.

◆ CanRemoveFromHands()

override bool CanRemoveFromHands ( EntityAI parent)
private

Definition at line 412 of file plantbase.c.

◆ ChangeInfestation()

◆ CheckWater()

void CheckWater ( )
private

◆ DebugSetGlobalTimes()

void DebugSetGlobalTimes ( int maturity,
int spoil,
int spoilRemove,
int dryDelete )
staticprivate

◆ DebugSetTickSpeedMultiplier()

void DebugSetTickSpeedMultiplier ( float multiplier)
staticprivate

Definition at line 726 of file plantbase.c.

References m_DebugTickSpeedMultiplier.

◆ DebugSetTimes()

void DebugSetTimes ( int maturity,
int spoil,
int spoilRemove,
int dryDelete )
private

◆ DeleteDryPlantTick()

void DeleteDryPlantTick ( )
private

◆ DestroyPlant()

void DestroyPlant ( )
private

Definition at line 557 of file plantbase.c.

References g_Game, RemoveSlot(), and UnlockFromParent().

Referenced by ~PlantBase().

◆ GetCropsType()

string GetCropsType ( )
private

Definition at line 220 of file plantbase.c.

References m_CropsType.

◆ GetGarden()

GardenBase GetGarden ( )
private

Definition at line 666 of file plantbase.c.

References m_GardenBase.

◆ GetPlantState()

EPlantState GetPlantState ( )
private

Definition at line 594 of file plantbase.c.

References m_PlantState.

◆ GetPlantStateIndex()

int GetPlantStateIndex ( )
private

Definition at line 599 of file plantbase.c.

References m_PlantStateIndex.

◆ GetSlot()

Slot GetSlot ( )
private

Definition at line 656 of file plantbase.c.

References m_Slot.

Referenced by GetWater(), GetWaterMax(), and OnStoreSave().

◆ GetSprayQuantity()

float GetSprayQuantity ( )
private

Definition at line 630 of file plantbase.c.

References m_SprayQuantity.

◆ GetSprayUsage()

float GetSprayUsage ( )
private

Definition at line 635 of file plantbase.c.

References m_SprayUsage.

◆ GetWater()

float GetWater ( )
private

Definition at line 604 of file plantbase.c.

References GetSlot().

◆ GetWaterMax()

float GetWaterMax ( )
private

Definition at line 612 of file plantbase.c.

References GetSlot().

◆ GrowthTimerTick()

◆ Harvest()

◆ HasCrops()

bool HasCrops ( )
private

Definition at line 687 of file plantbase.c.

References m_HasCrops.

Referenced by UpdatePlant().

◆ InfestationTimerTick()

void InfestationTimerTick ( )
private

◆ Init()

◆ IsDry()

bool IsDry ( )
private

◆ IsGrowing()

bool IsGrowing ( )
private

◆ IsHarvestable()

bool IsHarvestable ( )
private

Definition at line 679 of file plantbase.c.

References m_HasCrops, and m_PlantState.

Referenced by Harvest().

◆ IsMature()

bool IsMature ( )
private

◆ IsSpoiled()

bool IsSpoiled ( )
private

◆ IsSprayable()

bool IsSprayable ( )
private

Definition at line 671 of file plantbase.c.

References m_PlantState, m_SprayQuantity, and m_SprayUsage.

◆ NeedsSpraying()

bool NeedsSpraying ( )
private

◆ NeedsWater()

bool NeedsWater ( )
private

Definition at line 620 of file plantbase.c.

References m_PlantState, and m_Slot.

Referenced by Init().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
private

Definition at line 177 of file plantbase.c.

References OnStoreLoadCustom(), Serializer::Read(), and SetSlot().

◆ OnStoreLoadCustom()

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
private

Definition at line 198 of file plantbase.c.

References ErrorEx, g_Game, GetPosition(), GetSlot(), OnStoreSaveCustom(), and Serializer::Write().

◆ OnStoreSaveCustom()

◆ PlantBase()

◆ PrintValues()

◆ RemovePlant()

void RemovePlant ( )
private

◆ RemovePlantEx()

void RemovePlantEx ( vector pos)
private

◆ RemoveSlot()

void RemoveSlot ( )
private

Definition at line 640 of file plantbase.c.

Referenced by DestroyPlant(), RemovePlantEx(), ItemBase::RemoveSlotPlant(), and Tick().

◆ SetActions()

override void SetActions ( )
private

Definition at line 692 of file plantbase.c.

References AddAction().

◆ SetDry()

void SetDry ( )
private

Definition at line 515 of file plantbase.c.

References m_PlantState, m_PlantStateIndex, SetPlantState(), and UpdatePlant().

Referenced by GrowthTimerTick().

◆ SetGarden()

void SetGarden ( GardenBase gardenBase)
private

Definition at line 661 of file plantbase.c.

References m_GardenBase.

◆ SetPlantState()

void SetPlantState ( int state)
private

Definition at line 587 of file plantbase.c.

References m_PlantState, and m_TimeTracker.

Referenced by GrowthTimerTick(), Init(), SetDry(), and SetSpoiled().

◆ SetSlot()

void SetSlot ( Slot slot)
private

Definition at line 648 of file plantbase.c.

References m_Slot.

Referenced by OnStoreLoad().

◆ SetSpoiled()

void SetSpoiled ( )
private

Definition at line 505 of file plantbase.c.

References m_PlantState, m_PlantStateIndex, SetPlantState(), and UpdatePlant().

Referenced by Tick().

◆ SpoiledRemoveTimerTick()

void SpoiledRemoveTimerTick ( )
private

◆ SprayPlant()

void SprayPlant ( float consumed_quantity)
private

◆ StopInfestation()

string StopInfestation ( float consumed_quantity)
private

Definition at line 753 of file plantbase.c.

◆ Tick()

◆ UpdatePlant()

Variable Documentation

◆ m_CropsCount

int m_CropsCount
private

Definition at line 17 of file plantbase.c.

Referenced by Harvest(), Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), and PlantBase().

◆ m_CropsType

string m_CropsType
private

Definition at line 19 of file plantbase.c.

Referenced by GetCropsType(), Harvest(), OnStoreLoadCustom(), OnStoreSaveCustom(), and PlantBase().

◆ m_CurrentPlantMaterialQuantity

float m_CurrentPlantMaterialQuantity
private

◆ m_DebugDeleteDryTime

int m_DebugDeleteDryTime
staticprivate

Definition at line 51 of file plantbase.c.

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugFullMaturityTime

int m_DebugFullMaturityTime
staticprivate

Definition at line 48 of file plantbase.c.

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugSpoilRemoveTime

int m_DebugSpoilRemoveTime
staticprivate

Definition at line 50 of file plantbase.c.

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugSpoilTime

int m_DebugSpoilTime
staticprivate

Definition at line 49 of file plantbase.c.

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugTickSpeedMultiplier

float m_DebugTickSpeedMultiplier = 1
staticprivate

Definition at line 52 of file plantbase.c.

Referenced by DebugSetTickSpeedMultiplier(), and Tick().

◆ m_DeleteDryPlantTime

int m_DeleteDryPlantTime
private

Definition at line 30 of file plantbase.c.

Referenced by DebugSetTimes(), Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), PlantBase(), and Tick().

◆ m_DeleteDryPlantTimer

ref Timer m_DeleteDryPlantTimer
private

Definition at line 738 of file plantbase.c.

◆ m_FullMaturityTime

◆ m_GardenBase

GardenBase m_GardenBase = NULL
private

Definition at line 39 of file plantbase.c.

Referenced by GetGarden(), Harvest(), Init(), PrintValues(), and SetGarden().

◆ m_GrowthStagesCount

int m_GrowthStagesCount
private

◆ m_GrowthTimer

ref Timer m_GrowthTimer
private

Definition at line 740 of file plantbase.c.

◆ m_HasCrops

bool m_HasCrops
private

◆ m_InfestationChance

float m_InfestationChance
private

◆ m_InfestationTimer

ref Timer m_InfestationTimer
private

Definition at line 741 of file plantbase.c.

◆ m_IsInfested

bool m_IsInfested
private

◆ m_MarkForDeletion

bool m_MarkForDeletion = false
private

Definition at line 28 of file plantbase.c.

Referenced by ~PlantBase().

◆ m_ModuleHorticulture

PluginHorticulture m_ModuleHorticulture
private

Definition at line 42 of file plantbase.c.

Referenced by ChangeInfestation(), and PlantBase().

◆ m_PlantMaterialMultiplier

float m_PlantMaterialMultiplier
private

Definition at line 20 of file plantbase.c.

Referenced by Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), and UpdatePlant().

◆ m_PlantState

◆ m_PlantStateIndex

◆ m_Slot

ref Slot m_Slot = NULL
private

Definition at line 40 of file plantbase.c.

Referenced by GetSlot(), NeedsWater(), PrintValues(), and SetSlot().

◆ m_SpoilAfterFullMaturityTime

int m_SpoilAfterFullMaturityTime
private

Definition at line 33 of file plantbase.c.

Referenced by DebugSetTimes(), Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), PrintValues(), and Tick().

◆ m_SpoilAfterFullMaturityTimer

ref Timer m_SpoilAfterFullMaturityTimer
private

Definition at line 739 of file plantbase.c.

◆ m_SpoiledRemoveTime

int m_SpoiledRemoveTime
private

Definition at line 31 of file plantbase.c.

Referenced by DebugSetTimes(), Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), PlantBase(), and Tick().

◆ m_SpoiledRemoveTimer

ref Timer m_SpoiledRemoveTimer
private

Definition at line 737 of file plantbase.c.

◆ m_SprayQuantity

float m_SprayQuantity
private

◆ m_SprayUsage

◆ m_StateChangeTime

float m_StateChangeTime
private

Definition at line 34 of file plantbase.c.

Referenced by DebugSetTimes(), Init(), OnStoreLoadCustom(), OnStoreSaveCustom(), PrintValues(), and Tick().

◆ m_TimeTicker

ref Timer m_TimeTicker
protected

Definition at line 36 of file plantbase.c.

Referenced by ~PlantBase(), PlantBase(), and Tick().

◆ m_TimeTracker

float m_TimeTracker
protected

◆ SPOIL_AFTER_MATURITY_TIME

const float SPOIL_AFTER_MATURITY_TIME = 14400.0
private

Definition at line 44 of file plantbase.c.

Referenced by Init().

◆ STATE_DRY

const int STATE_DRY = 0
staticprivate

Definition at line 732 of file plantbase.c.

◆ STATE_GROWING

const int STATE_GROWING = 1
staticprivate

Definition at line 733 of file plantbase.c.

◆ STATE_MATURE

const int STATE_MATURE = 2
staticprivate

Definition at line 734 of file plantbase.c.

◆ STATE_SPOILED

const int STATE_SPOILED = 3
staticprivate

Definition at line 735 of file plantbase.c.

◆ TICK_FREQUENCY

const int TICK_FREQUENCY = 1
private

Definition at line 45 of file plantbase.c.

Referenced by PlantBase().