The astral background saga has concluded
This commit is contained in:
1 parent
c944959d6a
commit
902156bbbd
4 files changed
+86
-15
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class AstralSurfaceFogBGStyle : ModSurfaceBackgroundStyle
|
||||
{
|
||||
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
|
||||
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
|
||||
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
|
||||
{
|
||||
scale *= 0.75f;
|
||||
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
}
|
||||
|
||||
public override void ModifyFarFades(float[] fades, float transitionSpeed)
|
||||
{
|
||||
// This just fades in the background and fades out other backgrounds.
|
||||
for (int i = 0; i < fades.Length; i++)
|
||||
{
|
||||
if (i == Slot)
|
||||
{
|
||||
fades[i] += transitionSpeed;
|
||||
if (fades[i] > 1f)
|
||||
fades[i] = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
fades[i] -= transitionSpeed;
|
||||
if (fades[i] < 0f)
|
||||
fades[i] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public class AbovegroundAstralBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceFogBGStyle");
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon";
|
||||
@@ -20,28 +20,18 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astral Surface");
|
||||
DisplayName.SetDefault("Astral Surface Fog");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneDesert && !player.ZoneSnow;
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950;
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
if (SkyManager.Instance["CalamityMod:AstralSurface"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSurface"].IsActive())
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
SkyManager.Instance.Activate("CalamityMod:AstralSurface");
|
||||
}
|
||||
else
|
||||
{
|
||||
SkyManager.Instance.Deactivate("CalamityMod:AstralSurface");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using CalamityMod.Systems;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class AbovegroundAstralBiomeSurface : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astral Surface");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneSnow && !player.ZoneDesert;
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
if (SkyManager.Instance["CalamityMod:AstralSurface"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSurface"].IsActive())
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
SkyManager.Instance.Activate("CalamityMod:AstralSurface");
|
||||
}
|
||||
else
|
||||
{
|
||||
SkyManager.Instance.Deactivate("CalamityMod:AstralSurface");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Deactivate(params object[] args)
|
||||
{
|
||||
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneSnow;
|
||||
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneSnow && !Main.LocalPlayer.ZoneDesert;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
|
||||
Reference in new issue
Block a user