diff --git a/Items/Tools/TinkerersVoucher.cs b/Items/Tools/TinkerersVoucher.cs index 029fe85840..4caab5f1cd 100644 --- a/Items/Tools/TinkerersVoucher.cs +++ b/Items/Tools/TinkerersVoucher.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using CalamityMod.Prefixes; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +12,7 @@ namespace CalamityMod.Items.Tools public static class VoucherReforgeSystem { public static int ForcedPrefix = -1; + public static bool RollWon = false; } public class VoucherGlobalItem : GlobalItem @@ -36,6 +38,30 @@ namespace CalamityMod.Items.Tools if (invItem.stack <= 0) invItem.TurnToAir(); + if (Main.netMode != NetmodeID.Server) + { + if (VoucherReforgeSystem.RollWon) + { + for (int d = 0; d < 24; d++) + { + int dust = Dust.NewDust(player.position, player.width, player.height, DustID.Confetti, 0f, 0f, 100, default, 1f); + Main.dust[dust].velocity *= 2f; + Main.dust[dust].noGravity = false; + } + + SoundEngine.PlaySound(SoundID.Item4, player.position); + } + else + { + for (int d = 0; d < 20; d++) + { + int dust = Dust.NewDust(player.position, player.width, player.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); + Main.dust[dust].velocity *= 1.5f; + } + + SoundEngine.PlaySound(SoundID.Item16, player.position); + } + } break; } } @@ -137,15 +163,21 @@ namespace CalamityMod.Items.Tools if (prefixChoices.Length == 0) return -1; - // Combat Voucher handles 50/50 loss logic for weapons on its own if (isAccessory) { if (Main.rand.NextBool()) + { + VoucherReforgeSystem.RollWon = true; return prefixChoices[chosenPrefix]; + } else + { + VoucherReforgeSystem.RollWon = false; return ModContent.PrefixType(); + } } + VoucherReforgeSystem.RollWon = true; return prefixChoices[chosenPrefix]; } } @@ -182,7 +214,16 @@ namespace CalamityMod.Items.Tools else prefix = PrefixID.Godly; - return Main.rand.NextBool() ? prefix : ModContent.PrefixType(); + if (Main.rand.NextBool()) + { + VoucherReforgeSystem.RollWon = true; + return prefix; + } + else + { + VoucherReforgeSystem.RollWon = false; + return ModContent.PrefixType(); + } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index b6b6c876c4..b709086eb1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -18,6 +18,7 @@ AggressiveVoucher: { Tooltip: ''' Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge + This effect only applies when reforging accessories Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -157,7 +158,7 @@ CombatVoucher: { Tooltip: ''' Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies to reforging weapons + This effect only applies when reforging weapons ''' } @@ -230,6 +231,7 @@ HurriedVoucher: { Tooltip: ''' Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge + This effect only applies when reforging accessories Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -304,6 +306,7 @@ OddVoucher: { Tooltip: ''' Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge + This effect only applies when reforging accessories Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -426,6 +429,7 @@ UnbreakableVoucher: { Tooltip: ''' Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge + This effect only applies when reforging accessories Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges]