From e999e039cef869c63aa6c539e84b6fa9347c7a71 Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Sat, 4 Feb 2023 14:54:42 -0500 Subject: [PATCH 1/3] stuff --- BiomeManagers/SunkenSeaBiome.cs | 2 +- Dusts/CinderBlossomDust.png | Bin 150 -> 126 bytes Items/Placeables/BrimstoneSlab.cs | 7 +- NPCs/Abyss/Bloatfish.cs | 2 +- NPCs/Abyss/BobbitWormSegment.cs | 2 +- Systems/WorldMiscUpdateSystem.cs | 2 +- Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs | 76 +++++++ Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.png | Bin 0 -> 879 bytes .../AbyssAmbient/AbyssGiantKelp1Glow.png | Bin 0 -> 489 bytes Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2.png | Bin 0 -> 861 bytes .../AbyssAmbient/AbyssGiantKelp2Glow.png | Bin 0 -> 510 bytes Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs | 63 ++++++ Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.png | Bin 0 -> 795 bytes .../AbyssAmbient/AbyssGiantKelp3Glow.png | Bin 0 -> 483 bytes Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs | 63 ++++++ Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.png | Bin 0 -> 663 bytes .../AbyssAmbient/AbyssGiantKelp4Glow.png | Bin 0 -> 447 bytes Tiles/Abyss/AbyssAmbient/AbyssKelp.cs | 55 +++++ Tiles/Abyss/AbyssAmbient/AbyssKelp.png | Bin 0 -> 1032 bytes Tiles/Abyss/AbyssAmbient/BulbTree.cs | 81 +++++++ Tiles/Abyss/AbyssAmbient/BulbTree1.png | Bin 0 -> 780 bytes Tiles/Abyss/AbyssAmbient/BulbTree1Glow.png | Bin 0 -> 381 bytes Tiles/Abyss/AbyssAmbient/BulbTree2.png | Bin 0 -> 714 bytes Tiles/Abyss/AbyssAmbient/BulbTree2Glow.png | Bin 0 -> 396 bytes Tiles/Abyss/AbyssAmbient/BulbTree3.png | Bin 0 -> 672 bytes Tiles/Abyss/AbyssAmbient/BulbTree3Glow.png | Bin 0 -> 363 bytes Tiles/Abyss/AbyssFossilTile.cs | 3 +- Tiles/Abyss/AbyssGravel.cs | 27 ++- Tiles/Abyss/LumenylCrystals.cs | 7 +- Tiles/Abyss/PlantyMush.cs | 24 +- Tiles/Abyss/Voidstone.cs | 27 ++- Tiles/CalamityGlobalTile.cs | 4 +- Tiles/Crags/ScorchedRemains.cs | 4 +- Tiles/DraedonStructures/OnyxExcavatorTile.cs | 18 +- Utilities/TileFraming.cs | 2 + Utilities/WorldgenUtils.cs | 24 -- World/Abyss.cs | 208 +++++++++++++----- World/AerialiteOreGen.cs | 4 +- World/BrimstoneCrag.cs | 72 ++++-- World/DungeonArchive.cs | 138 ++++++------ World/UndergroundShrines.cs | 2 +- 41 files changed, 720 insertions(+), 197 deletions(-) create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssKelp.cs create mode 100644 Tiles/Abyss/AbyssAmbient/AbyssKelp.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree.cs create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree1.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree1Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree2.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree2Glow.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree3.png create mode 100644 Tiles/Abyss/AbyssAmbient/BulbTree3Glow.png diff --git a/BiomeManagers/SunkenSeaBiome.cs b/BiomeManagers/SunkenSeaBiome.cs index ed3c069dc4..e787148e6c 100644 --- a/BiomeManagers/SunkenSeaBiome.cs +++ b/BiomeManagers/SunkenSeaBiome.cs @@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers { public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/SunkenSeaWater"); public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.Temple; + public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight; public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon"; // Placeholder until we get a dedicated Sunken Sea background diff --git a/Dusts/CinderBlossomDust.png b/Dusts/CinderBlossomDust.png index e15ea39c59205f7466da4db81548a0fe532d3e03..aeb183ae7592a93686286c930f5db6a8c2cae15b 100644 GIT binary patch delta 83 zcmbQnSU17Y*UZz!F~q_@IYmLpKxkzjHLAoHc zCa(YUA0=i2Ss1a$%m6AJ3gJk7H_CrUjhTm>IAUf16;j{VR5K9(;L9){t~SX~00000 NNkvXXu0mjf0091zDBJ)5 diff --git a/Items/Placeables/BrimstoneSlab.cs b/Items/Placeables/BrimstoneSlab.cs index 3c6aec3eda..8a544d76bd 100644 --- a/Items/Placeables/BrimstoneSlab.cs +++ b/Items/Placeables/BrimstoneSlab.cs @@ -28,10 +28,9 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { CreateRecipe(25). - AddIngredient(ModContent.ItemType()). - AddTile(TileID.HeavyWorkBench). - Register(); + AddIngredient(ModContent.ItemType()). + AddTile(TileID.HeavyWorkBench). + Register(); } - } } diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 49f8414d4c..35f2d9dac9 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.Abyss { if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType()) < 3) { - return SpawnCondition.CaveJellyfish.Chance * 0.3f; + return SpawnCondition.CaveJellyfish.Chance * 0.5f; } return 0f; } diff --git a/NPCs/Abyss/BobbitWormSegment.cs b/NPCs/Abyss/BobbitWormSegment.cs index 017d858680..7274f48a2c 100644 --- a/NPCs/Abyss/BobbitWormSegment.cs +++ b/NPCs/Abyss/BobbitWormSegment.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.Abyss if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water) { if (CalamityGlobalNPC.bobbitWormBottom.Contains(-1)) - return SpawnCondition.CaveJellyfish.Chance * 0.3f; + return SpawnCondition.CaveJellyfish.Chance * 0.85f; } return 0f; } diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index 170f211391..e207bfb575 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -319,7 +319,7 @@ namespace CalamityMod.Systems if (tileType == ModContent.TileType() && !DownedBossSystem.downedCalamitasClone) return false; - int minDistanceFromOtherTiles = 6; + int minDistanceFromOtherTiles = 10; int sameTilesNearby = 0; for (int i = x - minDistanceFromOtherTiles; i < x + minDistanceFromOtherTiles; i++) { diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs new file mode 100644 index 0000000000..91512d672d --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs @@ -0,0 +1,76 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssGiantKelp1 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(1, 4); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(76, 72, 35)); + DustType = DustID.Grass; + HitSound = SoundID.Grass; + + base.SetStaticDefaults(); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Framing.GetTileSafely(i, j); + if (tile.TileFrameY <= 36) + { + r = 233f / 255f; + g = 144f / 255f; + b = 30f / 255f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 2; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } + + //just clone the first one its literally the same size + public class AbyssGiantKelp2 : AbyssGiantKelp1 + { + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.png new file mode 100644 index 0000000000000000000000000000000000000000..ee7a7eee5e49b7e597b89fd8cdfda4493bb86ef4 GIT binary patch literal 879 zcmV-#1CacQP)Px&DM>^@RA@u(nNLVmK^(_jBBKIPY!%wDKne*A7Q#yr7zKiXcPTu0?Bc0&=T4ow zb?F`yC`MiCV!{e`kp7THE9xeiqL~#2zv;X5CWqh5bKcDF#d_K2&f9sP_nF`P<~Q#Z znuProgz+>rfVdHHHng{PZSU_+3vJJ+4}6dRxeJ@x^9xirbNp`N<_gW1m7(32%G{P} zPixBBkQg8n2sHg;2n{Jsv4$Ez-1KZ1%AKL*`(2b@I!4YZcFR1p^6)L4-Z}P(oj8fi z&lwU2!~y$mchc$m;`{Z-0*w!!pcpFm9i!jZW9d(C`f5LMdxlyD9(`f^{y%_l7ba6M zgy64CZD(spEYQ8{rzw_3236UESb`z6-kT@X35Hv;0 zLwXEF2h!IxtoGBdzs8wmVt}~SKDZ(AKnP~kMZxossd5wp1dz35RXJi!i(WBC2SV(? z1QI2dlHi8K0NEB)zRzO|G~XBG`f~=-7u#2r8ufuRfuP6t9Dwt#L;ry|AOHfaT3shY zH*cM%+8g_}V1{xBggt-SSaJ?(&X5=&)0W#cmb@8?4rEFPSmW>nZtCf0I@Q)xYD2jJ z>c4uDSP|T=ro0;x2c*Z4KD1m+c{d~u2t$T74Tky#Ptjp;Lt=nj>mJkj-eM>^kf|O5 z*o)_jbclNCQn^U=5|^=48_Eq3GIV8jHDSnhNWB|s0NGZI!G_GVx7YV&^D95X#87k~ z0AQ%}cOH29fjpDe4EkqhnHV6`OBX$#=+B2XH`Uu}WN6#`!x|C`q`!1AJ<`iOhVUg002ovPDHLk FV1gO-pW6Tc literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..fd9d167e723a22414570dd2c6cbc37004b6f087f GIT binary patch literal 489 zcmeAS@N?(olHy`uVBq!ia0vp^DnJ~?!3HERXnfHGQjEnx?oJHr&dIz4vKM)}IEG|6 zzn!M&!Qv>=mM_RNt0lO3!P#XAhLWNz&3B6qW*E*qtG4-V*WG0qCXpgJW~|LhGtMPg zCLY_qWA$ls>vhNH{JH+^-%a!XHNW?7pS@M+cWUR)%##AP6K}QrTEF`5de_aJ+~J4+ zZO^{7!%IHS*>dK`zlR=fx+v=Z;_s!&uPbe*g%~VM;R%&A^tsP5Q^1pp^Q6Gm>0q_4!`)1DUFK_jW$Lyqo`qMe9lbmPy7gZL_asKg_B6Jpa|gg_qZEJAL8O zry0BL&tFR4`swz+oae_hUmw?x_+2ltDL7=Jk(1cJ*Q>YhSDmtEVe?kY=}XVG{eQDj zM^f?f_jB(TZ<<_h+fwFN)Mh50CNpdC+lhxHbA)Es75%o5a5^bzr1R~Cn0j?QDqD^}mx#jC}ogJZ%vo=yQlg;+@;MJ0z_ zMk-D&4JD}_EgcLmPfg$uWV|$0QBa9#iMF$n3yVj18xb1p8FYCcMStANn+S|L22WQ% Kmvv4FO$-3Fj@OX@ literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2.png new file mode 100644 index 0000000000000000000000000000000000000000..f77d5bf9da7c990454c0458736168b0e10a93776 GIT binary patch literal 861 zcmV-j1ETziP)Px&7D+@wRA@u(m`zAkK@`V*RQ3g>*i-0L8fA#|paW(mDJkP=DuB2ZDGU{cI0M{xk)gy5EzBNS`1hZdS|5>RT*u$sgMH)TB~t^m2(t02 z^>U@=gT~POQ)BL{8ILs;Y)B1|4+NV2GlYRiQ>-C%K(W;ldmn2k_8-UI#{#KavI2-( zYjuVuukWA^+u8yURHM6)kav5?BsR07mwWFPsrOWrat#c0y4Go*fTzU9b zlpV1lwLmAU6*6@5{3@%@z|e)k-*o-{cq1J{YJo0Re^`A6*}C=q7hRv2NZF7YpwKoE zJ1;7Du@4KmPYl%4W2)@j_SIIuIen&=u8%$coNk8H0`2ZvMHuO?!HY?rV=-l8Bk~@r1PQ;NgotCKN`r_7?B+SNUJUXKrrJwprsyawLpFQ zH&aaR+hd)@7cJ3`(ojP?x znFGc4k>%dUR@rhNAibXjLb#vRr)e&-a_I0@D?|8P_T=$Lx*pq)@(1K9hoM@vjfULs z7+2g-0VJ&gwM*93zJ}ff)rT*v@PhU6nW$=GtIU@nH9!D#_b&H{J3DEL7lNlM%LdHM}gT$aR! n)B#Di8tHtoA?X98^Zx*ug))dNn#Uvn0000 literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..50f8d69f9b9f8e61d4edd2bbe3d0483bcdf8e2f4 GIT binary patch literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^DnJ~?!3HERXnfHGQjEnx?oJHr&dIz4vbTG>IEG|6 zzrCjD;T$N!_Q1A)^HD2@2)j#~d=&-sR-&f0oLgm!sSIrqlXs@&7oz`FE>Z zY>(_QCYdhc|4$E>@3x$5FFFaOfmsMTkF z$>8bg L=d#Wzp@{(ih@#e0 literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs new file mode 100644 index 0000000000..f6939534ba --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs @@ -0,0 +1,63 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssGiantKelp3 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.Origin = new Point16(1, 3); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(76, 72, 35)); + DustType = DustID.Grass; + HitSound = SoundID.Grass; + + base.SetStaticDefaults(); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Framing.GetTileSafely(i, j); + if (tile.TileFrameY <= 36) + { + r = 233f / 255f; + g = 144f / 255f; + b = 30f / 255f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 2; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.png new file mode 100644 index 0000000000000000000000000000000000000000..d69f3d54450e7b7e6a18604df32c1d34747e1386 GIT binary patch literal 795 zcmV+$1LXXPP)Px%(@8`@RA@u(m``XEK@`TjsP#{&w!|btiiuREhXxvmx#&@`pwPP)Z$0!5v z9i>ofgB0t2zIVnu3UZZlR!9tx4$}3CNg)I{D#cbP2C|t>oI*C>evPv|)UO-buEPcr zw`AggYR|7yB~CrQsZ?iH>iW`03QsS5VXX!$=-`6lfMCYeN0&*d`!8lxFEey|C{y12 zL2!3n6d7^uEe;d!wx`=;KgG3=jaH-OG}fp1l1W+A%_*r8mkA z80Svh*+XK1=JFX*Xl1)flR{Yl@ciN*`ik)*S4cb%%)ZqaAu-lZo$e{h>(!lq+Qi#K zxm~0>Ee?p&PJCj#74o?m=Re*+rX3@?{CHaJ6eHg; z4jd?x8KZ22T%eHfLUNW&jg?xf0jTxg3xpsHm=-vuN4x}#? zo+_4KexONVoV#~6l>oLvVu7$!NN;3WWC}$Ngqe?ys`oy4%+c$LsSa`4#o-vMhr|M* zGNVW79?~na>+=|UPpxNHWI#5M=Fef86y7nSQtQC3mD}hcaX_xw(XV)Gmi6mK-0S=W Z&SP|EgsX~g00000NkvXXu0mjf001AcZjJx| literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..d3e69df07e4e41afe15a843bb1804b756f3f9eb0 GIT binary patch literal 483 zcmV<90UZ8`P)Px$ok>JNRA@u(mM=&{Q544a%EFd}v4w#)n=p&XIGN3Ev6)R~vuS0~uwq{j23s^) z1Z_42gMYxJL6FJL+j+PP<2hG+1-wCy`P_q)IQ-FshBa`q(7{FG=2tq2K`5F&u| z=nPFh+LLMXWNj=x^t%qIzas;ozWRnT64f)ATvFam34LD+vF!Pr=`(^>Qn?AaF%%lf zva*Pf7UU#lCPYIhbnXZt!$s-l3>7sX>SH$KZpqvkdg-pqNnAhLOsN}B>ev2*ls8VE zOsioknl^N2NW(ZhtO==3ua(|q3vPQQb9?h8b^Dj^rpcR%{_YI7hPHPqbJ@_)$CAnJ zMszNOx)O3@NDZFvZAg|*M~`!Fj7q3~m8L;;>%?tf+&{~t^jJ{C#}_~H zQT3%0a&Jh(e)m?5%1-ny(?5oU{@qZRiE!6hGZWTD?=ts>Vu>t`5DgVY0QD&>)My~9 zPD6+k36T&YfOKYvgb)FwGeabV2q2vqA|XTo>C6xbAp%HehDZnzKsqx-LWls;nW2>< Z^b3cL{z<2uq~rhq002ovPDHLkV1l1A)O7#= literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs new file mode 100644 index 0000000000..9dee8245d8 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs @@ -0,0 +1,63 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssGiantKelp4 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 2); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(76, 72, 35)); + DustType = DustID.Grass; + HitSound = SoundID.Grass; + + base.SetStaticDefaults(); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Framing.GetTileSafely(i, j); + if (tile.TileFrameY <= 36) + { + r = 233f / 255f; + g = 144f / 255f; + b = 30f / 255f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 2; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.png b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.png new file mode 100644 index 0000000000000000000000000000000000000000..fc436a83419fc3ed4a1ed4348926f60db4a511b6 GIT binary patch literal 663 zcmV;I0%-k-P)Px%P)S5VR9Hvtmpw>AQ5c4msHh+m`x%4^qKLpjh?b(MASh^Sh@v5AX=!S1uB9yq z3ZiHa8j2cgiNL@J$)Z0T%)&^FvZV04zS2E-@f`JfKOr~IJ>L7A=e*x{k9HfgkDVEh zEpMQo=-^LkF?Qz>-2>mTK#Z#{xcq@KCh8Vx@%E~I%~0Z)jAcIY^!2nsSyRe}*Z_$j znXDKY!URQA(uV$la)s{SP}vy@ue4B~X`1fT*d_bW)8-XTZ=QdUDj=yzsT;Bb+Mj43 zL*Cw6S}{x+y~_^f&S~E8&a?EQsq^Q`4z9BUk_9hxp0uGtA0+#GWgv0uP(5gzs4Cy- zySW)M%97Af3Be(SP=>Ra_!n`?*-5I{P5>a+H=$o(gcZ*N^vRuJ}$N6lOy zP~;4;1A-P2EO_=tmmG~+R$vJ8uJ1m~F~k-~1cRB|iwIph@kJ;@U0qs#$~QZBj&$?F zmaqYGyB%bpt*Me0<80QdZ*Tv`8bj=WvNj_V2BkA(!n3p9QW}WemazkZUx0Z%E?t%N zc^jz;@1DMBJQRABw*PnUlz+q)2>l418jaKEf3e088z3=D$janYH)RO#xO}suoT0J- zLY3himv5GeX2>!iqp}zO4B+G#i^Y|yPT3F}AQ1%N#(7BGvS?U4d#hHPv>`S?MlV$u x5YN=EnuP8|scI^xA$CBeI+!W{>nIi2FM)mPx$cu7P-R9Hu2WEfwKtkx(5pamX!B?m}Gz5taDUw5I&^QR)A@H<us()>YpPbA&ZEWA9WC+kQxo4(GVgO0)*s8)6i%L5efl9@}p^JG=vC+03rF&G&CAQghGIj p{Ad~)4Ix4yKuCTx4G{_<0Q0K$H)W}0ga7~l07*qoM6N<$f&kT%vjqSE literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs new file mode 100644 index 0000000000..758f576d96 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs @@ -0,0 +1,55 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.GameContent.Metadata; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssKelp : 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(76, 72, 35)); + 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 = -12; + height = 32; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Framing.GetTileSafely(i, j); + if (tile.TileFrameX >= 72) + { + r = 233f / 350f; + g = 144f / 350f; + b = 30f / 350f; + } + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelp.png b/Tiles/Abyss/AbyssAmbient/AbyssKelp.png new file mode 100644 index 0000000000000000000000000000000000000000..7534a84571edd1d754c8f83578d97d2a2ce0ef89 GIT binary patch literal 1032 zcmV+j1o!)iP)Px&z)3_wRCr$PTRmtLK@`q`pcwoKxF{$@Q6Ytq1Y(+0g26xpdmC%9x3;zyYa1&Y z!C)kURhoE^U_=5&G@zia5Pyg$2oY!U9p1~noq03w+`G+Olicpk+kNkQ-}~FSMqm2u zNDDM}q}EC4J{I_i(QNatedZVQS~v&vp_uo&ew*tT3{Lno2A+7~m4NSY$5sO#%s6o- zGfwp8MQ;A~Iy0cxz~TLEq+kE|tt<4C0@%8~|7Lp-+pynV%-_cN1bj6GKxM#FMjXs` zt1w68KBLv!<`sgtJfJw0Zt`+Uvj_^KE`d*zUMo{P6f+Jb?rD#yiGKRUkG9J)JWA-yrT zCS!a8zI+)DMkH92S)e|6dp;1(Btc;#rw z!TPh=hB@>+@0T%N%OJ5iGyz{R@UNP-y?HqM+T;q~{+R-w4cd7CmFEJOI}iENloXrW zxezVQtyIqC;iHD?*M@Da;mcSqa)9}FmaW|%EWaoj0s{JxO`=2pJ*1TJOxMh=$o3Hb8huN9&z2cBan)R#`Uur8Eo+z1)( z(=mCgD#vR920bUw+llGi)3AxD)DhWPJ=(AYd@=KD13c8D)p#h=wHQxp3v?IK`9Nso zam^EAnX1Kj8X>S2Lds=4tU>p09?(12n5DU6PAeeUsIw4R6CVFdRGWh&jjAl+fqHH_CXbOPRQ_pcauYFKzKax%V4nS}`( zJ=N2tpRYVu1mOtg(yNhx_xnMGFHkOn z(|HL;5Z_`r7("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } + + public class BulbTree2 : BulbTree1 + { + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } + + public class BulbTree3 : BulbTree1 + { + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow").Value; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + + spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White); + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree1.png b/Tiles/Abyss/AbyssAmbient/BulbTree1.png new file mode 100644 index 0000000000000000000000000000000000000000..d2bd2967caf036a1a8a83bf52bc7ba5435f63a33 GIT binary patch literal 780 zcmV+n1M~ceP)Px%#Ysd#RA@u(S-VODK@{}?f}lwh1VIUEf>@YBv=BuL@ek~@SARe&ODp{WwXw6e zw^9*7#Ud6W8YDgl1WckSMDYPP9&oNqW}Tfi*>Tf^?C#9Yxo6IqGn3jHL!W`itB>zp zorYqyhPu}3#@NfP0R|vo=IA3QFgE-2K$Wf(bJ~mrz$&D*fH7`O{fS}H)LHV7io?z0 zb##WB;J%i%xoD)#m~Vl}7~n+&BO}ub#NbO$oE~}J-mFf>tOEu>8_lf(IartKS9a)n zL+X;g54KimIu9+a6JwQT3WNTkv40D!aej@80xcac&rxxpvB%_IMYW~Pm~VjrvC2F` zi7`QA!xK}av10bl2xD$TwR9b`7MP1gzbcw)Cy%NaeVIXM1LKhjuK1ow(d$%NLwk&k zXHMBV>U4h>0OPE8MSIBwuhSP)95B$-)*(E~nZt8%RlXjo0)pp^SqBV&n!=?l32ksD zpf%73<~UQb%=xxBDKPJpDQWUhxt%q@_(BcfNclV~;yyAX*IZqDk5Ie&{cZXUt@0_Z zDzxmr(iN=(CUYlLh@Tr`KL*W!322csm$^&|OzAT7YsLa#U+0EM9x}~v=6u7LwZLR< z#+L`IV{px4p>)O%S2U$H<$jEZQJH!81{eUy>|T`wBH=d5lAX~QbtPNRWLXjKSH0)g zu4p|lQ*-{W`%xy3zaEgO_jv{k8tWSz7siUL2yG$7oBn4s0OoXx$lMV7vD@^O&{g-% zA^om;#;ga%wRL{7OU&d8*|O8$?FlfZgK>??OvAUp04Ne}p`x|N6ZFlsrDDvfmQ~Lg zW6XMBJR4fWn6<#*hF}V*-l=)0wBz)?agF&N7|a4L$9Kxu8N(fM#*r`N9Ial z$r}C}VEq3sFox496bRS7W=>mUoH1*Fxz&Kz?X?;6dSGt*{{-ep>{Tg0mNNhV002ov KPDHLkV1fW#X>Hg5 literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree1Glow.png b/Tiles/Abyss/AbyssAmbient/BulbTree1Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..3b203f5be125fa5e99d618c734381891b50fa4b3 GIT binary patch literal 381 zcmV-@0fPRCP)Px$HAzH4RA@u(nb8fxFbqWL0Pw*IOu$kM#Y%iI0V{w60~86#5)F#nCKubJ$8U<0 zcV|0IGi*S=jmXCP3%yej)kwR=MUQzn}HdZ z1bn*UcSZP0zyZU7p_&)Lz?qT_N5>SU!=)l>A6+k4x>1UvUSFT)*1GCgcVM~hB#K2p zpQ-PP>4B4AbBm$Tb95{fmNnKW)wHnT+I{T-Q-IeCrdb|!Ty-q!!nJj|gSEOqB$#G> z={Ox*c;)M!imfgX307J|UjGZ{7)l6&p_H_WL&vO?M$JRVP)b_Gp<`A`qvoMwC?&1p bya7@h3Pw0fn~4Ab002ovPDHLkV1fVuY1yKN literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree2.png b/Tiles/Abyss/AbyssAmbient/BulbTree2.png new file mode 100644 index 0000000000000000000000000000000000000000..04e4bb54f37aaa406a247ae0de4797a3e203c44f GIT binary patch literal 714 zcmV;*0yX`KP)Px%gGod|RA@u(TDwXEK@>HImHgyOlFyxWG9;@$;@W&oO|ZnIWrqykL1^EIa_UX z%ZI?EPjaZHx04>sIA8#DG(6HUliS~4)UJy;X^eTmG-=Iaj91aTspz(;2uAJ7{qNEy zUGkW|kv9FC%_8YRj0J`)&LooLK!#FV)HL{#q4#q7LJM=!88aRj3owvau`q^yRhm=A zSl0pj%e@fh-e|0$=Ag}it7A*i6ZM$d88ZeL&#|cLSI(HKf%ER`7#J2}%zb=k9R@Vx zkBnKgg@OIV;`H%ue}~3m=Q&09a~?3(3u33d;0sf7ZmR`y8pte|!|%XYE|aDvf6%(q z#(LH^#@N7J2dwYljF{=aKDFo^jJ>`+Hu&V{r8>b5Hl@oxzv~ zto|Sm8pFN|XBs%`(5*FFjfpa5EHEtGa3Y~#gfurjw_5Xzb?>OFI!a^AHNdczIQzQN5j0GlIRCHhOm@(Z06^-`~P!@Vs1Y$pf00000NkvXXu0mjf02J;_w*UYD literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree2Glow.png b/Tiles/Abyss/AbyssAmbient/BulbTree2Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..692bb9a5c8918438dfbdf7df490676faf356aea8 GIT binary patch literal 396 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e>Z#^NA%Cx&(BWL^T2VZeYu(09o;>~BbAIa-;b5KvQ?huwu3AY273Qs+Arc$2 zJKknPly25u@z-5ZjN5-PZU|epr>A&z#J$*+)jkZLCnc>d+!4A))FD$wI$~Ahl;1z= z^AeWYs(-a%Pxv`abMBP$iSj3R@~*GA?wD#8e$8j&9m58}ZogXD*J~qQPFb+c;rpvD zm&ESFcS~K16M`7OY&smaCfp&YjM1mdQ`b7cr#n;AJ^+awdUVg7qrr^p`Dbi@ADh(0 zIO9^gjmEd+1vhLabQOCay|mP;%5QJX!fPk4e0&{!e3?<2?fz9WN*iMSGaO4jmnA2% mIceT&@vg#|n`eDzeXQ}u+@!o-4j8x$p00i_>zopr7#ILVU#!yr literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree3.png b/Tiles/Abyss/AbyssAmbient/BulbTree3.png new file mode 100644 index 0000000000000000000000000000000000000000..d93e9367752cc8578b44eccaed2e768fdf131b54 GIT binary patch literal 672 zcmV;R0$=@!P)Px%SxH1eRA@u(nL$eeK@`WcAP7n;5QIWPB|7LKB8Z|+UHS@j55GWth(3YzSvu7v zi0EL42$hfmL1@*4peUo!|6w1yz1eMN-5K?w_!MF^TFKh|LW|K>z>trhP zr()=jagjwi&*1F9b!o-80gVL%I0eN2-R6sJZsLVq(S9!##WyOJo1W!ZlODgl+WK)5 z9hhRqgRP`j`>~ej*OrJmfFt&hJ-<%(^-#=MFwXbGx*m9pg=IMR9A#i`>7Q06+GIty z>`0RaN-pie+}5+mS02>oWfyAg!BBa0+x-gSss5-ezJJG8HaJyGdoWtHqw;7}%AqI~ zcy&*+A==u5K`B)20Q+v##7}J%GX{*F{GvT|c45o>Sct<`&UaQc4vZe4;_MzfU+i?P z{DDomRIXratByI(ij6!Ned~e^D3sGyG3~&(4PI2PdycWF7|z+@8_X@;yS>q*F@~b} zxn31Ew%SeKwm3oh9?V!U&K2l&Z4?`W4Q61hm{(VD>F+yv$Uc8QkrZe7%jvAR1sl(Y z+e;I6YW;pQj#5&rF*KF z_F!%<{9002ovPDHLk GV1fY59XIFz literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree3Glow.png b/Tiles/Abyss/AbyssAmbient/BulbTree3Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..ebe3d5f0871a70cfca613bfa609ff639657c11ba GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e>Z#^NA%Cx&(BWL^T<%APKcAsNnZ zXP)I{QWR)i%HX?&Rr^DNw^*vT+?oSocU-t5Cihk-NF*HIt}}Ui`lmy`XELVURr_qc zS1vi{Wo>!MOo48_)Ay!WCe6E0THT>lSN7XeW`CY8pPH=j#(dsWhC8NebUmBZ?%%Vs zEPtLv%xn7}Q71jj`j>KC^>Zsudf5BajPIiL%cp 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + 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); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + } public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) { diff --git a/Tiles/Abyss/LumenylCrystals.cs b/Tiles/Abyss/LumenylCrystals.cs index 1fc5b615ed..772947bc33 100644 --- a/Tiles/Abyss/LumenylCrystals.cs +++ b/Tiles/Abyss/LumenylCrystals.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Tiles.Abyss Tile leftTile = Main.tile[i - 1, j]; if ((belowTile.Slope == SlopeType.Solid && !belowTile.IsHalfBlock && belowTile.HasTile && belowTile.IsTileSolid()) || - (aboveTile.Slope == SlopeType.Solid && !aboveTile.IsHalfBlock && aboveTile.HasTile && aboveTile.IsTileSolid()) || - (rightTile.Slope == SlopeType.Solid && !rightTile.IsHalfBlock && rightTile.HasTile && rightTile.IsTileSolid()) || - (leftTile.Slope == SlopeType.Solid && !leftTile.IsHalfBlock && leftTile.HasTile && leftTile.IsTileSolid())) + (aboveTile.Slope == SlopeType.Solid && !aboveTile.IsHalfBlock && aboveTile.HasTile && aboveTile.IsTileSolid()) || + (rightTile.Slope == SlopeType.Solid && !rightTile.IsHalfBlock && rightTile.HasTile && rightTile.IsTileSolid()) || + (leftTile.Slope == SlopeType.Solid && !leftTile.IsHalfBlock && leftTile.HasTile && leftTile.IsTileSolid())) return true; return false; @@ -75,6 +75,7 @@ namespace CalamityMod.Tiles.Abyss { Main.tile[i, j].TileFrameY = 54; } + Main.tile[i, j].TileFrameX = (short)(WorldGen.genRand.Next(18) * 18); } } diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index a8f155029b..459056b6aa 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -1,4 +1,5 @@ -using CalamityMod.Walls; +using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.Walls; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -49,6 +50,27 @@ namespace CalamityMod.Tiles.Abyss 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 kelp + if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + 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); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143)); if (Main.tile[i, j + 1] != null) { diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 88e1f5b766..0b9ee5d29d 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Tiles.Abyss.AbyssAmbient; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; @@ -43,6 +44,30 @@ 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 kelp + if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + 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); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + } + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) { int uniqueAnimationFrameX = 0; diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 0fcc3addc1..301ffd3361 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.DraedonStructures; @@ -46,7 +47,8 @@ namespace CalamityMod.Tiles TileID.CrimsonPlants, (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType() + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType() }; public static List GrowthTiles = new List() diff --git a/Tiles/Crags/ScorchedRemains.cs b/Tiles/Crags/ScorchedRemains.cs index 3e0f379c82..139143f484 100644 --- a/Tiles/Crags/ScorchedRemains.cs +++ b/Tiles/Crags/ScorchedRemains.cs @@ -30,10 +30,12 @@ namespace CalamityMod.Tiles.Crags public override void RandomUpdate(int i, int j) { + Tile up = Main.tile[i, j - 1]; Tile left = Main.tile[i - 1, j]; Tile right = Main.tile[i + 1, j]; - if (WorldGen.genRand.Next(3) == 0 && (left.TileType == ModContent.TileType() || right.TileType == ModContent.TileType())) + if (WorldGen.genRand.Next(3) == 0 && !up.HasTile && (left.TileType == ModContent.TileType() || + right.TileType == ModContent.TileType())) { Main.tile[i, j].TileType = (ushort)ModContent.TileType(); } diff --git a/Tiles/DraedonStructures/OnyxExcavatorTile.cs b/Tiles/DraedonStructures/OnyxExcavatorTile.cs index 47849e331d..bffd6762b5 100644 --- a/Tiles/DraedonStructures/OnyxExcavatorTile.cs +++ b/Tiles/DraedonStructures/OnyxExcavatorTile.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Mounts; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Enums; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -13,18 +14,21 @@ namespace CalamityMod.Tiles.DraedonStructures public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileSpelunker[Type] = true; + Main.tileSolid[Type] = false; Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.Width = 8; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; - TileObjectData.addTile(Type); + TileObjectData.newTile.Width = 8; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + 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.DrawYOffset = 2; + TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Onyx Excavator"); AddMapEntry(new Color(128, 0, 128), name); - TileID.Sets.DisableSmartCursor[Type] = true; } public override void KillMultiTile(int i, int j, int frameX, int frameY) diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index dd79ddb252..e2980996fd 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; @@ -62,6 +63,7 @@ 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() }; VineToGrass = new Dictionary { diff --git a/Utilities/WorldgenUtils.cs b/Utilities/WorldgenUtils.cs index b2d0e4a3fe..5c1fbcdbf8 100644 --- a/Utilities/WorldgenUtils.cs +++ b/Utilities/WorldgenUtils.cs @@ -41,30 +41,6 @@ namespace CalamityMod } } - //place a circular clump of tiles - public static void NaturalCircle(int i, int j, int size, int tileType, bool hasRandomness = false) - { - int BaseRadius = size; - int radius = BaseRadius; - - for (int y = j - radius; y <= j + radius; y++) - { - for (int x = i - radius; x <= i + radius + 1; x++) - { - if ((int)Vector2.Distance(new Vector2(x, y), new Vector2(i, j)) <= radius && WorldGen.InWorld(x, y)) - { - Tile tile = Framing.GetTileSafely(x, y); - - WorldGen.KillTile(x, y); - WorldGen.PlaceTile(x, y, tileType); - tile.Slope = 0; - } - } - - radius = BaseRadius - (hasRandomness ? WorldGen.genRand.Next(-1, 2) : 0); - } - } - /// /// Settles all liquids in the world. /// diff --git a/World/Abyss.cs b/World/Abyss.cs index 5de4a82dd5..2eaf9f49d4 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureVoid; using CalamityMod.Tiles.Ores; using CalamityMod.Walls; @@ -65,37 +66,35 @@ namespace CalamityMod.World if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) { + //dithering on the edge of the abyss if (abyssIndex > abyssChasmX + 75) - { - if (WorldGen.genRand.NextBool(4)) - { - if (canConvert) - { - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); - } - else if (!tile.HasTile) - { - tile.Get().HasTile = true; - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); - } - } - } - else if (abyssIndex > abyssChasmX + 70) { if (WorldGen.genRand.NextBool(2)) { - if (canConvert) + WorldGen.KillTile(abyssIndex, abyssIndex2); + + if (abyssIndex2 > (rockLayer + y * 0.262)) { - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } - else if (!tile.HasTile) + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) { - tile.Get().HasTile = true; - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } } @@ -187,37 +186,35 @@ namespace CalamityMod.World if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) { + //dithering on the edge of the abyss if (abyssIndex < abyssChasmX - 75) - { - if (WorldGen.genRand.NextBool(4)) - { - if (canConvert) - { - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); - } - else if (!tile.HasTile) - { - tile.Get().HasTile = true; - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); - } - } - } - else if (abyssIndex < abyssChasmX - 70) { if (WorldGen.genRand.NextBool(2)) { - if (canConvert) + WorldGen.KillTile(abyssIndex, abyssIndex2); + + if (abyssIndex2 > (rockLayer + y * 0.262)) { - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } - else if (!tile.HasTile) + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) { - tile.Get().HasTile = true; - tile.WallType = (ushort)ModContent.WallType(); - tile.TileType = (ushort)ModContent.TileType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } } @@ -427,7 +424,7 @@ namespace CalamityMod.World } //increase y value so islands cant be spammed on top of each other - voidIslandY += WorldGen.genRand.Next(10, 20); + voidIslandY += WorldGen.genRand.Next(20, 32); } } @@ -525,15 +522,84 @@ namespace CalamityMod.World } } + //clear lava away from the side of the abyss + if (AtLeftSideOfWorld) + { + for (int abyssIndex = 0; abyssIndex < abyssChasmX + 155; abyssIndex++) + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + Tile tile = Main.tile[abyssIndex, abyssIndex2]; + + if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) + { + tile.LiquidAmount = 0; + } + } + } + } + else + { + for (int abyssIndex = abyssChasmX - 155; abyssIndex < x; abyssIndex++) + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + Tile tile = Main.tile[abyssIndex, abyssIndex2]; + + if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) + { + tile.LiquidAmount = 0; + } + } + } + } + + //ambient tiles and pots if (AtLeftSideOfWorld) { for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 { for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { - //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { + //above the 4th layer + if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + { + //giant kelp, more often in upper layers + if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || + (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) + { + ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); + } + + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) + { + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); + } + } + + //below 4th layer + if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + { + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) + { + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); + } + } + + //pots if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) { if (WorldGen.genRand.NextBool(5)) @@ -542,6 +608,7 @@ namespace CalamityMod.World CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } + //sulphur pots else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) { if (WorldGen.genRand.NextBool(3)) @@ -560,9 +627,45 @@ namespace CalamityMod.World { for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { - //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { + //above the 4th layer + if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + { + //giant kelp, more often in upper layers + if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || + (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) + { + ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); + } + + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) + { + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); + } + } + + //below 4th layer + if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + { + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) + { + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); + } + } + + //pots if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) { if (WorldGen.genRand.NextBool(5)) @@ -571,6 +674,7 @@ namespace CalamityMod.World CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } + //sulphur pots else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) { if (WorldGen.genRand.NextBool(3)) @@ -1027,4 +1131,4 @@ namespace CalamityMod.World } #endregion } -} \ No newline at end of file +} diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 43734d8122..f092bab67c 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -25,7 +25,9 @@ namespace CalamityMod.World { if (!Convert) { - if (WorldGen.genRand.Next(365) == 0 && Main.tile[x, y].TileType == TileID.Cloud && Main.tile[x, y].HasTile) + Tile tile = Main.tile[x, y]; + + if (WorldGen.genRand.Next(365) == 0 && tile.TileType == TileID.Cloud && tile.HasTile) { ShapeData circle = new ShapeData(); GenAction blotchMod = new Modifiers.Blotches(2, 0.4); diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 3c77b19d1e..bdb7e5e0b9 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -26,14 +26,15 @@ namespace CalamityMod.World static int lavaLakePlaceDelay = 0; static int lavaLakeBigPlaceDelay = 0; + static int numLavaLakes = 0; static int TreeDelay = 0; - //basic terrain (sorry for the excessive amount of loops lmao) + //all the main crags terrain generation private static void GenCrags() { - //set this here so it can properly scale to the worldsize and whatever - //the 25's are there to offset it from the exact edge of the world so no "out of bounds" crashing occurs + //set StartX here so it can properly scale with worldsize (just to be safe) + //the 25's are there to offset it from the exact edge of the world so that no "out of bounds" crashing occurs StartX = WorldGen.dungeonX < Main.maxTilesX / 2 ? 25 : (Main.maxTilesX - (Main.maxTilesX / 5)) - 25; //set these to be able to easily place things in certain locations, like structures @@ -41,7 +42,7 @@ namespace CalamityMod.World int biomeEdge = biomeStart + (Main.maxTilesX / 5); int biomeMiddle = (biomeStart + biomeEdge) / 2; - //clear all blocks and lava in the area + //clear literally everything in the area the biome will generate in for (int x = biomeStart; x <= biomeEdge; x++) { for (int y = Main.maxTilesY - 200; y < Main.maxTilesY - 2; y++) @@ -77,7 +78,19 @@ namespace CalamityMod.World tileDown.TileType != ModContent.TileType() || tileLeft.TileType != ModContent.TileType() || tileRight.TileType != ModContent.TileType())) { - CalamityUtils.NaturalCircle(x, y, WorldGen.genRand.Next(5, 22), ModContent.TileType(), true); + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + int radius = WorldGen.genRand.Next(5, 22); + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); } } } @@ -91,14 +104,26 @@ namespace CalamityMod.World } } - //place ceiling across the top of the biome + //place ceiling of slag across the top of the biome for (int x = biomeStart; x <= biomeEdge; x++) { for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 192; y++) { if (WorldGen.genRand.Next(25) == 0) { - CalamityUtils.NaturalCircle(x, y, WorldGen.genRand.Next(5, 15), ModContent.TileType(), true); + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + int radius = WorldGen.genRand.Next(3, 7); + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); } } } @@ -166,15 +191,19 @@ namespace CalamityMod.World lavaLakeBigPlaceDelay--; } - //surface lava lakes and pits - //the reason theres three different runners being used is so that a shallow lava pit is placed above each lava pit + //surface lava pits if (lavaLakeBigPlaceDelay == 0) { - LavaTileRunner runner3 = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500), - new Point16(250, 1000), 15f, WorldGen.genRand.Next(300, 1000), 0, true, true); - runner3.Start(); + //do not place lava in the general middle area of the biome because it keeps flooding the crag bridge + if (numLavaLakes != 2 && numLavaLakes != 3) + { + LavaTileRunner runner3 = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500), + new Point16(250, 1000), 15f, WorldGen.genRand.Next(300, 1000), 0, true, true); + runner3.Start(); + } - lavaLakeBigPlaceDelay = 240; //set lava lake delay so it cant just spam lava lakes everywhere + numLavaLakes++; + lavaLakeBigPlaceDelay = 200; //set lava lake delay so it cant just spam lava lakes everywhere } } @@ -185,8 +214,8 @@ namespace CalamityMod.World { if (WorldGen.genRand.Next(1200) == 0) { - LavaTileRunner runner = new LavaTileRunner(new Vector2(x, y), new Vector2(0, 5), new Point16(-20000, 20000), - new Point16(-12, 12), 15f, WorldGen.genRand.Next(12, 25), 0, true, true); + LavaTileRunner runner = new LavaTileRunner(new Vector2(x, y), new Vector2(0, 5), new Point16(0, 5), + new Point16(-12, 12), 15f, WorldGen.genRand.Next(-12, 25), 0, true, true); runner.Start(); } } @@ -209,7 +238,7 @@ namespace CalamityMod.World } } - //charred ore + //place clumps of charred ore for (int x = biomeStart; x <= biomeEdge; x++) { for (int y = Main.maxTilesY - 150; y <= Main.maxTilesY - 45; y++) @@ -249,7 +278,7 @@ namespace CalamityMod.World } } - //clean up any lava above a certain threshold to prevent the biome's surface from being flooded + //clean up any lava in the biomes surface to prevent it from being obnoxiously flooded for (int x = biomeStart; x <= biomeEdge; x++) { for (int y = Main.maxTilesY - 150; y <= Main.maxTilesY - 122; y++) @@ -276,7 +305,7 @@ namespace CalamityMod.World //stalactites and stalagmites if (tile.TileType == ModContent.TileType()) { - if (WorldGen.genRand.Next(32) == 0) + if (WorldGen.genRand.Next(20) == 0) { ushort[] Stalactites = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -284,7 +313,7 @@ namespace CalamityMod.World WorldGen.PlaceObject(x, y + 2, WorldGen.genRand.Next(Stalactites)); } - if (WorldGen.genRand.Next(10) == 0) + if (WorldGen.genRand.Next(8) == 0) { ushort[] Stalactites = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), @@ -312,17 +341,16 @@ namespace CalamityMod.World WorldGen.PlaceObject(x, y - 1, WorldGen.genRand.Next(Stalagmites)); } - //decrease tree delay if (TreeDelay > 0) { TreeDelay--; } //grow spine tree - if (WorldGen.genRand.Next(12) == 0 && TreeDelay == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(3) == 0 && TreeDelay == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { SpineTree.Spawn(x, y - 1, 22, 28, false, -1, false); - TreeDelay = 15; + TreeDelay = 20; } } } diff --git a/World/DungeonArchive.cs b/World/DungeonArchive.cs index d63bb58129..88a6212a89 100644 --- a/World/DungeonArchive.cs +++ b/World/DungeonArchive.cs @@ -19,95 +19,89 @@ namespace CalamityMod.World { public static void PlaceArchive() { - int archiveX = 0; - int archiveY = 0; + int worldThird = Main.maxTilesX / 3; - bool placedArchive = false; - bool foundValidPosition = false; - bool shouldPlaceTheDamnThing = false; int dungeonArchiveColor = 0; //0 = blue, 1 = green, 2 = pink - int heightLimit = (Main.maxTilesY / 2) + (Main.maxTilesY / 8); - - for (int x = WorldGen.dungeonX - 100; x <= WorldGen.dungeonX + 100; x++) + //start much higher above the top of hell so it doesnt get nuked by the crags generation, and so it wont generate too low + for (int j = Main.maxTilesY - 380; j > 0; j--) { - for (int y = Main.maxTilesY - 200; y >= heightLimit; y--) - { - Tile tile = Main.tile[x, y]; - Tile tileUp = Main.tile[x, y - 1]; - Tile tileUp2 = Main.tile[x, y - 2]; - Tile tileUp3 = Main.tile[x, y - 3]; - Tile tileDown = Main.tile[x, y + 1]; + int i = 100; + if (WorldGen.dungeonSide == 1) + { + i = Main.maxTilesX - 100; + } - if ((tile.TileType == 41 || tile.TileType == 43 || tile.TileType == 44 || tile.TileType == 48) && !tileUp.HasTile) + bool shouldContinue = true; + bool placedArchive = false; + int color = 0; + + while (shouldContinue) + { + if (WorldGen.dungeonSide == 1) { - //blue brick walls - if ((tileUp.WallType == 7 || tileUp.WallType == 94 || tileUp.WallType == 95) && - (tileUp2.WallType == 7 || tileUp2.WallType == 94 || tileUp2.WallType == 95) && - (tileUp3.WallType == 7 || tileUp3.WallType == 94 || tileUp3.WallType == 95)) + i--; + if (i < Main.maxTilesX - worldThird) { + shouldContinue = false; + } + } + else + { + i++; + if (i > worldThird) + { + shouldContinue = false; + } + } + + Tile tile = Main.tile[i, j]; + Tile tileUp1 = Main.tile[i, j - 1]; + Tile tileUp2 = Main.tile[i, j - 2]; + Tile tileUp3 = Main.tile[i, j - 3]; + Tile tileUp4 = Main.tile[i, j - 4]; + Tile tileUp5 = Main.tile[i, j - 5]; + + if (Main.tileDungeon[tile.TileType] && !tileUp1.HasTile && !tileUp2.HasTile && !tileUp3.HasTile && !tileUp4.HasTile && !tileUp5.HasTile) + { + //i += WorldGen.dungeonSide * -16; + + //determine the archive brick color + if (tile.TileType == TileID.BlueDungeonBrick) dungeonArchiveColor = 0; - archiveX = x; - archiveY = y; - - foundValidPosition = true; - } - //green brick walls - if ((tileUp.WallType == 8 || tileUp.WallType == 98 || tileUp.WallType == 99) && - (tileUp2.WallType == 8 || tileUp2.WallType == 98 || tileUp2.WallType == 99) && - (tileUp3.WallType == 8 || tileUp3.WallType == 98 || tileUp3.WallType == 99)) - { + else if (tile.TileType == TileID.GreenDungeonBrick) dungeonArchiveColor = 1; - archiveX = x; - archiveY = y; - - foundValidPosition = true; - } - //pink brick walls - if ((tileUp.WallType == 9 || tileUp.WallType == 96 || tileUp.WallType == 97) && - (tileUp2.WallType == 9 || tileUp2.WallType == 96 || tileUp2.WallType == 97) && - (tileUp3.WallType == 9 || tileUp3.WallType == 96 || tileUp3.WallType == 97)) - { + else if (tile.TileType == TileID.PinkDungeonBrick) dungeonArchiveColor = 2; - archiveX = x; - archiveY = y; + + placedArchive = true; - foundValidPosition = true; - } + break; } + } - //in order to make sure the archive places at the very bottom of the dungeon - //loop upward a certain amount, and if it doesnt place reset everything and increase the maximum check height before the loop ends - //this way it will keep checking upward so it places nicely and doesnt destroy other parts of the dungeon (or at least not as much) - if (x >= (WorldGen.dungeonX + 100) - 5 && y <= heightLimit + 5 && !foundValidPosition) + if (placedArchive) + { + bool firstItem = false; + + if (dungeonArchiveColor == 0) { - x = WorldGen.dungeonX - 100; - heightLimit -= 1; + SchematicManager.PlaceSchematic(SchematicManager.BlueArchiveKey, new Point(i, j), SchematicAnchor.TopCenter, + ref firstItem, new Action(FillArchiveChests)); + } + if (dungeonArchiveColor == 1) + { + SchematicManager.PlaceSchematic(SchematicManager.GreenArchiveKey, new Point(i, j), SchematicAnchor.TopCenter, + ref firstItem, new Action(FillArchiveChests)); + } + if (dungeonArchiveColor == 2) + { + SchematicManager.PlaceSchematic(SchematicManager.PinkArchiveKey, new Point(i, j), SchematicAnchor.TopCenter, + ref firstItem, new Action(FillArchiveChests)); } - } - } - if (foundValidPosition && !placedArchive) - { - bool firstItem = false; - - if (dungeonArchiveColor == 0) - { - SchematicManager.PlaceSchematic(SchematicManager.BlueArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter, - ref firstItem, new Action(FillArchiveChests)); + break; } - if (dungeonArchiveColor == 1) - { - SchematicManager.PlaceSchematic(SchematicManager.GreenArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter, - ref firstItem, new Action(FillArchiveChests)); - } - if (dungeonArchiveColor == 2) - { - SchematicManager.PlaceSchematic(SchematicManager.PinkArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter, - ref firstItem, new Action(FillArchiveChests)); - } - - placedArchive = true; } } diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index fed61a2bfc..b827bdb11b 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -372,7 +372,7 @@ namespace CalamityMod.World iceTilesInArea++; } } - if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.2f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.35f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) { tries++; } From 5e35925fb22af9ab88fdcfdddac0c5fd6bb62d00 Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Sat, 4 Feb 2023 15:16:01 -0500 Subject: [PATCH 2/3] Update Abyss.cs --- World/Abyss.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/World/Abyss.cs b/World/Abyss.cs index 2eaf9f49d4..56e1af5b72 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -522,7 +522,7 @@ namespace CalamityMod.World } } - //clear lava away from the side of the abyss + //clear lava and glowing moss away from the side of the abyss because it ruins immersion if (AtLeftSideOfWorld) { for (int abyssIndex = 0; abyssIndex < abyssChasmX + 155; abyssIndex++) @@ -535,6 +535,13 @@ namespace CalamityMod.World { tile.LiquidAmount = 0; } + + int[] Mosses = { 381, 534, 536, 539, 625, 627 }; + + if (Mosses.Contains(tile.TileType)) + { + tile.TileType = TileID.Stone; + } } } } @@ -550,6 +557,13 @@ namespace CalamityMod.World { tile.LiquidAmount = 0; } + + int[] Mosses = { 381, 534, 536, 539, 625, 627 }; + + if (Mosses.Contains(tile.TileType)) + { + tile.TileType = TileID.Stone; + } } } } From bcbfeaf34a70d460a4b6c5a51b8564598916d087 Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Sat, 4 Feb 2023 15:55:11 -0500 Subject: [PATCH 3/3] last things before PR --- World/Abyss.cs | 3 +++ World/DungeonArchive.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/World/Abyss.cs b/World/Abyss.cs index 56e1af5b72..3364142fb6 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -13,8 +13,11 @@ using CalamityMod.Tiles.Ores; using CalamityMod.Walls; using Microsoft.Xna.Framework; using System; +using System.Linq; +using System.Collections.Generic; using Terraria; using Terraria.ID; +using Terraria.IO; using Terraria.ModLoader; namespace CalamityMod.World diff --git a/World/DungeonArchive.cs b/World/DungeonArchive.cs index 88a6212a89..5c86cd5991 100644 --- a/World/DungeonArchive.cs +++ b/World/DungeonArchive.cs @@ -62,6 +62,9 @@ namespace CalamityMod.World Tile tileUp4 = Main.tile[i, j - 4]; Tile tileUp5 = Main.tile[i, j - 5]; + int[] DungeonWalls = { 7, 94, 95, 8, 98, 99, 9, 96, 97 }; + //if (Main.tileDungeon[tile.TileType] && DungeonWalls.Contains(tileUp.WallType) && !tileUp.HasTile) + if (Main.tileDungeon[tile.TileType] && !tileUp1.HasTile && !tileUp2.HasTile && !tileUp3.HasTile && !tileUp4.HasTile && !tileUp5.HasTile) { //i += WorldGen.dungeonSide * -16;