From fa0224ffed16a8b225126a0aaa73a0da4b0a65ec Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 12 Oct 2020 19:27:36 -0400 Subject: [PATCH] abyssal/sulphuric treasure now drop more loot to compensate for only droppingo ne now --- Items/TreasureBags/AbyssalTreasure.cs | 202 +++++++++--------- Items/TreasureBags/SulphuricTreasure.cs | 202 +++++++++--------- Projectiles/Typeless/StarStruckWaterBottle.cs | 4 +- 3 files changed, 208 insertions(+), 200 deletions(-) diff --git a/Items/TreasureBags/AbyssalTreasure.cs b/Items/TreasureBags/AbyssalTreasure.cs index 19bccd77f7..faa3783c58 100644 --- a/Items/TreasureBags/AbyssalTreasure.cs +++ b/Items/TreasureBags/AbyssalTreasure.cs @@ -26,116 +26,120 @@ namespace CalamityMod.Items.TreasureBags public override void RightClick(Player player) { - if (Main.rand.NextBool(10)) + // Loops 4 times to compensate for dropping only one treasure now + for (int i = 0; i < 4; i++) { - int potionType = Utils.SelectRandom(WorldGen.genRand, new int[] + if (Main.rand.NextBool(10)) { - ItemID.SpelunkerPotion, - ItemID.MagicPowerPotion, - ItemID.ShinePotion, - ItemID.WaterWalkingPotion, - ItemID.ObsidianSkinPotion, - ItemID.WaterWalkingPotion, - ItemID.GravitationPotion, - ItemID.RegenerationPotion, - ModContent.ItemType(), - ModContent.ItemType(), - ItemID.GillsPotion, - ItemID.EndurancePotion, - ItemID.HeartreachPotion, - ItemID.FlipperPotion, - ItemID.LifeforcePotion, - ItemID.InfernoPotion - }); - DropHelper.DropItem(player, potionType); - } - else - { - switch (Main.rand.Next(10)) + int potionType = Utils.SelectRandom(WorldGen.genRand, new int[] + { + ItemID.SpelunkerPotion, + ItemID.MagicPowerPotion, + ItemID.ShinePotion, + ItemID.WaterWalkingPotion, + ItemID.ObsidianSkinPotion, + ItemID.WaterWalkingPotion, + ItemID.GravitationPotion, + ItemID.RegenerationPotion, + ModContent.ItemType(), + ModContent.ItemType(), + ItemID.GillsPotion, + ItemID.EndurancePotion, + ItemID.HeartreachPotion, + ItemID.FlipperPotion, + ItemID.LifeforcePotion, + ItemID.InfernoPotion + }); + DropHelper.DropItem(player, potionType); + } + else { - case 0: - int sglowstickAmt = Main.rand.Next(2, 6); - if (Main.expertMode) - { - sglowstickAmt += Main.rand.Next(1, 7); - } - DropHelper.DropItem(player, ItemID.SpelunkerGlowstick, sglowstickAmt); - break; - case 1: - DropHelper.DropItem(player, ItemID.HellfireArrow, 10, 20); - break; - case 2: - DropHelper.DropItem(player, ModContent.ItemType()); - break; - case 3: - DropHelper.DropItem(player, ItemID.StickyDynamite); - break; - default: - int coinCount = 5000 + Main.rand.Next(-100, 101); - while (coinCount > 0) - { - if (coinCount > 1000000) + switch (Main.rand.Next(10)) + { + case 0: + int sglowstickAmt = Main.rand.Next(2, 6); + if (Main.expertMode) { - int ptCoinAmt = coinCount / 1000000; - if (ptCoinAmt > 50 && Main.rand.NextBool(2)) - { - ptCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - ptCoinAmt /= Main.rand.Next(3) + 1; - } - coinCount -= 1000000 * ptCoinAmt; - DropHelper.DropItem(player, ItemID.PlatinumCoin, ptCoinAmt); + sglowstickAmt += Main.rand.Next(1, 7); } - else if (coinCount > 10000) + DropHelper.DropItem(player, ItemID.SpelunkerGlowstick, sglowstickAmt); + break; + case 1: + DropHelper.DropItem(player, ItemID.HellfireArrow, 10, 20); + break; + case 2: + DropHelper.DropItem(player, ModContent.ItemType()); + break; + case 3: + DropHelper.DropItem(player, ItemID.StickyDynamite); + break; + default: + int coinCount = 5000 + Main.rand.Next(-100, 101); + while (coinCount > 0) { - int auCoinAmt = coinCount / 10000; - if (auCoinAmt > 50 && Main.rand.NextBool(2)) + if (coinCount > 1000000) { - auCoinAmt /= Main.rand.Next(3) + 1; + int ptCoinAmt = coinCount / 1000000; + if (ptCoinAmt > 50 && Main.rand.NextBool(2)) + { + ptCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + ptCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 1000000 * ptCoinAmt; + DropHelper.DropItem(player, ItemID.PlatinumCoin, ptCoinAmt); } - if (Main.rand.NextBool(2)) + else if (coinCount > 10000) { - auCoinAmt /= Main.rand.Next(3) + 1; + int auCoinAmt = coinCount / 10000; + if (auCoinAmt > 50 && Main.rand.NextBool(2)) + { + auCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + auCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 10000 * auCoinAmt; + DropHelper.DropItem(player, ItemID.GoldCoin, auCoinAmt); + } + else if (coinCount > 100) + { + int agCoinAmt = coinCount / 100; + if (agCoinAmt > 50 && Main.rand.NextBool(2)) + { + agCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + agCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 100 * agCoinAmt; + DropHelper.DropItem(player, ItemID.SilverCoin, agCoinAmt); + } + else + { + int cuCoinAmt = coinCount; + if (cuCoinAmt > 50 && Main.rand.NextBool(2)) + { + cuCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + cuCoinAmt /= Main.rand.Next(4) + 1; + } + if (cuCoinAmt < 1) + { + cuCoinAmt = 1; + } + coinCount -= cuCoinAmt; + DropHelper.DropItem(player, ItemID.CopperCoin, cuCoinAmt); } - coinCount -= 10000 * auCoinAmt; - DropHelper.DropItem(player, ItemID.GoldCoin, auCoinAmt); } - else if (coinCount > 100) - { - int agCoinAmt = coinCount / 100; - if (agCoinAmt > 50 && Main.rand.NextBool(2)) - { - agCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - agCoinAmt /= Main.rand.Next(3) + 1; - } - coinCount -= 100 * agCoinAmt; - DropHelper.DropItem(player, ItemID.SilverCoin, agCoinAmt); - } - else - { - int cuCoinAmt = coinCount; - if (cuCoinAmt > 50 && Main.rand.NextBool(2)) - { - cuCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - cuCoinAmt /= Main.rand.Next(4) + 1; - } - if (cuCoinAmt < 1) - { - cuCoinAmt = 1; - } - coinCount -= cuCoinAmt; - DropHelper.DropItem(player, ItemID.CopperCoin, cuCoinAmt); - } - } - break; + break; + } } } } diff --git a/Items/TreasureBags/SulphuricTreasure.cs b/Items/TreasureBags/SulphuricTreasure.cs index 295fa6917e..a522dfe720 100644 --- a/Items/TreasureBags/SulphuricTreasure.cs +++ b/Items/TreasureBags/SulphuricTreasure.cs @@ -26,116 +26,120 @@ namespace CalamityMod.Items.TreasureBags public override void RightClick(Player player) { - if (Main.rand.NextBool(15)) + // Loops 4 times to compensate for dropping only one treasure now + for (int i = 0; i < 4; i++) { - int potionType = Utils.SelectRandom(WorldGen.genRand, new int[] + if (Main.rand.NextBool(15)) { - ItemID.SpelunkerPotion, - ItemID.MagicPowerPotion, - ItemID.ShinePotion, - ItemID.WaterWalkingPotion, - ItemID.ObsidianSkinPotion, - ItemID.WaterWalkingPotion, - ItemID.GravitationPotion, - ItemID.RegenerationPotion, - ModContent.ItemType(), - ModContent.ItemType(), - ItemID.GillsPotion, - ItemID.EndurancePotion, - ItemID.HeartreachPotion, - ItemID.FlipperPotion, - ItemID.LifeforcePotion, - ItemID.InfernoPotion - }); - DropHelper.DropItem(player, potionType); - } - else - { - switch (Main.rand.Next(10)) + int potionType = Utils.SelectRandom(WorldGen.genRand, new int[] + { + ItemID.SpelunkerPotion, + ItemID.MagicPowerPotion, + ItemID.ShinePotion, + ItemID.WaterWalkingPotion, + ItemID.ObsidianSkinPotion, + ItemID.WaterWalkingPotion, + ItemID.GravitationPotion, + ItemID.RegenerationPotion, + ModContent.ItemType(), + ModContent.ItemType(), + ItemID.GillsPotion, + ItemID.EndurancePotion, + ItemID.HeartreachPotion, + ItemID.FlipperPotion, + ItemID.LifeforcePotion, + ItemID.InfernoPotion + }); + DropHelper.DropItem(player, potionType); + } + else { - case 0: - int glowstickAmt = Main.rand.Next(2, 6); - if (Main.expertMode) - { - glowstickAmt += Main.rand.Next(1, 7); - } - DropHelper.DropItem(player, ItemID.Glowstick, glowstickAmt); - break; - case 1: - DropHelper.DropItem(player, ItemID.JestersArrow, 10, 20); - break; - case 2: - DropHelper.DropItem(player, ItemID.HealingPotion); - break; - case 3: - DropHelper.DropItem(player, ItemID.Bomb, 5, 8); - break; - default: - int coinCount = 5000 + Main.rand.Next(-100, 101); - while (coinCount > 0) - { - if (coinCount > 1000000) + switch (Main.rand.Next(10)) + { + case 0: + int glowstickAmt = Main.rand.Next(2, 6); + if (Main.expertMode) { - int ptCoinAmt = coinCount / 1000000; - if (ptCoinAmt > 50 && Main.rand.NextBool(2)) - { - ptCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - ptCoinAmt /= Main.rand.Next(3) + 1; - } - coinCount -= 1000000 * ptCoinAmt; - DropHelper.DropItem(player, ItemID.PlatinumCoin, ptCoinAmt); + glowstickAmt += Main.rand.Next(1, 7); } - else if (coinCount > 10000) + DropHelper.DropItem(player, ItemID.Glowstick, glowstickAmt); + break; + case 1: + DropHelper.DropItem(player, ItemID.JestersArrow, 10, 20); + break; + case 2: + DropHelper.DropItem(player, ItemID.HealingPotion); + break; + case 3: + DropHelper.DropItem(player, ItemID.Bomb, 5, 8); + break; + default: + int coinCount = 5000 + Main.rand.Next(-100, 101); + while (coinCount > 0) { - int auCoinAmt = coinCount / 10000; - if (auCoinAmt > 50 && Main.rand.NextBool(2)) + if (coinCount > 1000000) { - auCoinAmt /= Main.rand.Next(3) + 1; + int ptCoinAmt = coinCount / 1000000; + if (ptCoinAmt > 50 && Main.rand.NextBool(2)) + { + ptCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + ptCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 1000000 * ptCoinAmt; + DropHelper.DropItem(player, ItemID.PlatinumCoin, ptCoinAmt); } - if (Main.rand.NextBool(2)) + else if (coinCount > 10000) { - auCoinAmt /= Main.rand.Next(3) + 1; + int auCoinAmt = coinCount / 10000; + if (auCoinAmt > 50 && Main.rand.NextBool(2)) + { + auCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + auCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 10000 * auCoinAmt; + DropHelper.DropItem(player, ItemID.GoldCoin, auCoinAmt); + } + else if (coinCount > 100) + { + int agCoinAmt = coinCount / 100; + if (agCoinAmt > 50 && Main.rand.NextBool(2)) + { + agCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + agCoinAmt /= Main.rand.Next(3) + 1; + } + coinCount -= 100 * agCoinAmt; + DropHelper.DropItem(player, ItemID.SilverCoin, agCoinAmt); + } + else + { + int cuCoinAmt = coinCount; + if (cuCoinAmt > 50 && Main.rand.NextBool(2)) + { + cuCoinAmt /= Main.rand.Next(3) + 1; + } + if (Main.rand.NextBool(2)) + { + cuCoinAmt /= Main.rand.Next(4) + 1; + } + if (cuCoinAmt < 1) + { + cuCoinAmt = 1; + } + coinCount -= cuCoinAmt; + DropHelper.DropItem(player, ItemID.CopperCoin, cuCoinAmt); } - coinCount -= 10000 * auCoinAmt; - DropHelper.DropItem(player, ItemID.GoldCoin, auCoinAmt); } - else if (coinCount > 100) - { - int agCoinAmt = coinCount / 100; - if (agCoinAmt > 50 && Main.rand.NextBool(2)) - { - agCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - agCoinAmt /= Main.rand.Next(3) + 1; - } - coinCount -= 100 * agCoinAmt; - DropHelper.DropItem(player, ItemID.SilverCoin, agCoinAmt); - } - else - { - int cuCoinAmt = coinCount; - if (cuCoinAmt > 50 && Main.rand.NextBool(2)) - { - cuCoinAmt /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(2)) - { - cuCoinAmt /= Main.rand.Next(4) + 1; - } - if (cuCoinAmt < 1) - { - cuCoinAmt = 1; - } - coinCount -= cuCoinAmt; - DropHelper.DropItem(player, ItemID.CopperCoin, cuCoinAmt); - } - } - break; + break; + } } } } diff --git a/Projectiles/Typeless/StarStruckWaterBottle.cs b/Projectiles/Typeless/StarStruckWaterBottle.cs index 2f45c6cbb8..b0c5b02244 100644 --- a/Projectiles/Typeless/StarStruckWaterBottle.cs +++ b/Projectiles/Typeless/StarStruckWaterBottle.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless { if (projectile.owner == Main.myPlayer) { - Main.PlaySound(SoundID.Shatter, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); + Main.PlaySound(SoundID.Shatter, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); for (int index = 0; index < 5; ++index) Dust.NewDust(projectile.position, projectile.width, projectile.height, 13, 0f, 0f, 0, new Color(), 1f); for (int index1 = 0; index1 < 30; ++index1) @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless dust.velocity.X *= 1.5f; dust.velocity *= 3f; } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, 4f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, projectile.owner, 4f); } } }