Can you post the code being used? Did you make your new projectile friendly?
using Microsoft.Xna.Framework;
using System;
using System.Diagnostics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace VariousStuffExpansion.Items
{
public class ZeusLightning : ModItem
{
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
item.damage = 200;
item.magic = true; //Становится луком
item.width = 22;
item.height = 44;
item.useTime = 5;
item.useAnimation = 30;
item.crit = 10;
item.useStyle = 5;
item.shoot = 10;
item.shootSpeed = 8; //скорость полета стрелы
item.knockBack = 7;
item.mana = 30;
item.value = 90000;
item.shoot = (466);
item.rare = 5;
item.UseSound = SoundID.Item21;
item.autoReuse = true;
item.useTurn = false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(3467, 10);
recipe.AddIngredient(3457, 16);
recipe.AddIngredient(2623, 1);
recipe.AddTile(412);
recipe.SetResult(this);
recipe.AddRecipe();
}
public static Vector2[] randomSpread(float speedX, float speedY, int angle, int num)
{
var posArray = new Vector2[num];
float spread = (float)(angle * 0.0174532925);
float baseSpeed = (float)System.Math.Sqrt(speedX * speedX + speedY * speedY);
double baseAngle = System.Math.Atan2(speedX, speedY);
double randomAngle;
for (int i = 0; i < num; ++i)
{
randomAngle = baseAngle + (Main.rand.NextFloat() - 0.5f) * spread;
posArray
= new Vector2(baseSpeed * (float)System.Math.Sin(randomAngle), baseSpeed * (float)System.Math.Cos(randomAngle));
}
return (Vector2[])posArray;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2[] speeds = randomSpread(speedX, speedY, 10, 10);
for (int i = 0; i < 1; ++i)
{
Projectile.NewProjectile(position.X, position.Y, speeds.X, speeds.Y, type, damage, knockBack, player.whoAmI);
}
return false;
}
}
}
Its code of my weapon
I change something abd get this
this lightning is similar
and all time shoots at the right side