a

So what if you're making a large sword, and you want to add a debuff to it? Check out Getting Started With Modding. But there are some things that berberborscing doesn't touch on, regarding items.

Go to http://dev.willhuxtable.com/ids/#buff for a buff list. Remember something- not many buffs work against enemies. Most likely the only ones you should tinker with are the ones that an existing item uses.

But what else can you do? Obviously you can add dust, but I myself don't really understand dust and I prefer to stay away from it. So what can we do? Oh yeah, what did 1.2 add that revolutionized melee? Melee projectiles.
So how do you make a sword shoot a projectile?
Let's see.

You should know where to put this, the "Items" folder.
Code:
{
"displayName": "Sword of Shootiness",
"size": [width, height],
"maxStack": number,
"value": [platinum, gold, silver, copper],
"rare": number,
"tooltip": "string",
"useStyle": [For a broadsword, usually 1],
"useAnimation": number,
"useTime": number,
"damage": number,
"knockback": number,
"useSound": [Usually 1 for boradswords],
"autoReuse": bool,
"melee": true,
"shoot": InternalName:Projectile,

"recipes":
[{
"items": { "material": number, "material": number },
"tiles": [ "tile", "tile" ],
"creates": [Usually 1 for weapons]
}]
}
In the "Projectiles" folder.
Code:
{
"displayName": "string",
"size": [width, height],
"damage": number,
"knockback": number,
"aiStyle": 27,
"ranged": true
}
Dat middle collumn.
 
although, rather than doing ranged, you could probably do something like "noMelee": false, so that the projectile is affected by melee booster (I'm not sure if this actually matters, I did it, and it compiled fine)
 
I don't want to crash the party, but you forgot "shootSpeed" in your item's JSON. Also, the "damage" json property doesn't affect the projectile at all.

although, rather than doing ranged, you could probably do something like "noMelee": false, so that the projectile is affected by melee booster (I'm not sure if this actually matters, I did it, and it compiled fine)

Setting "noMelee" to false doesn't really change anything, it's default is false after all. "noMelee" is a property that makes the item texture that is currently used not do damage, which is why all ranged weapons have this to true.

Ooh I didn't think of that. Nice catch. The projectile should in fact count as ranged damage. I'm going to add some illuminating comments as well.

If the projectile's "melee" is set to true, then it should be counted as a melee. If that is not working, you should probably change the projectile's damage directly using the projectile's AI() like this...

Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace ModInternalName.Projectiles
{   
    public class ProjectileName : ModProjectile
    {
        public override void AI()
        {
            Player player = Main.player[projectile.owner];
            int damage = 10; //Set damage to anything...
            float meleeMult = player.meleeDamage;
            projectile.damage = damage *meleeMult;
        }
    }
}

Of course you can just do all that directly in projectile.damage, but that was separated to show the individual stuff...

But anyways, dat middle collumn. ( ͡° ͜ʖ ͡°)
 
Back
Top Bottom