Files
CalamityModPublic/Items/Weapons/Magic/ValkyrieRay.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

63 lines
2.3 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class ValkyrieRay : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
// The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames.
// The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges.
// This math is handled in its holdout projectile, ValkyrieRayStaff.
public const int ChargeFrames = 18;
public const int CooldownFrames = 10;
public const float GemDistance = 18f;
public static readonly Color LightColor = new Color(235, 40, 121);
public override void SetStaticDefaults()
{
Item.staff[Type] = true;
}
public override void SetDefaults()
{
Item.width = 54;
Item.height = 52;
Item.damage = 115;
Item.knockBack = 8.5f;
Item.DamageType = DamageClass.Magic;
Item.crit = 11;
Item.mana = 17;
Item.useTime = ChargeFrames + CooldownFrames;
Item.useAnimation = ChargeFrames + CooldownFrames;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = SoundID.NPCDeath7 with { Volume = 0.7f };
Item.useTurn = false;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.shoot = ModContent.ProjectileType<ValkyrieRayStaff>();
Item.shootSpeed = 25f;
Item.autoReuse = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.HallowedBar, 12).
AddIngredient<AerialiteBar>(6).
AddIngredient(ItemID.Ruby).
AddIngredient(ItemID.SoulofFright).
AddIngredient(ItemID.SoulofMight).
AddIngredient(ItemID.SoulofSight).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}