Jonah Graham
Terrarian
I'm gonna post this again because no one replied to my other one. Basically I'm getting this error and I'm trying to figure out which line of code is causing it. Can someone please help me figure it out? I am also not very good at coding and stuff so if you would like to join my Discord and help me and stuff please ask me. The code is very unfinished but it was happening before I added the unfinished part.
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Microsoft.Xna.Framework;
namespace SpiritsofEvil.NPCs
{
[AutoloadBossHead]
public class WardingEye : ModNPC
{
private Player player;
private float speed;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Warding Eye");
Main.npcFrameCount[npc.type] = 1;
}
public override void SetDefaults()
{
npc.aiStyle = 2;
npc.lifeMax = 5000;
npc.damage = 20;
npc.defense = 20;
npc.knockBackResist = 0f;
npc.width = 100;
npc.height = 100;
npc.value = 20000;
npc.npcSlots = 3f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
music = MusicID.Boss1;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}
public override void AI()
{
Target();
}
private void Target()
{
player = Main.player[npc.target];
}
private void Move(Vector2 offset)
{
}
public override void FindFrame(int frameHeight)
{
speed = 5f;
Vector2 moveTo = player.Center + offset;
Vector2 move = moveTo - npc.Center;
float magnitude = (float)MathHelper.Sqrt(move.X * move.Y * move.Y);
}
public override void NPCLoot()
{
//part 3
}
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
{
scale = 1.5f;
return null;
}
}
}
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Microsoft.Xna.Framework;
namespace SpiritsofEvil.NPCs
{
[AutoloadBossHead]
public class WardingEye : ModNPC
{
private Player player;
private float speed;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Warding Eye");
Main.npcFrameCount[npc.type] = 1;
}
public override void SetDefaults()
{
npc.aiStyle = 2;
npc.lifeMax = 5000;
npc.damage = 20;
npc.defense = 20;
npc.knockBackResist = 0f;
npc.width = 100;
npc.height = 100;
npc.value = 20000;
npc.npcSlots = 3f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
music = MusicID.Boss1;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}
public override void AI()
{
Target();
}
private void Target()
{
player = Main.player[npc.target];
}
private void Move(Vector2 offset)
{
}
public override void FindFrame(int frameHeight)
{
speed = 5f;
Vector2 moveTo = player.Center + offset;
Vector2 move = moveTo - npc.Center;
float magnitude = (float)MathHelper.Sqrt(move.X * move.Y * move.Y);
}
public override void NPCLoot()
{
//part 3
}
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
{
scale = 1.5f;
return null;
}
}
}