WillOWisp

This commit is contained in:
Heart-Plus-Up committed 2025-09-24 12:04:39 -07:00
1 parent 6218083e5f
commit 4b2985d98d
7 files changed
+91 -5

No files matched your search

+5 -5
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.Items.Placeables.SunkenSea;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -25,10 +26,9 @@ namespace CalamityMod.Items.Materials
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<PearlShard>(2).
AddIngredient(ItemID.Coral, 2).
AddIngredient(ItemID.Starfish, 2).
AddIngredient(ItemID.Seashell, 2).
AddIngredient<WillOWisp>(1).
//AddIngredient<PolypItem>(2).
AddIngredient<PearlShard>(3).
AddTile(TileID.Furnaces).
Register();
}
+69
View File
@@ -0,0 +1,69 @@
using CalamityMod.Cooldowns;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Wulfrum;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Items.Materials
{
public class WillOWisp : ModItem, ILocalizedModType
{
public int textureVariant = 0;
public static Asset<Texture2D> altTexture = null;
public new string LocalizationCategory => "Items.Materials";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 25;
ItemID.Sets.SortingPriorityMaterials[Type] = 60; // Meteorite
}
public override void SetDefaults()
{
Item.width = 20;
Item.height = 26;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 1);
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Material;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (textureVariant == 0)
return true;
else
{
spriteBatch.Draw(altTexture.Value, Item.Center - Main.screenPosition, null, lightColor, rotation, altTexture.Size() / 2, scale, SpriteEffects.None, 0);
return false;
}
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
if (textureVariant == 0)
return true;
else
{
spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, altTexture.Size() / 2, scale, SpriteEffects.None, 0);
return false;
}
}
public override void OnSpawn(IEntitySource source)
{
textureVariant = Main.rand.NextBool().ToInt();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

@@ -326,3 +326,8 @@ AnodizedWulfrumMetal: {
DisplayName: Anodized Wulfrum Metal
Tooltip: ""
}
WillOWisp: {
DisplayName: Will O Wisp
Tooltip: ""
}
+7
View File
@@ -1,6 +1,9 @@
using System.IO;
using CalamityMod.BiomeManagers;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
@@ -216,5 +219,9 @@ namespace CalamityMod.NPCs.SunkenSea
spriteBatch.Draw(tex, NPC.Center - screenPos, frame, drawColor, NPC.rotation, frame.Size() / 2f, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
return false;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<WillOWisp>(), 1, 1, 2);
}
}
}
+5
View File
@@ -11,6 +11,7 @@ using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Utilities;
using System.IO;
using CalamityMod.Items.Materials;
namespace CalamityMod.NPCs.SunkenSea
{
@@ -179,5 +180,9 @@ namespace CalamityMod.NPCs.SunkenSea
}
return true;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<WillOWisp>(), 1, 1, 2);
}
}
}