protected override void ScatterAt(IntVec3 c, Map map, int stackCount = 1)
        {
            int      randomInRange  = GenStep_EscapeShip.EscapeShipSizeWidth.RandomInRange;
            int      randomInRange2 = GenStep_EscapeShip.EscapeShipSizeHeight.RandomInRange;
            CellRect rect           = new CellRect(c.x - randomInRange / 2, c.z - randomInRange2 / 2, randomInRange, randomInRange2);

            rect.ClipInsideMap(map);
            foreach (IntVec3 item in rect)
            {
                if (!map.terrainGrid.TerrainAt(item).affordances.Contains(TerrainAffordance.Heavy))
                {
                    CompTerrainPumpDry.AffectCell(map, item);
                    for (int i = 0; i < 8; i++)
                    {
                        Vector2 vector = Random.insideUnitCircle * 3f;
                        IntVec3 c2     = IntVec3.FromVector3(item.ToVector3Shifted() + new Vector3(vector.x, 0f, vector.y));
                        if (c2.InBounds(map))
                        {
                            CompTerrainPumpDry.AffectCell(map, c2);
                        }
                    }
                }
            }
            ResolveParams resolveParams = default(ResolveParams);

            resolveParams.rect = rect;
            RimWorld.BaseGen.BaseGen.globalSettings.map = map;
            RimWorld.BaseGen.BaseGen.symbolStack.Push("ship_core", resolveParams);
            RimWorld.BaseGen.BaseGen.Generate();
        }
Exemple #2
0
 protected override void AffectCell(IntVec3 c)
 {
     CompTerrainPumpDry.AffectCell(this.parent.Map, c);
 }