private void IterateFloor(int i, int j, bool isFloor) { float bannerChance = ConfigReader.Get<float>("worldgen.lost city.banners per tile"); if (!isFloor && Framing.GetTileSafely(i, j).active() && WorldGen.genRand.Chance(bannerChance)) { TileExtensions.PlaceMultitile(i, j + 1, TileType<CityBanner>(), 2, 3); } }
private void GenLostChest(IList<LostBuilding> buildings) { LostBuilding lostChestBuilding = Main.rand.Next(buildings); for (int attempt = 0; attempt < 100; attempt++) { int i = WorldGen.genRand.Next(lostChestBuilding.Area.Left + 1, lostChestBuilding.Area.Right); int j = lostChestBuilding.Area.Bottom - WorldGen.genRand.Next(lostChestBuilding.Floors) * lostChestBuilding.FloorHeight; if (!WorldGen.SolidTile(i, j) || !WorldGen.SolidTile(i - 1, j)) { continue; } if (TileExtensions.PlaceMultitile(i - 1, j - 2, TileType<LostChest>(), 2, 2)) { return; } } GenLostChest(buildings); }