diff --git a/Content/Items/Materials/MiniSingularity.cs b/Content/Items/Materials/MiniSingularity.cs index 9d700fb..859ae19 100644 --- a/Content/Items/Materials/MiniSingularity.cs +++ b/Content/Items/Materials/MiniSingularity.cs @@ -17,5 +17,16 @@ namespace ForgottenWawiTech.Content.Items.Materials Item.value = Item.buyPrice(gold: 50); } + public override void AddRecipes() + { + CreateRecipe() + .AddIngredient(ItemID.FragmentNebula, 5) + .AddIngredient(ItemID.FragmentSolar, 5) + .AddIngredient(ItemID.FragmentVortex, 5) + .AddIngredient(ItemID.FragmentStardust, 5) + .AddIngredient(ItemID.WormholePotion, 1) + .AddTile() + .Register(); + } } } \ No newline at end of file diff --git a/Content/Items/Materials/RGBAlloy.cs b/Content/Items/Materials/RGBAlloy.cs index 0ff525e..b905168 100644 --- a/Content/Items/Materials/RGBAlloy.cs +++ b/Content/Items/Materials/RGBAlloy.cs @@ -1,16 +1,31 @@ +// Animated by British_Raccoon using Terraria.ID; using Terraria; using Terraria.ModLoader; +using Terraria.DataStructures; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System; +using Terraria.GameContent; namespace ForgottenWawiTech.Content.Items.Materials { public class RGBAlloy : ModItem { + private const int FRAME_COUNT = 5; + private const int TICKS_PER_FRAME = 10; + + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Type, new DrawAnimationVertical(TICKS_PER_FRAME, FRAME_COUNT)); + + } public override void SetDefaults() { - Item.width = 20; - Item.height = 20; + Item.width = 32; + Item.height = 32; Item.maxStack = 9999; Item.rare = ItemRarityID.White; Item.value = Item.buyPrice(gold: 50); @@ -24,5 +39,28 @@ namespace ForgottenWawiTech.Content.Items.Materials .AddTile(TileID.Anvils) .Register(); } + + // Some tML setups won't animate dropped items with just RegisterItemAnimation. + // Manually draw the animated frame in-world to ensure it animates when dropped. + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Terraria.GameContent.TextureAssets.Item[Type].Value; + + // Protect against incorrect frame count + int frameHeight = texture.Height / Math.Max(1, FRAME_COUNT); + int frame = (int)((Main.GameUpdateCount / (ulong)Math.Max(1, TICKS_PER_FRAME)) % (ulong)Math.Max(1, FRAME_COUNT)); + + Rectangle source = new Rectangle(0, frame * frameHeight, texture.Width, frameHeight); + + Vector2 drawPos = Item.Center - Main.screenPosition; + Vector2 origin = new Vector2(source.Width / 2f, source.Height / 2f); + + // Use alphaColor for dropped items (includes item alpha), multiplied by light + Color drawColor = lightColor; + + spriteBatch.Draw(texture, drawPos, source, drawColor, rotation, origin, scale, SpriteEffects.None, 0f); + + return false; // we've handled the draw + } } } \ No newline at end of file diff --git a/Content/Items/Materials/RGBAlloy.png b/Content/Items/Materials/RGBAlloy.png index 9e0cf81..4c9b7a3 100644 Binary files a/Content/Items/Materials/RGBAlloy.png and b/Content/Items/Materials/RGBAlloy.png differ diff --git a/Content/Items/Materials/RGBass.png b/Content/Items/Materials/RGBass.png index 9e0cf81..1f14489 100644 Binary files a/Content/Items/Materials/RGBass.png and b/Content/Items/Materials/RGBass.png differ diff --git a/Content/Items/Materials/SingularityAlloy.cs b/Content/Items/Materials/SingularityAlloy.cs index c222d10..7026b89 100644 --- a/Content/Items/Materials/SingularityAlloy.cs +++ b/Content/Items/Materials/SingularityAlloy.cs @@ -16,5 +16,17 @@ namespace ForgottenWawiTech.Content.Items.Materials Item.rare = ModContent.RarityType(); Item.value = Item.buyPrice(gold: 10); } + + public override void AddRecipes() + { + CreateRecipe() + .AddIngredient(ModContent.ItemType(), 2) + .AddIngredient(ItemID.HallowedBar, 5) + .AddIngredient(ItemID.SoulofMight, 3) + .AddIngredient(ItemID.SoulofSight, 3) + .AddIngredient(ItemID.SoulofFright, 3) + .AddTile() + .Register(); + } } } \ No newline at end of file diff --git a/Content/Items/SummonItems/NeptuneSummon.png b/Content/Items/SummonItems/NeptuneSummon.png index 9e0cf81..9e9b9e9 100644 Binary files a/Content/Items/SummonItems/NeptuneSummon.png and b/Content/Items/SummonItems/NeptuneSummon.png differ diff --git a/Content/Items/Tiles/RGBAlloy_Tile.png b/Content/Items/Tiles/RGBAlloy_Tile.png new file mode 100644 index 0000000..eb4a1c5 Binary files /dev/null and b/Content/Items/Tiles/RGBAlloy_Tile.png differ diff --git a/Content/Rarities/DeveloperItem.cs b/Content/Rarities/DeveloperItem.cs index 647062e..81f2791 100644 --- a/Content/Rarities/DeveloperItem.cs +++ b/Content/Rarities/DeveloperItem.cs @@ -1,11 +1,26 @@ using Terraria.ModLoader; using Terraria; using Microsoft.Xna.Framework; +using System; namespace ForgottenWawiTech.Content.Rarities { public class FWTDeveloperItem : ModRarity { - public override Color RarityColor => new Color(255, 0, 255); // Bright magenta color + // Smoothly fades between Bright Magenta and Dark Red. + public override Color RarityColor + { + get + { + // Speed in cycles per second + const float cyclesPerSecond = 0.75f; + float theta = Main.GlobalTimeWrappedHourly * cyclesPerSecond * MathHelper.TwoPi; + float t = (float)((Math.Sin(theta) + 1f) * 0.5f); // 0..1 + + Color darkRed = new Color(139, 0, 0); // Dark Red + Color brightMagenta = Color.Magenta; // Bright Magenta + return Color.Lerp(darkRed, brightMagenta, t); + } + } } } \ No newline at end of file diff --git a/Content/Rarities/SingularityItem.cs b/Content/Rarities/SingularityItem.cs index 664f0ff..9abbdd8 100644 --- a/Content/Rarities/SingularityItem.cs +++ b/Content/Rarities/SingularityItem.cs @@ -1,11 +1,40 @@ using Terraria.ModLoader; using Terraria; using Microsoft.Xna.Framework; +using System; namespace ForgottenWawiTech.Content.Rarities { public class SingularityItem : ModRarity { - public override Color RarityColor => new Color(140, 0, 128); // Dark reddish-purple color + // Fade between very dark purple and bright purple (avoids unreadable black) + // with periodic brightness pulses for a "singularity" feel. + public override Color RarityColor + { + get + { + float time = Main.GlobalTimeWrappedHourly; + + // Base fade (slow): very dark purple <-> bright purple + const float fadeHz = 0.5f; // cycles per second + float fadeT = (float)((Math.Sin(time * fadeHz * MathHelper.TwoPi) + 1f) * 0.5f); // 0..1 + // Keep a minimum fade so text stays readable + const float minFade = 0.25f; // never dip below 25% toward bright + fadeT = minFade + (1f - minFade) * fadeT; // remap to [minFade, 1] + + Color veryDarkPurple = new Color(50, 0, 80); + Color brightPurple = new Color(160, 0, 255); + Color baseColor = Color.Lerp(veryDarkPurple, brightPurple, fadeT); + + // Pulse (quick, narrow peaks). Using a powered sine to make sharp flashes. + const float pulseHz = 1.2f; // pulses per second + float s = (float)Math.Sin(time * pulseHz * MathHelper.TwoPi); + float pulse = (float)Math.Pow(Math.Max(0f, s), 3f); // 0..1, narrow peaks + float brightness = 1f + 0.25f * pulse; // up to +25% brightness at pulse peak + + // Multiply to apply brightness pulse. Color*float clamps components safely. + return baseColor * brightness; + } + } } } \ No newline at end of file diff --git a/Content/Tiles/CraftingStations/HighTechMarvel.cs b/Content/Tiles/CraftingStations/HighTechMarvel.cs index ba01216..d1ed46d 100644 --- a/Content/Tiles/CraftingStations/HighTechMarvel.cs +++ b/Content/Tiles/CraftingStations/HighTechMarvel.cs @@ -13,7 +13,7 @@ namespace ForgottenWawiTech.Content.Tiles.CraftingStations { Main.tileSolid[Type] = false; Main.tileNoAttach[Type] = true; - AdjTiles = new [] { + AdjTiles = new int[] { TileID.WorkBenches, TileID.Anvils, TileID.Furnaces, @@ -26,8 +26,7 @@ namespace ForgottenWawiTech.Content.Tiles.CraftingStations TileID.Autohammer, TileID.CrystalBall, TileID.TinkerersWorkbench, - TileID.LunarCraftingStation, - SingularitySealingUnit.Type + TileID.LunarCraftingStation }; AddMapEntry(new Color(150, 50, 250), Language.GetText("High Tech Marvel")); diff --git a/Localization/en-US_Mods.ForgottenWawiTech.hjson b/Localization/en-US_Mods.ForgottenWawiTech.hjson index ba405ff..d4efd62 100644 --- a/Localization/en-US_Mods.ForgottenWawiTech.hjson +++ b/Localization/en-US_Mods.ForgottenWawiTech.hjson @@ -42,7 +42,7 @@ Items: { Not consumable 'The waves are restless...' ''' - DisplayName: Neptune Summon + DisplayName: Megaladon } LyykaSummon: {