using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { public class TacticiansTrumpCard : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { Item.width = 74; Item.height = 70; Item.damage = 248; Item.knockBack = 7f; Item.DamageType = DamageClass.Magic; Item.useAnimation = Item.useTime = 12; Item.mana = 20; Item.useTurn = true; Item.autoReuse = true; Item.shootSpeed = 13.5f; Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.Rarity12BuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(3)) { int dustType = Main.rand.NextBool() ? 132 : 264; int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustType); Main.dust[dust].noGravity = true; } } public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Electrified, 300); public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) => target.AddBuff(BuffID.Electrified, 300); public override void AddRecipes() { CreateRecipe(). AddIngredient(ItemID.CopperShortsword). AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(5). AddIngredient(). AddTile(TileID.LunarCraftingStation). Register(); CreateRecipe(). AddIngredient(ItemID.TinShortsword). AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(5). AddIngredient(). AddTile(TileID.LunarCraftingStation). Register(); } } }