From eb23f15f9a3e5451fb3a67fca812c95c40f9acb0 Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Mon, 30 Jan 2023 21:17:36 -0500 Subject: [PATCH] a few small worldgen fixes, also funny snail --- Buffs/Pets/EidolonSnailBuff.cs | 30 +++ Buffs/Pets/EidolonSnailBuff.png | Bin 0 -> 591 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Pets/AbyssShellFossil.cs | 48 ++++ Items/Pets/AbyssShellFossil.png | Bin 0 -> 576 bytes Projectiles/Pets/EidolonSnail.cs | 333 ++++++++++++++++++++++++++ Projectiles/Pets/EidolonSnail.png | Bin 0 -> 3162 bytes Projectiles/Pets/EidolonSnailGlow.png | Bin 0 -> 1557 bytes Tiles/Abyss/AbyssFossilTile.cs | 35 +++ Tiles/Abyss/AbyssFossilTile.png | Bin 0 -> 969 bytes World/Abyss.cs | 43 +++- World/AstralBiome.cs | 6 +- World/GiantHive.cs | 8 +- World/UndergroundShrines.cs | 14 +- 14 files changed, 501 insertions(+), 18 deletions(-) create mode 100644 Buffs/Pets/EidolonSnailBuff.cs create mode 100644 Buffs/Pets/EidolonSnailBuff.png create mode 100644 Items/Pets/AbyssShellFossil.cs create mode 100644 Items/Pets/AbyssShellFossil.png create mode 100644 Projectiles/Pets/EidolonSnail.cs create mode 100644 Projectiles/Pets/EidolonSnail.png create mode 100644 Projectiles/Pets/EidolonSnailGlow.png create mode 100644 Tiles/Abyss/AbyssFossilTile.cs create mode 100644 Tiles/Abyss/AbyssFossilTile.png diff --git a/Buffs/Pets/EidolonSnailBuff.cs b/Buffs/Pets/EidolonSnailBuff.cs new file mode 100644 index 0000000000..086d38c0f8 --- /dev/null +++ b/Buffs/Pets/EidolonSnailBuff.cs @@ -0,0 +1,30 @@ +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class EidolonSnailBuff : ModBuff + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Escargidolon Snail"); + Description.SetDefault("It probably doesn't taste good, but is very friendly!"); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().eidolonSnailPet = true; + + bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + } + } +} diff --git a/Buffs/Pets/EidolonSnailBuff.png b/Buffs/Pets/EidolonSnailBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..6cc347ab66b62871e160e095a6af578ac274f825 GIT binary patch literal 591 zcmV-V0Px%2T4RhR9Hu2WI%xbNNjpA89|nS2`Csa2Y@a9eLDfKuRk8T1eTXBeTP@w({3TK zJinbDUUjUh3&8TA5E$GJ;4wb{cB#IaDwx)_u?EwUI?5wR_DL2D{uX zBMxg^qx%>=L|`GYYsMn5)V9>OD7gb?2n?75-pn-uyAYPo(c>N#r?}Drt`I;^3$SuR zB>5az3%nc{v<|=(*H|+*k|28SfaL~~Ltwxh;AR6U!Nk-QuzD6(NraHv`TW;vV5M)*+yK)ho=jjG7WcS(4l^HTE*NkJpqB$MpXdiU zgWc9$R12m>Dp#UJ_nY=`Fu$~~8BAYXw-+T1k(~<$%mFa(!Ae9Je}}jyn5ph%2BweN zDuQY2!}r0o;`~OGkb(IeCP;KHpt}QLZ9??6-;c|X)Xg9TY4JE;gK%L!hxrJWc3>d^ zlSlVCtgT3}HiQ{ScL%^+3~P|U9B_Ky3$T=Jz8IK>`5dMm?%=nOw7~ET(q`n){RgJW zZV?Tb1JFYPJuXp_I#N60@WfYODN`p2%0gh!H~`(Juv~&Jj-D1^e2V)8^l$*ojsfeO d4yXeFf^60lGNl(); + Item.Calamity().devItem = true; + + Item.shoot = ModContent.ProjectileType(); + Item.buffType = ModContent.BuffType(); + Item.UseSound = SoundID.Item2; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(Item.buffType, 15, true); + } + } + } +} diff --git a/Items/Pets/AbyssShellFossil.png b/Items/Pets/AbyssShellFossil.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f41db3151c9681c973df8bd35308f5e510d66f GIT binary patch literal 576 zcmV-G0>AxPx$`AI}UR9HvVn6XL&K@f($N^C_E#3mr7Qt|*sP=ug`7S_l^#K zl3EGd#>I`iyRP4QkyVKXFH{qVoYU}XIeYS66qA+CrDKZR9h7W>Xz)TIaAN=5A%MtB z8_TIMEn=D-R_LjICw?F9YkfC%JeV1wYwJ}xaZo1_X=P_iB4%=&li1C`u94(r8MF$- zM1vQKCEwhxIw#5F!fxtr1rd#?b#iGZ7W`@_SCmH$C6 z%D~^*@u_oiC5UELD1_&8QxYK)vBpt{*$zZu&(#1c1F|MjONcf8>q60QqHjb*R^%FK z?n5{OzbV;25rLbY6FLD~s}c}x)RYhz3D zw^uuGT$aA;rgh&}?@S;RtWYLv<)-gAe}h7`vA#{2_j+F;*8E|GegRbmA017|2p#|c O002ovPDHLkV1fWfYWtu7 literal 0 HcmV?d00001 diff --git a/Projectiles/Pets/EidolonSnail.cs b/Projectiles/Pets/EidolonSnail.cs new file mode 100644 index 0000000000..a43725cc6e --- /dev/null +++ b/Projectiles/Pets/EidolonSnail.cs @@ -0,0 +1,333 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Projectiles.Pets +{ + public class EidolonSnail : ModProjectile + { + private int playerStill = 0; + private bool fly = false; + private int idleTimer = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Escargidolon Snail"); + Main.projFrames[Projectile.type] = 8; + Main.projPet[Projectile.type] = true; + } + + public override void SetDefaults() + { + Projectile.netImportant = true; + Projectile.width = 54; + Projectile.height = 38; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft *= 5; + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnail").Value; + + int height = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = height * Projectile.frame; + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, + Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0); + + return false; + } + + public override void PostDraw(Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value; + + int height = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = height * Projectile.frame; + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Color.White, + Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0); + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + Player player = Main.player[Projectile.owner]; + Vector2 center2 = Projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + fallThrough = playerDistance > 200f; + return true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (!player.active) + { + Projectile.active = false; + return; + } + CalamityPlayer modPlayer = player.Calamity(); + if (player.dead) + { + modPlayer.eidolonSnailPet = false; + } + if (modPlayer.eidolonSnailPet) + { + Projectile.timeLeft = 2; + } + + Vector2 vector46 = Projectile.position; + if (!fly) + { + Projectile.rotation = 0; + Vector2 center2 = Projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (Projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 110f && Projectile.position.X == Projectile.oldPosition.X))) + { + Projectile.velocity.Y = -8f; + } + Projectile.velocity.Y += 0.35f; + if (Projectile.velocity.Y > 15f) + { + Projectile.velocity.Y = 15f; + } + if (playerDistance > 600f) + { + fly = true; + Projectile.velocity.X = 0f; + Projectile.velocity.Y = 0f; + } + if (playerDistance > 100f) + { + if (player.position.X - Projectile.position.X > 0f) + { + Projectile.velocity.X += 0.10f; + if (Projectile.velocity.X > 5f) + { + Projectile.velocity.X = 5f; + } + } + else + { + Projectile.velocity.X -= 0.10f; + if (Projectile.velocity.X < -5f) + { + Projectile.velocity.X = -5f; + } + } + } + if (playerDistance < 100f) + { + if (Projectile.velocity.X != 0f) + { + if (Projectile.velocity.X > 0.8f) + { + Projectile.velocity.X -= 0.25f; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.velocity.X += 0.25f; + } + else if (Projectile.velocity.X < 0.8f && Projectile.velocity.X > -0.8f) + { + Projectile.velocity.X = 0f; + } + } + } + if (playerDistance < 70f) + { + Projectile.velocity.X *= 0.5f; + } + + //set frames when idle + if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0) + { + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + //falling frame + if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) + { + Projectile.frame = 4; + Projectile.frameCounter = 0; + } + else + { + //moving animation + Projectile.frameCounter++; + if (Projectile.frameCounter > 2) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 4) + { + Projectile.frame = 1; + } + } + + if (Projectile.velocity.X > 0.8f) + { + Projectile.spriteDirection = 1; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.spriteDirection = -1; + } + } + else if (fly) + { + float num16 = 0.5f; + Projectile.tileCollide = false; + Vector2 vector3 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float horiPos = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - vector3.X; + float vertiPos = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - vector3.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)player.direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + float num21 = 18f; + float num27 = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + if (playerDistance > 1200f) + { + Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); + Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2); + Projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + num16 = 0.5f; + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 10 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + { + fly = false; + Projectile.velocity *= 0.2f; + Projectile.tileCollide = true; + } + } + if (playerDistance < 50f) + { + if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) + { + Projectile.velocity *= 0.90f; + } + num16 = 0.02f; + } + else + { + if (playerDistance < 100f) + { + num16 = 0.35f; + } + if (playerDistance > 300f) + { + num16 = 1f; + } + playerDistance = num21 / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + if (Projectile.velocity.X <= horiPos) + { + Projectile.velocity.X = Projectile.velocity.X + num16; + if (num16 > 0.05f && Projectile.velocity.X < 0f) + { + Projectile.velocity.X = Projectile.velocity.X + num16; + } + } + if (Projectile.velocity.X > horiPos) + { + Projectile.velocity.X = Projectile.velocity.X - num16; + if (num16 > 0.05f && Projectile.velocity.X > 0f) + { + Projectile.velocity.X = Projectile.velocity.X - num16; + } + } + if (Projectile.velocity.Y <= vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y + num16; + if (num16 > 0.05f && Projectile.velocity.Y < 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y + num16 * 2f; + } + } + if (Projectile.velocity.Y > vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y - num16; + if (num16 > 0.05f && Projectile.velocity.Y > 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y - num16 * 2f; + } + } + + Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; + + if (Projectile.Center.X < Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = 1; + } + else if (Projectile.Center.X > Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = -1; + } + + //funny flying animation + Projectile.frameCounter++; + if (Projectile.frameCounter > 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 7) + { + Projectile.frame = 5; + } + + idleTimer = 0; + } + } + + private bool HoleBelow() + { + int tileWidth = 4; + int tileX = (int)(Projectile.Center.X / 16f) - tileWidth; + if (Projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((Projectile.position.Y + Projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].HasTile) + { + return false; + } + } + } + return true; + } + } +} \ No newline at end of file diff --git a/Projectiles/Pets/EidolonSnail.png b/Projectiles/Pets/EidolonSnail.png new file mode 100644 index 0000000000000000000000000000000000000000..661849921168a2a7948bc0214637219a5b993a21 GIT binary patch literal 3162 zcmV-g45jmlP)Px>6i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0bK;x>|izUn*aa+07*qoM6N<$g7aY+ Ang9R* literal 0 HcmV?d00001 diff --git a/Projectiles/Pets/EidolonSnailGlow.png b/Projectiles/Pets/EidolonSnailGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..2097448bf6d55f93cb600fb616d2650722fb8246 GIT binary patch literal 1557 zcma)6c{J1u6dp&fgop`~eI3P|7}>XMV+Lc624l$57_yHVODVKGgJ0GOb7rzdqN(}G zC>%@aF&WQfXDV6RB!u@YDZ=yqdhc{j=k(Wi&pqF{_dDPH&ILSh=mX-4;t&YrfD6V6 zzl)|2h=_;S-rZ`oJm=Uhh{WO14v^YDiw|*BVd#?+D3#AoQIs1dCsWHqUIpuKe zZxCAu?OEkO@*c%q_zJOAr+<3mP?68gyXOu^eGDCbY;`_%5qB(Iuezyq$!6t@n#+sD zy7|@q0d{REEhdKpu$Y;mlh-xXhhmt-F+I8+6e>cebn=D>z@D2-vCMcSIHS>3dw}O> z|Jk5yiLcC`c^}kiXooHBk#H%KnRs0HQ0=m_8g4Sc0c*2$(ReY<=RtYkLRwgRS6lvv zxXc7ygqG@IN3HZ|%K|}%(Xpe?m`vFmtO1qRlM*p!s{kqt$}|3$lJ$H-EsB-$Y&Jzl zuXIqJNcvzj@jCttSisAfyw>|W1_3)3NlEcDrUp}$((>iW&70)E*SEmSK^r>eZgX$E zJ`;!np!xzho+24~gH}-zGL1wshVNR!)2TO#_&g%+_8b$|<3dn{k}Y!Xk%N!u`X*ts zr;YFB0zZ&5oH?5!3<^4zvHdwUQsR?H`{0!2G z#Cc(6?bLU3Ug1+p+9+A3xP0XZuSJF+;k!}F&5lX_8ozVPbipgxkTfTX@Wt<2=Tc~> zbruK?+mfTni0p+6Q8v)1g#47p09Pdz3=0OO>K~XP8{dO#Sk9>Zmo<1-Vp~HQ&|um9 zWRmyq?&Dm-zE>}XGn4wra6cAWfY@Sf6$bVvJs;m+|MpSm?+aIGKTi6PiF$}1yols= z_%%7lr8wN&cMK=Bl&NkBY?QoW6l@)0XA`s!uhkc6PW?4*#W#K>&6io0v_WJ#r zYd^6#oM-K30%eD>&nPma4Ehqyv>AzzLl`S-yRGVB;(vK_%q1EpK|zISdB&uugs6|& zY2TMVE1~hEHUCY@I~7dW)MWO%%Kc^gil4K=skS;cT2Qjx)^^7vS>WyNwH8AtRuF!l zRd7>3ujcrTO#1nCf1>k$QK*nv3F*UDl|5%g5G}_GEF$hNN>{0<-bx*gKpB~6-@iR5`?C9%)awpS{zGX+VA*NjbE%i} zAPP>9P1KKeeKX##9yzAu%(+BDo!0PHjhF2W9qD>xTYC_<+Zvp0{IU_r6H=^uVo7wz z$a#3Rv-TXHr+cr_7KhnkP@dy^3Pn^fmAnATe=9&U2YbY>8&bGTyi^oEX< zm9=V4-7+kvc}1o5{fbPFp`?4YS-|(5#=Ag*ZuG3vfej?>Z1BW>K^cK#4nq<;Us=jC z5?poqcwU&0O+zlnQ|}zS+ClSm1`t|`2aY4+3W`wJ=9x5n!o7E5z# zl!gi{@5qJ)>uJ}gFp0vWMdnaX4f;YSuO7$d#iSDx&)$JWkvvaj?+PpJzA7_MAfEd) zC|PH{IxBXF!>9f<8i15ft>{Q90=O3GuA7{(y|~>v2j% h{mBj?H4$vvfs}a%rJ@>Y{{8b17ZlE^*5UNEe*hsZ>vI4A literal 0 HcmV?d00001 diff --git a/Tiles/Abyss/AbyssFossilTile.cs b/Tiles/Abyss/AbyssFossilTile.cs new file mode 100644 index 0000000000..8428cb4f76 --- /dev/null +++ b/Tiles/Abyss/AbyssFossilTile.cs @@ -0,0 +1,35 @@ +using CalamityMod.Items.Fishing.SulphurCatches; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss +{ + public class AbyssFossilTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(29, 37, 58)); + DustType = 33; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/Abyss/AbyssFossilTile.png b/Tiles/Abyss/AbyssFossilTile.png new file mode 100644 index 0000000000000000000000000000000000000000..642a908547ed8b8c2e3fc927371e081e45a75411 GIT binary patch literal 969 zcmV;)12+7LP)Px&f=NU{RA@u(m`_O4VHn39gqFF5E;q(Z1=}FfggV$C!yu6^33-f)Q5U02hddY^ z1fxq4T{>2SBJ5&NhoTG;ELI1>G=eQbt1*5X89DP$mxAZVH+r7!-EUhv_d7tNfHb;e~ABU#8D*g+z8`+W(tEy}MRgCzxg}IXL;qUJ+*`l@=1_3>thsdDE zkHTcmnF~Wi%-7nI6I^0umim*?Ickk$oZ7dM=d=#i|5uU)6Vpx@1PxptW<)NBPLes7 z!gq^`F)W64j`oIVoo5p-sjFCWc@xu4m`V_0<<_+!7GpBNR55oa6{Mj@j3?B}br6Ha zlCvbHoiGU6I{1J&3n$zA4%2&8j7cIODd)==L#*ONOi#RGSu@|eQb|l(VaQINU^AHn z=X&~2(KCp|2Rd@zV^gCqn8_e5omY{^{6b?*NlZIoID#imhggL$dGIWYH8?J_naqN4 z9OThIGJKUm`#AfKk(ZST22Vv}dEIXr#L7k(Vymt503!$jASNphnbk0V{NX6AB$mH!UyQuQ$I@U-1@&sVrd$+?m$ypLB8(|RY_4vs#S=|Ez$lw_StcbO??ImKX z%gZ#iuHKvV>cR<7kt>*(ZH47~v#QX<;Qm22`?o<{44+OJb5V$bpzu1!76e_QDV&(%~IDchjp6?@v@~B&H(uBfUi9aX+alkBim2B2DKQES`ow~VeAk4lEgq3`*CP53}?Q^w z2u_2Tbh6?2O?p+|ZT>5TZ2IN?ITmwpy0Ia^V$9drMC0VX(xVS9veW r@0TYB{mRNi8)4E3yFY9D3;H*i_^en%Bi3C20000(), (ushort)ModContent.TileType(), - (ushort)ModContent.WallType(), UndergroundShrines.UndergroundShrineType.Abyss, abyssChasmX, AbyssChasmBottom); + (ushort)ModContent.WallType(), UndergroundShrines.UndergroundShrineType.Abyss, abyssChasmX, AbyssChasmBottom); + + //place eidolon snail fossil + int realFossilY = 0; + bool placedFossil = false; + + while (!placedFossil) + { + //make sure it places at the very bottom, below where the terminus shrine is + for (int fossilCheckY = AbyssChasmBottom + 30; fossilCheckY < AbyssChasmBottom + 100; fossilCheckY++) + { + if (Main.tile[abyssChasmX, fossilCheckY].HasTile && Main.tile[abyssChasmX, fossilCheckY].TileType == ModContent.TileType()) + { + realFossilY = fossilCheckY; + + //place a box of voidstone for the fossil to spawn on + for (int fossilX = abyssChasmX - 3; fossilX <= abyssChasmX + 3; fossilX++) + { + for (int fossilY = realFossilY - 2; fossilY <= realFossilY + 3; fossilY++) + { + WorldGen.PlaceTile(fossilX, fossilY, ModContent.TileType()); + } + } + + WorldGen.PlaceObject(abyssChasmX, realFossilY - 3, (ushort)ModContent.TileType()); + + placedFossil = true; + } + } + } int islandLocationOffset = 30; int islandLocationY = rockLayer; @@ -355,8 +384,7 @@ namespace CalamityMod.World //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 > rockLayer) + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) { if (WorldGen.genRand.NextBool(5)) { @@ -364,8 +392,7 @@ namespace CalamityMod.World CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 < (int)Main.worldSurface) + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) { if (WorldGen.genRand.NextBool(3)) { @@ -386,8 +413,7 @@ namespace CalamityMod.World //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 > rockLayer) + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) { if (WorldGen.genRand.NextBool(5)) { @@ -395,8 +421,7 @@ namespace CalamityMod.World CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 < (int)Main.worldSurface) + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) { if (WorldGen.genRand.NextBool(3)) { diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index b5b1711bdc..219ac5f8a0 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -127,11 +127,13 @@ namespace CalamityMod.World { float worldEdgeMargin = (float)Main.maxTilesX * 0.08f; int xLimit = Main.maxTilesX / 2; - int x = Abyss.AtLeftSideOfWorld ? rand.Next(400, xLimit) : rand.Next(xLimit, Main.maxTilesX - 400); + int x = Abyss.AtLeftSideOfWorld ? rand.Next(700, xLimit) : rand.Next(xLimit, Main.maxTilesX - 700); + /* while ((float)x > (float)Main.spawnTileX - worldEdgeMargin && (float)x < (float)Main.spawnTileX + worldEdgeMargin) { - x = Abyss.AtLeftSideOfWorld ? rand.Next(400, xLimit) : rand.Next(xLimit, Main.maxTilesX - 400); + x = Abyss.AtLeftSideOfWorld ? rand.Next(600, xLimit) : rand.Next(xLimit, Main.maxTilesX - 600); } + */ //world surface = 920 large 740 medium 560 small int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336 while (y < Main.maxTilesY) diff --git a/World/GiantHive.cs b/World/GiantHive.cs index cb988f670b..6bc609d0fb 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -119,10 +119,6 @@ namespace CalamityMod.World int radius = extraWidth - 1; - WorldUtils.Gen(new Point(origin.X + 2, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); WorldUtils.Gen(new Point(origin.X + 2, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] { blotchMod.Output(circle) @@ -142,10 +138,10 @@ namespace CalamityMod.World //chance to place blocks inside the tree for randomness if (WorldGen.genRand.Next(20) == 0) { - WorldUtils.Gen(new Point(origin.X + WorldGen.genRand.Next(-2, 2), y), new ModShapes.All(tinyCircle), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(origin.X + WorldGen.genRand.Next(-2, 2), y), new ModShapes.All(circle), Actions.Chain(new GenAction[] { new Actions.ClearTile(), - new Actions.PlaceWall(WallID.LivingWood) + new Actions.PlaceTile(TileID.LivingMahogany) })); } diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index 2857fb5fcc..fed61a2bfc 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -102,7 +102,9 @@ namespace CalamityMod.World } } if (!canGenerateInLocation || corruptStuffInArea < totalTiles * 0.5f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true; @@ -172,7 +174,9 @@ namespace CalamityMod.World } } if (!canGenerateInLocation || crimsonStuffInArea < totalTiles * 0.5f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true; @@ -236,7 +240,9 @@ namespace CalamityMod.World } } if (!canGenerateInLocation || desertTilesInArea < totalTiles * 0.3f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true; @@ -299,7 +305,9 @@ namespace CalamityMod.World } } if (!canGenerateInLocation || graniteWallsInArea < totalTiles * 0.95f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true; @@ -364,8 +372,10 @@ namespace CalamityMod.World iceTilesInArea++; } } - if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.35f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.2f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true; @@ -437,7 +447,9 @@ namespace CalamityMod.World } if (!canGenerateInLocation || marbleStuffInArea < totalTiles * 0.9f || airTilesBetweenPillar < totalTiles * 0.3f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { tries++; + } else { bool _ = true;