Files
CalamityModPublic/Items/Weapons/Ranged/Shellshooter.cs
T
CongratsIsTrash 9e54ec6567 Moved every instance of a weapon changing its crit chance in ModifyWeaponCrit to be set with Item.crit in SetDefaults instead
Appears to originally have been done this way due to some interaction with reforging, but doing it like this breaks continuous updating stats; perhaps check on reforge stuff just in case?
2026-03-04 17:00:00 -05:00

45 lines
1.6 KiB
C#

using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class Shellshooter : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.width = 30;
Item.height = 38;
Item.damage = 40;
Item.DamageType = DamageClass.Ranged;
Item.crit = 15;
Item.useTime = 70;
Item.useAnimation = 70;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 6f;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item5;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<Shell>();
Item.shootSpeed = 2.5f;
Item.useAmmo = AmmoID.Arrow;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (CalamityUtils.CheckWoodenAmmo(type, player))
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<Shell>(), damage, knockback, player.whoAmI);
else
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
return false;
}
}
}