示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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;
            }
        }
示例#4
0
 public void SetBiomeSpecific(VanillaBiome biome) => SetBiomeSpecific(biome.ToString());