Files
CalamityModPublic/Items/Weapons/Melee/MirrorBlade.cs
T
GinYuH 2d57f496d9 usual resprites
Resprited Corruption Effigy stuff, Afflicted buff (again), Deadshot Brook, Glacial State, Living Dew, Blood Orb, Murky Paste, Margarita, Moscow Mule, Mirror Blade + proj, Eternal Blizzard, ore rogue weapons except mythril, Phantasmal Ruin + clone, Astral Grass, Astral Dirt, and Astral Dirt Walls
2022-11-28 19:13:44 -08:00

63 lines
2.1 KiB
C#

using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class MirrorBlade : ModItem
{
private int baseDamage = 180;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mirror Blade");
Tooltip.SetDefault("The amount of contact damage an enemy does is added to this weapons' damage\n" +
"You must hit an enemy with the blade to trigger this effect");
SacrificeTotal = 1;
}
public override void SetDefaults()
{
Item.width = 72;
Item.height = 72;
Item.damage = baseDamage;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 12;
Item.useTime = 12;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 7f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity12BuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.shootSpeed = 9f;
Item.shoot = ModContent.ProjectileType<MirrorBlast>();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f);
return false;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
int conDamage = target.damage + baseDamage;
if (conDamage < baseDamage)
{
conDamage = baseDamage;
}
if (conDamage > 750)
{
conDamage = 750;
}
Item.damage = conDamage;
}
}
}