From b79159ca10342a7d935aeb135ba39ad6da0846b3 Mon Sep 17 00:00:00 2001 From: Arcri Date: Tue, 3 May 2022 20:39:10 -0600 Subject: [PATCH] Fixed Lightning Moth OOB Error --- .../Bosses/LightningMoth/LightningMoth.cs | 18 +++++++++++++----- .../NPCs/Bosses/LightningMoth/TestLance.png | Bin 0 -> 539 bytes 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 Content/NPCs/Bosses/LightningMoth/TestLance.png diff --git a/Content/NPCs/Bosses/LightningMoth/LightningMoth.cs b/Content/NPCs/Bosses/LightningMoth/LightningMoth.cs index 9530d38b..0f4b2d41 100644 --- a/Content/NPCs/Bosses/LightningMoth/LightningMoth.cs +++ b/Content/NPCs/Bosses/LightningMoth/LightningMoth.cs @@ -50,8 +50,10 @@ public override void SetDefaults() //bossBag = ModContent.ItemType(); music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/LightningMoth"); } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + var effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Texture2D glowTex = ModContent.GetTexture("AerovelenceMod/Content/NPCs/Bosses/LightningMoth/LightningMoth_Glow"); Texture2D auraTex = ModContent.GetTexture("AerovelenceMod/Content/NPCs/Bosses/LightningMoth/LightningMoth_Aura"); @@ -433,6 +435,11 @@ private void CrystalStomp() } } + private void Circular() + { + + } + private void Teleport() { UpdateFrame(0.3f, 0, 5); @@ -446,6 +453,7 @@ private void Teleport() if (attackCounter == 100) { + Main.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 66); Projectile.NewProjectile(npc.position, Vector2.Zero, ModContent.ProjectileType(), 30, 0f, Main.myPlayer, 0f, 0f); int rot = Main.rand.Next(360); @@ -455,7 +463,7 @@ private void Teleport() npc.position.Y = player.Center.Y + (int)(distance * angley); colorLerp = MathHelper.Lerp(colorLerp, 0f, 0.1f); - npc.velocity *= player.position / 2; + npc.velocity *= 0.95f; npc.netUpdate = true; for (int i = 0; i < 50; i++) @@ -474,7 +482,7 @@ private void Teleport() npc.position.Y = player.Center.Y + (int)(distance * angley); colorLerp = MathHelper.Lerp(colorLerp, 0f, 0.1f); - npc.velocity *= player.position / 2; + npc.velocity *= 0.95f; npc.netUpdate = true; for (int i = 0; i < 50; i++) @@ -493,7 +501,7 @@ private void Teleport() npc.position.Y = player.Center.Y + (int)(distance * angley); colorLerp = MathHelper.Lerp(colorLerp, 0f, 0.1f); - npc.velocity *= player.position / 2; + npc.velocity *= 0.95f; npc.netUpdate = true; for (int i = 0; i < 50; i++) @@ -512,8 +520,7 @@ private void Teleport() npc.position.Y = player.Center.Y + (int)(distance * angley); colorLerp = MathHelper.Lerp(colorLerp, 0f, 0.1f); - npc.velocity *= 1.005f; - npc.position = player.position * 5; + npc.velocity *= 0.95f; npc.netUpdate = true; for (int i = 0; i < 50; i++) @@ -1424,6 +1431,7 @@ public override void AI() } } + public class LightningGem : ModProjectile { diff --git a/Content/NPCs/Bosses/LightningMoth/TestLance.png b/Content/NPCs/Bosses/LightningMoth/TestLance.png new file mode 100644 index 0000000000000000000000000000000000000000..c4cbe885540d8b58c7273e8a56afb2f3c3f8dc5e GIT binary patch literal 539 zcmV+$0_6RPP)Px$)k#D_R7i=-fyLBY@-Y#F7|* z?8%Ywf1#Z5zJhk0hfe?+)$4)t>=R2g`=S`|6Aji;s@v`>P9=&*CPAG zqNq`=7r2lK`|kZJ?ifgR%LBFPJt)k7EJ5Y`YH=0ib3u$uw#X7T=3jPB#O6 zU!5HoAImQ}0Ij!oz$UTOTzD@Bk&x?rsjHVoy0?_|x09b30N?#=d