Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace gnt.Items
- {
- public class StarNeonTetraSword : ModItem
- {
- public override void SetStaticDefaults()
- {
- Tooltip.SetDefault("Upgraded version of Neon Tetra Sword");
- DisplayName.SetDefault("Star Neon Tetra Sword");
- }
- public override void SetDefaults()
- {
- item.damage = 480;
- item.melee = true;
- item.width = 50;
- item.height = 50;
- item.useTime = 8;
- item.useAnimation = 8;
- item.useStyle = 1;
- item.knockBack = 6;
- item.value = Item.buyPrice(gold: 23);
- item.rare = 9;
- item.UseSound = SoundID.Item1;
- item.autoReuse = true;
- item.shoot = mod.ProjectileType("NeonTetra");
- item.shootSpeed = 12f;
- }
- public override void AddRecipes()
- {
- ModRecipe recipe = new ModRecipe(mod);
- recipe.AddIngredient(mod.ItemType("NeonTetraSword"), 1);
- recipe.AddIngredient(ItemID.FallenStar, 20);
- recipe.AddIngredient(ItemID.NeonTetra, 20);
- recipe.AddIngredient(ItemID.StarWrath, 1);
- recipe.AddTile(TileID.WorkBenches);
- recipe.SetResult(this);
- recipe.AddRecipe();
- }
- 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 target = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY);
- float ceilingLimit = target.Y;
- if (ceilingLimit > player.Center.Y - 200f)
- {
- ceilingLimit = player.Center.Y - 200f;
- }
- for (int i = 0; i < 3; i++)
- {
- position = player.Center + new Vector2((-(float)Main.rand.Next(0, 401) * player.direction), -600f);
- position.Y -= (100 * i);
- Vector2 heading = target - position;
- if (heading.Y < 0f)
- {
- heading.Y *= -1f;
- }
- if (heading.Y < 20f)
- {
- heading.Y = 20f;
- }
- heading.Normalize();
- heading *= new Vector2(speedX, speedY).Length();
- speedX = heading.X;
- speedY = heading.Y + Main.rand.Next(-40, 41) * 0.02f;
- Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage * 2, knockBack, player.whoAmI, 0f, ceilingLimit);
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement