1.0.0 commit
This commit is contained in:
109
Biomes.cs
Normal file
109
Biomes.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// CREDITS
|
||||
/// Thanks to d-Dice for his biomes class.
|
||||
/// https://github.com/d-Dice/BTitles-1.4.3/blob/1.4.4/BiomeTitlesMod.cs
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria;
|
||||
|
||||
namespace tTP
|
||||
{
|
||||
internal class Biomes
|
||||
{
|
||||
public static string GetBiome(Player p)
|
||||
{
|
||||
if (p.ZoneMeteor) return "Meteor Crash Site";
|
||||
if (p.ZoneGraveyard) return "Graveyard";
|
||||
if (p.ZoneHive) return "Hive";
|
||||
if (p.ZoneShimmer) return "Aether";
|
||||
|
||||
// Small
|
||||
if (p.ZoneDungeon) return "The Dungeon";
|
||||
if (p.ZoneLihzhardTemple) return "The Temple";
|
||||
|
||||
// Rare
|
||||
if (p.ZoneTowerNebula) return "Nebula Pillar";
|
||||
if (p.ZoneTowerSolar) return "Solar Pillar";
|
||||
if (p.ZoneTowerStardust) return "Stardust Pillar";
|
||||
if (p.ZoneTowerVortex) return "Vortex Pillar";
|
||||
|
||||
// Misc
|
||||
if (p.ZoneGranite) return "Granite Cave";
|
||||
if (p.ZoneMarble) return "Marble Cave";
|
||||
|
||||
if (p.ZoneDirtLayerHeight || p.ZoneRockLayerHeight)
|
||||
{
|
||||
if (p.ZoneGlowshroom) return "Underground Glowing Mushroom";
|
||||
}
|
||||
|
||||
if (p.ZoneGlowshroom) return "Glowing Mushroom";
|
||||
|
||||
if (p.ZoneDirtLayerHeight || p.ZoneRockLayerHeight)
|
||||
{
|
||||
// Underground infection-independent
|
||||
if (p.ZoneJungle) return "Underground Jungle";
|
||||
|
||||
// Underground infectable biomes
|
||||
if (p.ZoneDesert)
|
||||
{
|
||||
if (p.ZoneCorrupt) return "Corrupt Cave Desert";
|
||||
if (p.ZoneCrimson) return "Crimson Cave Desert";
|
||||
if (p.ZoneHallow) return "Hallow Cave Desert";
|
||||
return "Cave Desert";
|
||||
}
|
||||
else if (p.ZoneSnow)
|
||||
{
|
||||
if (p.ZoneCorrupt) return "Corrupt Ice Caves";
|
||||
if (p.ZoneCrimson) return "Crimson Ice Caves";
|
||||
if (p.ZoneHallow) return "Hallow Ice Caves";
|
||||
return "Ice Caves";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p.ZoneCorrupt) return "Underground Corruption";
|
||||
if (p.ZoneCrimson) return "Underground Crimson";
|
||||
if (p.ZoneHallow) return "Underground Hallow";
|
||||
}
|
||||
}
|
||||
|
||||
// Layer-independent
|
||||
if (p.ZoneBeach) return "Ocean";
|
||||
|
||||
// Layers
|
||||
if (p.ZoneSkyHeight) return "Sky";
|
||||
if (p.ZoneDirtLayerHeight) return "Underground";
|
||||
if (p.ZoneRockLayerHeight) return "Caverns";
|
||||
if (p.ZoneUnderworldHeight) return "Hell";
|
||||
|
||||
// Non-underground infection-independent
|
||||
if (p.ZoneJungle) return "Jungle";
|
||||
|
||||
// Non-underground infectable biomes
|
||||
if (p.ZoneDesert)
|
||||
{
|
||||
if (p.ZoneCorrupt) return "Corrupt Desert";
|
||||
if (p.ZoneCrimson) return "Crimson Desert";
|
||||
if (p.ZoneHallow) return "Hallow Desert";
|
||||
return "Desert";
|
||||
}
|
||||
else if (p.ZoneSnow)
|
||||
{
|
||||
return "Tundra";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p.ZoneCorrupt) return "Corruption";
|
||||
if (p.ZoneCrimson) return "Crimson";
|
||||
if (p.ZoneHallow) return "Hallow";
|
||||
}
|
||||
|
||||
// ... other Terraria biome checks ...
|
||||
|
||||
return "Forest";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user