Example #1
0
        public override void Generate(Map map, GenStepParams parms)
        {
            base.Generate(map, parms);
            int      randomInRange  = GenStep_AmbrosiaAnimalsGenLGE.AmbrosiaSproutSizeWidth.RandomInRange;
            int      randomInRange2 = GenStep_AmbrosiaAnimalsGenLGE.AmbrosiaSproutSizeHeight.RandomInRange;
            CellRect rect           = new CellRect(Rand.RangeInclusive(this.adventureRegion.minX + 10, this.adventureRegion.maxX - AmbrosiaSproutSizeWidth.max - 10), Rand.RangeInclusive(this.adventureRegion.minZ + 10, this.adventureRegion.maxZ - AmbrosiaSproutSizeHeight.max - 10), randomInRange, randomInRange2);

            rect.ClipInsideMap(map);
            foreach (IntVec3 c2 in rect)
            {
                CompTerrainPumpDry.AffectCell(map, c2);
                for (int i = 0; i < 8; i++)
                {
                    Vector3 b  = Rand.InsideUnitCircleVec3 * 3f;
                    IntVec3 c3 = IntVec3.FromVector3(c2.ToVector3Shifted() + b);
                    if (c3.InBounds(map))
                    {
                        CompTerrainPumpDry.AffectCell(map, c3);
                    }
                }
            }
            ResolveParams baseResolveParams = default(ResolveParams);

            baseResolveParams.rect     = rect;
            BaseGen.globalSettings.map = map;
            BaseGen.symbolStack.Push("ambrosiaAreaPrepareLGE", baseResolveParams);
            BaseGen.Generate();
        }
Example #2
0
        public override void Generate(Map map, GenStepParams parms)
        {
            base.Generate(map, parms);
            int      prisonCampWidth  = GenStep_PrisonCampLGE.PrisonCampSizeWidth.RandomInRange;
            int      prisonCampHeight = GenStep_PrisonCampLGE.PrisonCampSizeHeight.RandomInRange;
            CellRect rect             = new CellRect(this.adventureRegion.minX + (this.adventureRegion.Width / 2) - (prisonCampWidth / 2), this.adventureRegion.minZ + (this.adventureRegion.Height / 2) - (prisonCampHeight / 2), prisonCampWidth, prisonCampHeight);

            rect.ClipInsideMap(map);
            foreach (IntVec3 c2 in rect)
            {
                CompTerrainPumpDry.AffectCell(map, c2);
                for (int i = 0; i < 8; i++)
                {
                    Vector3 b  = Rand.InsideUnitCircleVec3 * 3f;
                    IntVec3 c3 = IntVec3.FromVector3(c2.ToVector3Shifted() + b);
                    if (c3.InBounds(map))
                    {
                        CompTerrainPumpDry.AffectCell(map, c3);
                    }
                }
            }
            ResolveParams baseResolveParams = default(ResolveParams);

            baseResolveParams.rect     = rect;
            BaseGen.globalSettings.map = map;
            BaseGen.symbolStack.Push("prisonCampLGE", baseResolveParams);
            BaseGen.Generate();
        }