using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Pets { public class PrimroseKeepsake : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Primrose Keepsake"); Tooltip.SetDefault("Did they just..."); } public override void SetDefaults() { item.damage = 0; item.useStyle = 1; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; item.width = 30; item.height = 30; item.value = Item.sellPrice(1, 0, 0, 0); item.shoot = 0; // neither kendra nor bear is the direct "shoot" item.buffType = ModContent.BuffType(); item.rare = 6; item.UseSound = SoundID.Item44; } public override void UseStyle(Player player) { if (player.whoAmI == Main.myPlayer && player.itemTime == 0) { player.AddBuff(item.buffType, 15, true); } } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { List pets = new List { ModContent.ProjectileType(), ModContent.ProjectileType() }; foreach(int petProjID in pets) Projectile.NewProjectile(position, new Vector2(speedX, speedY), petProjID, damage, knockBack, player.whoAmI); return false; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.LovePotion); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); } } }