Example #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);
        }
Example #2
0
 private void GenerateEvilAlt(int num4, int num5, List <ModBiome> allBiome)
 {
     if (BiomeWorld.currentEvil == "Corruption" || BiomeWorld.currentEvil == "Crimson")
     {
         WorldGen.GERunner(num4, 0, (float)(3 * -(float)num5), 5f, false);
         return;
     }
     ModBiome biome = allBiome.Single(i => i.BiomeName == BiomeWorld.currentEvil);
 }
Example #3
0
        private void GenerateEvilAlt(int num4, int num5, List <ModBiome> allBiome)
        {
            if (CurrentEvil == VanillaBiome.Corruption.ToString() || CurrentEvil == VanillaBiome.Crimson.ToString())
            {
                WorldGen.GERunner(num4, 0, (float)(3 * -(float)num5), 5f, false);
                return;
            }

            ModBiome biome = allBiome.Single(i => i.BiomeName == CurrentEvil);
        }
Example #4
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);
            }
        }
Example #5
0
        private void DetermineHallowAlt(int num3, int num5)
        {
            EvilSpecific currentEvil = (Main.ActiveWorldFileData.HasCorruption)
                ? EvilSpecific.corruption
                : EvilSpecific.crimson;

            List <ModBiome> allAltToGen = BiomeLibs.Biomes.Values.Where(both =>
                                                                        both.BiomeAlt == BiomeAlternative.hallowAlt && both.EvilSpecific == EvilSpecific.both).ToList();

            if (!BiomeLibs.Biomes.Values.Any(c =>
                                             c.EvilSpecific == EvilSpecific.crimson || c.BiomeAlt == BiomeAlternative.hallowAlt) &&
                currentEvil == EvilSpecific.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);
        }
Example #6
0
        public override void ModifyHardmodeTasks(List <GenPass> list)
        {
            Main.hardMode = true;

            /*if (BiomeLibs.hallowAltList.Count != 0)
             * {*/

            list[0] = (new PassLegacy("Hardmode Good", delegate
            {
                float num = (float)WorldGen.genRand.Next(300, 400) * 0.001f;
                float num2 = (float)WorldGen.genRand.Next(200, 300) * 0.001f;
                int num3 = (int)((float)Main.maxTilesX * num);
                int num4 = (int)((float)Main.maxTilesX * (1f - num));
                int num5 = 1;
                if (WorldGen.genRand.Next(2) == 0)
                {
                    num4 = (int)((float)Main.maxTilesX * num);
                    num3 = (int)((float)Main.maxTilesX * (1f - num));
                    num5 = -1;
                }
                int num6 = 1;
                if (WorldGen.dungeonX < Main.maxTilesX / 2)
                {
                    num6 = -1;
                }
                if (num6 < 0)
                {
                    if (num4 < num3)
                    {
                        num4 = (int)((float)Main.maxTilesX * num2);
                    }
                    else
                    {
                        num3 = (int)((float)Main.maxTilesX * num2);
                    }
                }
                else if (num4 > num3)
                {
                    num4 = (int)((float)Main.maxTilesX * (1f - num2));
                }
                else
                {
                    num3 = (int)((float)Main.maxTilesX * (1f - num2));
                }

                int rand = Main.rand.Next(0, BiomeLibs.hallowAltList.Count);

                if (rand == 0)
                {
                    Main.NewText("Hallow has generated", Color.Red);
                    WorldGen.GERunner(num3, 0, 3f * (float)3 * num5, 5f, true);
                }
                else
                {
                    string message = BiomeLibs.BiomeList[BiomeLibs.hallowAltList[rand]].getMessage();
                    if (message != null)
                    {
                        Main.NewText(message, Color.Red);
                    }
                    else
                    {
                        Main.NewText(BiomeLibs.hallowAltList[rand] + "has generated", Color.Red);
                    }


                    BWRunner(num3, 0, blockFinder(BiomeLibs.hallowAltList[rand]), BiomeLibs.BiomeList[BiomeLibs.hallowAltList[rand]].mod, (float)(3 * num5), 5f);
                }
            }));
            //}
        }