private void DetermineHallowAlt(int num3, int num5) { VanillaBiome currentEvil = Main.ActiveWorldFileData.HasCorruption ? VanillaBiome.Corruption : VanillaBiome.Crimson; List <ModBiome> allAltToGen = BiomeLoader.loadedBiomes.Values.Where(biome => biome.BiomeAlternative == BiomeAlternative.Hallow && biome.BiomeSpecific == VanillaBiome.BothEvilBiomes.ToString()).ToList(); if (!BiomeLoader.loadedBiomes.Values.Any(biome => biome.BiomeSpecific == VanillaBiome.Crimson.ToString() || biome.BiomeAlternative == BiomeAlternative.Hallow) && currentEvil == VanillaBiome.Crimson) { Main.NewText("The fantasy creature has arrived!", Color.LightCyan); WorldGen.GERunner(num3, 0, 3f * (float)3 * num5, 5f, true); return; } ExtractAllSpecificAlt(currentEvil, allAltToGen); GenerateHallowAlt(num3, num5, currentEvil, allAltToGen); MethodInfo draw = typeof(Main).GetMethod("Draw", BindingFlags.Instance | BindingFlags.NonPublic); Object[] obj = { Main._drawInterfaceGameTime }; draw.Invoke(Main.instance, obj); }
private void GenerateHallowAlt(int num3, int num5, VanillaBiome currentEvil, List <ModBiome> allAltToGen) { ModBiome biome; int rng = (currentEvil == VanillaBiome.Corruption ? WorldGen.genRand.Next(allAltToGen.Count) : WorldGen.genRand.Next(allAltToGen.Count - 1)); if (rng == allAltToGen.Count) { Main.NewText("The fantasy creature has arrived!", Color.LightCyan); WorldGen.GERunner(num3, 0, 3f * (float)3 * num5, 5f, true); } biome = allAltToGen[rng]; string message = ""; if (!biome.BiomeAlternativeGeneration(ref message)) { Main.NewText(message); BWRunner(num3, 0, blockFinder(biome.biomeBlocks), (float)(3 * num5), 5f); } }
private static void ExtractAllSpecificAlt(VanillaBiome currentEvil, List <ModBiome> allAltToGen) { switch (currentEvil) { case VanillaBiome.Corruption: allAltToGen.AddRange(BiomeLoader.loadedBiomes.Values.Where(biome => biome.BiomeSpecific == VanillaBiome.Corruption.ToString() && biome.BiomeAlternative == BiomeAlternative.Hallow).ToList()); break; case VanillaBiome.Crimson: allAltToGen.AddRange(BiomeLoader.loadedBiomes.Values.Where(biome => biome.BiomeSpecific == VanillaBiome.Crimson.ToString() && biome.BiomeAlternative == BiomeAlternative.Hallow).ToList()); break; case VanillaBiome.Modded: allAltToGen.AddRange(BiomeLoader.loadedBiomes.Values.Where(biome => biome.BiomeSpecific == VanillaBiome.Modded.ToString() && biome.BiomeAlternative == BiomeAlternative.Hallow && biome.BiomeSpecific == CurrentEvil).ToList()); break; } }
public void SetBiomeSpecific(VanillaBiome biome) => SetBiomeSpecific(biome.ToString());