using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { public class AMR : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Anti-materiel Rifle"); Tooltip.SetDefault("Fires a .50 caliber sniper round that rips apart enemy defense and DR\n" + "If you crit the target a second swarm of bullets will fire near the target"); } public override void SetDefaults() { item.damage = 7000; item.ranged = true; item.width = 76; item.crit += 20; item.height = 30; item.useTime = 60; item.useAnimation = 60; item.useStyle = 5; item.noMelee = true; item.knockBack = 9.5f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); item.autoReuse = true; item.shoot = 10; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().postMoonLordRarity = 14; } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; } } }