tModLoader Can someone help with this?

I am trying to make an early game sword that fires a Sand Ball-esque projectile. Whenever I try to load the mod it tells me it needs a semicolon on 27,29, despite the fact I do have a semicolon there. Here's the code.
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace DuncanMod.Items.Weapons
{
public class MoreClaymore : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("Shoots clay blocks when swung.");
}

public override void SetDefaults() {
item.damage = 12;
item.melee = true;
item.width = 40;
item.height = 40;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare = 2;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.shoot = ProjectileID.42;
item.shootSpeed = 5f;
}

public override void AddRecipes() {
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType("Clay"), 10);
recipe.AddTile(mod.TileType("Furnace"));
recipe.SetResult(this);
recipe.AddRecipe();
}

public override bool AltFunctionUse(Player player) {
return true;
}

public override bool CanUseItem(Player player) {
if (player.altFunctionUse == 2) {
item.useStyle = 3;
item.useTime = 20;
item.useAnimation = 20;
item.damage = 20;
item.shoot = ProjectileID.42;
}
else {
item.useStyle = 1;
item.useTime = 40;
item.useAnimation = 40;
item.damage = 24;
item.shoot = 0;
}
return base.CanUseItem(player);
}

public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) {
if (player.altFunctionUse == 2) {}
}

public override void MeleeEffects(Player player, Rectangle hitbox) {
if (Main.rand.NextBool(3)) {
if (player.altFunctionUse == 2) {
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 169, 0f, 0f, 100, default(Color), 2f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity.X += player.direction * 2f;
Main.dust[dust].velocity.Y += 0.2f;
}
else {
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Fire, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 2.5f);
Main.dust[dust].noGravity = true;
}
}
}

public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) {
// Fix the speedX and Y to point them horizontally.
speedX = new Vector2(speedX, speedY).Length() * (speedX > 0 ? 1 : -1);
speedY = 0;
Vector2 speed = new Vector2(speedX, speedY);
speed = speed.RotatedByRandom(MathHelper.ToRadians(30));
damage = (int)(damage * .1f);
speedX = speed.X;
speedY = speed.Y;
return true;
}
}
}
 
You're using ProjectileID wrong. For the Sand Gun's projectile, it's either going to be item.shoot = 42; or item.shoot = ProjectileID.SandBallGun;.
 
Back
Top Bottom