Sunken sea biome separation, other stuff

-Added new custom backgrounds for the astral biome and sulphur sea, and removed the skybox backgrounds
-Added new water styles for each sunken sea sub-biome, and edited the IL edit so you can make custom glow colors for each water
-Added super work in progress sulphur reefs generation
-Fixed cuttable grass tiles not dying if the block below them was broken or if they were on the incorrect tile
This commit is contained in:
Mortis3 committed 2023-11-13 22:05:19 -05:00
1 parent 27ae8c2b26
commit 277d13c20e
100 files changed
+1096 -921

No files matched your search

+114
View File
@@ -0,0 +1,114 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.BiomeManagers;
using CalamityMod.World;
namespace CalamityMod.Backgrounds
{
internal static class AstralDesertBG
{
public static void Load()
{
if (Main.dedServ)
{
return;
}
On_Main.DrawSurfaceBG += DrawAstralSnowBG;
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawAstralSnowBG(On_Main.orig_DrawSurfaceBG orig, Main self)
{
if (Main.gameMenu)
{
orig(self);
return;
}
orig(self);
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<AbovegroundAstralDesertBiome>()))
{
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
Transparency -= TransitionSpeed;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active)
if (Transparency > 0f)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 2f;
for (int Layers = 2; Layers >= 0; Layers--)
{
//get each background texture
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralDesertBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 125f;
break;
}
case 1:
{
zero.Y += 170f;
break;
}
case 2:
{
zero.Y += 125f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float RectangleScale = Scale * rectangle.Width;
int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale);
for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++)
{
int sulphurSeaHeight = SulphurousSea.YStart;
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), sulphurSeaHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var clr = new Color(50, 50, 50) * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

-37
View File
@@ -1,37 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralDesertSurfaceBGStyle : 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)
{
b -= 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;
}
}
}
}
}
+132
View File
@@ -0,0 +1,132 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.BiomeManagers;
using CalamityMod.World;
namespace CalamityMod.Backgrounds
{
internal static class AstralSnowBG
{
public static void Load()
{
if (Main.dedServ)
{
return;
}
On_Main.DrawSurfaceBG += DrawAstralSnowBG;
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawAstralSnowBG(On_Main.orig_DrawSurfaceBG orig, Main self)
{
if (Main.gameMenu)
{
orig(self);
return;
}
orig(self);
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<AbovegroundAstralSnowBiome>()))
{
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
Transparency -= TransitionSpeed;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active)
if (Transparency > 0f)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 2f;
for (int Layers = 4; Layers >= 0; Layers--)
{
//get each background texture
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSnowBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 125f;
break;
}
case 1:
{
zero.Y += 160f;
break;
}
case 2:
{
zero.Y += 280f;
break;
}
case 3:
{
zero.Y += 135f;
break;
}
case 4:
{
zero.Y += 110f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float RectangleScale = Scale * rectangle.Width;
int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale);
for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++)
{
int sulphurSeaHeight = SulphurousSea.YStart;
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), sulphurSeaHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var clr = new Color(50, 50, 50) * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
//draw glowmasks
if (Layers < 2)
{
Texture2D BGTextureGlow = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSnowBG" + Layers + "_Glow").Value;
Main.spriteBatch.Draw(BGTextureGlow, drawPosition, frame, Color.White * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

-33
View File
@@ -1,33 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSnowSurfaceBGStyle : 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) => 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;
}
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

+132
View File
@@ -0,0 +1,132 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.BiomeManagers;
using CalamityMod.World;
namespace CalamityMod.Backgrounds
{
internal static class AstralSurfaceBG
{
public static void Load()
{
if (Main.dedServ)
{
return;
}
On_Main.DrawSurfaceBG += DrawAstralBG;
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawAstralBG(On_Main.orig_DrawSurfaceBG orig, Main self)
{
if (Main.gameMenu)
{
orig(self);
return;
}
orig(self);
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<AbovegroundAstralBiomeSurface>()))
{
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
Transparency -= TransitionSpeed;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active)
if (Transparency > 0f)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 2f;
for (int Layers = 4; Layers >= 0; Layers--)
{
//get each background texture
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 125f;
break;
}
case 1:
{
zero.Y += 160f;
break;
}
case 2:
{
zero.Y += 280f;
break;
}
case 3:
{
zero.Y += 135f;
break;
}
case 4:
{
zero.Y += 110f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float RectangleScale = Scale * rectangle.Width;
int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale);
for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++)
{
int sulphurSeaHeight = SulphurousSea.YStart;
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), sulphurSeaHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var clr = new Color(50, 50, 50) * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
//draw glowmasks
if (Layers < 3)
{
Texture2D BGTextureGlow = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceBG" + Layers + "_Glow").Value;
Main.spriteBatch.Draw(BGTextureGlow, drawPosition, frame, Color.White * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

+8 -7
View File
@@ -2,36 +2,37 @@
namespace CalamityMod.Backgrounds
{
//this is just a blank background, so each custom background will draw over it
public class AstralSurfaceBGStyle : 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;
b -= 100f;
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.
//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;
}
}
}
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

-37
View File
@@ -1,37 +0,0 @@
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;
}
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

+121
View File
@@ -0,0 +1,121 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.World;
using CalamityMod.Systems;
namespace CalamityMod.Backgrounds
{
internal static class SulphurSeaBG
{
public static void Load()
{
if (Main.dedServ)
{
return;
}
On_Main.DrawBG += DrawSulphurBG;
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawSulphurBG(On_Main.orig_DrawBG orig, Main self)
{
//conditions for the sulphur sea biome (copied directly from the biome manager)
Point point = Main.LocalPlayer.Center.ToTileCoordinates();
bool sulphurPosX = false;
if (Abyss.AtLeftSideOfWorld)
{
if (point.X < 435)
{
sulphurPosX = true;
}
}
else
{
if (point.X > Main.maxTilesX - 435)
{
sulphurPosX = true;
}
}
bool inSulphurSeaBiome = (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX && !WeakReferenceSupport.InAnySubworld())) && !Main.LocalPlayer.Calamity().ZoneAbyss;
//dont run if you are on the menu
if (Main.gameMenu)
{
orig(self);
return;
}
//always call orig
orig(self);
//increase transparency while in the biome, and decrease it if not
if (inSulphurSeaBiome)
{
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
Transparency -= TransitionSpeed;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually being used in game)
if (Transparency > 0f)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float ZoomPos = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
//the scale of the entire background
float Scale = 2f;
//get each background texture
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SulphurSeaBG").Value;
Texture2D BGFrontTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SulphurSeaBGFront").Value;
Vector2 BackgroundTexCenter = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
Vector2 vector3 = new Vector2(1f / 3f);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
BackgroundTexCenter *= Scale;
zero.Y -= ZoomPos;
float RectangleScale = Scale * rectangle.Width;
int num6 = (int)((vector.X * vector3.X - BackgroundTexCenter.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale);
for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++)
{
int sulphurSeaHeight = SulphurousSea.YStart;
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), sulphurSeaHeight * 16f) + BackgroundTexCenter - vector) * vector3 + vector - Main.screenPosition - BackgroundTexCenter + zero;
var frame = rectangle;
var color = Main.ColorOfTheSkies * Transparency;
var frontColor = Color.LightSeaGreen * 0.5f;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(BGFrontTexture, drawPosition, frame, frontColor * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

-2
View File
@@ -10,7 +10,6 @@ namespace CalamityMod.BiomeManagers
public class AbovegroundAstralBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceFogBGStyle");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<AstralTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
@@ -28,7 +27,6 @@ namespace CalamityMod.BiomeManagers
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
}
}
}
@@ -21,21 +21,5 @@ namespace CalamityMod.BiomeManagers
{
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");
}
}
}
}
}
+1 -16
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.BiomeManagers
public class AbovegroundAstralDesertBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralDesertSurfaceBGStyle");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<AstralTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon";
@@ -23,20 +23,5 @@ namespace CalamityMod.BiomeManagers
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneDesert && !player.ZoneSnow;
}
public override void SpecialVisuals(Player player, bool isActive)
{
if (SkyManager.Instance["CalamityMod:AstralDesert"] != null && isActive != SkyManager.Instance["CalamityMod:AstralDesert"].IsActive())
{
if (isActive)
{
SkyManager.Instance.Activate("CalamityMod:AstralDesert");
}
else
{
SkyManager.Instance.Deactivate("CalamityMod:AstralDesert");
}
}
}
}
}
+1 -17
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.BiomeManagers
public class AbovegroundAstralSnowBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSnowSurfaceBGStyle");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<AstralTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
@@ -21,21 +21,5 @@ namespace CalamityMod.BiomeManagers
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneSnow;
}
public override void SpecialVisuals(Player player, bool isActive)
{
if (SkyManager.Instance["CalamityMod:AstralSnow"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSnow"].IsActive())
{
if (isActive)
{
SkyManager.Instance.Activate("CalamityMod:AstralSnow");
}
else
{
SkyManager.Instance.Deactivate("CalamityMod:AstralSnow");
}
}
}
}
}
+1 -4
View File
@@ -8,10 +8,7 @@ namespace CalamityMod.BiomeManagers
{
public class SunkenSeaBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
//this is just a global sunken sea biome to check if you are in any of the existing biomes
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaBurrowsBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaBurrowsWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 150 && MoreThanReefs && MoreThanPolyp;
}
}
}
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaPolypBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaPolypWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
return BiomeTileCounterSystem.SunkenSeaPolypTiles > 150 && MoreThanReefs && MoreThanBurrows;
}
}
}
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaReefsBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaReefsWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
return BiomeTileCounterSystem.SunkenSeaReefsTiles > 150 && MoreThanBurrows && MoreThanPolyp;
}
}
}
+26
View File
@@ -0,0 +1,26 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaShoresBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaShoresWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaShoresTiles > 150;
}
}
}
+5 -1
View File
@@ -1048,7 +1048,11 @@ namespace CalamityMod.CalPlayer
Player.InModBiome(ModContent.GetInstance<AbovegroundAstralSnowBiome>()) ||
Player.InModBiome(ModContent.GetInstance<AbovegroundAstralDesertBiome>()) ||
Player.InModBiome(ModContent.GetInstance<UndergroundAstralBiome>())) && !ZoneAbyss;
public bool ZoneSunkenSea => Player.InModBiome(ModContent.GetInstance<SunkenSeaBiome>());
public bool ZoneSunkenSea => ZoneSunkenBurrows || ZoneSunkenSeaReefs || ZoneSunkenSeaPolyp || ZoneSunkenSeaShores;
public bool ZoneSunkenBurrows => Player.InModBiome(ModContent.GetInstance<SunkenSeaBurrowsBiome>());
public bool ZoneSunkenSeaReefs => Player.InModBiome(ModContent.GetInstance<SunkenSeaReefsBiome>());
public bool ZoneSunkenSeaPolyp => Player.InModBiome(ModContent.GetInstance<SunkenSeaPolypBiome>());
public bool ZoneSunkenSeaShores => Player.InModBiome(ModContent.GetInstance<SunkenSeaShoresBiome>());
public bool ZoneSulphur => Player.InModBiome(ModContent.GetInstance<SulphurousSeaBiome>());
public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4;
public bool ZoneAbyssLayer1 => Player.InModBiome(ModContent.GetInstance<AbyssLayer1Biome>());
+5 -68
View File
@@ -88,27 +88,6 @@ namespace CalamityMod
//Astral Sky/BG
public static Texture2D AstralSky;
public static Texture2D AstralSurfaceFront;
public static Texture2D AstralSurfaceFrontGlow;
public static Texture2D AstralSurfaceClose;
public static Texture2D AstralSurfaceCloseGlow;
public static Texture2D AstralSurfaceMiddle;
public static Texture2D AstralSurfaceMiddleGlow;
public static Texture2D AstralSurfaceFar;
public static Texture2D AstralSurfaceHorizon;
//Astral Desert Sky/BG
public static Texture2D AstralDesertSurfaceClose;
public static Texture2D AstralDesertSurfaceMiddle;
public static Texture2D AstralDesertSurfaceFar;
//Astral Snow Sky/BG
public static Texture2D AstralSnowSurfaceMiddle;
//Sulpher Sea Sky/BG
public static Texture2D SulphurSeaSky;
public static Texture2D SulphurSeaSkyFront;
public static Texture2D SulphurSeaSurface;
// DR data structure
public static SortedDictionary<int, float> DRValues;
@@ -239,55 +218,17 @@ namespace CalamityMod
BaseIdleHoldoutProjectile.LoadAll();
PlayerDashManager.Load();
/*
//keep this disabled for now, hell bg system isnt used and there is a better way to load it
//hell background loading
HellBGManager.Load();
//load stuff for hell background
loadCache = new List<HellBGLoad>();
foreach (Type type in Code.GetTypes())
{
if (!type.IsAbstract && type.GetInterfaces().Contains(typeof(HellBGLoad)))
{
var instance = Activator.CreateInstance(type);
loadCache.Add(instance as HellBGLoad);
}
}
for (int k = 0; k < loadCache.Count; k++)
{
loadCache[k].Load();
}
*/
//load all the detours for the custom surface backgrounds
Backgrounds.AstralSurfaceBG.Load();
Backgrounds.AstralDesertBG.Load();
Backgrounds.AstralSnowBG.Load();
Backgrounds.SulphurSeaBG.Load();
}
private void LoadClient()
{
//Astral Sky/BG
AstralSky = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceFront = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceFrontGlow = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceClose = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceCloseGlow = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceMiddleGlow = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceFar = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceFar", AssetRequestMode.ImmediateLoad).Value;
AstralSurfaceHorizon = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSurfaceHorizon", AssetRequestMode.ImmediateLoad).Value;
//Astral Desert Sky/BG
AstralDesertSurfaceClose = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value;
AstralDesertSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
AstralDesertSurfaceFar = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralDesertSurfaceFar", AssetRequestMode.ImmediateLoad).Value;
//Astral Snow Sky/BG
AstralSnowSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
//Sulpher Sea Sky/BG
SulphurSeaSky = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value;
SulphurSeaSkyFront = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value;
SulphurSeaSurface = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value;
// TODO -- Sky shaders should probably be loaded in a ModSystem
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
@@ -331,10 +272,6 @@ namespace CalamityMod
SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky();
SkyManager.Instance["CalamityMod:Astral"] = new AstralSky();
SkyManager.Instance["CalamityMod:AstralSurface"] = new AstralSkySurface();
SkyManager.Instance["CalamityMod:AstralDesert"] = new AstralSkyDesert();
SkyManager.Instance["CalamityMod:AstralSnow"] = new AstralSkySnow();
SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky();
SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky();
SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky();
+35 -4
View File
@@ -795,7 +795,11 @@ namespace CalamityMod.ILEditing
{
initialColor = SelectLavaQuadColor(initialTexture, ref initialColor, liquidType == 1);
if (liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater").Slot ||
if (liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/BasaltGullyWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaBurrowsWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaPolypWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaReefsWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaShoresWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricDepthsWater").Slot ||
liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/UpperAbyssWater").Slot ||
@@ -917,7 +921,8 @@ namespace CalamityMod.ILEditing
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
if (tile.LiquidAmount <= 0 || tile.HasTile || tile.Get<LiquidData>().LiquidType != LiquidID.Water || (Main.waterStyle != SulphuricWater.Type &&
Main.waterStyle != SulphuricDepthsWater.Type && Main.waterStyle != SunkenSeaWater.Type))
Main.waterStyle != SulphuricDepthsWater.Type && Main.waterStyle != SunkenSeaBurrowsWater.Type && Main.waterStyle != SunkenSeaPolypWater.Type &&
Main.waterStyle != SunkenSeaReefsWater.Type && Main.waterStyle != SunkenSeaShoresWater.Type && Main.waterStyle != BasaltGullyWater.Type))
return;
Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1);
@@ -988,8 +993,34 @@ namespace CalamityMod.ILEditing
if (Main.waterStyle == SulphuricDepthsWater.Type)
outputColor = Vector3.Lerp(outputColor, Color.MediumSeaGreen.ToVector3(), 0.18f);
if (Main.waterStyle == SunkenSeaWater.Type)
if (Main.waterStyle == SunkenSeaBurrowsWater.Type || Main.waterStyle == SunkenSeaPolypWater.Type || Main.waterStyle == SunkenSeaReefsWater.Type ||
Main.waterStyle == SunkenSeaShoresWater.Type || Main.waterStyle == BasaltGullyWater.Type)
{
//default to white
Color waterGlowColor = Color.White;
//set the glow colors for each sunken sea biome water style
if (Main.waterStyle == SunkenSeaShoresWater.Type)
{
waterGlowColor = new Color(233, 170, 184);
}
if (Main.waterStyle == SunkenSeaPolypWater.Type)
{
waterGlowColor = new Color(213, 185, 178);
}
if (Main.waterStyle == SunkenSeaReefsWater.Type)
{
waterGlowColor = new Color(140, 222, 239);
}
if (Main.waterStyle == SunkenSeaBurrowsWater.Type)
{
waterGlowColor = new Color(76, 211, 231);
}
if (Main.waterStyle == BasaltGullyWater.Type)
{
waterGlowColor = new Color(144, 174, 200);
}
float brightness = MathHelper.Clamp(0.07f, 0f, 0.07f);
float waveScale1 = Main.GameUpdateCount * 0.028f;
float waveScale2 = Main.GameUpdateCount * 0.1f;
@@ -1009,7 +1040,7 @@ namespace CalamityMod.ILEditing
float wave5angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave5));
float wave6angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave6));
float bigwaveangle = 0.55f + 0.80f * (float)Math.Sin(MathHelper.ToRadians(bigwave));
outputColor = Vector3.Lerp(outputColor, Color.DeepSkyBlue.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle);
outputColor = Vector3.Lerp(outputColor, waterGlowColor.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle);
outputColor *= brightness;
}
}
@@ -76,3 +76,23 @@ UndergroundAstralBiome: {
DisplayName: Astral Underground
TownNPCDialogueName: Underground Astral Infection
}
SunkenSeaBurrowsBiome: {
DisplayName: Sunken Sea Burrows Biome
TownNPCDialogueName: the Sunken Sea Burrows Biome
}
SunkenSeaPolypBiome: {
DisplayName: Sunken Sea Polyp Biome
TownNPCDialogueName: the Sunken Sea Polyp Biome
}
SunkenSeaReefsBiome: {
DisplayName: Sunken Sea Reefs Biome
TownNPCDialogueName: the Sunken Sea Reefs Biome
}
SunkenSeaShoresBiome: {
DisplayName: Sunken Sea Shores Biome
TownNPCDialogueName: the Sunken Sea Shores Biome
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

-137
View File
@@ -1,137 +0,0 @@
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.ID;
namespace CalamityMod.Skies
{
public class AstralSkyDesert : CustomSky
{
private bool skyActive;
private float opacity;
private const float Scale = 2f;
public override void Deactivate(params object[] args)
{
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow;
}
public override void Reset()
{
skyActive = false;
}
public override bool IsActive()
{
return skyActive || opacity > 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
skyActive = true;
}
public override Color OnTileColor(Color inColor)
{
return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity);
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
// Small worlds, default draw height.
int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2;
// Medium worlds.
if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4;
// Large worlds (and anything bigger).
if (Main.maxTilesX >= 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140;
// Background from here starting from the back layer to the front layer.
float width = Main.screenWidth / 2f;
float height = Main.screenHeight / 2f;
Color color = new Color(63, 51, 90, 255) * opacity;
if (maxDepth >= 9f && minDepth < 9f)
{
float screenParralaxMultiplier = 0.16f;
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
int x = (int)(Main.screenPosition.X * screenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * screenParralaxMultiplier);
y -= 1380; // 1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceFar;
int x = (int)(Main.screenPosition.X * 0.5f * screenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.45f * screenParralaxMultiplier);
y -= 1520; // 1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceMiddle;
int x = (int)(Main.screenPosition.X * 0.8f * screenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.5f * screenParralaxMultiplier);
y -= 1900; // 1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceClose;
int x = (int)(Main.screenPosition.X * 1f * screenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.55f * screenParralaxMultiplier);
y -= 2050; // 1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f);
}
}
}
public override void Update(GameTime gameTime)
{
if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu)
skyActive = false;
if (skyActive && opacity < 1f)
opacity += 0.02f;
else if (!skyActive && opacity > 0f)
opacity -= 0.02f;
}
public override float GetCloudAlpha()
{
return (1f - opacity) * 0.97f + 0.03f;
}
}
}
-171
View File
@@ -1,171 +0,0 @@
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.ID;
namespace CalamityMod.Skies
{
public class AstralSkySnow : CustomSky
{
private bool skyActive;
private float opacity;
private const float Scale = 2.0f;
private const float ScreenParralaxMultiplier = 0.4f;
public override void Deactivate(params object[] args)
{
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneSnow && !Main.LocalPlayer.ZoneDesert;
}
public override void Reset()
{
skyActive = false;
}
public override bool IsActive()
{
return skyActive || opacity > 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
skyActive = true;
}
public override Color OnTileColor(Color inColor)
{
return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity);
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
// Small worlds, default draw height.
int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2;
// Medium worlds.
if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4;
// Large worlds (and anything bigger).
if (Main.maxTilesX >= 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140;
// Background from here starting from the back layer to the front layer.
float width = Main.screenWidth / 2f;
float height = Main.screenHeight / 2f;
Color textureColor = new Color(116, 96, 164, 255) * opacity;
Vector2 origin = new Vector2(0f, AstralBiomeHeight);
if (maxDepth >= 9f && minDepth < 9f)
{
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
int x = (int)(Main.screenPosition.X * 0.4f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.4f * ScreenParralaxMultiplier);
y -= 1380; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
Texture2D texture = CalamityMod.AstralSurfaceFar;
int x = (int)(Main.screenPosition.X * 0.5f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.45f * ScreenParralaxMultiplier);
y -= 1520; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
Texture2D texture = CalamityMod.AstralSnowSurfaceMiddle;
int x = (int)(Main.screenPosition.X * 0.8f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier);
y -= 1900; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
Texture2D texture = CalamityMod.AstralSurfaceClose;
int x = (int)(Main.screenPosition.X * 0.9f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.55f * ScreenParralaxMultiplier);
y -= 1880; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow;
Color textureGlowColor = Color.White * 0.7f * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 5f && minDepth < 5f)
{
Texture2D texture = CalamityMod.AstralSurfaceFront;
int x = (int)(Main.screenPosition.X * 1.1f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.6f * ScreenParralaxMultiplier);
y -= 2100; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow;
Color textureGlowColor = Color.White * 0.9f * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
}
public override void Update(GameTime gameTime)
{
if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu)
skyActive = false;
if (skyActive && opacity < 1f)
opacity += 0.02f;
else if (!skyActive && opacity > 0f)
opacity -= 0.02f;
}
public override float GetCloudAlpha()
{
return (1f - opacity) * 0.97f + 0.03f;
}
}
}
-179
View File
@@ -1,179 +0,0 @@
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.ID;
namespace CalamityMod.Skies
{
public class AstralSkySurface : CustomSky
{
private bool skyActive;
private float opacity;
private const float Scale = 2f;
private const float ScreenParralaxMultiplier = 0.4f;
public override void Deactivate(params object[] args)
{
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow;
}
public override void Reset()
{
skyActive = false;
}
public override bool IsActive()
{
return skyActive || opacity > 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
skyActive = true;
}
public override Color OnTileColor(Color inColor)
{
return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity);
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
// Small worlds, default draw height.
int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2;
// Medium worlds.
if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4;
// Large worlds (and anything bigger).
if (Main.maxTilesX >= 8400)
AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140;
// Background from here starting from the back layer to the front layer.
float width = Main.screenWidth / 2f;
float height = Main.screenHeight / 2f;
Color textureColor = new Color(63, 51, 90, 255) * opacity;
Vector2 origin = new Vector2(0f, AstralBiomeHeight);
if (maxDepth >= 9f && minDepth < 9f)
{
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
int x = (int)(Main.screenPosition.X * 0.4f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.4f * ScreenParralaxMultiplier);
y -= 1380; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
Texture2D texture = CalamityMod.AstralSurfaceFar;
int x = (int)(Main.screenPosition.X * 0.5f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.45f * ScreenParralaxMultiplier);
y -= 1520; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
Texture2D texture = CalamityMod.AstralSurfaceMiddle;
int x = (int)(Main.screenPosition.X * 0.8f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier);
y -= 1900; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceMiddleGlow;
Color textureGlowColor = Color.White * 0.5f * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
Texture2D texture = CalamityMod.AstralSurfaceClose;
int x = (int)(Main.screenPosition.X * 0.9f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.55f * ScreenParralaxMultiplier);
y -= 1880; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow;
Color textureGlowColor = Color.White * 0.7f * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 5f && minDepth < 5f)
{
Texture2D texture = CalamityMod.AstralSurfaceFront;
int x = (int)(Main.screenPosition.X * 1.1f * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.6f * ScreenParralaxMultiplier);
y -= 2100; // 1000
Vector2 position = texture.Size() / 2f * Scale;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow;
Color textureGlowColor = Color.White * 0.9f * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(width - x + texture.Width * k * Scale, height - y);
spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f);
}
}
}
public override void Update(GameTime gameTime)
{
if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu)
skyActive = false;
if (skyActive && opacity < 1f)
opacity += 0.02f;
else if (!skyActive && opacity > 0f)
opacity -= 0.02f;
}
public override float GetCloudAlpha()
{
return (1f - opacity) * 0.97f + 0.03f;
}
}
}
-118
View File
@@ -1,118 +0,0 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.ID;
namespace CalamityMod.Skies
{
public class SulphurSeaSky : CustomSky
{
private bool skyActive;
private float opacity;
private const float ScreenParralaxMultiplier = 0.4f;
// Vanila scales backgrounds to 250% size. Depending on what you might want to do you can change this if you wanted to make a non scaled bg.
private const float Scale = 2.5f;
public override void Deactivate(params object[] args)
{
skyActive = Main.LocalPlayer.Calamity().ZoneSulphur;
}
public override void Reset()
{
skyActive = false;
}
public override bool IsActive()
{
return skyActive || opacity > 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
skyActive = true;
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 4f && minDepth < 4f)
spriteBatch.Draw(CalamityMod.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity);
// Small worlds, default draw height
int sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 2;
// Medium worlds
if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400)
sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 5;
// Large worlds (and anything bigger)
if (Main.maxTilesX >= 8400)
sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 140;
// Explantion on how to use this BG code for skies.
// This changes the speed of the parralax, the closer the layer to the player the faster it should be.
if (maxDepth >= 1f && minDepth < 1f)
{
Texture2D texture = CalamityMod.SulphurSeaSkyFront;
// Keep in mind that y paralex should always be half of x's or it will feel odd compared to how terraria does it.
// Keep in mind when you change screen parralax it affects the y offset for the bg in the world.
int x = (int)(Main.screenPosition.X * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier);
// Y offset to align with whatever position you want it in the world (is affected by screenParralaxMultiplier as stated before).
y -= 1800;
float screenWidth = Main.screenWidth / 2f;
float screenHeight = Main.screenHeight / 2f;
Vector2 position = texture.Size() / 2f * Scale;
Color color = Color.LightSeaGreen * 0.5f * opacity;
// This loops the BG horizontally.
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(screenWidth - x + texture.Width * k * Scale, screenHeight - y);
spriteBatch.Draw(texture, pos - position, null, color, 0f, new Vector2(0f, (float)sulphurSeaHeight), Scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 3f && minDepth < 3f)
{
Texture2D texture = CalamityMod.SulphurSeaSurface;
int x = (int)(Main.screenPosition.X * ScreenParralaxMultiplier);
x %= (int)(texture.Width * Scale);
int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier);
y -= 1800; // 1000
float screenWidth = Main.screenWidth / 2f;
float screenHeight = Main.screenHeight / 2f;
Vector2 position = texture.Size() / 2f * Scale;
Color color = Main.ColorOfTheSkies * opacity;
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(screenWidth - x + texture.Width * k * Scale, screenHeight - y);
spriteBatch.Draw(texture, pos - position, null, color, 0f, new Vector2(0f, (float)sulphurSeaHeight), Scale, SpriteEffects.None, 0f);
}
}
}
public override void Update(GameTime gameTime)
{
if (!Main.LocalPlayer.Calamity().ZoneSulphur || Main.gameMenu)
skyActive = false;
if (skyActive && opacity < 1f)
opacity += 0.02f;
else if (!skyActive && opacity > 0f)
opacity -= 0.02f;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

+13 -1
View File
@@ -19,6 +19,10 @@ namespace CalamityMod.Systems
public static int AbyssTiles = 0;
public static int AstralTiles = 0;
public static int SunkenSeaTiles = 0;
public static int SunkenSeaShoresTiles = 0;
public static int SunkenSeaPolypTiles = 0;
public static int SunkenSeaReefsTiles = 0;
public static int SunkenSeaBurrowsTiles = 0;
public static int ArsenalLabTiles = 0;
public static int Layer1Tiles = 0;
@@ -31,6 +35,10 @@ namespace CalamityMod.Systems
BrimstoneCragTiles = 0;
AstralTiles = 0;
SunkenSeaTiles = 0;
SunkenSeaShoresTiles = 0;
SunkenSeaPolypTiles = 0;
SunkenSeaReefsTiles = 0;
SunkenSeaBurrowsTiles = 0;
SulphurTiles = 0;
AbyssTiles = 0;
ArsenalLabTiles = 0;
@@ -44,7 +52,11 @@ namespace CalamityMod.Systems
public override void TileCountsAvailable(ReadOnlySpan<int> tileCounts)
{
BrimstoneCragTiles = tileCounts[ModContent.TileType<InfernalSuevite>()] + tileCounts[ModContent.TileType<BrimstoneSlag>()];
SunkenSeaTiles = tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()] + tileCounts[ModContent.TileType<RuneSand>()] + + tileCounts[ModContent.TileType<Runestone>()];
SunkenSeaTiles = tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<HardenedEutrophicSand>()] + tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()] + tileCounts[ModContent.TileType<RuneSand>()] + + tileCounts[ModContent.TileType<Runestone>()];
SunkenSeaShoresTiles = tileCounts[ModContent.TileType<Runestone>()] + + tileCounts[ModContent.TileType<RuneSand>()];
SunkenSeaPolypTiles = tileCounts[ModContent.TileType<Limestone>()] + tileCounts[ModContent.TileType<PolypSand>()];
SunkenSeaReefsTiles = tileCounts[ModContent.TileType<Shellstone>()] + tileCounts[ModContent.TileType<EutrophicSand>()];
SunkenSeaBurrowsTiles = tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<HardenedEutrophicSand>()];
AbyssTiles = tileCounts[ModContent.TileType<AbyssGravel>()] + tileCounts[ModContent.TileType<Voidstone>()];
SulphurTiles = tileCounts[ModContent.TileType<SulphurousSand>()] + tileCounts[ModContent.TileType<SulphurousSandstone>()] + tileCounts[ModContent.TileType<HardenedSulphurousSandstone>()];
ArsenalLabTiles = tileCounts[ModContent.TileType<LaboratoryPanels>()] + tileCounts[ModContent.TileType<LaboratoryPlating>()] + tileCounts[ModContent.TileType<HazardChevronPanels>()];
+20
View File
@@ -35,6 +35,26 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<AbyssGravel>() || type == ModContent.TileType<PlantyMush>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = -16;
@@ -34,6 +34,26 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<SulphurousShale>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = -30;
@@ -35,6 +35,26 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<Voidstone>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = -30;
+20
View File
@@ -33,6 +33,26 @@ namespace CalamityMod.Tiles.Astral
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<AstralGrass>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = 2;
+20
View File
@@ -37,6 +37,26 @@ namespace CalamityMod.Tiles.Astral
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<AstralGrass>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void DropCritterChance(int i, int j, ref int wormChance, ref int grassHopperChance, ref int jungleGrubChance)
{
if (NPC.CountNPCS(NPCID.EnchantedNightcrawler) < 5 && Main.rand.NextBool(200))
+20
View File
@@ -34,6 +34,26 @@ namespace CalamityMod.Tiles.Crags
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<ScorchedRemainsGrass>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = -30;
+20
View File
@@ -36,6 +36,26 @@ namespace CalamityMod.Tiles.Crags
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<ScorchedRemainsGrass>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = -128;
-5
View File
@@ -24,11 +24,6 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
base.SetStaticDefaults();
}
public override void NearbyEffects(int i, int j, bool closer)
{
Main.SceneMetrics.ActiveFountainColor = ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater").Slot;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
+20
View File
@@ -29,6 +29,26 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
base.SetStaticDefaults();
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
Tile tileBelow = Framing.GetTileSafely(i, j + 1);
int type = -1;
if (tileBelow.HasTile)
{
type = tileBelow.TileType;
}
if (type == ModContent.TileType<EutrophicSand>())
{
return true;
}
WorldGen.KillTile(i, j);
return true;
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = 0;
+33
View File
@@ -0,0 +1,33 @@
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class BasaltGullyWater : ModWaterStyle
{
public static int Type;
public override void SetStaticDefaults()
{
Type = Slot;
}
public override int ChooseWaterfallStyle()
{
return ModContent.Find<ModWaterfallStyle>("CalamityMod/BasaltGullyWaterflow").Slot;
}
public override int GetSplashDust()
{
return 33;
}
public override int GetDropletGore()
{
return 713;
}
public override Color BiomeHairColor()
{
return Color.DarkGray;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

@@ -1,8 +1,8 @@
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaWaterflow : ModWaterfallStyle
public class BasaltGullyWaterflow : ModWaterfallStyle
{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -3,7 +3,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaWater : ModWaterStyle
public class SunkenSeaBurrowsWater : ModWaterStyle
{
public static int Type;
public override void SetStaticDefaults()
@@ -12,7 +12,7 @@ namespace CalamityMod.Waters
}
public override int ChooseWaterfallStyle()
{
return ModContent.Find<ModWaterfallStyle>("CalamityMod/SunkenSeaWaterflow").Slot;
return ModContent.Find<ModWaterfallStyle>("CalamityMod/SunkenSeaBurrowsWaterflow").Slot;
}
public override int GetSplashDust()
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

+8
View File
@@ -0,0 +1,8 @@
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaBurrowsWaterflow : ModWaterfallStyle
{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+33
View File
@@ -0,0 +1,33 @@
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaPolypWater : ModWaterStyle
{
public static int Type;
public override void SetStaticDefaults()
{
Type = Slot;
}
public override int ChooseWaterfallStyle()
{
return ModContent.Find<ModWaterfallStyle>("CalamityMod/SunkenSeaPolypWaterflow").Slot;
}
public override int GetSplashDust()
{
return 33;
}
public override int GetDropletGore()
{
return 713;
}
public override Color BiomeHairColor()
{
return Color.Coral;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

+8
View File
@@ -0,0 +1,8 @@
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaPolypWaterflow : ModWaterfallStyle
{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+33
View File
@@ -0,0 +1,33 @@
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaReefsWater : ModWaterStyle
{
public static int Type;
public override void SetStaticDefaults()
{
Type = Slot;
}
public override int ChooseWaterfallStyle()
{
return ModContent.Find<ModWaterfallStyle>("CalamityMod/SunkenSeaReefsWaterflow").Slot;
}
public override int GetSplashDust()
{
return 33;
}
public override int GetDropletGore()
{
return 713;
}
public override Color BiomeHairColor()
{
return Color.SkyBlue;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

+8
View File
@@ -0,0 +1,8 @@
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaReefsWaterflow : ModWaterfallStyle
{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+33
View File
@@ -0,0 +1,33 @@
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaShoresWater : ModWaterStyle
{
public static int Type;
public override void SetStaticDefaults()
{
Type = Slot;
}
public override int ChooseWaterfallStyle()
{
return ModContent.Find<ModWaterfallStyle>("CalamityMod/SunkenSeaShoresWaterflow").Slot;
}
public override int GetSplashDust()
{
return 33;
}
public override int GetDropletGore()
{
return 713;
}
public override Color BiomeHairColor()
{
return Color.OrangeRed;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

+8
View File
@@ -0,0 +1,8 @@
using Terraria.ModLoader;
namespace CalamityMod.Waters
{
public class SunkenSeaShoresWaterflow : ModWaterfallStyle
{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

+67 -64
View File
@@ -211,9 +211,10 @@ namespace CalamityMod.World
public static void SulphurSeaGenerationAfterAbyss()
{
CreateBeachAndReef();
CreateBeach();
ClearOutStrayTiles();
ClearAloneTiles();
PlaceSulphurReef();
var scrapPilePositions = PlaceScrapPiles();
GenerateColumnsInCaverns();
GenerateHardenedSandstone();
@@ -670,7 +671,71 @@ namespace CalamityMod.World
}
}
public static void CreateBeachAndReef()
public static void PlaceSulphurReef()
{
int beachWidth = WorldGen.genRand.Next(150, 190 + 1);
int x = GetActualX(BiomeWidth - 10);
float xRatio = Utils.GetLerpValue(BiomeWidth - 10, BiomeWidth + beachWidth, x, true);
int depth = (int)(Math.Sin((1f - xRatio) * MathHelper.PiOver2) * BeachMaxDepth + 1f);
int cavePerlinSeed = WorldGen.genRand.Next();
int cavePerlinSeedWalls = WorldGen.genRand.Next();
Point origin = new Point(x + (x < Main.maxTilesX / 2 ? -100 : 100), (int)Main.worldSurface + 20);
Vector2 center = origin.ToVector2() * 16f + new Vector2(8f);
float angle = MathHelper.Pi * 0.15f;
float otherAngle = MathHelper.PiOver2 - angle;
int distanceInTiles = 120 + (Main.maxTilesX - 4200) / 4200 * 200;
float distance = distanceInTiles * 16f;
float constant = distance * 2f / (float)Math.Sin(angle);
float fociSpacing = distance * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle);
int verticalRadius = (int)(constant / 16f);
Vector2 fociOffset = Vector2.UnitY * fociSpacing;
Vector2 topFoci = center - fociOffset;
Vector2 bottomFoci = center + fociOffset;
//first, place a basalt barrier around where the biome will be
for (int X = origin.X - distanceInTiles - 3; X <= origin.X + distanceInTiles + 3; X++)
{
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
{
if (CheckReefsCircle(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist))
{
//clear absolutely everything before generating the caverns
Main.tile[X, Y].ClearEverything();
//generate perlin noise caves
float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 20f, Y / 20f, 5, unchecked(cavePerlinSeed + 1)) * 0.01f;
float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 350f, Y / 600f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise;
float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 350f, Y / 600f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f;
float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f;
float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f;
//kill or place tiles depending on the noise map
if (caveNoiseMap * caveNoiseMap > caveCreationThreshold)
{
WorldGen.KillTile(X, Y);
}
else
{
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<SulphurousSand>());
}
Main.tile[X, Y].WallType = (ushort)ModContent.WallType<SulphurousSandWall>();
WorldGen.PlaceWall(X, Y, ModContent.WallType<SulphurousSandWall>());
Main.tile[X, Y].Get<LiquidData>().LiquidType = LiquidID.Water;
Main.tile[X, Y].LiquidAmount = byte.MaxValue;
}
}
}
}
public static void CreateBeach()
{
int beachWidth = WorldGen.genRand.Next(150, 190 + 1);
var searchCondition = Searches.Chain(new Searches.Down(3000), new Conditions.IsSolid());
@@ -696,68 +761,6 @@ namespace CalamityMod.World
int depth = (int)(Math.Sin((1f - xRatio) * MathHelper.PiOver2) * BeachMaxDepth + 1f);
for (int y = YStart - 50; y < YStart + depth; y++)
{
/*
//place sulphur reef, disabled for now
if (i == BiomeWidth - 10 && y == YStart + depth - 1)
{
int cavePerlinSeed = WorldGen.genRand.Next();
int cavePerlinSeedWalls = WorldGen.genRand.Next();
Point origin = new Point(i + (i < Main.maxTilesX / 2 ? -70 : 70), (int)GenVars.worldSurfaceLow);
Vector2 center = origin.ToVector2() * 16f + new Vector2(8f);
float angle = MathHelper.Pi * 0.15f;
float otherAngle = MathHelper.PiOver2 - angle;
int distanceInTiles = 100 + (Main.maxTilesX - 4200) / 4200 * 200;
float distance = distanceInTiles * 16f;
float constant = distance * 2f / (float)Math.Sin(angle);
float fociSpacing = distance * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle);
int verticalRadius = (int)(constant / 16f);
Vector2 fociOffset = Vector2.UnitY * fociSpacing;
Vector2 topFoci = center - fociOffset;
Vector2 bottomFoci = center + fociOffset;
//first, place a basalt barrier around where the biome will be
for (int X = origin.X - distanceInTiles - 3; X <= origin.X + distanceInTiles + 3; X++)
{
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
{
if (CheckReefsCircle(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist))
{
//clear absolutely everything before generating the caverns
Main.tile[X, Y].ClearEverything();
//generate perlin noise caves
float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 20f, Y / 20f, 5, unchecked(cavePerlinSeed + 1)) * 0.01f;
float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 350f, Y / 600f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise;
float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 350f, Y / 600f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f;
float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f;
float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f;
//kill or place tiles depending on the noise map
if (caveNoiseMap * caveNoiseMap > caveCreationThreshold)
{
WorldGen.KillTile(X, Y);
}
else
{
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<SulphurousSand>());
}
Main.tile[X, Y].WallType = (ushort)ModContent.WallType<SulphurousSandWall>();
WorldGen.PlaceWall(X, Y, ModContent.WallType<SulphurousSandWall>());
Main.tile[X, Y].Get<LiquidData>().LiquidType = LiquidID.Water;
Main.tile[X, Y].LiquidAmount = byte.MaxValue;
}
}
}
}
*/
Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(x, y);
if (tileAtPosition.HasTile && ValidBeachDestroyTiles.Contains(tileAtPosition.TileType))
{