Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class SoulEdge : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Soul Edge");
|
|
Tooltip.SetDefault("Fires the ghastly souls of long-deceased abyss dwellers");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 88;
|
|
item.damage = 365;
|
|
item.melee = true;
|
|
item.useAnimation = 18;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.useTime = 18;
|
|
item.useTurn = true;
|
|
item.knockBack = 5.5f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 88;
|
|
item.value = Item.buyPrice(1, 40, 0, 0);
|
|
item.rare = 10;
|
|
item.shoot = ModContent.ProjectileType<GhastlySoulLarge>();
|
|
item.shootSpeed = 12f;
|
|
item.Calamity().customRarity = CalamityRarity.PureGreen;
|
|
}
|
|
|
|
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 num6 = Main.rand.Next(2, 4);
|
|
for (int index = 0; index < num6; ++index)
|
|
{
|
|
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
|
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
|
float ai1 = Main.rand.NextFloat() + 0.5f;
|
|
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, Main.rand.Next(type, type + 3), (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, ai1);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<CrushDepth>(), 600);
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<CrushDepth>(), 600);
|
|
}
|
|
}
|
|
}
|