dust and map colour fixes, also moved branch coral to ambient folder and removed its debug item

+ extra cleanup in polyp sand file
This commit is contained in:
enamoured_ committed 2025-02-23 17:18:40 -06:00
1 parent 1804d91c13
commit 147e829038
12 files changed
+49 -261

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.SunkenSea
{
public class BranchCoral : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.BranchCoral>());
Item.rare = ItemRarityID.Blue;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

@@ -10,7 +10,7 @@ using Terraria.Enums;
using Terraria.ObjectData;
using CalamityMod.Items.Weapons.Melee;
namespace CalamityMod.Tiles.SunkenSea
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class BranchCoral : ModTile
{
@@ -23,13 +23,13 @@ namespace CalamityMod.Tiles.SunkenSea
Main.tileSpelunker[Type] = false;
HitSound = SoundID.Dig;
DustType = 67;
DustType = DustID.CrimsonPlants;
AddMapEntry(new Color(48, 201, 214));
AddMapEntry(new Color(210, 66, 90));
// Attach to ground
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleMultiplier = 32; // total 32 frames, all should be same "itemStyle"
TileObjectData.newTile.StyleWrapLimit = 8; // only 1 placement alternative per row
TileObjectData.newTile.RandomStyleRange = 8; // 8 different style will be selected upon placing
@@ -69,9 +69,5 @@ namespace CalamityMod.Tiles.SunkenSea
g = 122 / 500f;
b = 122 / 500f;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType<PrismShard>(), 4);
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

+2 -2
View File
@@ -18,8 +18,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.newTile.DrawYOffset = 2;
TileObjectData.addTile(Type);
AddMapEntry(new Color(233, 132, 58));
DustType = DustID.Coralstone;
AddMapEntry(new Color(48, 201, 214));
DustType = DustID.IceGolem;
base.SetStaticDefaults();
}
@@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2);
TileObjectData.addTile(Type);
AddMapEntry(new Color(187, 43, 44));
DustType = DustID.Grass;
DustType = DustID.CrimsonPlants;
HitSound = SoundID.Grass;
base.SetStaticDefaults();
+21 -6
View File
@@ -26,11 +26,16 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
DustType = 96;
AddMapEntry(new Color(156, 87, 57));
DustType = DustID.t_PearlWood;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 192f / 450f;
@@ -56,10 +61,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
DustType = 96;
AddMapEntry(new Color(156, 87, 57));
DustType = DustID.t_PearlWood;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 192f / 450f;
@@ -84,10 +94,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
DustType = 96;
AddMapEntry(new Color(156, 87, 57));
DustType = DustID.t_PearlWood;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 192f / 450f;
+17 -4
View File
@@ -26,10 +26,14 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
AddMapEntry(new Color(48, 201, 214));
DustType = 96;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 56f / 400f;
@@ -55,10 +59,14 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
AddMapEntry(new Color(48, 201, 214));
DustType = 96;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 56f / 400f;
@@ -83,10 +91,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
AddMapEntry(new Color(48, 201, 214));
DustType = 96;
HitSound = SoundID.Dig;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 56f / 400f;
@@ -111,7 +124,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.DrawYOffset = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(146, 123, 127));
AddMapEntry(new Color(48, 201, 214));
DustType = 96;
HitSound = SoundID.Dig;
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.CanBeDugByShovel[Type] = true;
DustType = 108;
DustType = DustID.Titanium;
AddMapEntry(new Color(158, 203, 234));
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.CanBeDugByShovel[Type] = true;
DustType = 108;
DustType = DustID.Titanium;
AddMapEntry(new Color(61, 151, 194));
this.RegisterUniversalMerge(ModContent.TileType<EutrophicSand>(), "CalamityMod/Tiles/Merges/EutrophicSandMerge");
+1 -216
View File
@@ -14,8 +14,6 @@ namespace CalamityMod.Tiles.SunkenSea
{
public class PolypSand : ModTile
{
private int extraFrameHeight = 36;
private int extraFrameWidth = 90;
public override void SetStaticDefaults()
{
TileID.Sets.GeneralPlacementTiles[Type] = false;
@@ -30,7 +28,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.CanBeDugByShovel[Type] = true;
DustType = 147;
DustType = DustID.Ice_Red;
AddMapEntry(new Color(221, 180, 182));
this.RegisterUniversalMerge(ModContent.TileType<Shellstone>(), "CalamityMod/Tiles/Merges/ShellstoneMerge");
@@ -43,223 +41,10 @@ namespace CalamityMod.Tiles.SunkenSea
{
num = fail ? 1 : 3;
}
//public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
//{
// if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type ||
// Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type)
// {
// try
// {
// Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j);
// }
// catch { }
// }
//}
private Color GetDrawColour(int i, int j)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
//public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch)
//{
// Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
// Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
// Color drawColour = GetDrawColour(i, j);
// Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass").Value;
// DrawExtraTop(i, j, leaves, drawOffset, drawColour);
// DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour);
// DrawExtraDrapes(i, j, leaves, drawOffset, drawColour);
//}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
}
//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 LongScarletSeagrass
// if (WorldGen.genRand.NextBool(1) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
// {
// up.TileType = (ushort)ModContent.TileType<LongScarletSeagrass>();
// up.HasTile = true;
// up.TileFrameY = 0;
// // 16 different frames, choose a random one
// up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18);
// WorldGen.SquareTileFrame(i, j - 1, true);
// if (Main.dedServ)
// NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
// }
//}
}
}
// #region 'Extra Drapes' Drawing
// private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour)
// {
// /*
// If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface
// */
// if (
// CheckTile(Type, false, 0, 1, i, j) ||
// (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// DrawExtraOverhang(i, j, extras, drawOffset, drawColour);
// }
// }
// private bool CheckTile(int type, bool equal, int x, int y, int i, int j)
// {
// //Subtract y so that y is vertical for ease of readability
// return Main.tile[i + x, j - y].TileType == type == equal;
// }
// private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour)
// {
// /*
// Ending the Extra when a wall is reached
// */
// //Left
// if (
// CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) &&
// (CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Right
// if (
// CheckTile(Type, true, -1, 0, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) &&
// (CheckTile(Type, true, 1, 1, i, j) || CheckTile(Type, false, 1, 0, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// }
// private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour)
// {
// /*
// Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached
// */
// //Left
// if (
// CheckTile(Type, false, -1, 0, i, j)
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Right
// if (
// CheckTile(Type, false, 1, 0, i, j)
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// }
// private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour)
// {
// /*
// Hanging 'drapes' of the extra element
// */
// //Base
// if (
// (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j)) ||
// (CheckTile(Type, true, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, true, -1, 1, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Left Wall
// if (
// CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) &&
// (CheckTile(Type, true, -1, 2, i, j) || CheckTile(Type, false, -1, 1, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Right Wall
// if (
// CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) &&
// (CheckTile(Type, true, 1, 2, i, j) || CheckTile(Type, false, 1, 1, i, j))
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Left Overhang
// if (
// CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j)
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// //Right Overhang
// if (
// CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, -1, 2, i, j)
// )
// {
// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// }
// }
// private int GetExtraState(string type)
// {
// switch (type)
// {
// case "middle":
// return 36;
// case "overhangLeft":
// return 18;
// case "overhangRight":
// return 54;
// case "wallEndLeft":
// return 0;
// case "wallEndRight":
// return 72;
// default:
// Main.NewText(type.ToString() + " is not a valid Extra sheet state");
// return 0;
// }
// }
// private int GetExtraPattern(int i)
// {
// return i % 3 * extraFrameHeight;
// }
// private int GetExtraVariant(int i, int j)
// {
// return Main.tile[i, j].TileFrameNumber * extraFrameWidth;
// }
// }
//}
//#endregion
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.SunkenSea
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.CanBeDugByShovel[Type] = true;
DustType = 147;
DustType = DustID.t_PearlWood;
AddMapEntry(new Color(117, 79, 97));
this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge");