diff --git a/Items/Placeables/AlgalSlateItem.cs b/Items/Placeables/AlgalSlateItem.cs new file mode 100644 index 0000000000..d448e3400d --- /dev/null +++ b/Items/Placeables/AlgalSlateItem.cs @@ -0,0 +1,29 @@ +using CalamityMod.Tiles.FloralParadise; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class AlgalSlateItem : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 100; + DisplayName.SetDefault("Algal Slate"); + } + + public override void SetDefaults() + { + Item.createTile = ModContent.TileType(); + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.autoReuse = true; + Item.consumable = true; + Item.width = 16; + Item.height = 16; + Item.maxStack = 999; + } + } +} diff --git a/Items/Placeables/AlgalSlateItem.png b/Items/Placeables/AlgalSlateItem.png new file mode 100644 index 0000000000..a589261603 Binary files /dev/null and b/Items/Placeables/AlgalSlateItem.png differ diff --git a/Items/Placeables/PeatItem.cs b/Items/Placeables/PeatItem.cs new file mode 100644 index 0000000000..d528db09de --- /dev/null +++ b/Items/Placeables/PeatItem.cs @@ -0,0 +1,29 @@ +using CalamityMod.Tiles.FloralParadise; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class PeatItem : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 100; + DisplayName.SetDefault("Peat"); + } + + public override void SetDefaults() + { + Item.createTile = ModContent.TileType(); + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.autoReuse = true; + Item.consumable = true; + Item.width = 16; + Item.height = 16; + Item.maxStack = 999; + } + } +} diff --git a/Items/Placeables/PeatItem.png b/Items/Placeables/PeatItem.png new file mode 100644 index 0000000000..2c060a37a8 Binary files /dev/null and b/Items/Placeables/PeatItem.png differ diff --git a/Systems/BiomeTileCounterSystem.cs b/Systems/BiomeTileCounterSystem.cs index 145aaf667a..b6c46cb04e 100644 --- a/Systems/BiomeTileCounterSystem.cs +++ b/Systems/BiomeTileCounterSystem.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Systems AbyssTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; SulphurTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; ArsenalLabTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; - FloralParadiseTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; + FloralParadiseTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; Layer1Tiles = tileCounts[ModContent.TileType()]; Layer2Tiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; diff --git a/Tiles/FloralParadise/FloralStone.cs b/Tiles/FloralParadise/AlgalSlate.cs similarity index 86% rename from Tiles/FloralParadise/FloralStone.cs rename to Tiles/FloralParadise/AlgalSlate.cs index 464cdfc321..1bb2cada32 100644 --- a/Tiles/FloralParadise/FloralStone.cs +++ b/Tiles/FloralParadise/AlgalSlate.cs @@ -1,11 +1,12 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FloralParadise { - public class FloralStone : ModTile + public class AlgalSlate : ModTile { public override void SetStaticDefaults() { @@ -21,7 +22,7 @@ namespace CalamityMod.Tiles.FloralParadise CalamityUtils.MergeWithFloralParadise(Type); DustType = 78; - // drop = ModContent.ItemType(); + ItemDrop = ModContent.ItemType(); HitSound = SoundID.Tink; diff --git a/Tiles/FloralParadise/AlgalSlate.png b/Tiles/FloralParadise/AlgalSlate.png new file mode 100644 index 0000000000..86f7743da6 Binary files /dev/null and b/Tiles/FloralParadise/AlgalSlate.png differ diff --git a/Tiles/FloralParadise/FloralGrass.cs b/Tiles/FloralParadise/FloralGrass.cs deleted file mode 100644 index cb41e4b811..0000000000 --- a/Tiles/FloralParadise/FloralGrass.cs +++ /dev/null @@ -1,113 +0,0 @@ -using CalamityMod.Projectiles.Environment; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class FloralGrass : ModTile - { - public override void SetStaticDefaults() - { - Main.tileSolid[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; - - TileID.Sets.Grass[Type] = true; - TileID.Sets.NeedsGrassFraming[Type] = true; - TileID.Sets.NeedsGrassFramingDirt[Type] = ModContent.TileType(); - TileID.Sets.Conversion.Grass[Type] = true; - - CalamityUtils.SetMerge(Type, TileID.Dirt); - CalamityUtils.SetMerge(Type, TileID.Grass); - CalamityUtils.SetMerge(Type, TileID.CorruptGrass); - CalamityUtils.SetMerge(Type, TileID.HallowedGrass); - CalamityUtils.SetMerge(Type, TileID.CrimsonGrass); - CalamityUtils.MergeWithFloralParadise(Type); - - DustType = 39; - - AddMapEntry(new Color(65, 142, 101)); - } - - public override void NumDust(int i, int j, bool fail, ref int Type) - { - Type = fail ? 1 : 3; - } - - public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) - { - if (fail && !effectOnly) - Main.tile[i, j].TileType = (ushort)ModContent.TileType(); - } - - public override void NearbyEffects(int i, int j, bool closer) - { - if (WorldGen.genRand.NextBool(60) && !Main.gamePaused && CalamityUtils.ParanoidTileRetrieval(i, j - 1).LiquidAmount >= 200) - { - Vector2 algaeVelocity = -Vector2.UnitY.RotatedByRandom(0.91f) * Main.rand.NextFloat(0.85f, 1.6f); - Projectile.NewProjectile(new EntitySource_WorldEvent(), new Vector2(i + 0.5f, j - 0.5f) * 16f, algaeVelocity, ModContent.ProjectileType(), 0, 0f); - } - } - - public override void RandomUpdate(int i, int j) - { - int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143)); - int nearbyVineCount = 0; - for (int x = i - 15; x <= i + 15; x++) - { - for (int y = j - 15; y <= j + 15; y++) - { - if (WorldGen.InWorld(x, y)) - { - if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile && - CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) - { - nearbyVineCount++; - } - } - } - } - if (Main.tile[i, j + 1] != null && nearbyVineCount < 5) - { - if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType()) - { - if (Main.tile[i, j + 1].LiquidAmount == 255 && - Main.tile[i, j + 1].LiquidType == LiquidID.Water) - { - bool flag13 = false; - for (int y = num8; y > num8 - 10; y--) - { - if (Main.tile[i, y].BottomSlope) - { - flag13 = false; - break; - } - if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope) - { - flag13 = true; - break; - } - } - if (flag13) - { - int num53 = i; - int num54 = j + 1; - Main.tile[num53, num54].TileType = (ushort)ModContent.TileType(); - Main.tile[num53, num54].Get().HasTile = true; - WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == NetmodeID.Server) - { - NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); - } - } - Main.tile[i, j].Get().Slope = SlopeType.Solid; - Main.tile[i, j].Get().IsHalfBlock = false; - } - } - } - } - } -} diff --git a/Tiles/FloralParadise/FloralGrass.png b/Tiles/FloralParadise/FloralGrass.png deleted file mode 100644 index cfddd51fe7..0000000000 Binary files a/Tiles/FloralParadise/FloralGrass.png and /dev/null differ diff --git a/Tiles/FloralParadise/FloralStone.png b/Tiles/FloralParadise/FloralStone.png deleted file mode 100644 index f72567a3fa..0000000000 Binary files a/Tiles/FloralParadise/FloralStone.png and /dev/null differ diff --git a/Tiles/FloralParadise/Peat.cs b/Tiles/FloralParadise/Peat.cs new file mode 100644 index 0000000000..058ae409a9 --- /dev/null +++ b/Tiles/FloralParadise/Peat.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FloralParadise +{ + public class Peat : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileBrick[Type] = true; + TileID.Sets.Stone[Type] = true; + TileID.Sets.Conversion.Stone[Type] = true; + TileID.Sets.CanBeClearedDuringOreRunner[Type] = false; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithOres(Type); + CalamityUtils.MergeWithFloralParadise(Type); + + DustType = 78; + ItemDrop = ModContent.ItemType(); + + AddMapEntry(new Color(72, 91, 47)); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FloralParadise/Peat.png b/Tiles/FloralParadise/Peat.png new file mode 100644 index 0000000000..2ebbd88951 Binary files /dev/null and b/Tiles/FloralParadise/Peat.png differ diff --git a/Tiles/FloralParadise/PeatMoss.cs b/Tiles/FloralParadise/PeatMoss.cs index ccbcdc0ae8..d9342064e7 100644 --- a/Tiles/FloralParadise/PeatMoss.cs +++ b/Tiles/FloralParadise/PeatMoss.cs @@ -1,5 +1,8 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables; +using CalamityMod.Projectiles.Environment; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -12,31 +15,101 @@ namespace CalamityMod.Tiles.FloralParadise Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileID.Sets.Stone[Type] = true; - TileID.Sets.Conversion.Stone[Type] = true; - TileID.Sets.CanBeClearedDuringOreRunner[Type] = false; - CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeWithOres(Type); + TileID.Sets.Grass[Type] = true; + TileID.Sets.NeedsGrassFraming[Type] = true; + TileID.Sets.NeedsGrassFramingDirt[Type] = ModContent.TileType(); + TileID.Sets.Conversion.Grass[Type] = true; + + CalamityUtils.SetMerge(Type, TileID.Dirt); + CalamityUtils.SetMerge(Type, TileID.Grass); + CalamityUtils.SetMerge(Type, TileID.CorruptGrass); + CalamityUtils.SetMerge(Type, TileID.HallowedGrass); + CalamityUtils.SetMerge(Type, TileID.CrimsonGrass); CalamityUtils.MergeWithFloralParadise(Type); - DustType = 78; - // drop = ModContent.ItemType(); + DustType = 39; + ItemDrop = ModContent.ItemType(); - HitSound = SoundID.Tink; - - AddMapEntry(new Color(72, 91, 47)); + AddMapEntry(new Color(65, 142, 101)); } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + public override void NumDust(int i, int j, bool fail, ref int Type) { - TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); - return false; + Type = fail ? 1 : 3; } - public override void NumDust(int i, int j, bool fail, ref int num) + public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) { - num = fail ? 1 : 3; + if (fail && !effectOnly) + Main.tile[i, j].TileType = (ushort)ModContent.TileType(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (WorldGen.genRand.NextBool(60) && !Main.gamePaused && CalamityUtils.ParanoidTileRetrieval(i, j - 1).LiquidAmount >= 200) + { + Vector2 algaeVelocity = -Vector2.UnitY.RotatedByRandom(0.91f) * Main.rand.NextFloat(0.85f, 1.6f); + Projectile.NewProjectile(new EntitySource_WorldEvent(), new Vector2(i + 0.5f, j - 0.5f) * 16f, algaeVelocity, ModContent.ProjectileType(), 0, 0f); + } + } + + public override void RandomUpdate(int i, int j) + { + int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143)); + int nearbyVineCount = 0; + for (int x = i - 15; x <= i + 15; x++) + { + for (int y = j - 15; y <= j + 15; y++) + { + if (WorldGen.InWorld(x, y)) + { + if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile && + CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) + { + nearbyVineCount++; + } + } + } + } + if (Main.tile[i, j + 1] != null && nearbyVineCount < 5) + { + if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType()) + { + if (Main.tile[i, j + 1].LiquidAmount == 255 && + Main.tile[i, j + 1].LiquidType == LiquidID.Water) + { + bool flag13 = false; + for (int y = num8; y > num8 - 10; y--) + { + if (Main.tile[i, y].BottomSlope) + { + flag13 = false; + break; + } + if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope) + { + flag13 = true; + break; + } + } + if (flag13) + { + int num53 = i; + int num54 = j + 1; + Main.tile[num53, num54].TileType = (ushort)ModContent.TileType(); + Main.tile[num53, num54].Get().HasTile = true; + WorldGen.SquareTileFrame(num53, num54, true); + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); + } + } + Main.tile[i, j].Get().Slope = SlopeType.Solid; + Main.tile[i, j].Get().IsHalfBlock = false; + } + } + } } } } diff --git a/Tiles/FloralParadise/PeatMoss.png b/Tiles/FloralParadise/PeatMoss.png index 8f4df31753..8a38476c20 100644 Binary files a/Tiles/FloralParadise/PeatMoss.png and b/Tiles/FloralParadise/PeatMoss.png differ diff --git a/Tiles/FloralParadise/VigorousVines.cs b/Tiles/FloralParadise/VigorousVines.cs index 7a1677a033..cc84f147f4 100644 --- a/Tiles/FloralParadise/VigorousVines.cs +++ b/Tiles/FloralParadise/VigorousVines.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.FloralParadise TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new[] { ModContent.TileType() }; + TileObjectData.newTile.AnchorValidTiles = new[] { ModContent.TileType() }; TileObjectData.newTile.LavaDeath = true; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.RandomStyleRange = 2; diff --git a/Tiles/FloralParadise/VigorousVines.png b/Tiles/FloralParadise/VigorousVines.png index 0056a23af2..d21bf12c35 100644 Binary files a/Tiles/FloralParadise/VigorousVines.png and b/Tiles/FloralParadise/VigorousVines.png differ diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 460ec3d254..8ac07385c8 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -465,9 +465,9 @@ namespace CalamityMod /// /// The tile whose merging properties will be set. public static void MergeWithFloralParadise(int type) => MergeWithSet(type, new int[] { - TileType(), TileType(), - TileType(), + TileType(), + TileType(), TileType(), }); diff --git a/World/Minibiomes/FloralParadiseMinibiome.cs b/World/Minibiomes/FloralParadiseMinibiome.cs index abf3bd6bc0..d9d3bd4064 100644 --- a/World/Minibiomes/FloralParadiseMinibiome.cs +++ b/World/Minibiomes/FloralParadiseMinibiome.cs @@ -192,8 +192,8 @@ namespace CalamityMod.World.Minibiomes caveState = CalamityUtils.SimulateCelluarAutomata(caveState); // Reset tile states based on the above results. - ushort grassID = (ushort)ModContent.TileType(); - ushort stoneID = (ushort)ModContent.TileType(); + ushort grassID = (ushort)ModContent.TileType(); + ushort stoneID = (ushort)ModContent.TileType(); grassDirtMap = new bool[placementArea.Width, placementArea.Height]; for (int x = placementArea.X; x < placementArea.X + placementArea.Width; x++) { @@ -232,9 +232,9 @@ namespace CalamityMod.World.Minibiomes public static void GenerateDirtBehindGrass(Rectangle placementArea, bool[,] grassDirtMap) { - ushort dirtID = (ushort)ModContent.TileType(); - ushort stoneID = (ushort)ModContent.TileType(); - ushort grassID = (ushort)ModContent.TileType(); + ushort dirtID = (ushort)ModContent.TileType(); + ushort stoneID = (ushort)ModContent.TileType(); + ushort grassID = (ushort)ModContent.TileType(); // Perform secondary passes that overlay dirt behind grass. for (int i = 0; i < TotalSecondaryDirtCreationPasses + 1; i++)