diff --git a/Items/Materials/SeaRemains.cs b/Items/Materials/SeaRemains.cs index ff70b1ad9f..439ca0a2f8 100644 --- a/Items/Materials/SeaRemains.cs +++ b/Items/Materials/SeaRemains.cs @@ -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(2). - AddIngredient(ItemID.Coral, 2). - AddIngredient(ItemID.Starfish, 2). - AddIngredient(ItemID.Seashell, 2). + AddIngredient(1). + //AddIngredient(2). + AddIngredient(3). AddTile(TileID.Furnaces). Register(); } diff --git a/Items/Materials/WillOWisp.cs b/Items/Materials/WillOWisp.cs new file mode 100644 index 0000000000..aa1520f1bf --- /dev/null +++ b/Items/Materials/WillOWisp.cs @@ -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 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(); + } + } +} diff --git a/Items/Materials/WillOWisp.png b/Items/Materials/WillOWisp.png new file mode 100644 index 0000000000..1c20a1c44b Binary files /dev/null and b/Items/Materials/WillOWisp.png differ diff --git a/Items/Materials/WillOWisp2.png b/Items/Materials/WillOWisp2.png new file mode 100644 index 0000000000..678e703357 Binary files /dev/null and b/Items/Materials/WillOWisp2.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 020e9628dd..ba2ebe56aa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -326,3 +326,8 @@ AnodizedWulfrumMetal: { DisplayName: Anodized Wulfrum Metal Tooltip: "" } + +WillOWisp: { + DisplayName: Will O Wisp + Tooltip: "" +} diff --git a/NPCs/SunkenSea/CarrionSwallower.cs b/NPCs/SunkenSea/CarrionSwallower.cs index 0d092cd892..d072498999 100644 --- a/NPCs/SunkenSea/CarrionSwallower.cs +++ b/NPCs/SunkenSea/CarrionSwallower.cs @@ -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(), 1, 1, 2); + } } } diff --git a/NPCs/SunkenSea/FesteringRemains.cs b/NPCs/SunkenSea/FesteringRemains.cs index 971696be5d..21f70be2af 100644 --- a/NPCs/SunkenSea/FesteringRemains.cs +++ b/NPCs/SunkenSea/FesteringRemains.cs @@ -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(), 1, 1, 2); + } } }