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

66 lines
2.3 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
[LegacyName("DeificThunderbolt")]
public class TwistingThunder : RogueWeapon
{
public override void SetDefaults()
{
Item.width = 56;
Item.height = 56;
Item.damage = 466;
Item.crit = 12;
Item.knockBack = 10f;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useTime = 21;
Item.useAnimation = 21;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.DamageType = RogueDamageClass.Instance;
Item.autoReuse = true;
Item.shootSpeed = 13.69f;
Item.shoot = ModContent.ProjectileType<TwistingThunderProj>();
}
public override float StealthVelocityMultiplier => 1.5f;
public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
if (Main.raining)
velocity = velocity * 1.5f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int thunder = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
if (player.Calamity().StealthStrikeAvailable() && thunder.WithinBounds(Main.maxProjectiles)) //setting the stealth strike
{
Main.projectile[thunder].Calamity().stealthStrike = true;
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<StormfrontRazor>().
AddIngredient<UnholyEssence>(15).
AddIngredient<ArmoredShell>(3).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}