using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { public class ThePack : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { Item.damage = 1000; Item.DamageType = DamageClass.Ranged; Item.width = 96; Item.height = 40; Item.useTime = 52; Item.useAnimation = 52; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7.5f; Item.UseSound = SoundID.Item11; Item.autoReuse = true; Item.shootSpeed = 24f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Rocket; Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; public override Vector2? HoldoutOffset() => new Vector2(-40, 0); 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, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). AddIngredient(ItemID.MarbleBlock, 50). AddIngredient(4). AddIngredient(8). AddIngredient(20). AddTile(). Register(); } } }