public static CaptureBiome GetCaptureBiome(int biomeChoice) { switch (biomeChoice) { case 1: return(GetPurityForPlayer()); case 2: return(Styles.Corruption); case 3: return(Styles.Jungle); case 4: return(Styles.Hallow); case 5: return(Styles.Snow); case 6: return(Styles.Desert); case 7: return(Styles.DirtLayer); case 8: return(Styles.RockLayer); case 9: return(Styles.BloodMoon); case 10: return(Styles.UndergroundDesert); case 11: return(Styles.Ocean); case 12: return(Styles.Mushroom); default: { CaptureBiome biomeByLocation = GetBiomeByLocation(); if (biomeByLocation != null) { return(biomeByLocation); } CaptureBiome biomeByWater = GetBiomeByWater(); if (biomeByWater != null) { return(biomeByWater); } return(GetPurityForPlayer()); } } }
private static CaptureBiome GetBiomeByWater() { int num = Main.CalculateWaterStyle(ignoreFountains: true); for (int i = 0; i < BiomesByWaterStyle.Length; i++) { CaptureBiome captureBiome = BiomesByWaterStyle[i]; if (captureBiome != null && captureBiome.WaterStyle == num) { return(captureBiome); } } return(null); }
private static CaptureBiome GetBiomeByWater() { int waterStyle = Main.CalculateWaterStyle(true); for (int index = 0; index < CaptureBiome.BiomesByWaterStyle.Length; ++index) { CaptureBiome captureBiome = CaptureBiome.BiomesByWaterStyle[index]; if (captureBiome != null && captureBiome.WaterStyle == waterStyle) { return(captureBiome); } } return((CaptureBiome)null); }