PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
PlantBase.c File Reference

Enumerations

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

Functions

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

Variables

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

Enumeration Type Documentation

◆ EPlantState

Enumerator
PAUSED 
GROWING 
MATURE 
SPOILED 
DRY 

Function Documentation

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI  parent)

◆ CanPutIntoHands()

override bool CanPutIntoHands ( EntityAI  parent)

◆ CanRemoveFromHands()

override bool CanRemoveFromHands ( EntityAI  parent)

◆ ChangeInfestation()

◆ CheckWater()

void CheckWater ( )

◆ DebugSetGlobalTimes()

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

◆ DebugSetTickSpeedMultiplier()

static void DebugSetTickSpeedMultiplier ( float  multiplier)
static

◆ DebugSetTimes()

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

◆ DeleteDryPlantTick()

void DeleteDryPlantTick ( )

◆ DestroyPlant()

void DestroyPlant ( )

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

Referenced by ~PlantBase().

◆ GetCropsType()

string GetCropsType ( )

References m_CropsType.

◆ GetGarden()

GardenBase GetGarden ( )

References m_GardenBase.

◆ GetPlantState()

EPlantState GetPlantState ( )

References m_PlantState.

◆ GetPlantStateIndex()

int GetPlantStateIndex ( )

References m_PlantStateIndex.

◆ GetSlot()

Slot GetSlot ( )

References m_Slot.

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

◆ GetSprayQuantity()

float GetSprayQuantity ( )

References m_SprayQuantity.

◆ GetSprayUsage()

float GetSprayUsage ( )

References m_SprayUsage.

◆ GetWater()

float GetWater ( )

References GetSlot().

◆ GetWaterMax()

float GetWaterMax ( )

References GetSlot().

◆ GrowthTimerTick()

◆ Harvest()

◆ HasCrops()

bool HasCrops ( )

References m_HasCrops.

Referenced by UpdatePlant().

◆ InfestationTimerTick()

void InfestationTimerTick ( )

◆ Init()

◆ IsDry()

bool IsDry ( )

◆ IsGrowing()

bool IsGrowing ( )

◆ IsHarvestable()

bool IsHarvestable ( )

References m_HasCrops, and m_PlantState.

Referenced by Harvest().

◆ IsMature()

bool IsMature ( )

◆ IsSpoiled()

bool IsSpoiled ( )

◆ IsSprayable()

bool IsSprayable ( )

◆ NeedsSpraying()

bool NeedsSpraying ( )

◆ NeedsWater()

bool NeedsWater ( )

References m_PlantState, and m_Slot.

Referenced by Init().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext  ctx,
int  version 
)

◆ OnStoreLoadCustom()

◆ OnStoreSave()

◆ OnStoreSaveCustom()

◆ PlantBase()

◆ PrintValues()

◆ RemovePlant()

void RemovePlant ( )

◆ RemovePlantEx()

◆ RemoveSlot()

void RemoveSlot ( )

◆ SetActions()

override void SetActions ( )

References AddAction().

◆ SetDry()

void SetDry ( )

◆ SetGarden()

void SetGarden ( GardenBase  gardenBase)

References m_GardenBase.

◆ SetPlantState()

void SetPlantState ( int  state)

References m_PlantState, and m_TimeTracker.

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

◆ SetSlot()

void SetSlot ( Slot  slot)

References m_Slot.

Referenced by OnStoreLoad().

◆ SetSpoiled()

void SetSpoiled ( )

◆ SpoiledRemoveTimerTick()

void SpoiledRemoveTimerTick ( )

◆ SprayPlant()

void SprayPlant ( float  consumed_quantity)

◆ StopInfestation()

string StopInfestation ( float  consumed_quantity)

◆ Tick()

◆ UpdatePlant()

◆ ~PlantBase()

Variable Documentation

◆ m_CropsCount

private int m_CropsCount

◆ m_CropsType

◆ m_CurrentPlantMaterialQuantity

private float m_CurrentPlantMaterialQuantity

◆ m_DebugDeleteDryTime

int m_DebugDeleteDryTime
static

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugFullMaturityTime

int m_DebugFullMaturityTime
static

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugSpoilRemoveTime

int m_DebugSpoilRemoveTime
static

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugSpoilTime

int m_DebugSpoilTime
static

Referenced by DebugSetGlobalTimes(), and Init().

◆ m_DebugTickSpeedMultiplier

float m_DebugTickSpeedMultiplier = 1
static

◆ m_DeleteDryPlantTime

int m_DeleteDryPlantTime

◆ m_DeleteDryPlantTimer

ref Timer m_DeleteDryPlantTimer

◆ m_FullMaturityTime

◆ m_GardenBase

private GardenBase m_GardenBase = NULL

◆ m_GrowthStagesCount

◆ m_GrowthTimer

ref Timer m_GrowthTimer

◆ m_HasCrops

◆ m_InfestationChance

private float m_InfestationChance

◆ m_InfestationTimer

ref Timer m_InfestationTimer

◆ m_IsInfested

◆ m_MarkForDeletion

bool m_MarkForDeletion = false

Referenced by ~PlantBase().

◆ m_ModuleHorticulture

private PluginHorticulture m_ModuleHorticulture

Referenced by ChangeInfestation(), and PlantBase().

◆ m_PlantMaterialMultiplier

private float m_PlantMaterialMultiplier

◆ m_PlantState

◆ m_PlantStateIndex

◆ m_Slot

private ref Slot m_Slot = NULL

◆ m_SpoilAfterFullMaturityTime

int m_SpoilAfterFullMaturityTime

◆ m_SpoilAfterFullMaturityTimer

ref Timer m_SpoilAfterFullMaturityTimer

◆ m_SpoiledRemoveTime

◆ m_SpoiledRemoveTimer

ref Timer m_SpoiledRemoveTimer

◆ m_SprayQuantity

◆ m_SprayUsage

◆ m_StateChangeTime

◆ m_TimeTicker

protected ref Timer m_TimeTicker

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

◆ m_TimeTracker

◆ SPOIL_AFTER_MATURITY_TIME

private const float SPOIL_AFTER_MATURITY_TIME = 14400.0

Referenced by Init().

◆ STATE_DRY

const int STATE_DRY = 0
static

◆ STATE_GROWING

const int STATE_GROWING = 1
static

◆ STATE_MATURE

const int STATE_MATURE = 2
static

◆ STATE_SPOILED

const int STATE_SPOILED = 3
static

◆ TICK_FREQUENCY

private const int TICK_FREQUENCY = 1

Referenced by PlantBase().