I get 11 errors while using the
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
}
hook:
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(40,29) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(40,23) : error CS0115: 'BFG69000.Shoot(Player, ref Vector2, ref float, ref float, ref int, ref int, ref float)': no suitable method found to override
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(29,3) : error CS0103: The name 'projectile' does not exist in the current context
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(30,3) : error CS0103: The name 'projectile' does not exist in the current context
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(43,29) : error CS0103: The name 'MathHelper' does not exist in the current context
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(44,24) : error CS0103: The name 'Vector2' does not exist in the current context
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(44,46) : error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(47,16) : error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(47,45) : error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(47,79) : error CS0103: The name 'MathHelper' does not exist in the current context
C:\Users\goodw\OneDrive\Документы\My Games\Terraria\ModLoader\Mod Sources\stupidopweapon\Items\BFG69000.cs(48,16) : error CS0103: The name 'Projectile' does not exist in the current context
And heres my code:
Code:
using Terraria.ID;
using Terraria.ModLoader;
namespace stupidopweapon.Items
{
public class BFG69000 : ModItem
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault(BFG 69000); // 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("stupid op");
}
public override void SetDefaults()
{
item.damage = 69420;
item.melee = true;
item.width = 40;
item.height = 40;
item.useTime = 1;
item.useAnimation = 1;
item.useStyle = 1;
item.knockBack = 69;
item.value = 10000;
item.rare = 2;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.shoot = ProjectileID.NightBeam;
projectile.aiStyle = 0;
projectile.friendly = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float numberProjectiles = 50; // 3 shots
float rotation = MathHelper.ToRadians(45);//Shoots them in a 45 degree radius. (This is technically 90 degrees because it's 45 degrees up from your cursor and 45 degrees down)
position += Vector2.Normalize(new Vector2(speedX, speedY)) * 45f; //45 should equal whatever number you had on the previous line
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f; // Vector for spread. Watch out for dividing by 0 if there is only 1 projectile.
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI); //Creates a new projectile with our new vector for spread.
}
return false; //makes sure it doesn't shoot the projectile again after this
}
}
}
45 degree radius. (This is technically 90 degrees because it's 45 degrees up from your cursor and 45 degrees down)
position += Vector2.Normalize(new Vector2(speedX, speedY)) * 45f; //45 should equal whatever number you had on the previous line
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f; // Vector for spread. Watch out for dividing by 0 if there is only 1 projectile.
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI); //Creates a new projectile with our new vector for spread.
}
return false; //makes sure it doesn't shoot the projectile again after this
}
}
}
[CODE]