Standalone [1.3] tModLoader - A Modding API

I get this error when I try to build my mod:
Code:
c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\Items\DragonEgg.cs(32,13) : warning CS0162: Unreachable code detected

c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\NPCs\Boss\DragonSlime.cs(71,40) : error CS0234: The type or namespace name 'NewProjectile' does not exist in the namespace 'GunPulse.Projectile' (are you missing an assembly reference?)
And here is the code for the Dragon Slime
Code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace GunPulse.NPCs.Boss
{
    public class DragonSlime : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Dragon Slime";
            npc.displayName = "Dragon Slime";
            npc.aiStyle = 3;
            npc.lifeMax = 5000;
            npc.damage = 60;
            npc.defense = 200;
            npc.knockBackResist = 0;
            npc.width = 162;
            npc.height = 126;
            animationType = NPCID.Zombie;
            Main.npcFrameCount[npc.type] = 3;
            npc.value = Item.buyPrice(0, 40, 75, 42);
            aiType = NPCID.Bunny;
            npc.npcSlots = 1f;
            npc.boss = true;
            npc.lavaImmune = true;
            npc.noGravity = false;
            npc.noTileCollide = false;
            npc.soundHit = 8;
            npc.soundKilled = 14;
            npc.netAlways = true;
        }
        public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
        {
            bossHeadTexture = "GunPulse/NPCs/Boss/DragonSlime_Head_Boss";
        }
        public override void BossLoot(ref string name, ref int potionType)
        {
            potionType = ItemID.GreaterHealingPotion;
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBar"), 23);
        }
        public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
        {
            npc.lifeMax += (int)(npc.lifeMax * 0.579f * bossLifeScale);
            npc.damage += (int)(npc.damage * 0.6f);
        }
        public override void AI()
        {
            npc.ai[0]++;
            Player P = Main.player[npc.target];
            if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
            {
                npc.TargetClosest(true);
            }
            npc.netUpdate = true;

            npc.ai[1]++;
            if (npc.ai[1] >= 230)
            {
                float Speed = 20f;
                Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2));
                int damage = 10;
                int type = mod.ProjectileType("DragonSlimePro");
                Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
                float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
                int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1);
                npc.ai[1] = 0;
            }
        }
    }
}
Whats wrong here?

First error: don't know because you didn't post the code, but I presume there is some code behind a return statement.

Second error: you haven't provided the right parameters for NewProjectile (it has no overloads).
Code:
int Projectile.NewProjectile(float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float Knockback, [int Owner = 255], [float ai0 = 0], [float ai1 = 0])
Example gun is missing using terraria on top.
Disregard, already sorted privately.
 
ID 207, aiStyle 1, its homing isnt in its ai style, but in the bullet itself
what would I do, maybe try to find close enemies and then change the velocity to go towards that, but all those velocity, vector things don't make much sense to me, and I think I would have to use those to do that

someone pls help me
 
what would I do, maybe try to find close enemies and then change the velocity to go towards that, but all those velocity, vector things don't make much sense to me, and I think I would have to use those to do that

someone pls help me
so, what are you trrying to do that you need a homing projctile
 
Back
Top Bottom