Astral Infection Polish

This commit is contained in:
Heart-Plus-Up committed 2023-02-26 18:58:06 -07:00
1 parent 3a8406a8d0
commit 391cb97093
30 files changed
+887 -28

No files matched your search

+3 -3
View File
@@ -4,14 +4,14 @@ namespace CalamityMod.Backgrounds
{
public class AstralDesertSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralDesertSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle");
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/AstralDesertSurfaceClose");
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
+3 -3
View File
@@ -4,11 +4,11 @@ namespace CalamityMod.Backgrounds
{
public class AstralSnowSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSnowSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle");
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/AstralSurfaceClose");
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)
{
+3 -3
View File
@@ -4,14 +4,14 @@ namespace CalamityMod.Backgrounds
{
public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceMiddle");
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/AstralSurfaceClose");
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
+12 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
@@ -28,7 +29,17 @@ namespace CalamityMod.BiomeManagers
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", 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");
}
}
}
}
}
+12 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
@@ -26,7 +27,17 @@ namespace CalamityMod.BiomeManagers
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", 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");
}
}
}
}
+41
View File
@@ -96,7 +96,27 @@ namespace CalamityMod
public static Asset<Texture2D> rainOriginal;
public static Asset<Texture2D> manaOriginal;
public static Asset<Texture2D> carpetOriginal;
//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;
@@ -275,7 +295,26 @@ namespace CalamityMod
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;
@@ -322,6 +361,8 @@ namespace CalamityMod
SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky();
SkyManager.Instance["CalamityMod:Astral"] = new AstralSky();
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();
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+174 -4
View File
@@ -1,6 +1,8 @@
using Microsoft.Xna.Framework;
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;
@@ -14,7 +16,7 @@ namespace CalamityMod.Skies
public override void Deactivate(params object[] args)
{
skyActive = Main.LocalPlayer.Calamity().ZoneAstral;
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow;
}
public override void Reset()
@@ -31,18 +33,23 @@ namespace CalamityMod.Skies
{
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)
{
if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f)
{
spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.ColorOfTheSkies * opacity);
spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity);
//Terraria's conditions.
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
@@ -51,8 +58,74 @@ namespace CalamityMod.Skies
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 800f);
float posX = star.position.X * (Main.screenWidth / 500f);
float posY = star.position.Y * (Main.screenHeight / 600f);
Color astralcyan = new Color(100, 183, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), astralcyan * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) - 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.2f, t2D.Height * 0.2f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 600f);
float posY = star.position.Y * (Main.screenHeight / 800f);
Color purple = new Color(201, 148, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), purple * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) + 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.8f, t2D.Height * 0.8f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 200f);
float posY = star.position.Y * (Main.screenHeight / 900f);
Color yellow = new Color(255, 146, 73);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), yellow * star.twinkle * 0.952f * opacity, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 1000f);
float posY = star.position.Y * (Main.screenHeight / 200f);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
@@ -60,6 +133,103 @@ namespace CalamityMod.Skies
}
}
}
//Background from here starting from the back layer to the front layer
if (maxDepth >= 9f && minDepth < 9f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
float scale = 2.0f;
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
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, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceFar;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceMiddle;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceMiddleGlow;
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(textureglow, pos - texture.Size() / 2f * scale, null, Color.White * 0.5f * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceClose;
float scale = 2.0f;
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
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, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow;
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(textureglow, pos - texture.Size() / 2f * scale, null, Color.White * 0.7f * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 5f && minDepth < 5f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceFront;
float scale = 2.0f;
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
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, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow;
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(textureglow, pos - texture.Size() / 2f * scale, null, Color.White * 0.9f * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
}
public override void Update(GameTime gameTime)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 400 KiB

+219
View File
@@ -0,0 +1,219 @@
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;
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)
{
if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f)
{
spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity);
//Terraria's conditions.
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 500f);
float posY = star.position.Y * (Main.screenHeight / 600f);
Color astralcyan = new Color(100, 183, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), astralcyan * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) - 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.2f, t2D.Height * 0.2f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 600f);
float posY = star.position.Y * (Main.screenHeight / 800f);
Color purple = new Color(201, 148, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), purple * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) + 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.8f, t2D.Height * 0.8f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 200f);
float posY = star.position.Y * (Main.screenHeight / 900f);
Color yellow = new Color(255, 146, 73);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), yellow * star.twinkle * 0.952f * opacity, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 1000f);
float posY = star.position.Y * (Main.screenHeight / 200f);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), Color.White * star.twinkle * 0.952f * opacity, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
}
}
}
//Background from here starting from the back layer to the front layer
if (maxDepth >= 9f && minDepth < 9f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
float scale = 2.0f;
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
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, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceFar;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceMiddle;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralDesertSurfaceClose;
float scale = 2.0f;
int x = (int)(Main.screenPosition.X * 1.0f * 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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(63, 51, 90, 255) * opacity, 0f, new Vector2(0f, 0f), 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;
}
}
}
+248
View File
@@ -0,0 +1,248 @@
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;
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)
{
if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f)
{
spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity);
//Terraria's conditions.
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 500f);
float posY = star.position.Y * (Main.screenHeight / 600f);
Color astralcyan = new Color(100, 183, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), astralcyan * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) - 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.2f, t2D.Height * 0.2f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 600f);
float posY = star.position.Y * (Main.screenHeight / 800f);
Color purple = new Color(201, 148, 255);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), purple * star.twinkle * 0.952f * opacity, star.rotation, origin, (star.scale * star.twinkle) + 0.2f, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.8f, t2D.Height * 0.8f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 200f);
float posY = star.position.Y * (Main.screenHeight / 900f);
Color yellow = new Color(255, 146, 73);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), yellow * star.twinkle * 0.952f * opacity, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
}
}
if (Main.netMode != NetmodeID.Server)
{
for (int i = 0; i < Main.star.Length; i++)
{
Star star = Main.star[i];
if (star == null)
continue;
Texture2D t2D = TextureAssets.Star[star.type].Value;
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
float posX = star.position.X * (Main.screenWidth / 1000f);
float posY = star.position.Y * (Main.screenHeight / 200f);
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), Color.White * star.twinkle * 0.952f * opacity, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
}
}
}
//Background from here starting from the back layer to the front layer
if (maxDepth >= 9f && minDepth < 9f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceHorizon;
float scale = 2.0f;
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
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, new Color(116, 96, 164, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 8f && minDepth < 8f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceFar;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(116, 96, 164, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 7f && minDepth < 7f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSnowSurfaceMiddle;
float scale = 2.0f;
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(Main.screenWidth / 2f - x + texture.Width * k * scale, Main.screenHeight / 2f - y);
spriteBatch.Draw(texture, pos - texture.Size() / 2f * scale, null, new Color(116, 96, 164, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 6f && minDepth < 6f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceClose;
float scale = 2.0f;
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
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, new Color(116, 96, 164, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow;
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(textureglow, pos - texture.Size() / 2f * scale, null, Color.White * 0.7f * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
}
if (maxDepth >= 5f && minDepth < 5f)
{
float screenParralaxMultiplier = 0.4f;
Texture2D texture = CalamityMod.AstralSurfaceFront;
float scale = 2.0f;
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
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, new Color(116, 96, 164, 255) * opacity, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f);
}
Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow;
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(textureglow, pos - texture.Size() / 2f * scale, null, Color.White * 0.9f * opacity, 0f, new Vector2(0f, 0f), 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;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

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: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

+129
View File
@@ -35,11 +35,140 @@ namespace CalamityMod.Tiles.Astral
TileID.Sets.NeedsGrassFramingDirt[Type] = ModContent.TileType<AstralDirt>();
TileID.Sets.CanBeDugByShovel[Type] = true;
}
int animationFrameWidth = 288;
public override void NumDust(int i, int j, bool fail, ref int Type)
{
Type = fail ? 1 : 3;
}
public override void RandomUpdate(int i, int j)
{
Tile tile = Main.tile[i, j];
Tile up = Main.tile[i, j - 1];
Tile up2 = Main.tile[i, j - 2];
//place Astral Wild Grass
if (WorldGen.genRand.Next(10) == 0 && !up.HasTile && !up2.HasTile && !(up.LiquidAmount > 0 && up2.LiquidAmount > 0) && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
{
up.TileType = (ushort)ModContent.TileType<AstralTallPlants>();
up.HasTile = true;
up.TileFrameY = 0;
//20 different frames, choose a random one
up.TileFrameX = (short)(WorldGen.genRand.Next(20) * 18);
WorldGen.SquareTileFrame(i, j - 1, true);
if (Main.netMode == NetmodeID.Server)
{
NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
}
}
//place Astral Short Grass
if (WorldGen.genRand.Next(10) == 0 && !up.HasTile && !up2.HasTile && !(up.LiquidAmount > 0 && up2.LiquidAmount > 0) && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
{
up.TileType = (ushort)ModContent.TileType<AstralShortPlants>();
up.HasTile = true;
up.TileFrameY = 0;
//23 different frames, choose a random one
up.TileFrameX = (short)(WorldGen.genRand.Next(23) * 18);
WorldGen.SquareTileFrame(i, j - 1, true);
if (Main.netMode == NetmodeID.Server)
{
NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
}
}
}
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
{
int uniqueAnimationFrameX = 0;
int xPos = i % 4;
int yPos = j % 4;
switch (xPos)
{
case 0:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 0;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 1;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 1:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 1;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 1;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 2:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 1;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 0;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 3:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 0;
break;
case 1:
uniqueAnimationFrameX = 1;
break;
case 2:
uniqueAnimationFrameX = 0;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
}
frameXOffset = uniqueAnimationFrameX * animationFrameWidth;
}
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB

+15 -4
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using System;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -43,9 +44,19 @@ namespace CalamityMod.Tiles.Astral
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = Main.DiscoR / 255f * 0.5f;
g = 0.5f;
b = (255 - Main.DiscoR) / 255f * 0.5f;
float brightness = 0.9f;
brightness += 0.2f;
brightness = MathHelper.Clamp(brightness, 0.5f, 0.9f);
Color orange = new Color(237, 93, 83);
Color cyan = new Color(66, 189, 181);
Color value = Color.Lerp(orange, cyan, (MathF.Sin(j / 30f + Main.GameUpdateCount * 0.017f + -i / 40f) + 1f) / 2f);
Color value1 = Color.Lerp(orange, cyan, (MathF.Sin((-j - 100) / 40f + Main.GameUpdateCount * 0.014f + i / 20f) + 1f) / 2f);
r = (value.R + value1.R) / 600f;
g = (value.G + value1.G) / 600f;
b = (value.B + value1.B) / 600f;
r *= brightness;
g *= brightness;
b *= brightness;
}
}
}
+9 -8
View File
@@ -75,15 +75,16 @@ namespace CalamityMod.Tiles.Ores
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
float brightness = 0.7f;
brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.007f);
brightness *= (float)MathF.Sin(-i / 40f + Main.GameUpdateCount * 0.005f);
brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.006f);
brightness *= (float)MathF.Sin(-i / 40f + Main.GameUpdateCount * 0.009f);
float brightness = 0.9f;
brightness += 0.5f;
r = Main.DiscoR / 255f * 0.5f;
g = 0.5f;
b = (255 - Main.DiscoR) / 255f * 0.5f;
brightness = MathHelper.Clamp(brightness, 0.5f, 0.9f);
Color orange = new Color(237, 93, 83);
Color cyan = new Color(66, 189, 181);
Color value = Color.Lerp(orange, cyan, (MathF.Sin(-j / 30f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
Color value1 = Color.Lerp(orange, cyan, (MathF.Sin((j - 100) / 40f + Main.GameUpdateCount * 0.014f + -i / 20f) + 1f) / 2f);
r = (value.R + value1.R) / 600f;
g = (value.G + value1.G) / 600f;
b = (value.B + value1.B) / 600f;
r *= brightness;
g *= brightness;
b *= brightness;
+18
View File
@@ -1,11 +1,15 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Walls
{
public class AstralGrassWall : ModWall
{
public static Vector2 TileAdj => (Lighting.Mode == Terraria.Graphics.Light.LightMode.Retro || Lighting.Mode == Terraria.Graphics.Light.LightMode.Trippy) ? Vector2.Zero : Vector2.One * 12;
/*public override bool Autoload(ref string name, ref string texture)
{
mod.AddWall("AstralGrassWallUnsafe", this, texture);
@@ -22,6 +26,20 @@ namespace CalamityMod.Walls
AddMapEntry(new Color(60, 48, 64));
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
if (i > Main.screenPosition.X / 16 && i < Main.screenPosition.X / 16 + Main.screenWidth / 16 && j > Main.screenPosition.Y / 16 && j < Main.screenPosition.Y / 16 + Main.screenHeight / 16)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Walls/AstralGrassWallLeaves").Value;
var rand = new Random(i + (j * 100000));
float offset = i * j % 6.28f + (float)rand.NextDouble() / 8f;
float sin = (float)Math.Sin(Main.GameUpdateCount / 45f + offset);
spriteBatch.Draw(tex, (new Vector2(i + 0.5f, j + 0.5f) + TileAdj) * 16 + new Vector2(1, 0.5f) * sin * 2.2f - Main.screenPosition,
new Rectangle(rand.Next(4) * 26, 0, 24, 24), Lighting.GetColor(i, j), offset + sin * 0.09f, new Vector2(12, 12), 1 + sin / 14f, 0, 0);
}
}
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

+1 -1
View File
@@ -569,7 +569,7 @@ namespace CalamityMod.World
WorldGen.SquareWallFrame(x, y, true);
NetMessage.SendTileSquare(-1, x, y, 1);
break;
case WallID.LivingWood:
case WallID.LivingWoodUnsafe:
Main.tile[x, y].WallType = (ushort)ModContent.WallType<AstralMonolithWall>();
WorldGen.SquareWallFrame(x, y, true);
NetMessage.SendTileSquare(-1, x, y, 1);