Dat middle collumn.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 }
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)
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.
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;
}
}
}