CaveworldFlora.ClusterPlant.TickLong C# (CSharp) Method

TickLong() public method

Main function: - update the glower if necessary. - verify the cave plant is in good conditions to growth. - when the cave plant is too old, damage it over time. - when the cave plant is mature, try to reproduce.
public TickLong ( ) : void
return void
        public override void TickLong()
        {
            /*Log.Message("TickLong");
            Log.Message("isGrowingNow = " + this.isGrowingNow);
            Log.Message("isInCryostasis = " + this.isInCryostasis);*/
            if (this.isGrowingNow)
            {
                bool plantWasAlreadyMature = (this.LifeStage == PlantLifeStage.Mature);
                /*Log.Message("plantWasAlreadyMature = " + plantWasAlreadyMature);
                Log.Message("growthInt before = " + this.growthInt);
                Log.Message("GrowthPerTick = " + this.GrowthPerTick);*/
                this.growthInt += this.GrowthPerTick * GenTicks.TickLongInterval;
                if (DebugSettings.fastEcology)
                {
                    // TODO: fastEcology debug.
                    this.growthInt += 0.1f;
                }
                if (!plantWasAlreadyMature
                    && (this.LifeStage == PlantLifeStage.Mature))
                {
                    // Plant just became mature.
					Find.MapDrawer.MapMeshDirty(this.Position, MapMeshFlag.Things);
                }
            }

            // Verify the plant is not in cryostasis.
            if (this.isInCryostasis == false)
            {
                if (this.LifeStage == PlantLifeStage.Mature)
                {
                    this.ageInt += GenTicks.TickLongInterval;
                }
                if (this.Dying)
                {
                    int amount = Mathf.CeilToInt(1.25f);
                    base.TakeDamage(new DamageInfo(DamageDefOf.Rotting, amount, null, null, null));
                }
                if (!base.Destroyed
                    && (this.growthInt > minGrowthToReproduce)
                    && Rand.MTBEventOccurs(this.def.plant.seedEmitMTBDays, GenDate.TicksPerDay, GenTicks.TickLongInterval))
                {
                    GenClusterPlantReproduction.TryToReproduce(this);
                }

                if (DebugSettings.fastEcology
                    && !base.Destroyed
                    && (this.growthInt > minGrowthToReproduce))
                {
                    // TODO: fastEcology debug.
                    GenClusterPlantReproduction.TryToReproduce(this);
                }
            }

            // Update glower.
            if (!base.Destroyed)
            {
                UpdateGlowerAccordingToGrowth();
            }

            this.cachedLabelMouseover = null;
        }