Wall flowers and piles tile tweaks

This commit is contained in:
Heart-Plus-Up committed 2025-09-23 16:22:19 -07:00
1 parent c66d71006e
commit 6218083e5f
26 files changed
+381 -11

No files matched your search

@@ -0,0 +1,68 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class LargeShoresFlower : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileLighted[Type] = true;
TileID.Sets.FramesOnKillWall[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall);
TileObjectData.newTile.Width = 3;
TileObjectData.newTile.Height = 3;
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 };
TileObjectData.newTile.Origin = new Point16(1, 1);
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleWrapLimit = 3;
TileObjectData.newTile.RandomStyleRange = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(20, 100, 220));
DustType = DustID.MagicMirror;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
float pulse = 0.95f + 0.15f * (0.5f + 0.5f * (float)System.Math.Sin(Main.GlobalTimeWrappedHourly * 4.2f));
r = 0.1f * pulse;
g = 0.3f * pulse;
b = 0.8f * pulse;
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
if (Main.tile[i, j].IsTileActuallyInvisible())
return;
float pulse = 0.95f + 0.15f * (float)System.Math.Sin(Main.GlobalTimeWrappedHourly * 4.2f);
int xFrameOffset = Main.tile[i, j].TileFrameX;
int yFrameOffset = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/Ambient/LargeShoresFlower").Value;
Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest;
Color drawColour = Color.White * pulse;
Tile trackTile = Main.tile[i, j];
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
else if (trackTile.IsHalfBlock)
spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/Ambient/LargeShoresFlower_Center").Value, i, j, 2);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

@@ -0,0 +1,42 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class MediumDunesandPile : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileSolid[Type] = false;
Main.tileLighted[Type] = true;
Main.tileNoFail[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileWaterDeath[Type] = false;
TileObjectData.newTile.Width = 2;
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.Origin = new Point16(2, 2);
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 };
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleWrapLimit = 3;
TileObjectData.newTile.RandomStyleRange = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(185, 104, 80));
DustType = DustID.BlueMoss;
HitSound = SoundID.Dig;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

@@ -0,0 +1,42 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class MediumShorePile : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileSolid[Type] = false;
Main.tileLighted[Type] = true;
Main.tileNoFail[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileWaterDeath[Type] = false;
TileObjectData.newTile.Width = 2;
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.Origin = new Point16(2, 2);
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 };
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
TileObjectData.newTile.CoordinateWidth = 16;
TileObjectData.newTile.CoordinatePadding = 2;
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleWrapLimit = 3;
TileObjectData.newTile.RandomStyleRange = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(158, 129, 177));
DustType = DustID.BlueMoss;
HitSound = SoundID.Dig;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B

+45
View File
@@ -0,0 +1,45 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Microsoft.Xna.Framework;
using Terraria.GameContent;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class ShorePileBase : ModTile
{
public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/ShorePile";
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoFail[Type] = true;
Main.tileObsidianKill[Type] = true;
DustType = DustID.Stone;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
TileObjectData.newTile.DrawYOffset = 2;
TileObjectData.addTile(Type);
AddMapEntry(new Color(189, 120, 94));
DustType = 96;
HitSound = SoundID.Dig;
}
}
public class ShorePile : ShorePileBase
{
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
TileID.Sets.BreakableWhenPlacing[Type] = true;
TileID.Sets.ReplaceTileBreakUp[Type] = true;
TileObjectData.GetTileData(Type, 0).LavaDeath = false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+75
View File
@@ -0,0 +1,75 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class ShoresFlower : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileLighted[Type] = true;
TileID.Sets.FramesOnKillWall[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.newTile.Width = 2;
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 };
TileObjectData.newTile.AnchorWall = true;
TileObjectData.newTile.AnchorTop = AnchorData.Empty;
TileObjectData.newTile.AnchorBottom = AnchorData.Empty;
TileObjectData.newTile.AnchorLeft = AnchorData.Empty;
TileObjectData.newTile.AnchorRight = AnchorData.Empty;
TileObjectData.newTile.Origin = new Point16(1, 1);
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.StyleWrapLimit = 3;
TileObjectData.newTile.RandomStyleRange = 3;
TileObjectData.addTile(Type);
AddMapEntry(new Color(20, 100, 220));
DustType = DustID.MagicMirror;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
float pulse = 0.95f + 0.15f * (0.5f + 0.5f * (float)System.Math.Sin(Main.GlobalTimeWrappedHourly * 4.2f));
r = 0.1f * pulse;
g = 0.3f * pulse;
b = 0.8f * pulse;
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
if (Main.tile[i, j].IsTileActuallyInvisible())
return;
float pulse = 0.95f + 0.15f * ((float)System.Math.Sin(Main.GlobalTimeWrappedHourly * 4.2f));
int xFrameOffset = Main.tile[i, j].TileFrameX;
int yFrameOffset = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/Ambient/ShoresFlower").Value;
Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest;
Color drawColour = Color.White * pulse;
Tile trackTile = Main.tile[i, j];
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
else if (trackTile.IsHalfBlock)
spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/Ambient/ShoresFlower_Center").Value, i, j, 2);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

@@ -0,0 +1,45 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Microsoft.Xna.Framework;
using Terraria.GameContent;
namespace CalamityMod.Tiles.SunkenSea.Ambient
{
public class SmallLimestoneCobblePileBase : ModTile
{
public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/SmallLimestoneCobblePile";
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoFail[Type] = true;
Main.tileObsidianKill[Type] = true;
DustType = DustID.Stone;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1);
TileObjectData.newTile.DrawYOffset = 2;
TileObjectData.addTile(Type);
AddMapEntry(new Color(174, 120, 91));
DustType = 96;
HitSound = SoundID.Dig;
}
}
public class SmallLimestoneCobblePile : SmallLimestoneCobblePileBase
{
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
TileID.Sets.BreakableWhenPlacing[Type] = true;
TileID.Sets.ReplaceTileBreakUp[Type] = true;
TileObjectData.GetTileData(Type, 0).LavaDeath = false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Waters
public class SunkenSeaShoresWater : CalamityModWaterStyle
{
private readonly Vector3 WaterGlowColor = new Color(140, 222, 239).ToVector3();
private readonly Vector3 WaterGlowColor = new Color(82, 223, 255).ToVector3();
public static int Type { get; private set; }
public static CalamityModWaterStyle Instance { get; private set; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

+63 -10
View File
@@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Reflection.Metadata;
using System.Threading.Tasks;
using Terraria.ObjectData;
using CalamityMod.Tiles.SunkenSea;
using CalamityMod.Tiles.SunkenSea.Ambient;
using CalamityMod.Utilities;
@@ -336,6 +337,33 @@ namespace CalamityMod.World
}
});
// places wall flowers in the curved cavity inside the timeless shores. This is done here to prevent them from appearing in the transiton area
ParallelFor(startX - biomeSize + 10, startX + biomeSize - 10, 1, (X) =>
{
int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 20, startX + biomeSize - 200, X, true)));
int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 17, startX - biomeSize + 200, X, true)));
for (int Y = startY - 60 + curveDepth + curveDepth2; Y <= startY + 30; Y++)
{
int Rand3() => WorldGen.genRand.Next(3);
int ShoresFlowerVariants = Rand3();
if (Main.tile[X, Y].WallType == ModContent.WallType<UnsafeRunestoneWall>() && WorldGen.EmptyTileCheck(X - 1, Y - 1, 3, 3))
{
if (WorldGen.genRand.NextBool(60))
{
WorldGen.PlaceObject(X - 1, Y - 1, ModContent.TileType<LargeShoresFlower>(), mute: true, style: ShoresFlowerVariants);
}
}
if (Main.tile[X, Y].WallType == ModContent.WallType<UnsafeRunestoneWall>() && WorldGen.EmptyTileCheck(X - 1, Y - 1, 2, 2))
{
if (WorldGen.genRand.NextBool(60))
WorldGen.PlaceObject(X - 1, Y - 1, ModContent.TileType<ShoresFlower>(), mute: true, style: ShoresFlowerVariants);
}
}
});
//
// Makes the transition area to the Timeless Shores.
// Replaces tiles, walls, and places some water spots.
@@ -359,7 +387,7 @@ namespace CalamityMod.World
WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles(TileID.HardenedSand, TileID.Sand),
new Modifiers.OnlyTiles(TileID.HardenedSand, TileID.Sand,TileID.Copper,TileID.Tin, TileID.Iron, TileID.Lead),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<AridSoil>()),
new Actions.PlaceWall((ushort)ModContent.WallType<UnsafeRunestoneWall>())
@@ -367,7 +395,7 @@ namespace CalamityMod.World
WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[]
{
new Modifiers.OnlyTiles(TileID.DesertFossil),
new Modifiers.OnlyTiles(TileID.DesertFossil,TileID.Tungsten,TileID.Silver,TileID.Gold,TileID.Platinum,TileID.Demonite,TileID.Crimtane),
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<Mire>()),
new Actions.PlaceWall((ushort)ModContent.WallType<UnsafeRunestoneWall>())
@@ -1666,21 +1694,38 @@ namespace CalamityMod.World
//Timeless Shores ambiant tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<Dunesand>())
{
int Rand3() => WorldGen.genRand.Next(3);
int MediumShorePileVariants = Rand3();
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
int Rand9() => WorldGen.genRand.Next(9);
int ShorePileVariants = Rand9();
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(60))
if (WorldGen.genRand.NextBool(100))
{
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<DriftwoodMast>(), true, DriftwoodVariants);
}
if (WorldGen.genRand.NextBool(30))
if (WorldGen.genRand.NextBool(100))
{;
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<DriftwoodScraps>(), true, DriftwoodVariants);
}
if (WorldGen.genRand.NextBool(30))
if (WorldGen.genRand.NextBool(100))
{
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<LargeDriftwoodWreckage>(), true, DriftwoodVariants);
}
//Shore piles
if (WorldGen.genRand.NextBool(30))
{
WorldGen.PlaceTile(X, Y - 1, ModContent.TileType<ShorePile>(), mute: true, style: ShorePileVariants);
}
if (WorldGen.genRand.NextBool(30))
{
WorldGen.PlaceTile(X, Y - 1, ModContent.TileType<MediumShorePile>(), mute: true, style: MediumShorePileVariants);
}
if (WorldGen.genRand.NextBool(30))
{
WorldGen.PlaceTile(X, Y - 1, ModContent.TileType<MediumDunesandPile>(), mute: true, style: MediumShorePileVariants);
}
}
@@ -1690,7 +1735,7 @@ namespace CalamityMod.World
if (Y > 0)
{
Tile above = Main.tile[X, Y - 1];
// only if it's open air (no solid tile), and we don't overwrite other special liquids other than lava (just incase)
if (!above.HasTile &&
above.Get<LiquidData>().LiquidType != LiquidID.Honey &&
@@ -1707,19 +1752,22 @@ namespace CalamityMod.World
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(60))
if (WorldGen.genRand.NextBool(80))
{
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<DriftwoodMast>(), true, DriftwoodVariants);
}
if (WorldGen.genRand.NextBool(30))
if (WorldGen.genRand.NextBool(60))
{
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<DriftwoodScraps>(), true, DriftwoodVariants);
}
if (WorldGen.genRand.NextBool(30))
if (WorldGen.genRand.NextBool(60))
{
WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<LargeDriftwoodWreckage>(), true, DriftwoodVariants);
}
}
//gleaming burrows ambient tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<HardenedEutrophicSand>())
{
@@ -1999,7 +2047,12 @@ namespace CalamityMod.World
if (WorldGen.PlaceObject(X, Y - 1, ModContent.TileType<SunkenShip>(), mute: true))
shipPlaced = true;
}
//small limestone piles
if (WorldGen.genRand.NextBool(25))
{
WorldGen.PlaceTile(X, Y - 1, ModContent.TileType<SmallLimestoneCobblePile>(), mute: true, style: DriftwoodVariants);
}
}
//radiant reefs ambient tiles