KiNG_Rustt
Terrarian
so i wanted to try and make a mod but im having problems with the projectile only two errors but still. could anybody help and see whats wrong with my code thanks a bunch.
Sword:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace RampageMod.Items
{
public class Swordofsparking : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sword of sparking"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
Tooltip.SetDefault("Shoots sparks when swung.");
}
public override void SetDefaults()
{
Item.damage = 17;
Item.DamageType = DamageClass.Melee;
Item.width = 40;
Item.height = 40;
Item.useTime = 24;
Item.useAnimation = 24;
Item.useStyle = 1;
Item.knockBack = 6;
Item.value = 1200;
Item.rare = 1;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shoot = Mod.ProjectileType("Sword of sparking beam");
Item.shootSpeed = 12f;
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.IronBroadsword, 1); recipe.AddIngredient(ItemID.WandofSparking, 1);
recipe.AddTile(TileID.Anvils);
recipe.Register();
}
}
}
Projectile for it:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace RampageMod.Items
{
public class Swordofsparkingbeam : ModProjectile
{
public override void SetDefaults()
{
Projectile.Name = "Sword of sparking beam";
Projectile.width = 30;
Projectile.height = 58;
Projectile.friendly = true;
Projectile.melee = true;
Projectile.tileCollide = true;
Projectile.penetrate = 30;
Projectile.timeLeft = 200;
Projectile.light = 0.75f;
Projectile.extraUpdates = 1;
Projectile.ignoreWater = true;
}
public override void AI()
{
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f;
}
}
}
Sword:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace RampageMod.Items
{
public class Swordofsparking : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sword of sparking"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
Tooltip.SetDefault("Shoots sparks when swung.");
}
public override void SetDefaults()
{
Item.damage = 17;
Item.DamageType = DamageClass.Melee;
Item.width = 40;
Item.height = 40;
Item.useTime = 24;
Item.useAnimation = 24;
Item.useStyle = 1;
Item.knockBack = 6;
Item.value = 1200;
Item.rare = 1;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shoot = Mod.ProjectileType("Sword of sparking beam");
Item.shootSpeed = 12f;
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.IronBroadsword, 1); recipe.AddIngredient(ItemID.WandofSparking, 1);
recipe.AddTile(TileID.Anvils);
recipe.Register();
}
}
}
Projectile for it:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace RampageMod.Items
{
public class Swordofsparkingbeam : ModProjectile
{
public override void SetDefaults()
{
Projectile.Name = "Sword of sparking beam";
Projectile.width = 30;
Projectile.height = 58;
Projectile.friendly = true;
Projectile.melee = true;
Projectile.tileCollide = true;
Projectile.penetrate = 30;
Projectile.timeLeft = 200;
Projectile.light = 0.75f;
Projectile.extraUpdates = 1;
Projectile.ignoreWater = true;
}
public override void AI()
{
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f;
}
}
}