Files
ForgottenWawiTech/Content/Items/Weapons/Magic/ShatteredPrism.cs
T
2025-11-15 20:31:06 +00:00

42 lines
1.3 KiB
C#

using ForgottenWawiTech.Content.Projectiles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ForgottenWawiTech.Content.Items.Weapons.Magic
{
public class ShatteredPrism : ModItem
{
public override string Texture => "Terraria/Images/Item_" + ItemID.LastPrism; // TODO: Change
public static Color OverrideColor = new(80,0,80);
public override void SetDefaults() {
Item.CloneDefaults(ItemID.LastPrism);
Item.mana = 4;
Item.damage = 500;
Item.shoot = ModContent.ProjectileType<ShatteredPrismHoldout>();
Item.shootSpeed = 30f;
Item.color = OverrideColor;
}
public override bool CanUseItem(Player player)
{
return player.ownedProjectileCounts[ModContent.ProjectileType<ShatteredPrismHoldout>()] <= 0;
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
// Only add recipe if Calamity Mod is loaded
if (ModLoader.TryGetMod("CalamityMod", out Mod calamityMod))
{
recipe.AddIngredient(ItemID.LastPrism, 1);
recipe.AddIngredient(calamityMod.Find<ModItem>("ShatteredCommunity").Type, 1);
recipe.AddIngredient<Content.Items.Materials.RGBAlloy>(10);
recipe.AddTile<Content.Tiles.CraftingStations.HighTechMarvel>();
recipe.Register();
}
}
}
}