Skip to content

Commit

Permalink
Fixed Lightning Moth OOB Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcri committed May 4, 2022
1 parent c22e070 commit b79159c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Content/NPCs/Bosses/LightningMoth/LightningMoth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public override void SetDefaults()
//bossBag = ModContent.ItemType<SnowriumBag>();
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");
Expand Down Expand Up @@ -433,6 +435,11 @@ private void CrystalStomp()
}
}

private void Circular()
{

}

private void Teleport()
{
UpdateFrame(0.3f, 0, 5);
Expand All @@ -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<LightningGem>(), 30, 0f, Main.myPlayer, 0f, 0f);
int rot = Main.rand.Next(360);
Expand All @@ -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++)
Expand All @@ -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++)
Expand All @@ -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++)
Expand All @@ -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++)
Expand Down Expand Up @@ -1424,6 +1431,7 @@ public override void AI()
}
}


public class LightningGem : ModProjectile
{

Expand Down
Binary file added Content/NPCs/Bosses/LightningMoth/TestLance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b79159c

Please sign in to comment.