Files
CalamityModPublic/Items/Weapons/Rogue/StormfrontRazor.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

77 lines
2.7 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.SunkenSea;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class StormfrontRazor : RogueWeapon
{
public static readonly SoundStyle LightningStrikeSound = new("CalamityMod/Sounds/Custom/LightningStrike");
public const float LightningDamageFactor = 1.5f;
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
public override void SetDefaults()
{
Item.width = 56;
Item.height = 64;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.useAnimation = 20;
Item.useTime = 20;
Item.damage = 38;
Item.crit = 8;
Item.knockBack = 7f;
Item.shoot = ModContent.ProjectileType<StormfrontRazorProjectile>();
Item.shootSpeed = 8.2f;
Item.DamageType = RogueDamageClass.Instance;
}
public override float StealthDamageMultiplier => 1.2f;
public override float StealthVelocityMultiplier => 1.5f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable())
{
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 10f);
if (p.WithinBounds(Main.maxProjectiles))
Main.projectile[p].Calamity().stealthStrike = true;
return false;
}
else
{
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 1f);
return false;
}
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<Cinquedea>().
AddRecipeGroup("AnyMythrilBar", 6).
AddIngredient<EssenceofSunlight>(4).
AddIngredient<SeaPrism>(15).
AddIngredient<StormlionMandible>(2).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}