public override bool Apply(Point origin, int x, int y, params object[] args) { x = MathUtility.Clamp(x, 1, Main.maxTilesX - 1); y = MathUtility.Clamp(y, 1, Main.maxTilesY - 1); if (!Main.tile[x, y].IsAir) { return(false); } if (!Sulfur.GetNeighbors(x, y).Any()) { return(false); } int found = 0; const int checkSize = 3; for (int i = x - checkSize; i <= x + checkSize; i++) { for (int j = y - checkSize; j <= y + checkSize; j++) { if (i < 1 || i > Main.maxTilesX - 1 || j < 1 || j > Main.maxTilesY - 1) { continue; } if (Main.tile[i, j] != null && !Main.tile[i, j].IsAir && Main.tile[i, j].type == ModContent.TileType <Sulfur>()) { found++; } } } if (found < 2) { WorldGen.PlaceTile(x, y, ModContent.TileType <Sulfur>(), true); Tile tile = Main.tile[x, y]; int style = WorldGen._genRand.Next(4); tile.frameX = (short)(style * 18); } return(true); }
public void TestPrintElectronShellCfg_All() { IElement testSubject;; testSubject = new Hydrogen(); Console.WriteLine($"Hydrogen {testSubject.PrintElectronShellCfg()}"); testSubject = new Helium(); Console.WriteLine($"Helium {testSubject.PrintElectronShellCfg()}"); testSubject = new Lithium(); Console.WriteLine($"Lithium {testSubject.PrintElectronShellCfg()}"); testSubject = new Beryllium(); Console.WriteLine($"Beryllium {testSubject.PrintElectronShellCfg()}"); testSubject = new Boron(); Console.WriteLine($"Boron {testSubject.PrintElectronShellCfg()}"); testSubject = new Carbon(); Console.WriteLine($"Carbon {testSubject.PrintElectronShellCfg()}"); testSubject = new Nitrogen(); Console.WriteLine($"Nitrogen {testSubject.PrintElectronShellCfg()}"); testSubject = new Oxygen(); Console.WriteLine($"Oxygen {testSubject.PrintElectronShellCfg()}"); testSubject = new Fluorine(); Console.WriteLine($"Fluorine {testSubject.PrintElectronShellCfg()}"); testSubject = new Neon(); Console.WriteLine($"Neon {testSubject.PrintElectronShellCfg()}"); testSubject = new Sodium(); Console.WriteLine($"Sodium {testSubject.PrintElectronShellCfg()}"); testSubject = new Magnesium(); Console.WriteLine($"Magnesium {testSubject.PrintElectronShellCfg()}"); testSubject = new Aluminum(); Console.WriteLine($"Aluminum {testSubject.PrintElectronShellCfg()}"); testSubject = new Silicon(); Console.WriteLine($"Silicon {testSubject.PrintElectronShellCfg()}"); testSubject = new Phosphorus(); Console.WriteLine($"Phosphorus {testSubject.PrintElectronShellCfg()}"); testSubject = new Sulfur(); Console.WriteLine($"Sulfur {testSubject.PrintElectronShellCfg()}"); testSubject = new Chlorine(); Console.WriteLine($"Chlorine {testSubject.PrintElectronShellCfg()}"); testSubject = new Argon(); Console.WriteLine($"Argon {testSubject.PrintElectronShellCfg()}"); testSubject = new Potassium(); Console.WriteLine($"Potassium {testSubject.PrintElectronShellCfg()}"); testSubject = new Calcium(); Console.WriteLine($"Calcium {testSubject.PrintElectronShellCfg()}"); testSubject = new Scandium(); Console.WriteLine($"Scandium {testSubject.PrintElectronShellCfg()}"); testSubject = new Titanium(); Console.WriteLine($"Titanium {testSubject.PrintElectronShellCfg()}"); testSubject = new Vanadium(); Console.WriteLine($"Vanadium {testSubject.PrintElectronShellCfg()}"); testSubject = new Chromium(); Console.WriteLine($"Chromium {testSubject.PrintElectronShellCfg()}"); testSubject = new Manganese(); Console.WriteLine($"Manganese {testSubject.PrintElectronShellCfg()}"); testSubject = new Iron(); Console.WriteLine($"Iron {testSubject.PrintElectronShellCfg()}"); testSubject = new Cobalt(); Console.WriteLine($"Cobalt {testSubject.PrintElectronShellCfg()}"); testSubject = new Nickel(); Console.WriteLine($"Nickel {testSubject.PrintElectronShellCfg()}"); testSubject = new Copper(); Console.WriteLine($"Copper {testSubject.PrintElectronShellCfg()}"); testSubject = new Zinc(); Console.WriteLine($"Zinc {testSubject.PrintElectronShellCfg()}"); testSubject = new Gallium(); Console.WriteLine($"Gallium {testSubject.PrintElectronShellCfg()}"); testSubject = new Germanium(); Console.WriteLine($"Germanium {testSubject.PrintElectronShellCfg()}"); testSubject = new Arsenic(); Console.WriteLine($"Arsenic {testSubject.PrintElectronShellCfg()}"); testSubject = new Selenium(); Console.WriteLine($"Selenium {testSubject.PrintElectronShellCfg()}"); testSubject = new Bromine(); Console.WriteLine($"Bromine {testSubject.PrintElectronShellCfg()}"); testSubject = new Krypton(); Console.WriteLine($"Krypton {testSubject.PrintElectronShellCfg()}"); testSubject = new Rubidium(); Console.WriteLine($"Rubidium {testSubject.PrintElectronShellCfg()}"); testSubject = new Strontium(); Console.WriteLine($"Strontium {testSubject.PrintElectronShellCfg()}"); testSubject = new Yttrium(); Console.WriteLine($"Yttrium {testSubject.PrintElectronShellCfg()}"); testSubject = new Zirconium(); Console.WriteLine($"Zirconium {testSubject.PrintElectronShellCfg()}"); testSubject = new Niobium(); Console.WriteLine($"Niobium {testSubject.PrintElectronShellCfg()}"); testSubject = new Molybdenum(); Console.WriteLine($"Molybdenum {testSubject.PrintElectronShellCfg()}"); testSubject = new Technetium(); Console.WriteLine($"Technetium {testSubject.PrintElectronShellCfg()}"); testSubject = new Ruthenium(); Console.WriteLine($"Ruthenium {testSubject.PrintElectronShellCfg()}"); testSubject = new Rhodium(); Console.WriteLine($"Rhodium {testSubject.PrintElectronShellCfg()}"); testSubject = new Palladium(); Console.WriteLine($"Palladium {testSubject.PrintElectronShellCfg()}"); testSubject = new Silver(); Console.WriteLine($"Silver {testSubject.PrintElectronShellCfg()}"); testSubject = new Cadmium(); Console.WriteLine($"Cadmium {testSubject.PrintElectronShellCfg()}"); testSubject = new Indium(); Console.WriteLine($"Indium {testSubject.PrintElectronShellCfg()}"); testSubject = new Tin(); Console.WriteLine($"Tin {testSubject.PrintElectronShellCfg()}"); testSubject = new Antimony(); Console.WriteLine($"Antimony {testSubject.PrintElectronShellCfg()}"); testSubject = new Tellurium(); Console.WriteLine($"Tellurium {testSubject.PrintElectronShellCfg()}"); testSubject = new Iodine(); Console.WriteLine($"Iodine {testSubject.PrintElectronShellCfg()}"); testSubject = new Xenon(); Console.WriteLine($"Xenon {testSubject.PrintElectronShellCfg()}"); testSubject = new Cesium(); Console.WriteLine($"Cesium {testSubject.PrintElectronShellCfg()}"); testSubject = new Barium(); Console.WriteLine($"Barium {testSubject.PrintElectronShellCfg()}"); }