(God I'm posting so much lol) I got an error, and here is the error code and my code:
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\Items\Weapons\BladeOfVictory.cs(32,30) : error CS0161: 'TheOmegaMod.Items.Weapons.BladeOfVictory.Shoot(Terraria.Player, ref Microsoft.Xna.Framework.Vector2, ref float, ref float, ref int, ref int, ref float)': not all code paths return a value
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace TheOmegaMod.Items.Weapons
{
public class BladeOfVictory : ModItem
{
public override void SetDefaults()
{
item.name = "Blade of Victory";
item.damage = 99999999;
item.melee = true;
item.width = 900;
item.height = 900;
item.useTime = 3;
item.useAnimation = 4;
item.useStyle = 1;
item.knockBack = 100000;
item.value = 1000000000;
item.rare = 1000;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
item.crit = 75;
item.toolTip = "Congratularationses! You have officially won The Omega Mod!";
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
{
int numberProjectiles = 6;
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(5));
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, mod.ProjectileType("BOVProj"), damage, knockBack, player.whoAmI);
}
}
}
public override void UseStyle(Player player) //while the player is using this item
{
//add a light at the center of my player with a brightness of %50
Lighting.AddLight(player.Center, 1f, 1f, 1f);
}
public override void Update(ref float gravity, ref float maxFallSpeed) //when this item is lying in the world
{
//add a light at the center of this item with a brightness of %50
Lighting.AddLight(item.position + item.Size / 2, 1f, 1f, 1f);
}
}
}
[doublepost=1470890935,1470890774][/doublepost]Nevermind I got it
I just forgot the return false; at the end of the shoot hook
I still don't know how to make the projectiles track down enemies though if anyone could tell me how