59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Chat;
|
|
using Terraria.Localization;
|
|
using ForgottenWawiTech.Content.NPCs.OriginalLexy;
|
|
using ForgottenWawiTech.Content.Rarities;
|
|
|
|
namespace ForgottenWawiTech.Content.Items.SummonItems
|
|
{
|
|
public class LexySummon : ModItem
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 40;
|
|
Item.height = 40;
|
|
Item.useTime = 10;
|
|
Item.useAnimation = 10;
|
|
Item.useStyle = ItemUseStyleID.HoldUp;
|
|
Item.consumable = false;
|
|
Item.rare = ModContent.RarityType<FWTDeveloperItem>();
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return Main.hardMode;
|
|
}
|
|
|
|
public override bool? UseItem(Player player)
|
|
{
|
|
string summonText = "Chaos energy fills the air...";
|
|
if (Main.netMode != NetmodeID.MultiplayerClient)
|
|
{
|
|
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Lexy>());
|
|
Main.NewText(summonText, 175, 75, 255);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
// Only add the recipe if Calamity Mod is loaded
|
|
if (ModLoader.TryGetMod("CalamityMod", out Mod calamityMod))
|
|
{
|
|
Recipe recipe = CreateRecipe();
|
|
recipe.AddIngredient(ItemID.RainbowBrick, 100);
|
|
// Exo Prism
|
|
recipe.AddIngredient(calamityMod.Find<ModItem>("ExoPrism").Type, 5);
|
|
recipe.AddIngredient(calamityMod.Find<ModItem>("MysteriousCircuitry").Type, 10);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.Register();
|
|
}
|
|
}
|
|
}
|
|
} |