using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Sounds; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class MatterModulator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); Item.width = 40; Item.height = 22; Item.DamageType = DamageClass.Ranged; Item.damage = 100; Item.knockBack = 11f; Item.useTime = Item.useAnimation = 33; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; modItem.UsesCharge = true; modItem.MaxCharge = 85f; modItem.ChargePerUse = 0.075f; } 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 < Main.rand.Next(3, 5 + 1); i++) { Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.8f, 1.3f), type, damage, knockback, player.whoAmI); } return false; } public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); public override void AddRecipes() { CreateRecipe(). AddIngredient(12). AddIngredient(8). AddRecipeGroup("AnyMythrilBar", 10). AddIngredient(ItemID.SoulofFright, 20). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). AddTile(TileID.MythrilAnvil). Register(); } } }