All my homies hate the vanilla BG system

This commit is contained in:
Heart-Plus-Up committed 2023-02-16 12:53:50 -07:00
1 parent a7c3007db5
commit 7e900a55e5
5 files changed
+36 -4

No files matched your search

+2 -2
View File
@@ -6,8 +6,8 @@ namespace CalamityMod.Backgrounds
{
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
b -= 250f;
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SulphurSeaSurfaceClose");
b -= 100f;
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
+2
View File
@@ -99,6 +99,7 @@ namespace CalamityMod
public static Texture2D AstralSky;
public static Texture2D SulphurSeaSky;
public static Texture2D SulphurSeaSkyFront;
public static Texture2D SulphurSeaSurface;
// DR data structure
public static SortedDictionary<int, float> DRValues;
@@ -277,6 +278,7 @@ namespace CalamityMod
AstralSky = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value;
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);
+32 -2
View File
@@ -36,11 +36,41 @@ namespace CalamityMod.Skies
{
if (maxDepth >= 4f && minDepth < 4f)
{
spriteBatch.Draw(CalamityMod.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1200, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.White, 0.33f) * 0.4f * opacity);
spriteBatch.Draw(CalamityMod.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.White, 0.33f) * 0.2f * opacity);
}
//if (maxDepth >= 1f && minDepth < 1f)
//{
// spriteBatch.Draw(CalamityMod.SulphurSeaSkyFront, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.White, 0.33f) * 1.5f * opacity);
//}
if (maxDepth >= 1f && minDepth < 1f)
{
spriteBatch.Draw(CalamityMod.SulphurSeaSkyFront, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.White, 0.33f) * 1.5f * opacity);
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.SulphurSeaSkyFront;
float scale = 2.5f;
int x = (int)(Main.screenPosition.X * 1f * screenParralaxMultiplier);
x %= (int)(texture.Width * scale);
int y = (int)(Main.screenPosition.Y * 0.5f * screenParralaxMultiplier);
y -= 1800; //1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, Color.Lerp(Main.ColorOfTheSkies, Color.White, 0.33f) * 0.7f * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 3f && minDepth < 3f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.SulphurSeaSurface;
float scale = 2.5f;
int x = (int)(Main.screenPosition.X * 1f * screenParralaxMultiplier);
x %= (int)(texture.Width * scale);
int y = (int)(Main.screenPosition.Y * 0.5f * screenParralaxMultiplier);
y -= 1800; //1000
for (int k = -1; k <= 1; k++)
{
var pos = new Vector2(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, Main.ColorOfTheSkies, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB