tAPI Spears+

Status
Not open for further replies.
Was made to be the spider fang spear but I changed it to the frost spear
FrostSpear.png


(EDIT: Oh wait. U already got the frost spear huh)
 
If it's fishron spear I would have to make quite the change, it's already weird enough as a frost spear
Maybe it could be used as a frost spear still, because it looks better than the frost spear that Ginnoken made (Ginnoken's sprite isn't bad but this one just looks better)

Edit: Maybe there could be two types of spider spear like there are two types of chlorophyte swords?
 
nvm palette swap everyday
-Fishron Spear
FishronSpear.png
FishronSpearPro.png

it looked slightly better than my frost spear. Either way Eli will decide on which sprite to use.
 
for the spears that do nothing but be spears just copy over the code and change the names
Who told you????
The star spear was not actually just copying over. I gave it a chance 2 shoot 2 different types of stars at random with this code
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace Spears.Projectiles
{
    public class StarSpearPro : ModProjectile
    {
        public override void AI()
        {
            projectile.light = 0.9f;
            int DustID = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 72, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.5f);
            Main.player[projectile.owner].direction = projectile.direction;
            Main.player[projectile.owner].heldProj = projectile.whoAmI;
            Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation;
            projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2);
            projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2);
            projectile.position += projectile.velocity * projectile.ai[0];
            if (projectile.ai[0] == 0f)
            {
                projectile.ai[0] = 3f;
                projectile.netUpdate = true;
            }
            if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3)
            {
                projectile.ai[0] -= 1.1f;
                if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner)
                {
                    projectile.localAI[0] = 1f;
                    if (Collision.CanHit(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, new Vector2(projectile.center().X + projectile.velocity.X * projectile.ai[0], projectile.center().Y + projectile.velocity.Y * projectile.ai[0]), projectile.width, projectile.height)) //The if statement to make a projectile after the spear point reaaches it's max distance; you can remove the if statements and the things it contains to make it a normal spear
                    {
                        int rand = Main.rand.Next(3);
                        if(rand == 0)
                            {
                                Projectile.NewProjectile(projectile.center().X + projectile.velocity.X , projectile.center().Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 12, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f);
                            }
                            else
                            {
                                Projectile.NewProjectile(projectile.center().X + projectile.velocity.X , projectile.center().Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 92, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f);
                            }
                        }
                    }
                }
                else
                {
                    projectile.ai[0] += 0.75f;
                }
                if (Main.player[projectile.owner].itemAnimation == 0)
                {
                    projectile.Kill();
                }
                projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f;
                if (projectile.spriteDirection == -1)
                {
                    projectile.rotation -= 1.57f;
                }
            }
        }
    }
 
Who told you????
The star spear was not actually just copying over. I gave it a chance 2 shoot 2 different types of stars at random with this code
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace Spears.Projectiles
{
    public class StarSpearPro : ModProjectile
    {
        public override void AI()
        {
            projectile.light = 0.9f;
            int DustID = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 72, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.5f);
            Main.player[projectile.owner].direction = projectile.direction;
            Main.player[projectile.owner].heldProj = projectile.whoAmI;
            Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation;
            projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2);
            projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2);
            projectile.position += projectile.velocity * projectile.ai[0];
            if (projectile.ai[0] == 0f)
            {
                projectile.ai[0] = 3f;
                projectile.netUpdate = true;
            }
            if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3)
            {
                projectile.ai[0] -= 1.1f;
                if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner)
                {
                    projectile.localAI[0] = 1f;
                    if (Collision.CanHit(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, new Vector2(projectile.center().X + projectile.velocity.X * projectile.ai[0], projectile.center().Y + projectile.velocity.Y * projectile.ai[0]), projectile.width, projectile.height)) //The if statement to make a projectile after the spear point reaaches it's max distance; you can remove the if statements and the things it contains to make it a normal spear
                    {
                        int rand = Main.rand.Next(3);
                        if(rand == 0)
                            {
                                Projectile.NewProjectile(projectile.center().X + projectile.velocity.X , projectile.center().Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 12, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f);
                            }
                            else
                            {
                                Projectile.NewProjectile(projectile.center().X + projectile.velocity.X , projectile.center().Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 92, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f);
                            }
                        }
                    }
                }
                else
                {
                    projectile.ai[0] += 0.75f;
                }
                if (Main.player[projectile.owner].itemAnimation == 0)
                {
                    projectile.Kill();
                }
                projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f;
                if (projectile.spriteDirection == -1)
                {
                    projectile.rotation -= 1.57f;
                }
            }
        }
    }
I meant for all the spears that don't shoot projectiles or particles, i know you can't just copy over the code from other spears then have them magically shoot the projectile you want them to shoot
 
I meant for all the spears that don't shoot projectiles or particles, i know you can't just copy over the code from other spears then have them magically shoot the projectile you want them to shoot
True. Should I True Dark Lance,True Gungnir, and also Terra Glaive
 
Status
Not open for further replies.
Back
Top Bottom