Files
CalamityModPublic/Items/Weapons/Magic/TheWand.cs
T
Ozzatron 22afdd3933 1 - Calamity sell prices increase much more sharply with rarity.
2 - (Example) Post DoG items are now 2 platinum instead of 1 platinum 40 gold.
3 - (Example) Dev items are now 2 platinum 80 gold instead of 2 platinum.
4 - Privated numeric rarity item values.
5 - All assigned item values use the rarity's names, e.g. RarityLightPurpleBuyPrice.
2024-04-17 21:20:17 -04:00

68 lines
2.4 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class TheWand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
// The actual base damage of The Wand. The damage reported on the item is just the spark, which is irrelevant.
public static int BaseDamage = 599;
public override void SetStaticDefaults()
{
Item.staff[Item.type] = true;
}
public override void SetDefaults()
{
Item.width = 40;
Item.height = 36;
Item.damage = 14; // same as 1.4 Wand of Sparking
Item.mana = 150;
Item.DamageType = DamageClass.Magic;
Item.noMelee = true;
Item.useAnimation = 19;
Item.useTime = 19;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Shoot;
Item.knockBack = 0.5f;
Item.UseSound = SoundID.Item102;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.shoot = ModContent.ProjectileType<SparkInfernal>();
Item.shootSpeed = 24f;
Item.rare = ModContent.RarityType<Violet>();
}
public override bool CanUseItem(Player player)
{
int numWandBolts = player.ownedProjectileCounts[ModContent.ProjectileType<SparkInfernal>()];
int numTornadoStarters = player.ownedProjectileCounts[ModContent.ProjectileType<InfernadoMarkFriendly>()];
int numTornadoPieces = player.ownedProjectileCounts[ModContent.ProjectileType<InfernadoFriendly>()];
return numWandBolts + numTornadoStarters + numTornadoPieces < 1;
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(3))
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Torch);
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.WandofSparking).
AddIngredient<YharonSoulFragment>(8).
AddTile<CosmicAnvil>().
Register();
}
}
}