Small Sea Prism, and other small stuff + fix to M Sea prism spawn
No files matched your search
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
@@ -21,6 +21,8 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
TileID.Sets.HasSlopeFrames[Type] = true;
|
||||
Main.tileMerge[Type][ModContent.TileType<MediumSeaPrismCrystal>()] = true;
|
||||
|
||||
Main.tileMerge[Type][ModContent.TileType<SeaPrismCrystals>()] = true;
|
||||
|
||||
CalamityUtils.MergeWithGeneral(Type);
|
||||
CalamityUtils.MergeWithDesert(Type);
|
||||
Main.tileLighted[Type] = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Placeables.SunkenSea;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
@@ -31,52 +32,51 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
var tile = Main.tile[i, j];
|
||||
bool lessLightDueToLowWater = tile.LiquidAmount > 50 && tile.LiquidType == LiquidID.Water;
|
||||
int xframe = tile.TileFrameX / 18;
|
||||
if (xframe > 7 && xframe < 14)
|
||||
{
|
||||
//Purple
|
||||
Color darkviolet = new Color(75, 54, 103);
|
||||
Color violet = new Color(231, 205, 245);
|
||||
Color value = Color.Lerp(darkviolet, violet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.037f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(darkviolet, violet, (MathF.Sin((j - 120) / 50f + Main.GameUpdateCount * 0.014f + -i / 30f) + 1f) / 2f);
|
||||
r = lessLightDueToLowWater ? 0.36f : 0.48f;
|
||||
g = lessLightDueToLowWater ? 0.315f : 0.42f;
|
||||
b = lessLightDueToLowWater ? 0.405f : 0.54f;
|
||||
r *= (value.R + value1.R) / 300f;
|
||||
g *= (value.G + value1.G) / 300f;
|
||||
b *= (value.B + value1.B) / 300f;
|
||||
|
||||
}
|
||||
else if (xframe >= 14)
|
||||
{
|
||||
//Green
|
||||
Color murkeygreen = new Color(28, 68, 54);
|
||||
Color lightgreen = new Color(166, 234, 198);
|
||||
Color value2 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.027f + i / 40f) + 1f) / 2f);
|
||||
Color value3 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin((j - 80) / 50f + Main.GameUpdateCount * 0.034f + -i / 30f) + 1f) / 2f);
|
||||
r = lessLightDueToLowWater ? 0.225f : 0.3f;
|
||||
g = lessLightDueToLowWater ? 0.405f : 0.54f;
|
||||
b = lessLightDueToLowWater ? 0.315f : 0.42f;
|
||||
r *= (value2.R + value3.R) / 300f;
|
||||
g *= (value2.G + value3.G) / 300f;
|
||||
b *= (value2.B + value3.B) / 300f;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Blue
|
||||
Color blue = new Color(67, 187, 204);
|
||||
Color darkviolet = new Color(18, 67, 116);
|
||||
Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 10) / 50f + Main.GameUpdateCount * 0.064f + -i / 30f) + 1f) / 2f);
|
||||
r = lessLightDueToLowWater ? 0.27f : 0.36f;
|
||||
g = lessLightDueToLowWater ? 0.405f : 0.54f;
|
||||
b = lessLightDueToLowWater ? 0.405f : 0.54f;
|
||||
r *= (value.R + value1.R) / 300f;
|
||||
g *= (value.G + value1.G) / 300f;
|
||||
b *= (value.B + value1.B) / 300f;
|
||||
}
|
||||
float fade1 = GetFade1(i, j);
|
||||
float fade2 = GetFade2(i, j);
|
||||
|
||||
Color baseColor = new Color(162, 216, 218); //Blue
|
||||
Color glow1 = new Color(171, 113, 215); //Purple
|
||||
Color glow2 = new Color(56, 174, 117); //Green
|
||||
|
||||
Vector3 blended = baseColor.ToVector3();
|
||||
|
||||
blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f);
|
||||
blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f);
|
||||
|
||||
float brightness = 0.6f;
|
||||
blended *= brightness;
|
||||
|
||||
r = blended.X;
|
||||
g = blended.Y;
|
||||
b = blended.Z;
|
||||
}
|
||||
|
||||
private static float GetFade1(int i, int j)
|
||||
{
|
||||
return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f;
|
||||
}
|
||||
|
||||
private static float GetFade2(int i, int j)
|
||||
{
|
||||
return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f;
|
||||
}
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen;
|
||||
|
||||
Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
|
||||
|
||||
Texture2D baseTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals").Value;
|
||||
spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f);
|
||||
|
||||
Texture2D tex1 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Purple").Value;
|
||||
Texture2D tex2 = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Green").Value;
|
||||
|
||||
spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j));
|
||||
spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j));
|
||||
}
|
||||
|
||||
public override bool CanPlace(int i, int j)
|
||||
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
@@ -21,7 +21,7 @@ namespace CalamityMod.Walls
|
||||
Main.wallHouse[Type] = true;
|
||||
DustType = 108;
|
||||
|
||||
AddMapEntry(new Color(11, 56, 81));
|
||||
AddMapEntry(new Color(27, 123, 131));
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace CalamityMod.Waters
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 2.48f / 4;
|
||||
g = 1.29f / 4;
|
||||
b = 0.48f / 4;
|
||||
r = 248f / 255;
|
||||
g = 73f / 255;
|
||||
b = 73f / 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1421,26 +1421,28 @@ namespace CalamityMod.World
|
||||
}
|
||||
if (Main.tile[X, Y].TileType == ModContent.TileType<SeaPrism>())
|
||||
{
|
||||
int RandStyle() => WorldGen.genRand.Next(8);
|
||||
int style = RandStyle();
|
||||
//Medium Sea Prism down
|
||||
if (WorldGen.genRand.NextBool(9))
|
||||
{
|
||||
ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType<MediumSeaPrismCrystal>() };
|
||||
WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 7);
|
||||
WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style);
|
||||
}
|
||||
if (WorldGen.genRand.NextBool(9))
|
||||
{
|
||||
ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType<MediumSeaPrismCrystal>() };
|
||||
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 5);
|
||||
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style);
|
||||
}
|
||||
if (WorldGen.genRand.NextBool(9))
|
||||
{
|
||||
ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType<MediumSeaPrismCrystal>() };
|
||||
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 4);
|
||||
WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style);
|
||||
}
|
||||
if (WorldGen.genRand.NextBool(9))
|
||||
{
|
||||
ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType<MediumSeaPrismCrystal>() };
|
||||
WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 2);
|
||||
WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style);
|
||||
}
|
||||
}
|
||||
if (Main.tile[X, Y].TileType == ModContent.TileType<Navystone>())
|
||||
|
||||