Beispiel #1
0
        private void HarmRandomPlantInRadius(float radius)
        {
            IntVec3 c = this.parent.Position + (Rand.InsideUnitCircleVec3 * radius).ToIntVec3();

            if (!c.InBounds(this.parent.Map))
            {
                return;
            }
            Plant plant = c.GetPlant(this.parent.Map);

            if (plant != null)
            {
                if (plant.LeaflessNow)
                {
                    if (Rand.Value < this.LeaflessPlantKillChance)
                    {
                        plant.Kill(null, null);
                    }
                }
                else
                {
                    plant.MakeLeafless(Plant.LeaflessCause.Poison);
                }
            }
        }
        private void HarmRandomPlantInRadius(float radius)
        {
            IntVec3 c = base.parent.Position + (Rand.PointOnDisc * radius).ToIntVec3();

            if (c.InBounds(base.parent.Map))
            {
                Plant plant = c.GetPlant(base.parent.Map);
                if (plant != null)
                {
                    if (plant.LeaflessNow)
                    {
                        if (Rand.Value < 0.20000000298023224)
                        {
                            plant.Kill(null, null);
                        }
                    }
                    else
                    {
                        plant.MakeLeafless(Plant.LeaflessCause.Poison);
                    }
                }
            }
        }