diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c3420d51e5..2a75f7b979 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -860,12 +860,27 @@ namespace CalamityMod.CalPlayer private void MiscEffects() { - // Update Carpet textures + // Update textures if (Main.netMode != NetmodeID.Server && Player.whoAmI == Main.myPlayer) { Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal); + + for (int l = 0; l < Player.MaxBuffs; l++) + { + if (Player.buffType[l] != BuffID.Lucky) + continue; + + if (Player.buffTime[l] > CalamityUtils.SecondsToFrames(600f)) + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconGreater; + else if (Player.buffTime[l] > CalamityUtils.SecondsToFrames(300f)) + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconVanilla; + else + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconLesser; + + break; + } } // Calculate/reset DoG cart rotations based on whether the DoG cart is in use. diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 724db66b6e..aaf5d76299 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.ExtraTextures @@ -32,6 +33,11 @@ namespace CalamityMod.ExtraTextures public static Asset FlyingCarpetVanilla; public static Asset FlyingCarpetAuric; + // Lucky Buff icon replacements + public static Asset LuckIconGreater; + public static Asset LuckIconVanilla; + public static Asset LuckIconLesser; + // Boss Heads // I know it's not exactly a Texture2D but it belongs to ExtraTextures. public static int BossHeadIndex_ChadPrime; @@ -60,6 +66,10 @@ namespace CalamityMod.ExtraTextures FlyingCarpetVanilla = TextureAssets.FlyingCarpet; FlyingCarpetAuric = ModContent.Request("CalamityMod/ExtraTextures/AuricCarpet", AssetRequestMode.AsyncLoad); + + LuckIconGreater = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyGreater", AssetRequestMode.AsyncLoad); + LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky]; + LuckIconLesser = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad); } public override void Unload() @@ -67,6 +77,7 @@ namespace CalamityMod.ExtraTextures if (!Main.dedServ) { TextureAssets.FlyingCarpet = FlyingCarpetVanilla; + TextureAssets.Buff[BuffID.Lucky] = LuckIconVanilla; } } } diff --git a/ExtraTextures/VanillaBuffs/LuckyGreater.png b/ExtraTextures/VanillaBuffs/LuckyGreater.png new file mode 100644 index 0000000000..76441d55cd Binary files /dev/null and b/ExtraTextures/VanillaBuffs/LuckyGreater.png differ diff --git a/ExtraTextures/VanillaBuffs/LuckyLesser.png b/ExtraTextures/VanillaBuffs/LuckyLesser.png new file mode 100644 index 0000000000..95ed2f505f Binary files /dev/null and b/ExtraTextures/VanillaBuffs/LuckyLesser.png differ