diff --git a/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs new file mode 100644 index 0000000000..9888e8c15b --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs @@ -0,0 +1,60 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using System; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.GameContent.Metadata; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class PhoviamareHalm : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileCut[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = true; + Main.tileFrameImportant[Type] = true; + TileID.Sets.ReplaceTileBreakUp[Type] = true; + TileID.Sets.SwaysInWindBasic[Type] = true; + TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(86, 33, 33)); + DustType = DustID.Grass; + HitSound = SoundID.Grass; + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = -30; + height = 48; + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + { + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; + brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i); + brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); + brightness += 0.7f; + r = 191f / 350f; + g = 85f / 350f; + b = 28f / 350f; + r *= brightness; + g *= brightness; + b *= brightness; + } + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.png b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.png new file mode 100644 index 0000000000..f3622027bf Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.png differ diff --git a/Tiles/Abyss/PyreMantle.cs b/Tiles/Abyss/PyreMantle.cs index 79c288ac89..ad8ae03f42 100644 --- a/Tiles/Abyss/PyreMantle.cs +++ b/Tiles/Abyss/PyreMantle.cs @@ -41,6 +41,29 @@ namespace CalamityMod.Tiles.Abyss { return false; } + 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 Phoviamare Halm + if (WorldGen.genRand.Next(12) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + up.TileType = (ushort)ModContent.TileType(); + 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.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { diff --git a/Tiles/Abyss/PyreMantleMolten.cs b/Tiles/Abyss/PyreMantleMolten.cs index 7684acc143..c1ef70d8eb 100644 --- a/Tiles/Abyss/PyreMantleMolten.cs +++ b/Tiles/Abyss/PyreMantleMolten.cs @@ -54,15 +54,15 @@ namespace CalamityMod.Tiles.Abyss Tile up = Main.tile[i, j - 1]; Tile up2 = Main.tile[i, j - 2]; - //place kelp - if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + //place PhoviamareHalm + if (WorldGen.genRand.Next(12) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { - up.TileType = (ushort)ModContent.TileType(); + up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; up.TileFrameY = 0; - //7 different frames, choose a random one - up.TileFrameX = (short)(WorldGen.genRand.Next(7) * 18); + //16 different frames, choose a random one + up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); WorldGen.SquareTileFrame(i, j - 1, true); if (Main.netMode == NetmodeID.Server) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 77a44ed266..a56cac3502 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -54,6 +54,7 @@ namespace CalamityMod.Tiles (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), }; diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index bb599f7c9d..cb8e512be7 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -64,8 +64,9 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; - PlantCheckAgainst[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType()}; + PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType() }; VineToGrass = new Dictionary { diff --git a/Walls/PlantyMushWall.png b/Walls/PlantyMushWall.png index 25c6ef92ff..99e7bf3978 100644 Binary files a/Walls/PlantyMushWall.png and b/Walls/PlantyMushWall.png differ diff --git a/Walls/PyreMantleWall.png b/Walls/PyreMantleWall.png index 7224452252..c1dfd18dfb 100644 Binary files a/Walls/PyreMantleWall.png and b/Walls/PyreMantleWall.png differ diff --git a/Walls/SulphurousSandWall.png b/Walls/SulphurousSandWall.png index 71024bb5f2..8f7a554dc5 100644 Binary files a/Walls/SulphurousSandWall.png and b/Walls/SulphurousSandWall.png differ diff --git a/Walls/SulphurousSandWallSafe.png b/Walls/SulphurousSandWallSafe.png index 71024bb5f2..8f7a554dc5 100644 Binary files a/Walls/SulphurousSandWallSafe.png and b/Walls/SulphurousSandWallSafe.png differ