53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class EutrophicScimitar : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Melee";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 110;
|
|
Item.DamageType = DamageClass.Melee;
|
|
Item.width = 64;
|
|
Item.height = 78;
|
|
Item.useTime = 40;
|
|
Item.useAnimation = 40;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 2;
|
|
Item.shoot = ModContent.ProjectileType<EutrophicScimitarProj>();
|
|
Item.shootSpeed = 17;
|
|
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
|
|
Item.rare = ItemRarityID.LightRed;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.useTurn = true;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
for (int i = 0; i <= 21; i++)
|
|
{
|
|
Dust dust;
|
|
dust = Main.dust[Dust.NewDust(new Vector2(position.X - 58 / 2, position.Y - 58 / 2), 58, 58, 226, 0f, 0f, 0, new Color(255, 255, 255), 0.4605263f)];
|
|
dust.noGravity = true;
|
|
dust.fadeIn = 0.9473684f;
|
|
}
|
|
|
|
for (int projectiles = 0; projectiles < 2; projectiles++)
|
|
{
|
|
float SpeedX = velocity.X + Main.rand.Next(-15, 16) * 0.05f;
|
|
float SpeedY = velocity.Y + Main.rand.Next(-15, 16) * 0.05f;
|
|
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.7), knockback, player.whoAmI);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|