diff --git a/Buffs/DamageOverTime/AstralInfectionDebuff.cs b/Buffs/DamageOverTime/AstralInfectionDebuff.cs index 935c00aecd..30c06e6559 100644 --- a/Buffs/DamageOverTime/AstralInfectionDebuff.cs +++ b/Buffs/DamageOverTime/AstralInfectionDebuff.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); - Particle orb = new GenericBloom(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, 0.055f, 8); + Particle orb = new GenericBloom(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.055f, 8); GeneralParticleHandler.SpawnParticle(orb); } } @@ -49,9 +49,9 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); Vector2 npcSize2 = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.1f + (0.0000007f * npc.width * npc.height), 0f, 20); + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.1f + (0.0000007f * npc.width * npc.height), 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); - Particle orb = new GenericBloom(npcSize2, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, 0.065f + (0.0000007f * npc.width * npc.height), 8); + Particle orb = new GenericBloom(npcSize2, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.065f + (0.0000007f * npc.width * npc.height), 8); GeneralParticleHandler.SpawnParticle(orb); } } diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index 33a4f169bd..a16cd403c0 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Buffs.DamageOverTime dust.noGravity = true; for (int i = 0; i < 3; i++) { - Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool(2) ? 90 : ModContent.DustType(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, hasDebuffResistance ? 0.4f : 1.4f); + Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool() ? 90 : ModContent.DustType(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, hasDebuffResistance ? 0.4f : 1.4f); dust2.noGravity = true; } } @@ -58,7 +58,7 @@ namespace CalamityMod.Buffs.DamageOverTime dust.scale = 1.6f; for (int i = 0; i < 3; i++) { - Dust dust2 = Dust.NewDustDirect(npc.position + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2), npc.width, npc.height, Main.rand.NextBool(2) ? 90 : ModContent.DustType()); + Dust dust2 = Dust.NewDustDirect(npc.position + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2), npc.width, npc.height, Main.rand.NextBool() ? 90 : ModContent.DustType()); dust2.noGravity = true; dust2.velocity = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + npc.velocity; dust2.scale = 1.4f; diff --git a/Buffs/DamageOverTime/GodSlayerInferno.cs b/Buffs/DamageOverTime/GodSlayerInferno.cs index 31f173cf1f..c92b632676 100644 --- a/Buffs/DamageOverTime/GodSlayerInferno.cs +++ b/Buffs/DamageOverTime/GodSlayerInferno.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(NPC npc, ref Color drawColor) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); SparkParticle spark = new SparkParticle(npcSize, new Vector2(0, Main.rand.NextFloat(-5f, 5f)), false, Main.rand.Next(11, 13), Main.rand.NextFloat(0.2f, 0.5f), Main.rand.NextBool(7) ? Color.Aqua : Color.Fuchsia); diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index a40358c3b2..d3c4582b09 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2) && drawInfo.shadow == 0f) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool(2) ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } @@ -58,7 +58,7 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool(2) ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f); + CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index 71a3c71d83..7f0f2bddb1 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2) && drawInfo.shadow == 0f) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool(2) ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++) @@ -57,7 +57,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(3)) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool(2) ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f); + CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } for (int i = 0; i < 2; i++) diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index 5c62e01774..134a167a8e 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Buffs.DamageOverTime } if (Main.rand.NextBool(5)) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool(2) ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); GeneralParticleHandler.SpawnParticle(pulse); } } @@ -56,7 +56,7 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(NPC npc, ref Color drawColor) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 298, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.2f + +(0.000003f * npc.width * npc.height)); @@ -69,9 +69,9 @@ namespace CalamityMod.Buffs.DamageOverTime Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.4f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-4.5f, -6f)), Main.rand.NextBool(2) ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.12f + (0.0000007f * npc.width * npc.height), 0f, 45); + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-4.5f, -6f)), Main.rand.NextBool() ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.12f + (0.0000007f * npc.width * npc.height), 0f, 45); GeneralParticleHandler.SpawnParticle(pulse); } } diff --git a/Buffs/StatBuffs/PhantomicRegen.png b/Buffs/StatBuffs/PhantomicRegen.png index 806d74e358..eda8b2201d 100644 Binary files a/Buffs/StatBuffs/PhantomicRegen.png and b/Buffs/StatBuffs/PhantomicRegen.png differ diff --git a/Buffs/StatBuffs/RageMode.cs b/Buffs/StatBuffs/RageMode.cs index 500bc4291c..116a319cc2 100644 --- a/Buffs/StatBuffs/RageMode.cs +++ b/Buffs/StatBuffs/RageMode.cs @@ -54,10 +54,10 @@ namespace CalamityMod.Buffs.StatBuffs modPlayer.ragePulseTimer++; int dustID = modPlayer.heartOfDarkness ? 240 : 114; - if (modPlayer.shatteredCommunity && Main.rand.NextBool(2)) + if (modPlayer.shatteredCommunity && Main.rand.NextBool()) dustID = 112; //special dust visual for Shattered Community - if (modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity && Main.rand.NextBool(2)) + if (modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity && Main.rand.NextBool()) dustID = 90; //special dust visual for Heart of Darkness if (modPlayer.ragePulseTimer == 60) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 7ca345f8c6..295e199674 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1070,6 +1070,8 @@ namespace CalamityMod.CalPlayer public bool abyssalDivingSuitPower; public bool profanedCrystal; public int profanedCrystalStatePrevious; + public bool profanedCrystalPrevious; + public int profanedCrystalAnim; public bool profanedCrystalForce; public bool profanedCrystalBuffs; public bool profanedCrystalHide; @@ -2087,6 +2089,7 @@ namespace CalamityMod.CalPlayer aquaticHeart = aquaticHeartHide = aquaticHeartForce = aquaticHeartPower = false; profanedCrystalStatePrevious = pscState; + profanedCrystalPrevious = profanedCrystal; profanedCrystal = profanedCrystalBuffs = profanedCrystalForce = profanedCrystalHide = false; pscState = 0; pscLerpColor = Color.White; @@ -2537,6 +2540,7 @@ namespace CalamityMod.CalPlayer blazingCoreSuccessfulParry = 0; flameLickedShellParry = 0; flameLickedShellEmpoweredParry = false; + profanedCrystalAnim = -1; #endregion #region Shields @@ -3101,7 +3105,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < dustPerSegment; ++i) { bool electricity = Main.rand.NextBool(4); - int dustID = electricity ? (Main.rand.NextBool(2) ? 132 : 131) : ModContent.DustType(); + int dustID = electricity ? (Main.rand.NextBool() ? 132 : 131) : ModContent.DustType(); float interpolant = i + 0.5f; float spreadSpeed = Main.rand.NextFloat(0.5f, maxDustVelSpread); @@ -3284,7 +3288,7 @@ namespace CalamityMod.CalPlayer Main.dust[idx].velocity *= 2f; Main.dust[idx].scale *= 1.2f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = Main.rand.NextFloat(0.75f, 1f); Main.dust[idx].scale = Main.rand.NextFloat(0.25f, 0.75f); @@ -3653,7 +3657,6 @@ namespace CalamityMod.CalPlayer (lunicCorpsLegs ? 0.1f : 0f) + (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + - (aeroStone && Player.equippedWings != null && Player.wingTime == 0f ? 0.5f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? 0.15f : 0f) + ((frostFlare && Player.statLife < (int)(Player.statLifeMax2 * 0.25)) ? 0.15f : 0f) + @@ -4793,7 +4796,7 @@ namespace CalamityMod.CalPlayer #endregion #region Misc Stuff - private static int musicModDisplayDelay = -1; + private static int startMessageDisplayDelay = -1; // Triggers effects that must occur when the player enters the world. This sends a bunch of packets in multiplayer. // It also starts the speedrun timer if applicable. @@ -4807,16 +4810,10 @@ namespace CalamityMod.CalPlayer if (CalamityConfig.Instance.SpeedrunTimer) CalamityMod.SpeedrunTimer.Restart(); - if (CalamityConfig.Instance.WikiStatusMessage) + // Set a random delay between 12 and 20 seconds. When this delay hits zero, the music mod and wiki reminder messages display + if ((CalamityMod.Instance.musicMod is null && CalamityConfig.Instance.MusicModReminderMessage) || CalamityConfig.Instance.WikiStatusMessage) { - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1"); - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2"); - } - - // Set a random delay between 12 and 20 seconds. When this delay hits zero, the music mod reminder message displays - if (CalamityMod.Instance.musicMod is null && CalamityConfig.Instance.MusicModReminderMessage) - { - musicModDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1); + startMessageDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1); } } @@ -4857,7 +4854,7 @@ namespace CalamityMod.CalPlayer public override void OnConsumeMana(Item item, int manaConsumed) { CalamityPlayer modPlayer = Player.Calamity(); - if (Main.rand.NextBool(2) && modPlayer.lifeManaEnchant) + if (Main.rand.NextBool() && modPlayer.lifeManaEnchant) { if (Main.myPlayer == Player.whoAmI) { diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index def12e18b3..9b3d759305 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -125,7 +125,7 @@ namespace CalamityMod.CalPlayer { if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 229, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -140,7 +140,7 @@ namespace CalamityMod.CalPlayer { if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 246, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -160,7 +160,7 @@ namespace CalamityMod.CalPlayer Lighting.AddLight((int)Player.Center.X / 16, (int)Player.Center.Y / 16, 100 / 235f, 1 / 235f, 250 / 235f); if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; @@ -191,7 +191,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(8) && drawInfo.shadow == 0f) { - int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); + int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool() ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[de_dust2].noGravity = true; Main.dust[de_dust2].velocity *= 0.5f; drawInfo.DustCache.Add(de_dust2); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 15c2208653..f22f377201 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -92,7 +92,7 @@ namespace CalamityMod.CalPlayer dust.velocity *= 0.4f; dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.noGravity = true; @@ -126,7 +126,7 @@ namespace CalamityMod.CalPlayer dust.velocity *= 0.4f; dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.cNeck, Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.noGravity = true; @@ -241,7 +241,7 @@ namespace CalamityMod.CalPlayer dust.scale *= 1f + Main.rand.Next(40) * 0.01f; // Change this accordingly if we have a proper equipped sprite. dust.shader = GameShaders.Armor.GetSecondaryShader(Player.cBody, Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + Main.rand.Next(40) * 0.01f; } @@ -2098,7 +2098,7 @@ namespace CalamityMod.CalPlayer { int dust = Dust.NewDust(Player.position, Player.width, Player.height, 31, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -2125,7 +2125,7 @@ namespace CalamityMod.CalPlayer { int ice = Dust.NewDust(Player.position, Player.width, Player.height, 67, 0f, 0f, 100, default, 2f); Main.dust[ice].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ice].scale = 0.5f; Main.dust[ice].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 6e0bd68c43..05886270c4 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -679,7 +679,7 @@ namespace CalamityMod.CalPlayer if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { Player.lifeRegen += 2; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, 5, 0f, 0f, 200, new Color(99, 54, 84), 2f); Main.dust[regen].noGravity = true; @@ -788,7 +788,7 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; - bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool() : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); @@ -832,7 +832,7 @@ namespace CalamityMod.CalPlayer // Normally 1.25 while resting and 0.5 while not Player.lifeRegen += (int)(baseRegenRate * 0.75f); - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2)) + if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool()) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, 12, 0f, 0f, 200, Color.OrangeRed, 1f); Main.dust[regen].noGravity = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 97f22774fc..412678025f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -246,7 +246,7 @@ namespace CalamityMod.CalPlayer float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 6f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); Vector2 velOffset = Vector2.Zero; - Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 160 : 307, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 160 : 307, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.alpha = 100; @@ -256,10 +256,10 @@ namespace CalamityMod.CalPlayer { float sparkscale = (Player.velocity.X * Player.direction * 0.07f); Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * 2, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue); GeneralParticleHandler.SpawnParticle(spark); Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * -2, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue); GeneralParticleHandler.SpawnParticle(spark2); } if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox @@ -287,7 +287,7 @@ namespace CalamityMod.CalPlayer float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 8f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); Vector2 velOffset = Vector2.Zero; - Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 35 : 127, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 35 : 127, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.alpha = 100; @@ -295,10 +295,10 @@ namespace CalamityMod.CalPlayer } float sparkscale = (Player.velocity.X * Player.direction * 0.08f); Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * -3, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark); Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * 3, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark2); if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox @@ -1556,7 +1556,7 @@ namespace CalamityMod.CalPlayer Main.dust[green].noGravity = true; Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[green].shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -1587,7 +1587,7 @@ namespace CalamityMod.CalPlayer dust.noGravity = true; dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -1658,7 +1658,7 @@ namespace CalamityMod.CalPlayer dust.noGravity = true; dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -2503,9 +2503,12 @@ namespace CalamityMod.CalPlayer if (baroclaw) Player.GetDamage() += 0.1f; - if (aeroStone) + if (aeroStone && !Player.slowFall) { - Player.moveSpeed += (Player.equippedWings != null && Player.wingTime == 0f ? 0.25f : 0f); + if (!Player.controlJump && Player.miscCounter % 5 == 0) + { + Player.wingTime += 1; + } } if (gShell) @@ -4096,12 +4099,22 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI != Main.myPlayer || Main.netMode == NetmodeID.Server) return; - if (musicModDisplayDelay >= 0) + if (startMessageDisplayDelay >= 0) { - if (musicModDisplayDelay == 0) - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.MusicModReminder"); + if (startMessageDisplayDelay == 0) + { + if (CalamityConfig.Instance.WikiStatusMessage) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1"); + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2"); + } + if (CalamityMod.Instance.musicMod is null && CalamityConfig.Instance.MusicModReminderMessage) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.MusicModReminder"); + } + } - --musicModDisplayDelay; + --startMessageDisplayDelay; } } #endregion diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index f7d1618af4..78c663053c 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -129,23 +129,13 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 120); break; - case ItemID.FieryGreatsword: - case ItemID.MoltenPickaxe: - case ItemID.MoltenHamaxe: - target.AddBuff(BuffID.OnFire, 120); - break; - - case ItemID.BladeofGrass: - target.AddBuff(BuffID.Poisoned, 210); - break; - case ItemID.BeeKeeper: target.AddBuff(BuffID.Poisoned, 240); break; case ItemID.IceSickle: case ItemID.Frostbrand: - target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(BuffID.Frostburn2, 300); break; case ItemID.IceBlade: @@ -162,7 +152,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4)) target.AddBuff(BuffID.OnFire3, 360); - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) target.AddBuff(BuffID.OnFire3, 240); else target.AddBuff(BuffID.OnFire3, 120); @@ -255,21 +245,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.OnFire3, 180); break; - case ProjectileID.Flamelash: - target.AddBuff(BuffID.OnFire, 300); - break; - - case ProjectileID.BallofFire: - target.AddBuff(BuffID.OnFire, 180); - break; - - case ProjectileID.Cascade: - case ProjectileID.Sunfury: - case ProjectileID.Flamarang: - case ProjectileID.FireArrow: - target.AddBuff(BuffID.OnFire, 120); - break; - case ProjectileID.GolemFist: target.AddBuff(BuffType(), 180); break; @@ -278,21 +253,12 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 60); break; - case ProjectileID.PoisonedKnife: - target.AddBuff(BuffID.Poisoned, 300); - break; - - case ProjectileID.ThornChakram: - target.AddBuff(BuffID.Poisoned, 210); - break; - case ProjectileID.Bee: case ProjectileID.GiantBee: target.AddBuff(BuffID.Poisoned, 120); break; case ProjectileID.Wasp: - target.AddBuff(BuffID.Poisoned, 120); target.AddBuff(BuffID.Venom, 60); break; @@ -300,42 +266,32 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 300); break; - case ProjectileID.FrostBlastFriendly: case ProjectileID.NorthPoleWeapon: target.AddBuff(BuffID.Frostburn, 300); break; - case ProjectileID.FrostBoltStaff: case ProjectileID.IceSickle: - case ProjectileID.FrostBoltSword: - case ProjectileID.FrostArrow: + case ProjectileID.FrostArrow: // Ice Bow case ProjectileID.NorthPoleSpear: - case ProjectileID.Amarok: - target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.Frostburn2, 180); break; - case ProjectileID.Blizzard: + case ProjectileID.Blizzard: // Blizzard Staff case ProjectileID.NorthPoleSnowflake: - target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.Frostburn2, 120); break; - case ProjectileID.IceBolt: + case ProjectileID.IceBolt: // Ice Blade case ProjectileID.FrostDaggerfish: - case ProjectileID.FrostburnArrow: target.AddBuff(BuffID.Frostburn, 60); break; - - case ProjectileID.IceBoomerang: - if (Main.rand.NextBool()) - target.AddBuff(BuffID.Frostburn, 60); - break; } if ((proj.arrow && Player.hasMoltenQuiver) || hellfireTreads) { if (Main.rand.NextBool(4)) target.AddBuff(BuffID.OnFire3, 360); - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) target.AddBuff(BuffID.OnFire3, 240); else target.AddBuff(BuffID.OnFire3, 120); @@ -895,7 +851,7 @@ namespace CalamityMod.CalPlayer for (int dustexplode = 0; dustexplode < 360; dustexplode++) { Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode)); - int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool(2) ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f); + int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool() ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f); Main.dust[d].noGravity = true; Main.dust[d].position = proj.Center; Main.dust[d].velocity *= 0.1f; @@ -907,7 +863,7 @@ namespace CalamityMod.CalPlayer { for (int i = 0; i < 3; i++) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int type = -1; switch (Main.rand.Next(15)) @@ -1096,7 +1052,7 @@ namespace CalamityMod.CalPlayer } } if (voidOfExtinction) - CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); + //CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); if (frostFlare) CalamityUtils.Inflict246DebuffsNPC(target, BuffID.Frostburn2); if (omegaBlueChestplate) @@ -1216,7 +1172,7 @@ namespace CalamityMod.CalPlayer if ((target.damage > 5 || target.boss) && !target.SpawnedFromStatue) { - if (bloodflareThrowing && proj.CountsAsClass() && crit && Main.rand.NextBool(2)) + if (bloodflareThrowing && proj.CountsAsClass() && crit && Main.rand.NextBool()) { float projHitMult = 0.03f; projHitMult -= proj.numHits * 0.015f; @@ -1249,7 +1205,7 @@ namespace CalamityMod.CalPlayer { if (manaOverloader && otherHealTypes) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { float healMult = 0.2f; healMult -= proj.numHits * 0.05f; diff --git a/CalPlayer/Dashes/AsgardsValorDash.cs b/CalPlayer/Dashes/AsgardsValorDash.cs index c3ff2c8611..27368abd27 100644 --- a/CalPlayer/Dashes/AsgardsValorDash.cs +++ b/CalPlayer/Dashes/AsgardsValorDash.cs @@ -46,7 +46,7 @@ namespace CalamityMod.CalPlayer.Dashes holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); holyFireDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) holyFireDashDust.fadeIn = 0.5f; } } diff --git a/CalPlayer/Dashes/DeepDiverDash.cs b/CalPlayer/Dashes/DeepDiverDash.cs index 43620c3d0a..61d2d5ab11 100644 --- a/CalPlayer/Dashes/DeepDiverDash.cs +++ b/CalPlayer/Dashes/DeepDiverDash.cs @@ -39,7 +39,7 @@ namespace CalamityMod.CalPlayer.Dashes iceDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); iceDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); iceDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) iceDashDust.fadeIn = 0.5f; } diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index 71b2ddb356..9f46dd1b95 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -46,7 +46,7 @@ namespace CalamityMod.CalPlayer.Dashes holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); holyFireDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) holyFireDashDust.fadeIn = 0.5f; } diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index 50ba65437a..ac567d7484 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -44,7 +44,7 @@ namespace CalamityMod.CalPlayer.Dashes plagueDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); plagueDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); plagueDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) plagueDashDust.fadeIn = 0.5f; } diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index f3ff62b178..4868dd5349 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1,5 +1,7 @@ using CalamityMod.Balancing; +using CalamityMod.Items.Fishing; using CalamityMod.Items.Materials; +using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; @@ -288,37 +290,391 @@ namespace CalamityMod.ILEditing orig(self, angler, questItemType); EntitySource_Gift source = new EntitySource_Gift(angler); - int questsDone = self.anglerQuestsFinished + Main.rand.Next(101); + int questsDone = self.anglerQuestsFinished; float rarityReduction = 1f; rarityReduction = (questsDone <= 50) ? (rarityReduction - questsDone * 0.01f) : ((questsDone <= 100) ? (0.5f - (questsDone - 50) * 0.005f) : ((questsDone > 150) ? 0.15f : (0.25f - (questsDone - 100) * 0.002f))); rarityReduction *= 0.9f; rarityReduction *= (float)(self.currentShoppingSettings.PriceAdjustment + 1.0) / 2f; + if (rarityReduction < 0.1f) + rarityReduction = 0.1f; + List rewardItems = new List(); GetItemSettings anglerRewardSettings = GetItemSettings.NPCEntityToPlayerInventorySettings; Item item = new Item(); - item.SetDefaults(ItemID.MasterBait); - item.stack += 5; - if (item.stack > 0) - rewardItems.Add(item); - Item item2 = self.GetItem(self.whoAmI, item, GetItemSettings.NPCEntityToPlayerInventorySettings); - if (item2.stack > 0) - rewardItems.Add(item2); + // GUARANTEED REWARDS - item = new Item(); - item.SetDefaults(ItemID.GoldCoin); - item.stack = 10; + // BAIT + switch (questsDone) + { + case 0: + case 1: + case 2: + case 3: + case 4: + item = new Item(); + item.SetDefaults(ItemID.Stinkbug); + item.stack = Main.rand.Next(2, 6); + break; + + case 5: + case 6: + case 7: + case 8: + case 9: + item = new Item(); + item.SetDefaults(ItemID.ApprenticeBait); + item.stack = Main.rand.Next(2, 6); + break; + + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + item = new Item(); + item.SetDefaults(Main.rand.NextBool() ? ItemID.Worm : ItemID.Maggot); + item.stack = Main.rand.Next(2, 6); + break; + + case 16: + case 17: + case 18: + case 19: + case 20: + item = new Item(); + item.SetDefaults(ItemID.JourneymanBait); + item.stack = Main.rand.Next(2, 6); + break; + + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + item = new Item(); + item.SetDefaults(Main.rand.NextBool() ? ItemID.EnchantedNightcrawler : ItemID.Buggy); + item.stack = Main.rand.Next(2, 6); + break; + + case 27: + case 28: + case 29: + case 30: + item = new Item(); + item.SetDefaults(ItemID.MasterBait); + item.stack = Main.rand.Next(2, 6); + break; + + default: + //item = new Item(); + //item.SetDefaults(ModContent.ItemType()); + //item.stack = Main.rand.Next(2, 6); + break; + } + + item.position = self.Center; + Item item2 = self.GetItem(self.whoAmI, item, anglerRewardSettings); + rewardItems.Add(item2); + + // COINS + switch (questsDone) + { + case 0: + case 1: + case 2: + case 3: + case 4: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + break; + + case 5: + case 6: + case 7: + case 8: + case 9: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + item.stack = 2; + item = new Item(); + item.SetDefaults(ItemID.SilverCoin); + item.stack = 50; + break; + + case 10: + case 11: + case 12: + case 13: + case 14: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + item.stack = 4; + break; + + case 15: + case 16: + case 17: + case 18: + case 19: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + item.stack = 6; + break; + + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + item.stack = 8; + break; + + default: + item = new Item(); + item.SetDefaults(ItemID.GoldCoin); + item.stack = 10; + break; + } item.position = self.Center; item2 = self.GetItem(self.whoAmI, item, anglerRewardSettings); - if (item2.stack > 0) - rewardItems.Add(item2); - + rewardItems.Add(item2); + + // PRIMARY ITEMS + switch (questsDone) + { + case 0: + case 1: + item = new Item(); + item.SetDefaults(ModContent.ItemType()); + rewardItems.Add(item); + break; + + case 2: + item = new Item(); + item.SetDefaults(ModContent.ItemType()); + item.stack = Main.rand.Next(4, 10); + rewardItems.Add(item); + break; + + case 3: + item = new Item(); + item.SetDefaults(ItemID.HighTestFishingLine); + rewardItems.Add(item); + break; + + case 4: + item = new Item(); + item.SetDefaults(ItemID.FishHook); + rewardItems.Add(item); + break; + + case 5: + item = new Item(); + item.SetDefaults(ItemID.FuzzyCarrot); + rewardItems.Add(item); + break; + + case 6: + item = new Item(); + item.SetDefaults(ItemID.FishermansGuide); + rewardItems.Add(item); + break; + + case 7: + item = new Item(); + item.SetDefaults(ItemID.FishCostumeMask); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.FishCostumeShirt); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.FishCostumeFinskirt); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ModContent.ItemType()); + rewardItems.Add(item); + break; + + case 8: + item = new Item(); + item.SetDefaults(ItemID.FishMinecart); + rewardItems.Add(item); + break; + + case 9: + item = new Item(); + item.SetDefaults(ItemID.SailfishBoots); + rewardItems.Add(item); + break; + + case 10: + item = new Item(); + item.SetDefaults(ItemID.AnglerHat); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.AnglerVest); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.AnglerPants); + rewardItems.Add(item); + break; + + case 11: + item = new Item(); + item.SetDefaults(ItemID.WeatherRadio); + rewardItems.Add(item); + break; + + case 12: + item = new Item(); + item.SetDefaults(ItemID.FishingBobber); + rewardItems.Add(item); + break; + + case 13: + item = new Item(); + item.SetDefaults(ItemID.SeashellHairpin); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.MermaidAdornment); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ItemID.MermaidTail); + rewardItems.Add(item); + item = new Item(); + item.SetDefaults(ModContent.ItemType()); + rewardItems.Add(item); + break; + + case 14: + item = new Item(); + item.SetDefaults(ItemID.Sextant); + rewardItems.Add(item); + break; + + case 15: + item = new Item(); + item.SetDefaults(ItemID.TackleBox); + rewardItems.Add(item); + break; + + case 16: + item = new Item(); + item.SetDefaults(ItemID.SuperAbsorbantSponge); + rewardItems.Add(item); + break; + + case 17: + item = new Item(); + item.SetDefaults(ItemID.HoneyAbsorbantSponge); + rewardItems.Add(item); + break; + + case 18: + item = new Item(); + item.SetDefaults(ItemID.MagicConch); + rewardItems.Add(item); + break; + + case 19: + item = new Item(); + item.SetDefaults(ItemID.DemonConch); + rewardItems.Add(item); + break; + + case 20: + item = new Item(); + item.SetDefaults(ItemID.AnglerEarring); + rewardItems.Add(item); + break; + + case 21: + item = new Item(); + item.SetDefaults(ItemID.LavaFishingHook); + rewardItems.Add(item); + break; + + case 22: + item = new Item(); + item.SetDefaults(ItemID.HotlineFishingHook); + rewardItems.Add(item); + break; + + case 23: + item = new Item(); + item.SetDefaults(ItemID.FrogLeg); + rewardItems.Add(item); + break; + + case 24: + item = new Item(); + item.SetDefaults(ItemID.SuperheatedBlood); + rewardItems.Add(item); + break; + + case 25: + item = new Item(); + item.SetDefaults(ItemID.BottomlessBucket); + rewardItems.Add(item); + break; + + case 26: + item = new Item(); + item.SetDefaults(ItemID.Sundial); + rewardItems.Add(item); + break; + + case 27: + item = new Item(); + item.SetDefaults(ItemID.BottomlessHoneyBucket); + rewardItems.Add(item); + break; + + case 28: + item = new Item(); + item.SetDefaults(ItemID.GoldenBugNet); + rewardItems.Add(item); + break; + + case 29: + item = new Item(); + item.SetDefaults(ItemID.BottomlessLavaBucket); + rewardItems.Add(item); + break; + + case 30: + item = new Item(); + item.SetDefaults(ItemID.GoldenFishingRod); + rewardItems.Add(item); + break; + } + + // RANDOM DROPS + + // Angling Kits + if (Main.rand.NextBool((int)(12f * rarityReduction)) && questsDone > 30) + { + item = new Item(); + item.SetDefaults(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType()); + rewardItems.Add(item); + } + // Golden Fishing Rod - if (Main.rand.NextBool((int)(500f * rarityReduction))) + if (Main.rand.NextBool((int)(500f * rarityReduction)) && questsDone > 30) { item = new Item(); item.SetDefaults(ItemID.GoldenFishingRod); @@ -326,7 +682,7 @@ namespace CalamityMod.ILEditing } // Hotline Fishing Hook - if (Main.rand.NextBool((int)(200f * rarityReduction)) || self.anglerQuestsFinished == 22) + if (Main.rand.NextBool((int)(200f * rarityReduction)) && questsDone > 22) { item = new Item(); item.SetDefaults(ItemID.HotlineFishingHook); @@ -334,7 +690,7 @@ namespace CalamityMod.ILEditing } // Angler Set - if (Main.rand.NextBool((int)(150f * rarityReduction))) + if (Main.rand.NextBool((int)(150f * rarityReduction)) && questsDone > 10) { item = new Item(); item.SetDefaults(ItemID.AnglerHat); @@ -348,7 +704,7 @@ namespace CalamityMod.ILEditing } // Mermaid Set - if (Main.rand.NextBool((int)(150f * rarityReduction)) || self.anglerQuestsFinished == 11) + if (Main.rand.NextBool((int)(150f * rarityReduction)) && questsDone > 13) { item = new Item(); item.SetDefaults(ItemID.SeashellHairpin); @@ -362,7 +718,7 @@ namespace CalamityMod.ILEditing } // Fish Set - if (Main.rand.NextBool((int)(150f * rarityReduction)) || self.anglerQuestsFinished == 8) + if (Main.rand.NextBool((int)(150f * rarityReduction)) && questsDone > 7) { item = new Item(); item.SetDefaults(ItemID.FishCostumeMask); @@ -376,7 +732,7 @@ namespace CalamityMod.ILEditing } // Fin Wings - if (Main.rand.NextBool((int)(140f * rarityReduction)) && Main.hardMode) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && Main.hardMode && questsDone > 10) { item = new Item(); item.SetDefaults(ItemID.FinWings); @@ -384,7 +740,7 @@ namespace CalamityMod.ILEditing } // Bottomless Water Bucket - if (Main.rand.NextBool((int)(140f * rarityReduction))) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 25) { item = new Item(); item.SetDefaults(ItemID.BottomlessBucket); @@ -392,15 +748,39 @@ namespace CalamityMod.ILEditing } // Bottomless Honey Bucket - /*if (Main.rand.NextBool((int)(140f * rarityReduction)) || self.anglerQuestsFinished == 29) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 27) { item = new Item(); item.SetDefaults(ItemID.BottomlessHoneyBucket); rewardItems.Add(item); - }*/ + } + + // Bottomless Lava Bucket + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 29) + { + item = new Item(); + item.SetDefaults(ItemID.BottomlessLavaBucket); + rewardItems.Add(item); + } + + // Magic Conch + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 18) + { + item = new Item(); + item.SetDefaults(ItemID.MagicConch); + rewardItems.Add(item); + } + + // Demon Conch + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 19) + { + item = new Item(); + item.SetDefaults(ItemID.DemonConch); + rewardItems.Add(item); + } // Super Absorbant Sponge - if (Main.rand.NextBool((int)(140f * rarityReduction)) || self.anglerQuestsFinished == 17) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 16) { item = new Item(); item.SetDefaults(ItemID.SuperAbsorbantSponge); @@ -408,15 +788,15 @@ namespace CalamityMod.ILEditing } // Honey Absorbant Sponge - /*if (Main.rand.NextBool((int)(140f * rarityReduction)) || self.anglerQuestsFinished == 19) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 17) { item = new Item(); item.SetDefaults(ItemID.SuperAbsorbantSponge); rewardItems.Add(item); - }*/ + } // Golden Bug Net - if (Main.rand.NextBool((int)(140f * rarityReduction)) || self.anglerQuestsFinished == 27) + if (Main.rand.NextBool((int)(140f * rarityReduction)) && questsDone > 28) { item = new Item(); item.SetDefaults(ItemID.GoldenBugNet); @@ -424,7 +804,7 @@ namespace CalamityMod.ILEditing } // Fish Hook - if (Main.rand.NextBool((int)(120f * rarityReduction)) || self.anglerQuestsFinished == 4) + if (Main.rand.NextBool((int)(120f * rarityReduction)) && questsDone > 4) { item = new Item(); item.SetDefaults(ItemID.FishHook); @@ -432,15 +812,23 @@ namespace CalamityMod.ILEditing } // Minecarp - if (Main.rand.NextBool((int)(120f * rarityReduction)) || self.anglerQuestsFinished == 9) + if (Main.rand.NextBool((int)(120f * rarityReduction)) && questsDone > 8) { item = new Item(); item.SetDefaults(ItemID.FishMinecart); rewardItems.Add(item); } + // Lava Shark + if (Main.rand.NextBool((int)(120f * rarityReduction)) && questsDone > 24) + { + item = new Item(); + item.SetDefaults(ItemID.SuperheatedBlood); + rewardItems.Add(item); + } + // High Test Fishing Line - if (Main.rand.NextBool((int)(80f * rarityReduction)) || self.anglerQuestsFinished == 2) + if (Main.rand.NextBool((int)(80f * rarityReduction)) && questsDone > 3) { item = new Item(); item.SetDefaults(ItemID.HighTestFishingLine); @@ -448,15 +836,23 @@ namespace CalamityMod.ILEditing } // Angler Earring - if (Main.rand.NextBool((int)(80f * rarityReduction)) || self.anglerQuestsFinished == 7) + if (Main.rand.NextBool((int)(80f * rarityReduction)) && questsDone > 20) { item = new Item(); item.SetDefaults(ItemID.AnglerEarring); rewardItems.Add(item); } + // Lavaproof Fishing Hook + if (Main.rand.NextBool((int)(80f * rarityReduction)) && questsDone > 21) + { + item = new Item(); + item.SetDefaults(ItemID.LavaFishingHook); + rewardItems.Add(item); + } + // Tackle Box - if (Main.rand.NextBool((int)(80f * rarityReduction)) || self.anglerQuestsFinished == 12) + if (Main.rand.NextBool((int)(80f * rarityReduction)) && questsDone > 15) { item = new Item(); item.SetDefaults(ItemID.TackleBox); @@ -464,7 +860,7 @@ namespace CalamityMod.ILEditing } // Fisherman's Pocket Guide - if (Main.rand.NextBool((int)(60f * rarityReduction)) || self.anglerQuestsFinished == 1) + if (Main.rand.NextBool((int)(60f * rarityReduction)) && questsDone > 6) { item = new Item(); item.SetDefaults(ItemID.FishermansGuide); @@ -472,7 +868,7 @@ namespace CalamityMod.ILEditing } // Weather Radio - if (Main.rand.NextBool((int)(60f * rarityReduction)) || self.anglerQuestsFinished == 3) + if (Main.rand.NextBool((int)(60f * rarityReduction)) && questsDone > 11) { item = new Item(); item.SetDefaults(ItemID.WeatherRadio); @@ -480,7 +876,7 @@ namespace CalamityMod.ILEditing } // Sextant - if (Main.rand.NextBool((int)(60f * rarityReduction)) || self.anglerQuestsFinished == 6) + if (Main.rand.NextBool((int)(60f * rarityReduction)) && questsDone > 14) { item = new Item(); item.SetDefaults(ItemID.Sextant); @@ -488,12 +884,12 @@ namespace CalamityMod.ILEditing } // Fishing Bobber - /*if (Main.rand.NextBool((int)(50f * rarityReduction)) || self.anglerQuestsFinished == 13) + if (Main.rand.NextBool((int)(50f * rarityReduction)) && questsDone > 12) { item = new Item(); item.SetDefaults(ItemID.FishingBobber); rewardItems.Add(item); - }*/ + } PlayerLoader.AnglerQuestReward(self, rarityReduction, rewardItems); diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 110a2a9a84..fba7118604 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().aeroStone = true; - player.wingTimeMax += 45; - + player.wingTimeMax += 35; + } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) diff --git a/Items/Accessories/BloomStone.cs b/Items/Accessories/BloomStone.cs index d927134cb7..d016818e8c 100644 --- a/Items/Accessories/BloomStone.cs +++ b/Items/Accessories/BloomStone.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Accessories // On grass, grow flowers. if (groundTile.TileType == TileID.Grass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { walkTile.Get().HasTile = true; walkTile.TileType = TileID.Plants; @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Accessories // On hallowed grass, grow hallowed flowers. else if (groundTile.TileType == TileID.HallowedGrass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { walkTile.Get().HasTile = true; walkTile.TileType = TileID.HallowedPlants; diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index c8c97e4045..283e14002a 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -15,13 +16,14 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - //subject to change to be "cooler" + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 10)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() { - Item.width = 28; - Item.height = 32; + Item.width = 50; + Item.height = 52; Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.accessory = true; Item.rare = ModContent.RarityType(); diff --git a/Items/Accessories/Nucleogenesis.png b/Items/Accessories/Nucleogenesis.png index 1ba42b2a88..1eee5951e9 100644 Binary files a/Items/Accessories/Nucleogenesis.png and b/Items/Accessories/Nucleogenesis.png differ diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index ba5a8737fd..cc65b39a37 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.strongBees = true; modPlayer.uberBees = true; modPlayer.alchFlask = true; player.buffImmune[ModContent.BuffType()] = true; diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 629e88b5ce..443a62a976 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -65,13 +65,18 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer localModPlayer = Main.LocalPlayer.Calamity(); DetermineTransformationEligibility(localModPlayer.Player); - var psc = localModPlayer.profanedCrystalBuffs; - scale += ((ProfanedSoulCrystalState)localModPlayer.pscState) == ProfanedSoulCrystalState.Empowered ? 0.05f : psc ? 0.025f : 0f; + var psState = (int)GetPscStateFor(localModPlayer.Player, localModPlayer.profanedCrystalAnim >= 0); + var psc = localModPlayer.profanedCrystalBuffs || (localModPlayer.profanedCrystalAnim >= 0 && psState >= (int)ProfanedSoulCrystalState.Buffs); + + scale += ((ProfanedSoulCrystalState)psState) == ProfanedSoulCrystalState.Empowered ? 0.05f : psc ? 0.025f : 0f; + if (localModPlayer.profanedCrystalAnim >= 0) + scale = MathHelper.Lerp(0f, scale, ((float)maxPscAnimTime - (float)localModPlayer.profanedCrystalAnim) / (float)maxPscAnimTime); //i don't like casting this many times, i'm not a fucking wizard + float visualShieldStrength = 1f; if (!isVanityOnly) { float max = psc ? ProfanedSoulCrystal.ShieldDurabilityMax : ShieldDurabilityMax; - float shieldDurabilityRatio = localModPlayer.pSoulShieldDurability / (float)ShieldDurabilityMax; + float shieldDurabilityRatio = localModPlayer.pSoulShieldDurability / max; visualShieldStrength = MathF.Pow(shieldDurabilityRatio, 0.5f); } @@ -95,8 +100,9 @@ namespace CalamityMod.Items.Accessories shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); // Profaned Soul shields are not team specific - Color shieldColor = GetColorForPsc(localModPlayer.pscState, Main.dayTime); - if (modPlayer.pscState >= (int)(ProfanedSoulCrystalState.Buffs)) + + Color shieldColor = GetColorForPsc(psState, Main.dayTime); + if (psState >= (int)(ProfanedSoulCrystalState.Buffs)) { bool tester = contributorNames.Any(name => name.Equals(localModPlayer.Player.name)); shieldColor = tester ? CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25) * 0.8f, 6f) : diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 234a6535d6..e80364a9e3 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Items.Accessories public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(4); - internal const int maxMinionRequirement = 10; + public const int maxMinionRequirement = 10; + public const int maxPscAnimTime = 120; public enum ProfanedSoulCrystalState { @@ -37,11 +38,20 @@ namespace CalamityMod.Items.Accessories Empowered //psc but no other minions, healer guardian functionality, inherits all other functionality (except vanity) and goes even further beyond, any remaining attack changes are here } - private static ProfanedSoulCrystalState GetPscStateFor(Player player) + internal static ProfanedSoulCrystalState GetPscStateFor(Player player, bool ignoreNoBuffs = false) { - if (!player.Calamity().profanedCrystalBuffs) + if (!player.Calamity().profanedCrystalBuffs && !ignoreNoBuffs) return ProfanedSoulCrystalState.Vanity; //vanity if no buffs + //vanity check during animation + if (ignoreNoBuffs && + (!DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs || + (player.maxMinions - player.slotsMinions) < maxMinionRequirement) || + player.Calamity().profanedCrystalForce || !player.HasBuff()) + { + return ProfanedSoulCrystalState.Vanity; //failsafe for vanity + } + var noMinions = player.slotsMinions == 0; var noSentries = !Main.projectile.Any(proj => proj.active && proj.owner == player.whoAmI && proj.sentry); if (noMinions && noSentries) @@ -188,8 +198,15 @@ namespace CalamityMod.Items.Accessories modPlayer.pSoulArtifact = true; modPlayer.profanedCrystal = true; + if (!modPlayer.profanedCrystalPrevious && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + { + modPlayer.pSoulShieldDurability = 1; + modPlayer.profanedCrystalAnim = maxPscAnimTime; + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + - modPlayer.profanedCrystalHide = hideVisual; + modPlayer.profanedCrystalHide = hideVisual || modPlayer.profanedCrystalAnim > 0; modPlayer.pSoulShieldVisible = !hideVisual; DetermineTransformationEligibility(player); @@ -204,7 +221,8 @@ namespace CalamityMod.Items.Accessories internal static void DetermineTransformationEligibility(Player player) { //short circuit immediately if profanedcrystalbuffs has already been set - if (!player.Calamity().profanedCrystalBuffs && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff()) + + if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; player.Calamity().pscState = (int)GetPscStateFor(player); //update psc state, default is 0 which is the same as the int value of vanity @@ -280,7 +298,7 @@ namespace CalamityMod.Items.Accessories } else if (item.CountsAsClass()) { - if (enraged || Main.rand.NextBool(2)) //100% chance if 50% or lower, else 1 in 2 chance + if (enraged || Main.rand.NextBool()) //100% chance if 50% or lower, else 1 in 2 chance { correctedVelocity *= 20f; Vector2 perturbedspeed = new Vector2(correctedVelocity.X + Main.rand.Next(-3, 4), correctedVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(3)); diff --git a/Items/Accessories/SlagsplitterPauldron.cs b/Items/Accessories/SlagsplitterPauldron.cs index 5ac8cda9eb..ea072683d2 100644 --- a/Items/Accessories/SlagsplitterPauldron.cs +++ b/Items/Accessories/SlagsplitterPauldron.cs @@ -1,17 +1,18 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Typeless; -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using Terraria.GameContent; +using CalamityMod.Items.Placeables; namespace CalamityMod.Items.Accessories { + [LegacyName("Gehenna")] public class SlagsplitterPauldron : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -31,6 +32,23 @@ namespace CalamityMod.Items.Accessories modPlayer.Pauldron = true; } + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + //Helping the item look a bit better in inventory by being larger + CalamityUtils.DrawInventoryCustomScale( + spriteBatch, + texture: TextureAssets.Item[Type].Value, + position, + frame, + drawColor, + itemColor, + origin, + scale, + wantedScale: 0.85f, + drawOffset: new(0f, 0f) + ); + return false; + } public override void AddRecipes() { CreateRecipe(). @@ -39,7 +57,6 @@ namespace CalamityMod.Items.Accessories AddIngredient(8). AddTile(TileID.Anvils). Register(); - } } } diff --git a/Items/Accessories/SlagsplitterPauldron.png b/Items/Accessories/SlagsplitterPauldron.png index 4a6485404c..e974d0a08d 100644 Binary files a/Items/Accessories/SlagsplitterPauldron.png and b/Items/Accessories/SlagsplitterPauldron.png differ diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index b466fbbe5b..5e7037db44 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.Rarity8BuyPrice; Item.rare = ItemRarityID.Yellow; Item.accessory = true; - Item.defense = 12; } public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().voidOfCalamity; @@ -31,9 +30,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.MoltenSkullRose). AddIngredient(). - AddIngredient(). AddIngredient(). AddIngredient(3). AddTile(TileID.MythrilAnvil). @@ -42,62 +39,11 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - var source = player.GetSource_Accessory(Item); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.voidOfCalamity = true; modPlayer.voidOfExtinction = true; modPlayer.abaddon = true; - player.buffImmune[ModContent.BuffType()] = true; - player.buffImmune[BuffID.OnFire] = true; - player.fireWalk = true; - player.lavaImmune = true; - player.GetDamage() += 0.12f; - if (player.immune) - { - if (player.miscCounter % 10 == 0) - { - if (player.whoAmI == Main.myPlayer) - { - int damage = (int)player.GetBestClassDamage().ApplyTo(30); - Projectile fire = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); - if (fire.whoAmI.WithinBounds(Main.maxProjectiles)) - { - fire.usesLocalNPCImmunity = true; - fire.localNPCHitCooldown = 60; - } - } - } - } - if (FireCountdown == 0) - { - FireCountdown = 600; - } - if (FireCountdown > 0) - { - FireCountdown--; - if (FireCountdown == 0) - { - if (player.whoAmI == Main.myPlayer) - { - int projSpeed = 25; - float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; - float spawnY = -1000 + player.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = player.Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity *= projSpeed; - for (int i = 0; i < FireProjectiles; i++) - { - Vector2 spawn = baseSpawn; - spawn.X += i * 30 - (FireProjectiles * 15); - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-FireAngleSpread / 2 + (FireAngleSpread * i / (float)FireProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - int damage = (int)player.GetBestClassDamage().ApplyTo(100); - Projectile.NewProjectile(source, spawn, velocity, ModContent.ProjectileType(), damage, 5f, Main.myPlayer, 0f, 0f); - } - } - } - } + player.GetCritChance() += 16; + } } } diff --git a/Items/Accessories/Wings/TracersElysian.cs b/Items/Accessories/Wings/TracersElysian.cs index 06dddf9908..94cddc43e6 100644 --- a/Items/Accessories/Wings/TracersElysian.cs +++ b/Items/Accessories/Wings/TracersElysian.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool(2) ? 206 : 173, 0f, 0f, 100, default, 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool() ? 206 : 173, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; if (Main.rand.NextBool(10)) diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index c71e0fd373..d7b1382c6a 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer //On grass, grow flowers if (Main.tile[x, y + 1].TileType == TileID.Grass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { tile.Get().HasTile = true; tile.TileType = TileID.Plants; @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer //On hallowed grass, grow hallowed flowers else if (Main.tile[x, y + 1].TileType == TileID.HallowedGrass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { tile.Get().HasTile = true; tile.TileType = TileID.HallowedPlants; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 7c16d3241a..d66d5d8a7d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -742,7 +742,7 @@ namespace CalamityMod.Items for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[projj].position, Main.projectile[projj].width, Main.projectile[projj].height, DustID.Ice); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index be2793f1fc..50cbb27ae1 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -649,6 +649,10 @@ namespace CalamityMod.Items if (item.type == ItemID.MagicPowerPotion) EditTooltipByNum(0, (line) => line.Text = "10% increased magic damage"); + // Featherfall Potion being stupid broken with Aero Stone + if (item.type == ItemID.FeatherfallPotion) + EditTooltipByNum(0, (line) => line.Text = "Slows falling speed\n" + "Disables all airborne flight recovery"); + // Magic Hat nerf if (item.type == ItemID.MagicHat) EditTooltipByNum(0, (line) => line.Text = "5% increased magic damage and critical strike chance"); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 3d5e695f68..858b259970 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -36,13 +36,13 @@ namespace CalamityMod.Items { #region CATEGORY 1: Weapon Balancing { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(65), ShootSpeedRatio(1.25f)) }, - { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(15)) }, + { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(14)) }, { ItemID.AdamantiteSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(77)) }, { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, { ItemID.AmethystStaff, Do(ManaExact(2)) }, { ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, { ItemID.AntlionClaw, Do(UseExact(14)) }, // Mandible Blade - { ItemID.Bananarang, Do(DamageExact(98), UseExact(14)) }, + { ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, { ItemID.BatScepter, Do(DamageExact(56)) }, { ItemID.BeamSword, Do(UseMeleeSpeed, UseTurn, DamageExact(180), UseAnimationExact(60), ShootSpeedExact(23f)) }, { ItemID.BeeGun, Do(DamageExact(11)) }, @@ -70,7 +70,7 @@ namespace CalamityMod.Items { ItemID.ClingerStaff, Do(DamageExact(118)) }, { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(90)) }, - { ItemID.CobaltRepeater, Do(PointBlank, UseExact(20)) }, + { ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) }, { ItemID.CobaltSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(80)) }, { ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise { ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery @@ -79,8 +79,7 @@ namespace CalamityMod.Items { ItemID.CrystalStorm, Do(DamageExact(40))}, { ItemID.CursedDart, Do(DamageExact(25)) }, { ItemID.Cutlass, Do(UseRatio(0.9f), DamageRatio(1.85f)) }, - // Vanilla 1.4 nerfed Daedalus Stormbow themselves. If further nerfs are needed, apply them here. - // { ItemID.DaedalusStormbow, Do(DamageRatio(0.9f)) }, + { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, { ItemID.DaoofPow, Do(DamageExact(160)) }, { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(45)) }, { ItemID.DartRifle, Do(PointBlank, DamageExact(58)) }, @@ -125,9 +124,8 @@ namespace CalamityMod.Items { ItemID.HighVelocityBullet, Do(DamageExact(15)) }, { ItemID.IceBlade, Do(UseMeleeSpeed) }, { ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) }, - { ItemID.IceBow, Do(PointBlank, AutoReuse, DamageRatio(3f), UseRatio(2.5f)) }, // Uses ratios due to remix seed { ItemID.IceRod, Do(UseExact(6), DamageExact(30), ShootSpeedExact(20)) }, - { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(84), ShootSpeedExact(20f)) }, + { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, { ItemID.InfernoFork, Do(DamageRatio(1.2f)) }, { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, { ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) }, @@ -156,7 +154,7 @@ namespace CalamityMod.Items { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) }, - { ItemID.MythrilRepeater, Do(PointBlank, UseExact(18)) }, + { ItemID.MythrilRepeater, Do(PointBlank, UseExact(16)) }, { ItemID.MythrilSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(100)) }, { ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) }, { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, @@ -249,7 +247,6 @@ namespace CalamityMod.Items { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.WhitePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, { ItemID.WoodenBoomerang, Do(DamageRatio(2f), Value(Item.sellPrice(copper: 20))) }, - { ItemID.Xenopopper, Do(DamageExact(48)) }, { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.YellowPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, { ItemID.Zenith, Do(DamageExact(210)) }, @@ -425,6 +422,7 @@ namespace CalamityMod.Items { ItemID.FlareGun, Do(PointBlank, Value(Item.sellPrice(silver: 10))) }, { ItemID.GoldBow, pointBlank }, { ItemID.Harpoon, pointBlank }, + { ItemID.IceBow, pointBlank }, { ItemID.IronBow, pointBlank }, { ItemID.LeadBow, pointBlank }, { ItemID.Megashark, pointBlank }, diff --git a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs index df2385d6b8..bdbdcf864b 100644 --- a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs +++ b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { velocity = velocity.RotatedByRandom(MathHelper.ToRadians(10f)); int shotType = ModContent.ProjectileType(); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { shotType = ModContent.ProjectileType(); } diff --git a/Items/PermanentBoosters/CometShard.cs b/Items/PermanentBoosters/CometShard.cs index 69879c764f..ef8a295c62 100644 --- a/Items/PermanentBoosters/CometShard.cs +++ b/Items/PermanentBoosters/CometShard.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.cShard) { string key = "Mods.CalamityMod.Misc.CometShardText"; - Color messageColor = Color.DarkOrchid; + Color messageColor = Color.SkyBlue; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/PermanentBoosters/Dragonfruit.cs b/Items/PermanentBoosters/Dragonfruit.cs index 564743a373..34d2b8884b 100644 --- a/Items/PermanentBoosters/Dragonfruit.cs +++ b/Items/PermanentBoosters/Dragonfruit.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.dFruit) { string key = "Mods.CalamityMod.Misc.DragonfruitText"; - Color messageColor = Color.Cyan; + Color messageColor = Color.SpringGreen; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/PermanentBoosters/Elderberry.cs b/Items/PermanentBoosters/Elderberry.cs index e09c7eb2c7..c8f5acb5c3 100644 --- a/Items/PermanentBoosters/Elderberry.cs +++ b/Items/PermanentBoosters/Elderberry.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.eBerry) { string key = "Mods.CalamityMod.Misc.ElderberryText"; - Color messageColor = Color.RoyalBlue; + Color messageColor = Color.Turquoise; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/PermanentBoosters/EtherealCore.cs b/Items/PermanentBoosters/EtherealCore.cs index 3f6bd13b06..ad3cdba065 100644 --- a/Items/PermanentBoosters/EtherealCore.cs +++ b/Items/PermanentBoosters/EtherealCore.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.eCore) { string key = "Mods.CalamityMod.Misc.EtherealCoreText"; - Color messageColor = Color.Purple; + Color messageColor = Color.MediumVioletRed; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 7ff881db9a..101152fb8d 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.mFruit) { string key = "Mods.CalamityMod.Misc.MiracleFruitText"; - Color messageColor = Color.GreenYellow; + Color messageColor = Color.DeepSkyBlue; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/PermanentBoosters/PhantomHeart.cs b/Items/PermanentBoosters/PhantomHeart.cs index ae7980272c..127a08a666 100644 --- a/Items/PermanentBoosters/PhantomHeart.cs +++ b/Items/PermanentBoosters/PhantomHeart.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.PermanentBoosters if (modPlayer.pHeart) { string key = "Mods.CalamityMod.Misc.PhantomHeartText"; - Color messageColor = Color.Magenta; + Color messageColor = Color.Pink; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; } diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 9da8a15c25..c5d9095915 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); if (d != null) { d.customData = 0.02f; diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index 79e208f270..0d8198880f 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.56f, 40, 65, -0.13f, 0.13f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.56f, 40, 65, -0.13f, 0.13f); if (d != null) { d.customData = 0.02f; diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index 03466e16d8..114c6c2e91 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -82,14 +82,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ModContent.ItemType(), 7); itemLoot.Add(ModContent.ItemType(), 7); itemLoot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); - - // Fishing - itemLoot.Add(ItemID.HotlineFishingHook, 10); - itemLoot.Add(ItemID.BottomlessBucket, 10); - itemLoot.Add(ItemID.SuperAbsorbantSponge, 10); - itemLoot.Add(ItemID.FishingPotion, 5, 5, 8); - itemLoot.Add(ItemID.SonarPotion, 5, 5, 8); - itemLoot.Add(ItemID.CratePotion, 5, 5, 8); } } } diff --git a/Items/TreasureBags/MiscGrabBags/SandyAnglingKit.cs b/Items/TreasureBags/MiscGrabBags/SandyAnglingKit.cs index 1ebaa2977e..ae8bf5b562 100644 --- a/Items/TreasureBags/MiscGrabBags/SandyAnglingKit.cs +++ b/Items/TreasureBags/MiscGrabBags/SandyAnglingKit.cs @@ -8,9 +8,10 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags public class SandyAnglingKit : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.TreasureBags"; + public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 10; + Item.ResearchUnlockCount = 10; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AuguroftheElements.cs b/Items/Weapons/Magic/AuguroftheElements.cs index 47f921ea19..50bfc5e410 100644 --- a/Items/Weapons/Magic/AuguroftheElements.cs +++ b/Items/Weapons/Magic/AuguroftheElements.cs @@ -46,12 +46,12 @@ namespace CalamityMod.Items.Weapons.Magic value2.Normalize(); value2 *= Item.shootSpeed; float num91 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index f38afbf721..c72df30e95 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic { counter++; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 speed = velocity.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-15, 16))); speed.Normalize(); @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Magic velocity.Y += Main.rand.Next(-40, 41) * 0.05f; Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, counter % 2 == 0 ? 1f : 0f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int noteProj = Utils.SelectRandom(Main.rand, new int[] { diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index 980c7c3469..a3d0c6b179 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -51,12 +51,12 @@ namespace CalamityMod.Items.Weapons.Magic value2.Normalize(); value2 *= Item.shootSpeed; float num91 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/TomeofFates.cs b/Items/Weapons/Magic/TomeofFates.cs index 3c2190b6fc..ce91cbf567 100644 --- a/Items/Weapons/Magic/TomeofFates.cs +++ b/Items/Weapons/Magic/TomeofFates.cs @@ -53,12 +53,12 @@ namespace CalamityMod.Items.Weapons.Magic value2 *= Item.shootSpeed; int projChoice = Main.rand.Next(7); float num91 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index efb9479a46..a761ac63b7 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Magic { type = ModContent.ProjectileType(); } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { type = ModContent.ProjectileType(); } diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index b37ee00df4..a1d33cf7d0 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Melee { for (int i = 0; i < 3; i++) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.7f, 55, 110, -0.07f, 0.07f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.7f, 55, 110, -0.07f, 0.07f); if (d != null) { d.customData = 0.03f; diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 94a5cbe023..8c8d88e7e0 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee { int idx = Dust.NewDust(target.position, target.width, target.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index aede17f8de..3d4820dad3 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - type = Main.rand.NextBool(2) ? type : ModContent.ProjectileType(); + type = Main.rand.NextBool() ? type : ModContent.ProjectileType(); Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * 0.8), knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 76fa47e506..5a4c74effc 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num146++; } diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index 3cae3e6583..38af0ebe27 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 100; - Item.damage = 200; + Item.damage = 225; Item.DamageType = DamageClass.Melee; Item.useAnimation = 19; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index fc422b4042..f462729e04 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(4)) { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool(2) ? 164 : 229); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool() ? 164 : 229); } } diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index 5b8310b62d..5e2ee3cefd 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num146++; } diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index e464576e79..1d36541e02 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee xDist *= speedMult; yDist *= speedMult; int knifeAmt = 3; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { knifeAmt++; } diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index bb02bdb6a9..8b1fd1401f 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 108; - Item.damage = 138; + Item.damage = 128; Item.DamageType = DamageClass.Melee; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 9214d7fad1..6039f8ddb1 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 1ce2eb2bb7..57afc04611 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (target.life <= (target.lifeMax * 0.2f) && target.canGhostHeal) { - if (!CalamityPlayer.areThereAnyDamnBosses || Main.rand.NextBool(2)) + if (!CalamityPlayer.areThereAnyDamnBosses || Main.rand.NextBool()) { int heartDrop = CalamityPlayer.areThereAnyDamnBosses ? 1 : Main.rand.Next(1, 3); for (int i = 0; i < heartDrop; i++) @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index 61f9c1dc10..45bf04d4c1 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -14,12 +14,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 14; + Item.damage = 9; Item.DamageType = DamageClass.Ranged; Item.width = 62; Item.height = 26; - Item.useTime = 26; - Item.useAnimation = 26; + Item.useTime = 30; + Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; diff --git a/Items/Weapons/Ranged/Scorpio.cs b/Items/Weapons/Ranged/Scorpio.cs index 3edecc1ca4..7f8879e6e7 100644 --- a/Items/Weapons/Ranged/Scorpio.cs +++ b/Items/Weapons/Ranged/Scorpio.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 80; + Item.damage = 40; Item.DamageType = DamageClass.Ranged; Item.width = 58; Item.height = 26; @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(damage * 1.25), knockback * 2f, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(damage * 1.85), knockback * 2f, player.whoAmI); return false; } else diff --git a/Items/Weapons/Ranged/StarSputter.cs b/Items/Weapons/Ranged/StarSputter.cs index 40951ef250..7358436448 100644 --- a/Items/Weapons/Ranged/StarSputter.cs +++ b/Items/Weapons/Ranged/StarSputter.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 112; + Item.damage = 138; Item.DamageType = DamageClass.Ranged; Item.width = 80; Item.height = 26; diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 98a54f12c7..d870e52b0c 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 2000; Item.knockBack = 9.5f; Item.DamageType = DamageClass.Ranged; - Item.useTime = 60; - Item.useAnimation = 60; + Item.useTime = 65; + Item.useAnimation = 65; Item.shoot = ProjectileID.BulletHighVelocity; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index fcc0bd297c..0b750a6875 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (int i = 0; i < icicleAmt; i++) { Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2)); - Projectile.NewProjectile(source, position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), damage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, perturbedspeed, (Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType()), damage, 0f, player.whoAmI, 0f, 0f); spread2 -= Main.rand.Next(1,4); } return false; diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index 549dce9289..fccc155ca0 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/IchorSpearThrow") { Volume = 0.2f, PitchVariance = 0.4f }; public override void SetDefaults() { - Item.width = 52; + Item.width = Item.height = 52; Item.damage = 132; Item.noMelee = true; Item.noUseGraphic = true; @@ -22,7 +22,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 7f; Item.UseSound = ThrowSound; Item.autoReuse = true; - Item.height = 52; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/IchorSpear.png b/Items/Weapons/Rogue/IchorSpear.png index c3519a7c59..13de0ffb66 100644 Binary files a/Items/Weapons/Rogue/IchorSpear.png and b/Items/Weapons/Rogue/IchorSpear.png differ diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 1db0317c2b..57e585f0a9 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 32; + Item.height = 38; Item.damage = 24; Item.noMelee = true; Item.noUseGraphic = true; @@ -27,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 1f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.height = 30; Item.maxStack = 9999; Item.value = Item.buyPrice(0, 0, 5, 0); Item.rare = ItemRarityID.Orange; diff --git a/Items/Weapons/Rogue/InfernalKris.png b/Items/Weapons/Rogue/InfernalKris.png index e709f2df95..4e31ab808d 100644 Binary files a/Items/Weapons/Rogue/InfernalKris.png and b/Items/Weapons/Rogue/InfernalKris.png differ diff --git a/Items/Weapons/Rogue/ShardofAntumbra.cs b/Items/Weapons/Rogue/ShardofAntumbra.cs index 07c4f868cd..47d8fbfdc8 100644 --- a/Items/Weapons/Rogue/ShardofAntumbra.cs +++ b/Items/Weapons/Rogue/ShardofAntumbra.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 1.5f; + public override float StealthDamageMultiplier => 0.5f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Summon/CindersOfLament.cs b/Items/Weapons/Summon/CindersOfLament.cs index cf7988de5a..8ea9cce618 100644 --- a/Items/Weapons/Summon/CindersOfLament.cs +++ b/Items/Weapons/Summon/CindersOfLament.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = ModContent.ProjectileType(); int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); if (Main.projectile.IndexInRange(p)) diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index aef847d348..ce81847306 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, DustID.Ice); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 0c9e45cabc..f30bc2b7d8 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 2c98c66697..57e6a319f3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -70,8 +70,8 @@ AeroStone: { DisplayName: Aero Stone Tooltip: ''' - Provides an additional 45 flight time - Movement speed and acceleration are greatly increased when you are out of flight time + Provides an additional 35 flight time + You slowly recover flight time while in the air if you are not flying or gliding 'One of the ancient relics' ''' } @@ -1528,6 +1528,15 @@ SilencingSheath: { Tooltip: +10 maximum stealth } +SlagsplitterPauldron: { + DisplayName: Slagsplitter Pauldron + Tooltip: + ''' + You gain 5% damage reduction while dashing + Your dashes are empowered by fire, shredding enemies near you with violent explosions + ''' +} + SpectralVeil: { DisplayName: Spectral Veil Tooltip: @@ -1870,42 +1879,6 @@ VampiricTalisman: { ''' } -AbandonedWulfrumHelmet: { - DisplayName: Abandoned Wulfrum Helmet - Tooltip: - ''' - A worn and rusty helmet resembling older models of wulfrum armor - Transforms the holder into a wulfrum robot - Can also be worn in the helmet slot as a regular helm - [c/83B87E:'This rather flimsy armor was commonly worn by scavengers and looters.] - [c/83B87E:Its versatility and common nature led it to be used as currency in trades.'] - ''' -} - -HapuFruit: { - DisplayName: Ha-pu Fruit - Tooltip: "'A fruit that calms your nerves (may have unintended side effects)'" -} - -RedBow: { - DisplayName: Red Bow - Tooltip: "'Pelusa's favorite bow'" -} - -OracleHeadphones: { - DisplayName: Oracle Headphones - Tooltip: "'Hey game's over!'" -} - -Popo: { - DisplayName: Magic Scarf and Hat - Tooltip: - ''' - Transforms the holder into a snowman - 'Don't let the demons steal your nose' - ''' -} - VeneratedLocket: { DisplayName: Venerated Locket Tooltip: @@ -1935,11 +1908,9 @@ VoidofExtinction: { DisplayName: Void of Extinction Tooltip: ''' - Drops brimstone fireballs from the sky occasionally - 12% increase to all damage - All attacks inflict Brimstone Flames - Brimstone fire rains down after getting hit - Grants immunity to lava, Burning, On Fire!, Brimstone Flames and Searing Lava + 16% increased critical strike chance + Critical strikes explode, causing nearby enemies to ignite with Brimstone Flames + Greatly reduces the damage taken by the Brimstone Flames debuff ''' } @@ -2020,11 +1991,39 @@ YharimsInsignia: { ''' } -SlagsplitterPauldron: { - DisplayName: Slagsplitter Pauldron +// Vanity Accessories +AbandonedWulfrumHelmet: { + DisplayName: Abandoned Wulfrum Helmet Tooltip: ''' - You gain 5% damage reduction while dashing - Your dashes are empowered by fire, shredding enemies near you with violent explosions + A worn and rusty helmet resembling older models of wulfrum armor + Transforms the holder into a wulfrum robot + Can also be worn in the helmet slot as a regular helm + [c/83B87E:'This rather flimsy armor was commonly worn by scavengers and looters.] + [c/83B87E:Its versatility and common nature led it to be used as currency in trades.'] ''' +} + +HapuFruit: { + DisplayName: Ha-pu Fruit + Tooltip: "'A fruit that calms your nerves (may have unintended side effects)'" +} + +OracleHeadphones: { + DisplayName: Oracle Headphones + Tooltip: "'Hey game's over!'" +} + +Popo: { + DisplayName: Magic Scarf and Hat + Tooltip: + ''' + Transforms the holder into a snowman + 'Don't let the demons steal your nose' + ''' +} + +RedBow: { + DisplayName: Red Bow + Tooltip: "'Pelusa's favorite bow'" } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index d5301343d7..347e5dd3d2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -49,7 +49,7 @@ AntiMaterielRifle: { Tooltip: ''' Converts musket balls into .50 caliber sniper rounds that rip apart enemy defense and DR - Critical hits unleash a second swarm of bullets + Critical hits unleash a second swarm of 5 bullets ''' } @@ -1242,9 +1242,9 @@ TyrannysEnd: { DisplayName: Tyranny's End Tooltip: ''' - Converts musket balls into .70 caliber sniper rounds that bypass enemy Defense and DR - Inflicts Marked for Death on enemy hits - Critical hits summon a swarm of 10 additional bullets + Converts musket balls into .70 caliber sniper rounds that deal devastating damage + Inflicts Marked for Death on enemy hits and bypasses defense + Critical hits summon a swarm of 6 additional bullets 'Pierce the heart of even the most heavily-armored foe' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 4529ea1314..fd340d717c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -515,7 +515,7 @@ GleamingDagger: { } GodsParanoia: { - DisplayName: God's Paranoia + DisplayName: Gods' Paranoia Tooltip: ''' Hurls up to 10 speedy homing spiky balls diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 591a7b9367..3f03a010d8 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -73,7 +73,6 @@ DeepSeaDumbbell3.DisplayName: Deep Sea Dumbbell DeepSeaDumbbellWeight.DisplayName: Deep Sea Dumbbell DeepWounderProjectile.DisplayName: Deep Wounder Projectile DeepWounderWater.DisplayName: Water Droplet -TwistingThunderProj.DisplayName: Deific Thunderbolt DesecratedBubble.DisplayName: Desecrated Bubble DesecratedWaterProj.DisplayName: Desecrated Water DestructionBolt.DisplayName: Destruction Bolt @@ -163,6 +162,7 @@ JawsShockwave.DisplayName: Reaper Tooth Shockwave KelvinCatalystBoomerang.DisplayName: Kelvin Catalyst Knife.DisplayName: Knife KylieBoomerang.DisplayName: Kylie +LanceofDestiny.DisplayName: Holy Lance LeadTomahawkProj.DisplayName: Lead Tomahawk LeonidCometBig.DisplayName: Leonid Comet LeonidCometSmall.DisplayName: Leonid Comet @@ -172,7 +172,6 @@ LeviathanTooth.DisplayName: Leviathan Tooth LionfishProj.DisplayName: Lionfish LostSoulFriendly.DisplayName: Lost Soul LuminousShard.DisplayName: Stardust Shard -RealityRuptureLance.DisplayName: Lance of Reality LunarKunaiProj.DisplayName: Lunar Kunai LuxorsGiftRogue.DisplayName: Luxor's Rogue MalachiteBolt.DisplayName: Malachite @@ -209,6 +208,7 @@ PenumbraBomb.DisplayName: Penumbra Bomb PenumbraSoul.DisplayName: Penumbra Soul PhantasmalRuinProj.DisplayName: Phantasmal Ruin PhantasmalSoul.DisplayName: Phantasmal Soul +PhantasmalSoulBlue.DisplayName: Blue Spirit PlaguedFuelPackCloud.DisplayName: Plagued Cloud PlaguenadeBee.DisplayName: Plague Bee PlaguenadeProj.DisplayName: Plaguenade @@ -223,6 +223,9 @@ ProfanedPartisanSpear.DisplayName: Profaned Spear RadiantExplosion.DisplayName: Radiant Explosion RadiantStar2.DisplayName: Radiant Star RadiantStarKnife.DisplayName: Radiant Star +RealityRuptureLance.DisplayName: Lance of Reality +RealityRuptureMini.DisplayName: Reality Shard +RealityRuptureStealth.DisplayName: Ruptured Reality ReaperProjectile.DisplayName: The Old Reaper RefractionRotorProjectile.DisplayName: Prism Shuriken RegulusEnergy.DisplayName: Regulus Energy @@ -260,13 +263,15 @@ ShockTeslaAura.DisplayName: Electrifying Aura ShroomerangSpore.DisplayName: Infested Spore SkyBomberGas.DisplayName: Irradiated Cloud SkyfinNuke.DisplayName: Skyfin Nuke -SkyStabberProj.DisplayName: SkyStabberProj +SkyStabberProj.DisplayName: Sky Stabber SlickCaneProjectile.DisplayName: Slick Cane SludgeSplotchProj1.DisplayName: Sludge Splotch SludgeSplotchProj2.DisplayName: Sludge Splotch SnapClamProj.DisplayName: Snap Clam SnapClamStealth.DisplayName: Snap Clam SpearofDestinyProjectile.DisplayName: Destiny Spear +SpearofDestinyStealth.DisplayName: Empowered Holy Lance +SpearofDestinyStealthExplosion.DisplayName: Strong Burst SpearofPaleolithProj.DisplayName: Paleolith Spear SpentFuelContainerProjectile.DisplayName: Spent Fuel Container SphereBladed.DisplayName: Bladed Sphere @@ -312,6 +317,7 @@ ToxicantTwisterDust.DisplayName: Toxicant Dust ToxicantTwisterTwoPointZero.DisplayName: Toxicant Twister TurbulanceProjectile.DisplayName: Turbulance TurbulanceWindSlash.DisplayName: Wind Slash +TwistingThunderProj.DisplayName: Twisting Thunder UmbraphileBoom.DisplayName: Umbra Blast UrchinStingerProj.DisplayName: Urchin Stinger ValariBoomerang.DisplayName: Frostcrush Valari @@ -319,15 +325,9 @@ Valaricicle.DisplayName: Valaricicle Valaricicle2.DisplayName: Valaricicle ValedictionBoomerang.DisplayName: Valediction VeneratedKnife.DisplayName: Venerated Knife +WaveSkipperProjectile.DisplayName: Wave Skipper WebBallBol.DisplayName: Web Ball WrathwingCinder.DisplayName: Wrathwing Eruption WrathwingFireball.DisplayName: Wrathwing Fireball WrathwingSpear.DisplayName: Wrathwing -WulfrumKnifeProj.DisplayName: Wulfrum Knife -WaveSkipperProjectile.DisplayName: Wave Skipper -LanceofDestiny.DisplayName: Holy Lance -SpearofDestinyStealth.DisplayName: Empowered Holy Lance -SpearofDestinyStealthExplosion.DisplayName: Strong Burst -RealityRuptureMini.DisplayName: Reality Shard -RealityRuptureStealth.DisplayName: Ruptured Reality -PhantasmalSoulBlue.DisplayName: Blue Spirit \ No newline at end of file +WulfrumKnifeProj.DisplayName: Wulfrum Knife \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 1fe7cfb25c..46bed1a0ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -60,7 +60,6 @@ CinderBlossom.DisplayName: Cinder Blossom CloudElementalMinion.DisplayName: Cloudy Waifu CnidarianJellyfishOnTheString.DisplayName: Cnidarian CnidarianSpark.DisplayName: Cnidarian Spark -GlacialEmbracePointyThing.DisplayName: Ice Castle Shard CorroslimeMinion.DisplayName: Corroslime CorruptionSlimeGodMinion.DisplayName: Slime God CosmicBlast.DisplayName: Cosmic Blast @@ -127,6 +126,7 @@ GastricBelcherVomit.DisplayName: Gastric Vomit GhostFire.DisplayName: Ghastly Particle GhostlyMine.DisplayName: Mine GiantIbanRobotOfDoom.DisplayName: Andromeda +GlacialEmbracePointyThing.DisplayName: Ice Castle Shard HallowedStarSummon.DisplayName: Hallowed Star HauntedDishes.DisplayName: Haunted Dishes HermitCrabMinion.DisplayName: Hermit Crab @@ -141,6 +141,7 @@ HowlsHeartHowl.DisplayName: Howl HowlsHeartTurnipHead.DisplayName: Turnip-Head HydrothermicVent.DisplayName: Hydrothermic Vent IceClasperMinion.DisplayName: Ice Clasper +IceClasperSummonProjectile.DisplayName: Ice Shard IceSentry.DisplayName: Ice Sentry IceSentryFrostBolt.DisplayName: Ball IceSentryShard.DisplayName: Frost Shard @@ -165,6 +166,8 @@ MidnightSunShot.DisplayName: Midnight Shot MidnightSunUFO.DisplayName: Midnight Sun UFO MiniGuardianAttack.DisplayName: Offensive Guardian MiniGuardianDefense.DisplayName: Defensive Guardian +MiniGuardianFireball.DisplayName: Mini Guardian Fireball +MiniGuardianFireballSplit.DisplayName: Mini Guardian Fireball Split MiniGuardianHealer.DisplayName: Healer Guardian MiniGuardianHolyRay.DisplayName: Bab Holy Ray MiniGuardianRock.DisplayName: Rocky Road @@ -178,6 +181,10 @@ MoonFist.DisplayName: Cosmic Fist MoonFistTeleportVisual.DisplayName: Light MortalityBeam.DisplayName: Beam MortalityBolt.DisplayName: Bolt +MutatedTruffleMinion.DisplayName: Baby Boomer +MutatedTruffleToothball.DisplayName: Baby Boomer's Toothball +MutatedTruffleToothballSpike.DisplayName: Baby Boomer's Toothball Spike +MutatedTruffleVortex.DisplayName: Baby Boomer's Vortex OldDukeHeadCorpse.DisplayName: Absolutely Disgusting Shark Puker OldDukeSharkVomit.DisplayName: Puke PerditionBeacon.DisplayName: Perdition Beacon @@ -189,11 +196,11 @@ PlagueBeeSmall.DisplayName: Plague Bee PlaguebringerMK2.DisplayName: Plaguebringer MK2 PlaguebringerSummon.DisplayName: Lil' Plaguebringer PlaguePrincess.DisplayName: Virili -PlantationStaffSummon.DisplayName: Mini Plantera -PlantationStaffThornball.DisplayName: Mini Plantera's Thornball PlantationStaffSeed.DisplayName: Mini Plantera's Seed PlantationStaffSporeCloud.DisplayName: Mini Plantera's Spores +PlantationStaffSummon.DisplayName: Mini Plantera PlantationStaffTentacle.DisplayName: Mini Plantera's Tentacle +PlantationStaffThornball.DisplayName: Mini Plantera's Thornball PlateProjectile.DisplayName: Plate PolypLauncherProjectile.DisplayName: Polyp Chunk PolypLauncherSentry.DisplayName: Polyp Launcher @@ -205,6 +212,7 @@ ProfanedCrystalMeleeSpear.DisplayName: Holy Friendly Spear ProfanedCrystalRangedHuges.DisplayName: Holy Bab Boomer ProfanedCrystalRangedSmalls.DisplayName: Holy Bab Boomer Orb ProfanedCrystalRogueShard.DisplayName: Holy Bab Crystal Shard +ProfanedCrystalWhip.DisplayName: Profaned Crystal Whip ProfanedEnergy.DisplayName: Profaned Energy PuffCloud.DisplayName: Puff Cloud PuffWarrior.DisplayName: Puff Warrior @@ -259,6 +267,8 @@ Spikecrag.DisplayName: Spikecrag SpikecragSpike.DisplayName: Spikecrag Spike SquirrelSquireAcorn.DisplayName: Squirrel Acorn SquirrelSquireMinion.DisplayName: Squirrel Squire +StellarTorusBeam.DisplayName: Stellar Torus Beam +StellarTorusSummon.DisplayName: Stellar Torus Summon StormjawBaby.DisplayName: Stormjaw Baby SummonAstralExplosion.DisplayName: Explosion SummonBrimstoneExplosion.DisplayName: Explosion @@ -302,11 +312,6 @@ WulfrumDroid.DisplayName: Wulfrum Droid WulfrumEnergyBurst.DisplayName: Wulfrum Bolt WulfrumFusionBolt.DisplayName: Fusion Bolt YharonMinionFireball.DisplayName: Dragon Fireball -MutatedTruffleMinion.DisplayName: Baby Boomer -MutatedTruffleVortex.DisplayName: Baby Boomer's Vortex -MutatedTruffleToothball.DisplayName: Baby Boomer's Toothball -MutatedTruffleToothballSpike.DisplayName: Baby Boomer's Toothball Spike -IceClasperSummonProjectile.DisplayName: Ice Shard AtzirisDisfavor.DisplayName: Atziri's Disfavor Starforge.DisplayName: Starforge Paradoxica.DisplayName: Paradoxica @@ -316,8 +321,3 @@ WindRipperArrow.DisplayName: Wind Ripper Arrow HopeShredder.DisplayName: Hope Shredder HopeShredderArrow.DisplayName: Hope Shredder Arrow HopeShredderArrowSplit.DisplayName: Hope Shredder Split Arrow -StellarTorusSummon.DisplayName: Stellar Torus Summon -StellarTorusBeam.DisplayName: Stellar Torus Beam -MiniGuardianFireball.DisplayName: Mini Guardian Fireball -MiniGuardianFireballSplit.DisplayName: Mini Guardian Fireball Split -ProfanedCrystalWhip.DisplayName: Profaned Crystal Whip \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index f326a37556..41ca08ad4f 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -1,3 +1,4 @@ +AbaddonCrit.DisplayName: Brimstone Blast AeroExplosive.DisplayName: Aeroboom AllianceTriangle.DisplayName: Alliance Triangle ArcZap.DisplayName: Arc Zap @@ -13,6 +14,8 @@ AstralSandBallGun.DisplayName: Astral Sand AstralSpray.DisplayName: Astral Spray AstralStar.DisplayName: Star BallisticPoisonCloud.DisplayName: Ballistic Cloud +BlazingStarHeal.DisplayName: Blazing Star Heal +BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal BlazingSun.DisplayName: Blazing Sun BlazingSun2.DisplayName: Blazing Sun BlissfulBombardierDustProjectile.DisplayName: Dust @@ -48,6 +51,8 @@ EmpyreanStellarDetritus.DisplayName: Empyrean Stellar Detritus EnergyShell.DisplayName: Energy Shell EutrophicSandBallGun.DisplayName: Eutrophic Sand FeralDoubleBobber.DisplayName: Feral Bobber +FlameLickedBarrage.DisplayName: Flame Licked Barrage +FlameLickedHellblast.DisplayName: Flame Licked Hellblast FuckYou.DisplayName: Explosion FungalClumpMinion.DisplayName: Fungal Clump GemTechArmorGem.DisplayName: Trireme's Gem @@ -68,6 +73,7 @@ HydrothermicFlareRogue.DisplayName: Hydrothermic Flare HydrothermicSphere.DisplayName: Hydrothermic Sphere JewelSpike.DisplayName: Spike KelvinCatalystStar.DisplayName: Kelvin Catalyst Star +LeviAmberDash.DisplayName: Riptide Slam LunicBeam.DisplayName: Beam MageHammerBoom.DisplayName: Explosion MagnusBeam.DisplayName: Beam @@ -80,10 +86,14 @@ NebulaStar.DisplayName: Star NobodyKnows.DisplayName: Nope OmegaBlueTentacle.DisplayName: Omega Blue Tentacle OnyxLabSeeker.DisplayName: Seeking Mechanism +PauldronDash.DisplayName: Pauldron Dash +PauldronExplosion.DisplayName: Pauldron Explosion PendantProjectile1.DisplayName: Prism Shard PendantProjectile2.DisplayName: Prism Shard PendantProjectile3.DisplayName: Prism Shard PoisonousSeawater.DisplayName: Seawater +PscTransformAnimation.DisplayName: Psc Transform Animation +PscTransformRocks.DisplayName: Psc Transform Rocks ReaverOrb.DisplayName: Reaver Orb ReaverThornBase.DisplayName: Thorn ReaverThornTip.DisplayName: Thorn @@ -101,7 +111,7 @@ SerpentsBiteHook.DisplayName: Serpent's Bite ShadowflameExplosion.DisplayName: Shadowflame Explosion ShadowflameExplosionBig.DisplayName: Shadowflame Explosion SkyFlareFriendly.DisplayName: Flare -SlimeStream.DisplayName: Silme Stream +SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye StandingFire.DisplayName: Flame @@ -111,6 +121,7 @@ SuicideBomberDemon.DisplayName: Demon SulphuricAcidBubbleFriendly.DisplayName: Acid Bubble SulphurousSandBallGun.DisplayName: Sulphurous Sand TarraEnergy.DisplayName: Tarra Energy +TarragonAura.DisplayName: Tarragon Aura TerminusHoldout.DisplayName: Terminus Holdout TeslaAura.DisplayName: Tesla's Electricity VanquisherArrowSplit.DisplayName: Arrow @@ -126,14 +137,3 @@ WulfrumLureSignal.DisplayName: Signal WulfrumScaffoldKitHoldout.DisplayName: Wulfrum Scaffold Kit YanmeisKnifeSlash.DisplayName: Yanmei's Knife YellowLabSeeker.DisplayName: Seeking Mechanism -TarragonAura.DisplayName: Tarragon Aura -BlazingStarHeal.DisplayName: Blazing Star Heal -BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal -LeviAmberDash.DisplayName: Riptide Slam -FlameLickedShellBurst.DisplayName: Flame Slam -FlameLickedShellExplosion.DisplayName: Fire Blast -PauldronDash.DisplayName: Pauldron Dash -PauldronExplosion.DisplayName: Pauldron Explosion -AbaddonCrit.DisplayName: Brimstone Blast -FlameLickedBarrage.DisplayName: Flame Licked Barrage -FlameLickedHellblast.DisplayName: Flame Licked Hellblast \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 7a83fe8711..80edcfad38 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -35,7 +35,7 @@ ClothierChat: { CyborgChat: { MoonLordDefeated1: Always shoot for the moon! It has clearly worked before. - MoonLordDefeated2: Draedon? The guy who made these upgrades on me said he wanted to best him, but I never cared about that, I just wanted to shoot lasers from my eyes. + MoonLordDefeated2: Draedon? The guy who made these upgrades on me said he wanted to best him. But I never cared about that, I just wanted to shoot lasers from my eyes. MentionPlague: Those big green roaches in the Jungle don't threaten me, but all of the animals it has consumed... Please, do me a favor and protect them. Rain: All these moments will be lost in time. Like tears... in the rain. } diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 81425f34d7..37670fd456 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Abyss int min = 6; int max = 9; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index 5a1e53a9c6..ae27431687 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.AcidRain Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; Main.dust[dust].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index ec06f3f5ae..c303aa1459 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.AcidRain { if (NPC.ai[0] == 0f) { - NPC.ai[0] = Main.rand.NextBool(2).ToDirectionInt(); + NPC.ai[0] = Main.rand.NextBool().ToDirectionInt(); NPC.netUpdate = true; } if (NPC.collideX) diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index d51eba85b6..90ae7aa4e8 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -492,7 +492,7 @@ namespace CalamityMod.NPCs.AcidRain int damageBoom = 200; for (iBoom = 0; iBoom < 25; iBoom++) { - int projectileType = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int projectileType = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.AcidRain { int num622 = Dust.NewDust(NPC.position, NPC.width, NPC.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index f31da29918..baa847bb42 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.Astral { int purple = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[purple].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[purple].scale = 0.5f; Main.dust[purple].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 10806b5498..97c1bd3230 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astral } else if (NPC.ai[1] >= 140f) //oozin dust at the "mouth" { - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); int d = Dust.NewDust(spawnPoint - new Vector2(5), 10, 10, dustType); Main.dust[d].velocity = NPC.velocity * 0.3f; Main.dust[d].customData = true; @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.Astral for (int i = 0; i < numDust; i++) { Vector2 vel = (angle + Main.rand.NextFloat(-0.04f, 0.04f)).ToRotationVector2(); - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); Dust d = Dust.NewDustPerfect(NPC.Center, dustType, vel * Main.rand.NextFloat(1.8f, 2.2f)); d.customData = NPC; diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 84fe1953db..a793112a20 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -48,7 +48,7 @@ namespace CalamityMod.NPCs.Astral for (int i = 0; i < 6; i++) { int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 2 * hit.HitDirection, -2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = true; Main.dust[dust].scale = 1.2f * NPC.scale; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index fb33d6dce8..4b79fc386c 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -444,7 +444,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 8fdd94864a..90390664c8 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int dust = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); Main.dust[dust].velocity *= 1.66f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -355,7 +355,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index c2e1cdf2ac..9904695fef 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 2b468f8585..2f2e2d5781 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 3dc727e6df..5747de46ef 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 1fcaad3998..65a4ec0463 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 0c022ec63b..48b41ad3c8 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index 7b8c9ea787..f3e564e480 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index a3b4255154..82937e480f 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 957acaa7d4..bc1b2865d9 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.CalClone { int red = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[red].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[red].scale = 0.5f; Main.dust[red].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index b8c41e9cf5..d058a3a086 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -837,12 +837,12 @@ namespace CalamityMod.NPCs int min = 12; int max = 16; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) playerPosX += Main.rand.Next(min, max); else playerPosX -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) playerPosY += Main.rand.Next(min, max); else playerPosY -= Main.rand.Next(min, max); @@ -3169,7 +3169,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index a9b28b37ac..48a955524b 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -720,7 +720,7 @@ namespace CalamityMod.NPCs int dustIdx = Dust.NewDust(spawnPosiion, 1, 1, 27, 0f, 0f, 0, default, 1f); Main.dust[dustIdx].velocity = -dustVelocity * 0.3f; Main.dust[dustIdx].alpha = 100; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dustIdx].noGravity = true; Main.dust[dustIdx].scale += 0.3f; @@ -5497,7 +5497,7 @@ namespace CalamityMod.NPCs } if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num121 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num121]; @@ -5507,7 +5507,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num122 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 174, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 1f); Dust dust = Main.dust[num122]; @@ -5519,7 +5519,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.RaggedCaster || npc.type == NPCID.RaggedCasterOpenCoat) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num123 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 175, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 0.1f); Dust dust = Main.dust[num123]; @@ -5535,7 +5535,7 @@ namespace CalamityMod.NPCs Lighting.AddLight(npc.Top, 0.6f, 0.6f, 0.3f); return false; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num124 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Dust dust = Main.dust[num124]; @@ -6627,13 +6627,13 @@ namespace CalamityMod.NPCs { npc.noGravity = false; npc.noTileCollide = false; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int sand = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 32, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); Dust dust = Main.dust[sand]; dust.velocity.X *= 0.4f; dust.velocity.Y *= -1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale += 0.2f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1fae8563bf..9ada03d4df 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5075,8 +5075,8 @@ namespace CalamityMod.NPCs Vector2 iceLabCenter = CalamityWorld.IceLabCenter / 16f; for (int i = 0; i < 8; i++) { - int checkPositionX = (int)(playerCenterX + Main.rand.Next(30, 54) * Main.rand.NextBool(2).ToDirectionInt()); - int checkPositionY = (int)(playerCenterY + Main.rand.Next(24, 45) * Main.rand.NextBool(2).ToDirectionInt()); + int checkPositionX = (int)(playerCenterX + Main.rand.Next(30, 54) * Main.rand.NextBool().ToDirectionInt()); + int checkPositionY = (int)(playerCenterY + Main.rand.Next(24, 45) * Main.rand.NextBool().ToDirectionInt()); Vector2 checkPosition = new Vector2(checkPositionX, checkPositionY); Tile aboveSpawnTile = CalamityUtils.ParanoidTileRetrieval(checkPositionX, checkPositionY - 1); @@ -5170,6 +5170,7 @@ namespace CalamityMod.NPCs } // 12JUL2023: Ozzatron: what does this do + // 27SEP2023: Fabsol: disables vanilla spawns "a pool of [0] indicates vanilla spawning" if (calamityBiomeZone) { pool[0] = 0f; @@ -5374,7 +5375,7 @@ namespace CalamityMod.NPCs // TODO -- These debuff visuals cannot be moved because they correspond to vanilla debuffs if (electrified > 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDustDirect(npc.position, npc.width, npc.height, 226, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), 0, default, 0.35f); } @@ -5387,7 +5388,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -5402,7 +5403,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index fdb8d83703..9d8bdfe390 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1003,7 +1003,7 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.DarksunEclipse"); else if (Main.rand.NextBool(5) && Main.LocalPlayer.ZoneGlowshroom) { - if (Main.rand.NextBool(2) && fapsol != -1) + if (Main.rand.NextBool() && fapsol != -1) chat = CalamityUtils.GetText("Vanilla.DryadChat.DrunkPrincessShroom").Format(Main.npc[fapsol].GivenName); else chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.Mushroom"); @@ -1066,7 +1066,7 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.PainterChat.Crimson"); if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneSnow) { - if (Main.rand.NextBool(2) && permadong != -1) + if (Main.rand.NextBool() && permadong != -1) chat = CalamityUtils.GetText("Vanilla.PainterChat.Archmage").Format(Main.npc[permadong].GivenName); else chat = CalamityUtils.GetTextValue("Vanilla.PainterChat.Tundra"); @@ -1292,9 +1292,6 @@ namespace CalamityMod.NPCs .Add(ItemID.ManaPotion, potionSells, Condition.HappyEnough, Condition.DownedEowOrBoc) .Add(ItemID.Flare, hasFlareGunUpgrade) .Add(ItemID.BlueFlare, hasFlareGunUpgrade) - .Add(ItemID.ApprenticeBait, Condition.DownedEyeOfCthulhu) - .Add(ItemID.JourneymanBait, Condition.DownedEowOrBoc) - .Add(ItemID.MasterBait, Condition.DownedSkeletron) .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron) .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron) diff --git a/NPCs/CalamityPolarityNPC.cs b/NPCs/CalamityPolarityNPC.cs index 0807e237cf..f3454b8521 100644 --- a/NPCs/CalamityPolarityNPC.cs +++ b/NPCs/CalamityPolarityNPC.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs curPolarity--; //Polarity particles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Color sparkColor = AdamantiteParticleAccelerator.LightColors[CurPolarity < 0 ? 1 : 0]; Particle spark = new ElectricSpark(npc.Center + Main.rand.NextVector2Circular(npc.width / 2f, npc.height / 2f), Main.rand.NextVector2CircularEdge(20f, 20f) * 0.4f, Color.Lerp(Color.White, sparkColor, 0.4f), sparkColor, Main.rand.NextFloat(0.5f, 1.2f), Main.rand.Next(20, 40), bloomScale: 2.5f); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 43433125a2..9701cdbc4a 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.CeaselessVoid int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 7973ed421d..d447e426b4 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -898,7 +898,7 @@ namespace CalamityMod.NPCs.Crabulon { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 2be4f47ffe..72d8388085 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Crags { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 1bcc5a4835..55f40e6d24 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -816,12 +816,12 @@ namespace CalamityMod.NPCs.Cryogen int min = 16; int max = 20; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -1254,7 +1254,7 @@ namespace CalamityMod.NPCs.Cryogen { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 21590d8360..246b7cc930 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.Cryogen { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index ad15015911..953fa54f05 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 9df1c84fcc..3a3476c303 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index a8ad499c87..5549188e1a 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 8792fd74db..e1660807f8 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -484,7 +484,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 0bc7aff722..2eea41b221 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -933,7 +933,7 @@ namespace CalamityMod.NPCs.DevourerofGods Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } - shotSpacing_Phase2[3] -= Main.rand.NextBool(2) ? 180 : 200; + shotSpacing_Phase2[3] -= Main.rand.NextBool() ? 180 : 200; } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -2813,7 +2813,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index e8f2c650bc..4c043d0e79 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index 5cfec8a4c8..99458991a0 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { if (NPC.ai[1] == 0) { - NPC.ai[2] = Main.rand.NextBool(2) ? -1 : 1; + NPC.ai[2] = Main.rand.NextBool() ? -1 : 1; } NPC.ai[1]++; NPC.velocity.X = NPC.ai[2] * 2; diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index bea4d4e741..9f8d5e76b0 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { if (!Initialized) { - NPC.velocity = Vector2.UnitX * Main.rand.NextBool(2).ToDirectionInt() * 1.5f; + NPC.velocity = Vector2.UnitX * Main.rand.NextBool().ToDirectionInt() * 1.5f; Initialized = true; } @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.DraedonLabThings if (CalamityUtils.ParanoidTileRetrieval((int)(NPC.Center.X / 16), (int)(NPC.Center.Y / 16)).WallType == WallID.None || ClimbTime > 620f) { CurrentState = BehaviorState.WalkAround; - NPC.velocity = new Vector2(Main.rand.NextBool(2).ToDirectionInt() * 1.2f, 3f); + NPC.velocity = new Vector2(Main.rand.NextBool().ToDirectionInt() * 1.2f, 3f); NPC.rotation = 0f; NPC.netUpdate = true; } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index bb9512608c..51e5a57441 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1,24 +1,25 @@ using CalamityMod.Events; using CalamityMod.Items.Potions; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; +using CalamityMod.Skies; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Graphics.Shaders; -using System.Collections.Generic; -using CalamityMod.Skies; -using Terraria.Audio; -using CalamityMod.Items.Weapons.DraedonsArsenal; -using CalamityMod.Sounds; + using ArtemisBoss = CalamityMod.NPCs.ExoMechs.Artemis.Artemis; namespace CalamityMod.NPCs.ExoMechs.Apollo @@ -162,7 +163,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.value = Item.buyPrice(15, 0, 0, 0); NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.BossBar = Main.BigBossProgressBar.NeverValid; @@ -1187,7 +1188,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (i < 50) dustVelocity = 4f; - int dust1 = Dust.NewDust(NPC.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int dust1 = Dust.NewDust(NPC.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float dustVelX = Main.dust[dust1].velocity.X; float dustVelY = Main.dust[dust1].velocity.Y; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index eb939d59f7..dec3821d42 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -10,31 +10,31 @@ using CalamityMod.Items.Placeables.Furniture.DevPaintings; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Skies; +using CalamityMod.Sounds; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using Terraria.GameContent.ItemDropRules; -using CalamityMod.Sounds; -using CalamityMod.Items.Weapons.Summon; -using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.value = Item.buyPrice(15, 0, 0, 0); NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 5fe548bc0b..7931ad3138 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -2,19 +2,19 @@ using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; -using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.canGhostHeal = false; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.hide = true; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 25c2cc80e8..03a1228c90 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -1,21 +1,22 @@ using CalamityMod.Events; +using CalamityMod.Items.Tools; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; -using CalamityMod.Items.Tools; -using ReLogic.Utilities; + namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -97,7 +98,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.canGhostHeal = false; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.hide = true; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 74ecb23f97..6d056c6235 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -6,16 +7,15 @@ using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Items.Weapons.DraedonsArsenal; -using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.canGhostHeal = false; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.hide = true; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 499af0c23c..e2f5026ff2 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -2,19 +2,19 @@ using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; -using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.canGhostHeal = false; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.hide = true; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 05cf161c29..e0b66c7179 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1,25 +1,25 @@ using CalamityMod.Events; +using CalamityMod.Items.Potions; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; using CalamityMod.Skies; +using CalamityMod.Sounds; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; -using ReLogic.Utilities; -using CalamityMod.Items.Potions; namespace CalamityMod.NPCs.ExoMechs.Artemis { @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index faf9306e96..6ef5556299 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -1,18 +1,18 @@ using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 8bc54a62e2..7582176e24 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -1,18 +1,18 @@ using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 8f423bf283..8f5ea05066 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -3,21 +3,21 @@ using CalamityMod.Items.Potions; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Skies; +using CalamityMod.Sounds; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Skies; -using Terraria.Audio; -using CalamityMod.Sounds; -using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 851cc27a9d..ac1bba95a2 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -1,18 +1,18 @@ using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DeathSound = SoundID.NPCDeath14; + NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index d466c300df..304c83fd4e 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.GreatSandShark int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 32, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -642,7 +642,7 @@ namespace CalamityMod.NPCs.GreatSandShark { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 6592faa79a..a75f68f6d3 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -573,7 +573,7 @@ namespace CalamityMod.NPCs.HiveMind int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, 14, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.HiveMind int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, 14, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -787,8 +787,8 @@ namespace CalamityMod.NPCs.HiveMind { for (int i = 0; i < 10; i++) { - int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); - int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); + int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool() ? -1 : 1); + int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool() ? -1 : 1); if (!WorldGen.SolidTile(posX, posY) && Collision.CanHit(new Vector2(posX * 16, posY * 16), 1, 1, player.position, player.width, player.height)) { NPC.ai[1] = posX; @@ -1095,7 +1095,7 @@ namespace CalamityMod.NPCs.HiveMind { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index b0f2f01e1a..ea6feed95e 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -748,7 +748,7 @@ namespace CalamityMod.NPCs.Leviathan { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -829,14 +829,6 @@ namespace CalamityMod.NPCs.Leviathan normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); - - // Fishing - normalOnly.Add(ItemID.HotlineFishingHook, 10); - normalOnly.Add(ItemID.BottomlessBucket, 10); - normalOnly.Add(ItemID.SuperAbsorbantSponge, 10); - normalOnly.Add(ItemID.FishingPotion, 5, 5, 8); - normalOnly.Add(ItemID.SonarPotion, 5, 5, 8); - normalOnly.Add(ItemID.CratePotion, 5, 5, 8); } // Relic diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 8d819f1183..5fe8e3fa18 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.NormalNPCs targetVec.X *= targetDist; targetVec.Y *= targetDist; int damage = adultWyrmAlive ? (Main.expertMode ? 150 : 200) : (Main.expertMode ? 30 : 40); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetVec, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 8db62b7754..8aa442bb97 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.NormalNPCs { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index f836dd9740..d386772c90 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Randomly chooses to go clockwise or anti-clockwise around the player. if (!checkedRotationDir) { - rotationDir = (Main.rand.NextBool(2)).ToDirectionInt(); + rotationDir = (Main.rand.NextBool()).ToDirectionInt(); checkedRotationDir = true; NPC.netUpdate = true; } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 0dae3655ef..cc5fa62cf0 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.NormalNPCs int ruby = Dust.NewDust(NPC.Center, NPC.width, NPC.height, 90, dustVel.X, dustVel.Y, 100, default, 2f); Main.dust[ruby].velocity *= 1.5f; Main.dust[ruby].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ruby].scale = 0.5f; Main.dust[ruby].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.NormalNPCs { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 4bc53f4294..7562a87a01 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (tries < 500) { - int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType() : ModContent.NPCType(); + int npcToSpawn = Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType(); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn); } } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index a12a5b9f06..e8994c00aa 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.OldDuke { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index d329949c9d..f355d92fc8 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.OldDuke int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 3ffbb331b2..68925efc27 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.localAI[1] >= 6f) { //Leak projectiles everywhere and start healing - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); int spread = Main.rand.Next(-45, 46); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 170, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -335,7 +335,7 @@ namespace CalamityMod.NPCs.Perforator float dustVelocityYAdd = Math.Abs(Main.dust[num622].velocity.Y) * 0.5f; if (Main.dust[num622].velocity.Y < 0f) Main.dust[num622].velocity.Y = 2f + dustVelocityYAdd; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 170, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator Main.dust[num624].velocity *= 2f; } - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; if (Main.getGoodWorld) @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 81dbf63782..a05634df2b 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -632,7 +632,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 690cfacf93..7895b13f7c 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index c0116e2067..7bf16570f0 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index b504457e6b..5449c22bac 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -912,7 +912,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity *= 0.75f; gaussMode = true; } - else if (Main.rand.NextBool(2) && Main.zenithWorld) + else if (Main.rand.NextBool() && Main.zenithWorld) { type = ModContent.ProjectileType(); baseVelocity *= 0.4f; @@ -1156,7 +1156,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 10f58b4c96..bc79c19f80 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 9a05d34a14..02370543e0 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -551,7 +551,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 462485cb74..c23fe9e9a5 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -773,7 +773,7 @@ namespace CalamityMod.NPCs.Polterghast int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -927,7 +927,7 @@ namespace CalamityMod.NPCs.Polterghast int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -973,7 +973,7 @@ namespace CalamityMod.NPCs.Polterghast double deltaAngle = rotation / numProj; double offsetAngle; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numProj; i++) @@ -1313,7 +1313,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 32c25068bb..c7b8761c08 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -467,7 +467,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 185, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 0.6f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7fbbf20fbb..816f212fa0 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1325,7 +1325,7 @@ namespace CalamityMod.NPCs.Providence player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -2541,7 +2541,7 @@ namespace CalamityMod.NPCs.Providence int fire = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; Main.dust[fire].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 4c32163b90..e6ed4e136f 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 995504074e..50a59b8c75 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 8f57fb78b2..da2bb1d95d 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Signus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 1a9a83dea1..b5fd703e4f 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -296,12 +296,12 @@ namespace CalamityMod.NPCs.Signus int min = 14; int max = 18; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.Signus int num622 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.Signus int num623 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num623].velocity *= 3f; Main.dust[num623].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num623].scale = 0.5f; Main.dust[num623].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -969,7 +969,7 @@ namespace CalamityMod.NPCs.Signus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 539130907e..5542aebf97 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.SlimeGod int damage = NPC.GetProjectileDamage(type); if (Main.zenithWorld) { - type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); } if (!NPC.wet) { diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 017f4582e6..ac07830de4 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.SlimeGod color.A = 150; int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, color, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -367,7 +367,7 @@ namespace CalamityMod.NPCs.SlimeGod color.A = 150; int dust2 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, color, 2f); Main.dust[dust2].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust2].scale = 0.5f; Main.dust[dust2].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index e7f442c334..dc279b91d3 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -700,7 +700,7 @@ namespace CalamityMod.NPCs.SlimeGod { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, dustColor, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 6f72cf4ebe..656e68f6f8 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -713,7 +713,7 @@ namespace CalamityMod.NPCs.SlimeGod { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, dustColor, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 5faf00cefb..ff92fcd7c0 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 467e5fde64..21ffbdd4cf 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -896,7 +896,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index ff664b375a..e50b446d82 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -327,7 +327,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index cd835819c1..73816facfa 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.SunkenSea Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; Main.dust[dust].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 5169d0bf88..1d23f095fa 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.SunkenSea } else if (NPC.ai[2] == 2f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num5 = Dust.NewDust(NPC.position, NPC.width, NPC.height, 226, 0f, 0f, 200, default, 1.5f); Main.dust[num5].noGravity = true; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 6504b97afa..fc97720873 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 3cffd4d0eb..128d74bc3b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -752,7 +752,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { Vector2 dustSpawnPosition = NPC.Bottom; float horizontalSpawnOffset = bodyWidth * Main.rand.NextFloat(0.42f, 0.5f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) horizontalSpawnOffset *= -1f; dustSpawnPosition.X += horizontalSpawnOffset; @@ -2084,7 +2084,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust brimstoneMagic = Dust.NewDustPerfect(handPosition, 264); brimstoneMagic.velocity = Vector2.UnitY.RotatedByRandom(0.14f) * Main.rand.NextFloat(-3.5f, -3f) + NPC.velocity; @@ -2621,7 +2621,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust brimstoneMagic = Dust.NewDustPerfect(handPosition, 264); brimstoneMagic.velocity = Vector2.UnitY.RotatedByRandom(0.14f) * Main.rand.NextFloat(-3.5f, -3f) + NPC.velocity; @@ -2965,9 +2965,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas heart.ModNPC().ChainEndpoints.Add(endpoint); } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { - endpoint.X = heart.Center.X + Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(45f, 360f); + endpoint.X = heart.Center.X + Main.rand.NextBool().ToDirectionInt() * Main.rand.NextFloat(45f, 360f); endpoint.X = MathHelper.Clamp(endpoint.X, safeBox.Left, safeBox.Right); heart.ModNPC().ChainEndpoints.Add(endpoint); } @@ -3373,7 +3373,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(NPC.position, NPC.width, NPC.height, cirrus ? (int)CalamityDusts.PurpleCosmilite : (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 0b8321e09e..0422546da0 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 0ab38a2510..9d9e4cf183 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 3e360bd064..a590d1a31d 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.TownNPCs { int brimstone = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[brimstone].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[brimstone].scale = 0.5f; Main.dust[brimstone].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index 4e926fe89a..00af992ebc 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -304,12 +304,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses min += teleportDistanceIncrease; max += teleportDistanceIncrease; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num801 += Main.rand.Next(min, max); else num801 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num802 += Main.rand.Next(min, max); else num802 -= Main.rand.Next(min, max); @@ -466,12 +466,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int min = 18 + teleportDistanceIncrease; int max = 26 + teleportDistanceIncrease; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num810 += Main.rand.Next(min, max); else num810 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num811 += Main.rand.Next(min, max); else num811 -= Main.rand.Next(min, max); diff --git a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs index e21cf78504..9758dde5b4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs @@ -332,7 +332,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num622 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs index 0df1f70898..9c90497a5c 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num622 = Dust.NewDust(vector, npc.width / 2, npc.height / 2, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 2f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index 60347ca386..5d9e8ebfd4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer); - if (projectileType == ProjectileID.ThornBall && (Main.rand.NextBool(2) || !Main.zenithWorld)) + if (projectileType == ProjectileID.ThornBall && (Main.rand.NextBool() || !Main.zenithWorld)) Main.projectile[proj].tileCollide = false; } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index a02c92c873..b8c931934c 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2398,7 +2398,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 0f) NPC.ai[1] = 450 * Math.Sign((NPC.Center - targetData.Center).X); - teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); + teleportLocation = Main.rand.NextBool() ? (revenge ? 500 : 600) : (revenge ? -500 : -600); Vector2 center = targetData.Center + new Vector2(-NPC.ai[1], teleportLocation); NPC.Center = center; } @@ -3125,7 +3125,7 @@ namespace CalamityMod.NPCs.Yharon { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Particles/CrackParticle.cs b/Particles/CrackParticle.cs index 0ebfc60c20..5743457e80 100644 --- a/Particles/CrackParticle.cs +++ b/Particles/CrackParticle.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Particles private float FinalScale; private Vector2 Squish; private Color BaseColor; + public float opacity; public int Stop = 0; public CrackParticle(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime) @@ -43,12 +44,14 @@ namespace CalamityMod.Particles if (Stop > 1) Velocity *= 0; Color = BaseColor; + + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); } public override void CustomDraw(SpriteBatch spriteBatch) { Texture2D tex = ModContent.Request(Texture).Value; - spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color * opacity, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); } } diff --git a/Particles/ManaDrainStreak.cs b/Particles/ManaDrainStreak.cs index 559b16f958..5af6d73faf 100644 --- a/Particles/ManaDrainStreak.cs +++ b/Particles/ManaDrainStreak.cs @@ -19,8 +19,9 @@ namespace CalamityMod.Particles public Color StartColor; public Color EndColor; public Vector2 OverridePosition; + public bool FadeOut; - public ManaDrainStreak(Player owner, float thickness, Vector2 startVector, float finalDistance, Color colorStart, Color colorEnd, int lifetime, Vector2 overridePosition = default) + public ManaDrainStreak(Player owner, float thickness, Vector2 startVector, float finalDistance, Color colorStart, Color colorEnd, int lifetime, Vector2 overridePosition = default, bool fadeOut = false) { Owner = owner; Scale = thickness; @@ -33,6 +34,7 @@ namespace CalamityMod.Particles Color = colorStart; Lifetime = lifetime; OverridePosition = overridePosition; + FadeOut = fadeOut; } public override void Update() @@ -42,7 +44,7 @@ namespace CalamityMod.Particles Vector2 setPosition = OverridePosition != default ? OverridePosition : Owner.MountedCenter; Position = setPosition + Rotation.ToRotationVector2() * MathHelper.Lerp(StartDistanceFromPlayer, FinalDistanceFromPlayer, (float)Math.Pow(LifetimeCompletion, 2)); - Color = Color.Lerp(StartColor, EndColor, LifetimeCompletion); + Color = Color.Lerp(StartColor, FadeOut ? EndColor with {A = 0} : EndColor, LifetimeCompletion); Lighting.AddLight(Position, Color.ToVector3() * 0.2f); } diff --git a/Particles/TitaniumRailgunShell.cs b/Particles/TitaniumRailgunShell.cs index b8b086a3cb..28352abf9a 100644 --- a/Particles/TitaniumRailgunShell.cs +++ b/Particles/TitaniumRailgunShell.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Particles if (Opacity <= 0.01f) GeneralParticleHandler.RemoveParticle(this); - if (LifetimeCompletion < 0.2f && Main.rand.NextBool(2)) + if (LifetimeCompletion < 0.2f && Main.rand.NextBool()) { Vector2 dustPosition = Position + Main.rand.NextVector2Circular(8f, 8f); diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index f79934f0ea..713f37392b 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Boss if (num640 < 50) num641 = 4f; - int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float num644 = Main.dust[num643].velocity.X; float num645 = Main.dust[num643].velocity.Y; diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index eba33bc8af..686826706e 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -216,10 +216,10 @@ namespace CalamityMod.Projectiles.Boss for (int num621 = 0; num621 < 12; num621++) { - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDustType, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -227,7 +227,7 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDustType, 0f, 0f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 5f; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index ba8af2a34b..eb1aaf9d5d 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Boss if (num640 < 50) num641 = 4f; - int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float num644 = Main.dust[num643].velocity.X; float num645 = Main.dust[num643].velocity.Y; diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index cfb5d98722..8cc17235dd 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.Brimstone; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.1f, Projectile.velocity.Y * 0.1f, 100, default, 1f); Dust dust = Main.dust[fire]; diff --git a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs index 7474c0e3ea..dc02dcb714 100644 --- a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs +++ b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss { int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 0, default, 1.2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 8061370fe3..8c5c3e30db 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index d25618c96c..66b4d5f4eb 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index e62390945e..9ff9326689 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index fd8fd42f1c..970a41e123 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Ectoplasm, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index d5a274e4f1..4514a6b39f 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index d6caaf9508..06f0b596ad 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 01d6cda48a..20bec96090 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 7c7701e21a..5e19c87710 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 4b2d24ce1a..a92b3bb7d3 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 5a1978f9df..7285cde7b5 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) Projectile.velocity.X *= 1.5f; diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 2dd15c56b2..5f7b867522 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 40b0888c85..beefd2c47a 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 56929b8276..c8865ae2ed 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 053e79fd50..b940eec81b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Boss int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 263fa60282..ec1b8562dd 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 7900f264ee..7041858f4a 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index fc2b7ec2df..8cba1a823b 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 6774adf70d..b2f6c8a002 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index b565a975b9..6038a979f5 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 45edf89dff..213b749959 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) Projectile.velocity.X *= 1.5f; diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 6cb97a3c18..12d35a5f38 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.ai[0] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; } if (Projectile.timeLeft == 720) diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index a5a1c06e47..cb02116a03 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 0ae356e8bf..98d7293148 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index ec7c43fcf3..82a9038ddc 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 3c5a358042..1f75613049 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 1.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index f6435549f2..a9aea616c2 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 1.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/OldDukeSummonDrop.cs b/Projectiles/Boss/OldDukeSummonDrop.cs index 11348b06f1..509944c523 100644 --- a/Projectiles/Boss/OldDukeSummonDrop.cs +++ b/Projectiles/Boss/OldDukeSummonDrop.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { // 1 to 3 seconds of poisoned target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(1, 4)); diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 42a738a6d9..5f1563b047 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index f132a6932b..6372dcfda0 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index db1dc45b34..a73bcea192 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < totalProjectiles; i++) { Vector2 vector = new Vector2(0f, -8f).RotatedBy(radians * i); - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector, type, Projectile.damage, 0f, Main.myPlayer); } } @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index d74c361d00..99960b56d5 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index 1e154f55a2..4e81eb7532 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 537ccfdf12..0a23c7e12a 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 6cf3eb91a2..83c800e849 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1347,10 +1347,10 @@ namespace CalamityMod.Projectiles for (int i = 0; i < 8; i++) { - int randomDustType = Main.rand.NextBool(2) ? 125 : 148; + int randomDustType = Main.rand.NextBool() ? 125 : 148; Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 2f); dust.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale = 0.5f; dust.fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -1358,7 +1358,7 @@ namespace CalamityMod.Projectiles } for (int i = 0; i < 10; i++) { - int randomDustType = Main.rand.NextBool(2) ? 125 : 148; + int randomDustType = Main.rand.NextBool() ? 125 : 148; Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 3f); dust.noGravity = true; dust.velocity *= 5f; @@ -2389,7 +2389,7 @@ namespace CalamityMod.Projectiles } break; case 2: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust cflame = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f); cflame.noGravity = true; @@ -2398,7 +2398,7 @@ namespace CalamityMod.Projectiles } break; case 3: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust fire = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f); fire.noGravity = true; @@ -2407,7 +2407,7 @@ namespace CalamityMod.Projectiles } break; case 4: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust gold = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 1.1f); gold.noGravity = true; @@ -2415,7 +2415,7 @@ namespace CalamityMod.Projectiles } break; case 5: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust ichor = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 169, 0f, 0f, 100); ichor.velocity.X += projectile.direction; @@ -2424,7 +2424,7 @@ namespace CalamityMod.Projectiles } break; case 6: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust nanite = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 135, 0f, 0f, 100); nanite.velocity.X += projectile.direction; diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index 9f24c66d94..8997eefdf8 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { for (int i = 0; i < 220; i++) { - int type = Main.rand.NextBool(2) ? 261 : 107; + int type = Main.rand.NextBool() ? 261 : 107; Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type); dust.scale = Main.rand.NextFloat(1.6f, 2.2f); dust.velocity = Main.rand.NextVector2CircularEdge(75f, 75f); diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index 3ab5d148e1..b5025c525a 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { float angle = MathHelper.TwoPi / 120f * i; Dust dust = Dust.NewDustPerfect(Target.Center + angle.ToRotationVector2() * 25f, 226); - dust.velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 9f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 9f) * Main.rand.NextBool().ToDirectionInt(); dust.velocity = dust.velocity.RotatedBy(dust.velocity.ToRotation() * -0.02f); dust.velocity *= 2.1f; dust.noGravity = true; diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index ac590c7381..7cd3ea53d4 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Enemy int dustID = Main.rand.NextBool(3) ? ModContent.DustType() : ModContent.DustType(); Dust astralParticle = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1.2f); astralParticle.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { astralParticle.scale = 0.5f; astralParticle.fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/CragmawBeam.cs b/Projectiles/Enemy/CragmawBeam.cs index e8d660fd83..2e9b7207b3 100644 --- a/Projectiles/Enemy/CragmawBeam.cs +++ b/Projectiles/Enemy/CragmawBeam.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Enemy { for (int i = 0; i < 4; i++) { - float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool(2).ToDirectionInt() * MathHelper.PiOver2; + float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool().ToDirectionInt() * MathHelper.PiOver2; float speed = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 velocity = theta.ToRotationVector2() * speed; Dust dust = Dust.NewDustDirect(beamEndPosiiton, 0, 0, (int)CalamityDusts.SulfurousSeaAcid, velocity.X, velocity.Y, 0, default, 1f); diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 884230862b..2be98d51c6 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 613786aaa2..f99194b621 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs index 908cf23f31..26ae691ba3 100644 --- a/Projectiles/Enemy/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/GammaBeam.cs b/Projectiles/Enemy/GammaBeam.cs index 366dd1e4aa..47a519e3a9 100644 --- a/Projectiles/Enemy/GammaBeam.cs +++ b/Projectiles/Enemy/GammaBeam.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Enemy { for (int i = 0; i < 4; i++) { - float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool(2).ToDirectionInt() * MathHelper.PiOver2; + float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool().ToDirectionInt() * MathHelper.PiOver2; float speed = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 velocity = theta.ToRotationVector2() * speed; Dust dust = Dust.NewDustDirect(beamEndPosiiton, 0, 0, (int)CalamityDusts.SulfurousSeaAcid, velocity.X, velocity.Y, 0, default, 1f); diff --git a/Projectiles/Enemy/HorsWaterBlast.cs b/Projectiles/Enemy/HorsWaterBlast.cs index d10c1cf442..0efe16c723 100644 --- a/Projectiles/Enemy/HorsWaterBlast.cs +++ b/Projectiles/Enemy/HorsWaterBlast.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/InkBombHostile.cs b/Projectiles/Enemy/InkBombHostile.cs index 2b8185a639..37d5a2e072 100644 --- a/Projectiles/Enemy/InkBombHostile.cs +++ b/Projectiles/Enemy/InkBombHostile.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 54, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index e16fe27a22..580ceac880 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -31,11 +31,11 @@ namespace CalamityMod.Projectiles.Enemy { Lighting.AddLight(Projectile.Center, 0.1f * Projectile.Opacity, 1f * Projectile.Opacity, 0f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Projectile.velocity *= 0.95f; - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) Projectile.velocity *= 0.9f; - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) Projectile.velocity *= 0.85f; else Projectile.velocity *= 0.8f; diff --git a/Projectiles/Environment/AcidDrop.cs b/Projectiles/Environment/AcidDrop.cs index 4dfa85231c..ceedcbaaec 100644 --- a/Projectiles/Environment/AcidDrop.cs +++ b/Projectiles/Environment/AcidDrop.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Environment if (info.Damage <= 0) return; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { // 1 to 3 seconds of poisoned target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(1, 4)); diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index c1f545a66e..d90618b0eb 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Healing { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs index 69b8fb94d2..a03c5821e0 100644 --- a/Projectiles/Magic/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/Ancient.cs b/Projectiles/Magic/Ancient.cs index d5c8acded6..29ce6a3375 100644 --- a/Projectiles/Magic/Ancient.cs +++ b/Projectiles/Magic/Ancient.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Magic int dustType = 22; int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[idx]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 2f; diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index ee8316c3bd..b16c9649fc 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic int dustType = 22; int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[idx]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 2f; diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index 4d560c68c1..4f7b862cc8 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Magic { int idx = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/ClamorNoctusStar.cs b/Projectiles/Magic/ClamorNoctusStar.cs index 53f2161d92..f7bc348210 100644 --- a/Projectiles/Magic/ClamorNoctusStar.cs +++ b/Projectiles/Magic/ClamorNoctusStar.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 20, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/CoralSpike.cs b/Projectiles/Magic/CoralSpike.cs index a0bf5e5c61..c63b6a524b 100644 --- a/Projectiles/Magic/CoralSpike.cs +++ b/Projectiles/Magic/CoralSpike.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public ref float ChargeCompletion => ref Projectile.ai[0]; - public static int DustPick => Main.rand.NextBool(2) ? 255 : Main.rand.NextBool() ? 282 : Main.rand.NextBool() ? 281 : 280; + public static int DustPick => Main.rand.NextBool() ? 255 : Main.rand.NextBool() ? 282 : Main.rand.NextBool() ? 281 : 280; public override void SetDefaults() { diff --git a/Projectiles/Magic/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs index 2b109401db..9d3e351d6a 100644 --- a/Projectiles/Magic/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic // Dust, randomly if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector140 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust28 = Main.dust[Dust.NewDust(Projectile.Center - vector140 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num1014 = 0; num1014 < 1; num1014 = num3 + 1) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector142 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust30 = Main.dust[Dust.NewDust(Projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; diff --git a/Projectiles/Magic/GhastlySubBlast.cs b/Projectiles/Magic/GhastlySubBlast.cs index 9cab92f7c6..d3e9531288 100644 --- a/Projectiles/Magic/GhastlySubBlast.cs +++ b/Projectiles/Magic/GhastlySubBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity *= 6f / Projectile.velocity.Length(); } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num1028 = Dust.NewDust(Projectile.Center, 8, 8, 60, 0f, 0f, 0, default, 1f); Main.dust[num1028].position = Projectile.Center; diff --git a/Projectiles/Magic/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs index beaa194058..15dc5a5d4f 100644 --- a/Projectiles/Magic/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.ToRadians(90); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.6f); if (Projectile.timeLeft < 60) diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index d9e20f3489..ed6cc4df7c 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Magic { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[ecto].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ecto].scale = 0.5f; Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Magic { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[ecto].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ecto].scale = 0.5f; Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs index ba54aec123..c2a57704a7 100644 --- a/Projectiles/Magic/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index 596d8f97c2..c2b29e4ddd 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[1]++; for (int j = 0; j < 3; j++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Magic } else { - int direct = Main.rand.NextBool(2) ? 1 : -1; + int direct = Main.rand.NextBool() ? 1 : -1; Vector2 dir1 = new Vector2(0f, 10f) * direct; int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, dir1.X, dir1.Y, 50, default, 1.3f); Main.dust[dust1].noGravity = true; Main.dust[dust1].velocity = dir1; - int direct2 = Main.rand.NextBool(2) ? 1 : -1; + int direct2 = Main.rand.NextBool() ? 1 : -1; Vector2 dir2 = new Vector2(10f, 0f) * direct2; int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, dir2.X, dir2.Y, 50, default, 1.3f); Main.dust[dust2].noGravity = true; @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 10; i++) { - int dtype1 = Main.rand.NextBool(2) ? 68 : 67; + int dtype1 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype1 = 80; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 270; i++) { - int dtype2 = Main.rand.NextBool(2) ? 68 : 67; + int dtype2 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype2 = 80; @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.Damage(); for (int i = 0; i < 180; i++) { - int dtype3 = Main.rand.NextBool(2) ? 68 : 67; + int dtype3 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype3 = 80; diff --git a/Projectiles/Magic/IceBlock.cs b/Projectiles/Magic/IceBlock.cs index 5b36943843..2c3097c93f 100644 --- a/Projectiles/Magic/IceBlock.cs +++ b/Projectiles/Magic/IceBlock.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 40; i++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; diff --git a/Projectiles/Magic/IceBlockIcicle.cs b/Projectiles/Magic/IceBlockIcicle.cs index 00bb7952a4..e3d2a4a69f 100644 --- a/Projectiles/Magic/IceBlockIcicle.cs +++ b/Projectiles/Magic/IceBlockIcicle.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 20; i++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; diff --git a/Projectiles/Magic/LightBall.cs b/Projectiles/Magic/LightBall.cs index 578897bf9c..af78682d23 100644 --- a/Projectiles/Magic/LightBall.cs +++ b/Projectiles/Magic/LightBall.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/ManaChargedCoral.cs b/Projectiles/Magic/ManaChargedCoral.cs index 0afd3c7660..ff9757e8f3 100644 --- a/Projectiles/Magic/ManaChargedCoral.cs +++ b/Projectiles/Magic/ManaChargedCoral.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Magic //particles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15f, 15f), 45, Vector2.UnitY * -7f, Alpha: Main.rand.Next(100) + 120, Scale: Main.rand.NextFloat(1f, 2f)); dust.noGravity = true; @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity.Y = Math.Clamp(Projectile.velocity.Y, 0, Math.Max(18f, fallSpeed)); //Sharticles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15f, 15f), 15, Projectile.velocity * 0.3f, Alpha: Main.rand.Next(100) + 120, Scale: Main.rand.NextFloat(1f, 2f)); dust.noGravity = true; diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index 2cfeb972f8..4547e0fe9d 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Magic { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/NebulaCloudCore.cs b/Projectiles/Magic/NebulaCloudCore.cs index 93d663a69a..39da6ca5e6 100644 --- a/Projectiles/Magic/NebulaCloudCore.cs +++ b/Projectiles/Magic/NebulaCloudCore.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic // Emit pretty as fuck dust. if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector93 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust45 = Main.dust[Dust.NewDust(Projectile.Center - vector93 * 45f, 0, 0, Utils.SelectRandom(Main.rand, 86, 90))]; diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 03a806ac9b..e0b5d5cf70 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 endOfLaser = Projectile.Center + Projectile.velocity * (LaserLength - Main.rand.NextFloat(12f, 72f)); Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Projectile.owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int type = ModContent.ProjectileType(); int damage = 0; diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 4b8436a00c..be83fe8146 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index b890cdc58e..0e90f7f3bb 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs index 855c462864..1cf678f1eb 100644 --- a/Projectiles/Magic/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 4f; diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 864cffd213..8a92982407 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic } for (int i = 0; i < 60; i++) { - Dust brimstoneMagic = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(2) ? (int)CalamityDusts.Brimstone : 27); + Dust brimstoneMagic = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? (int)CalamityDusts.Brimstone : 27); brimstoneMagic.velocity = Main.rand.NextVector2Circular(18f, 18f); brimstoneMagic.scale = 1.7f; brimstoneMagic.noGravity = true; diff --git a/Projectiles/Magic/VortexElementalBeam.cs b/Projectiles/Magic/VortexElementalBeam.cs index 2a0a5b21db..de347f1fab 100644 --- a/Projectiles/Magic/VortexElementalBeam.cs +++ b/Projectiles/Magic/VortexElementalBeam.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 dustSpawnPosition = Vector2.Lerp(Projectile.oldPos[i], Projectile.oldPos[i + 1], j / 8f); dustSpawnPosition += Projectile.Size * 0.5f; - Dust electricity = Dust.NewDustPerfect(dustSpawnPosition, Main.rand.NextBool(2) ? 226 : 229); + Dust electricity = Dust.NewDustPerfect(dustSpawnPosition, Main.rand.NextBool() ? 226 : 229); electricity.velocity = Vector2.Zero; electricity.scale = Main.rand.NextFloat(1.1f, 1.18f); electricity.noGravity = true; diff --git a/Projectiles/Magic/WyvernFeatherGreen.cs b/Projectiles/Magic/WyvernFeatherGreen.cs index f967f2febf..f3c92a4d7c 100644 --- a/Projectiles/Magic/WyvernFeatherGreen.cs +++ b/Projectiles/Magic/WyvernFeatherGreen.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 61, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/WyvernFeatherPink.cs b/Projectiles/Magic/WyvernFeatherPink.cs index f0381789b5..c8650fa92b 100644 --- a/Projectiles/Magic/WyvernFeatherPink.cs +++ b/Projectiles/Magic/WyvernFeatherPink.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 242, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/WyvernFeatherPurple.cs b/Projectiles/Magic/WyvernFeatherPurple.cs index 473e8038a4..3ecd3e229c 100644 --- a/Projectiles/Magic/WyvernFeatherPurple.cs +++ b/Projectiles/Magic/WyvernFeatherPurple.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/AegisFlame.cs b/Projectiles/Melee/AegisFlame.cs index c390af24b6..7e782a0e22 100644 --- a/Projectiles/Melee/AegisFlame.cs +++ b/Projectiles/Melee/AegisFlame.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index 6842f104f5..ef77df7943 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee for (int num157 = 0; num157 < 2; num157++) { - int num158 = Dust.NewDust(new Vector2(Projectile.position.X + 4f, Projectile.position.Y + 4f), Projectile.width - 8, Projectile.height - 8, Main.rand.NextBool(2) ? 5 : 6, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 2f); + int num158 = Dust.NewDust(new Vector2(Projectile.position.X + 4f, Projectile.position.Y + 4f), Projectile.width - 8, Projectile.height - 8, Main.rand.NextBool() ? 5 : 6, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 2f); Main.dust[num158].position -= Projectile.velocity * 2f; Main.dust[num158].noGravity = true; Dust expr_7A4A_cp_0_cp_0 = Main.dust[num158]; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/BloodExplosion.cs b/Projectiles/Melee/BloodExplosion.cs index 1ad3eeeae0..6657e3bdfc 100644 --- a/Projectiles/Melee/BloodExplosion.cs +++ b/Projectiles/Melee/BloodExplosion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Blood, 0f, 0f, 100, default, 1.5f); Main.dust[index].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[index].scale = 0.5f; Main.dust[index].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/Brimblast.cs b/Projectiles/Melee/Brimblast.cs index 32d6fe6e62..42b93f9ce6 100644 --- a/Projectiles/Melee/Brimblast.cs +++ b/Projectiles/Melee/Brimblast.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 4f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Melee/BrimlanceStandingFire.cs b/Projectiles/Melee/BrimlanceStandingFire.cs index fcea82e68a..5a011c9c82 100644 --- a/Projectiles/Melee/BrimlanceStandingFire.cs +++ b/Projectiles/Melee/BrimlanceStandingFire.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs index 1cdd9d1f8e..ac1cd322d6 100644 --- a/Projectiles/Melee/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.Y *= 1.05f; Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; Projectile.velocity.Y += Projectile.ai[0]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index be8cae2632..1c16658c09 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee // for spawning the side beams for (int i = 0; i < 2; i++) { - int directionSign = Main.rand.NextBool(2).ToDirectionInt(); + int directionSign = Main.rand.NextBool().ToDirectionInt(); Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501)); Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner); diff --git a/Projectiles/Melee/DragonRageFireball.cs b/Projectiles/Melee/DragonRageFireball.cs index 1da2623e7b..b4694228c0 100644 --- a/Projectiles/Melee/DragonRageFireball.cs +++ b/Projectiles/Melee/DragonRageFireball.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 16cf2799b6..b5f306b037 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector2 = num12.ToRotationVector2(); Vector2 value4 = vector2.RotatedBy(MathHelper.PiOver2 * Projectile.spriteDirection); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 244, player.velocity.X, player.velocity.Y, 150, default, 1f); dust.velocity = Projectile.SafeDirectionTo(dust.position) * 0.1f + dust.velocity * 0.1f; diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index b36d0c5830..2d3e77208a 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index bf627db606..5f16b42a05 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/EutrophicScimitarProj.cs b/Projectiles/Melee/EutrophicScimitarProj.cs index 6ecd525924..224631e6f9 100644 --- a/Projectiles/Melee/EutrophicScimitarProj.cs +++ b/Projectiles/Melee/EutrophicScimitarProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 226, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.5f); } diff --git a/Projectiles/Melee/EutrophicSpark.cs b/Projectiles/Melee/EutrophicSpark.cs index 17184a2ade..dbc92223f8 100644 --- a/Projectiles/Melee/EutrophicSpark.cs +++ b/Projectiles/Melee/EutrophicSpark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 92d74dc7aa..d26bb9b959 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = Projectile.velocity.ToRotation(); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Color dustColor = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.9f); Dust must = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20f, 20f) + Projectile.velocity, 267, Projectile.velocity * -2.6f, 0, dustColor); diff --git a/Projectiles/Melee/FallenPaladinsHammerEcho.cs b/Projectiles/Melee/FallenPaladinsHammerEcho.cs index 9ecacb7c6c..ffa8d34c22 100644 --- a/Projectiles/Melee/FallenPaladinsHammerEcho.cs +++ b/Projectiles/Melee/FallenPaladinsHammerEcho.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs index 3b61e3f8ec..5449be8ca2 100644 --- a/Projectiles/Melee/FallenPaladinsHammerProj.cs +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Melee } //Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs index 4cbad91841..f0307e9f50 100644 --- a/Projectiles/Melee/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector3 = Vector2.UnitX * (float)-(float)Projectile.width / 2f; vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); vector3 = vector3.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int num9 = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool(2) ? 164 : 229, 0f, 0f, 160, default, 1f); + int num9 = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool() ? 164 : 229, 0f, 0f, 160, default, 1f); Main.dust[num9].noGravity = true; Main.dust[num9].position = Projectile.Center + vector3; Main.dust[num9].velocity = Projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index 7699be7196..98690631bb 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index 5e0f3f7d22..c644028d7c 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Melee } //Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GayBeam.cs b/Projectiles/Melee/GayBeam.cs index 90c68438cc..ab1d83b2ed 100644 --- a/Projectiles/Melee/GayBeam.cs +++ b/Projectiles/Melee/GayBeam.cs @@ -233,7 +233,7 @@ namespace CalamityMod.Projectiles.Melee break; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 267, 0f, 0f, alpha, color, 1.5f); Main.dust[dust].noGravity = true; @@ -377,7 +377,7 @@ namespace CalamityMod.Projectiles.Melee { bool fromRight = x == 1; if (x == 2) - fromRight = Main.rand.NextBool(2); + fromRight = Main.rand.NextBool(); if (Projectile.owner == Main.myPlayer) { var source = Projectile.GetSource_FromThis(); diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index 4c86847f47..f5a21f5f72 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(Projectile.Center, 0f, 0.2f, 0.4f); Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; Projectile.velocity.Y += Projectile.ai[0]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 20, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 739d61b3df..d1df22217a 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index e2a86a28ff..320fa0c215 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs index 44a60a69b5..453558eb2d 100644 --- a/Projectiles/Melee/InsidiousHarpoon.cs +++ b/Projectiles/Melee/InsidiousHarpoon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index 591b66fcad..7b25c6095f 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee } int num564 = 8; - int num565 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num564, Projectile.position.Y + (float)num564), Projectile.width - num564 * 2, Projectile.height - num564 * 2, Main.rand.NextBool(2) ? 5 : 6, 0f, 0f, 0, default, 1f); + int num565 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num564, Projectile.position.Y + (float)num564), Projectile.width - num564 * 2, Projectile.height - num564 * 2, Main.rand.NextBool() ? 5 : 6, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num565]; dust.velocity *= 0.5f; dust = Main.dust[num565]; @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs index 57e6788d96..f3d37f56f8 100644 --- a/Projectiles/Melee/PhosphorescentGauntletPunches.cs +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee dust.noGravity = true; dust.fadeIn = 1f; dust.velocity += player.velocity; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.position += Utils.RandomVector2(Main.rand, -4f, 4f); dust.scale += Main.rand.NextFloat(); diff --git a/Projectiles/Melee/PrismRay.cs b/Projectiles/Melee/PrismRay.cs index 6b9298933c..194ddd6467 100644 --- a/Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee Utils.PlotTileLine(StartingPosition, Projectile.Center, 8f, DelegateMethods.CastLight); if (Projectile.localAI[0] == 0f) { - Projectile.direction = Main.rand.NextBool(2).ToDirectionInt(); + Projectile.direction = Main.rand.NextBool().ToDirectionInt(); Projectile.localAI[0] = 1f; } Projectile.rotation = Time / 20f * MathHelper.TwoPi * Projectile.direction; diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index 1f13f27b8d..bb7a487ff3 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee } Lighting.AddLight(Projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int rainbow = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 267, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, alpha, Main.rand.Next(colors)); Main.dust[rainbow].noGravity = true; diff --git a/Projectiles/Melee/PwnagehammerEcho.cs b/Projectiles/Melee/PwnagehammerEcho.cs index b660e89eac..da61efd72c 100644 --- a/Projectiles/Melee/PwnagehammerEcho.cs +++ b/Projectiles/Melee/PwnagehammerEcho.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index 339523d068..fe143e4435 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.X *= 0.9511f; Projectile.velocity.Y += 0.502f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/RSSolarFlare.cs b/Projectiles/Melee/RSSolarFlare.cs index 233f821c17..f8817afdc7 100644 --- a/Projectiles/Melee/RSSolarFlare.cs +++ b/Projectiles/Melee/RSSolarFlare.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 159, 0f, 0f, 100, default, 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/SeashineSwordProj.cs b/Projectiles/Melee/SeashineSwordProj.cs index 5460bc1842..ce59610eb5 100644 --- a/Projectiles/Melee/SeashineSwordProj.cs +++ b/Projectiles/Melee/SeashineSwordProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.25f / 255f, (255 - Projectile.alpha) * 0.25f / 255f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 187, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 1.2f); } diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs index f855f9c6a8..263b671986 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords { if (Main.rand.NextBool(5)) { - int num250 = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (Main.rand.NextBool(2) ? 20 : 176), (float)(Main.player[Projectile.owner].direction * 2), 0f, 150, default, 1.3f); + int num250 = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (Main.rand.NextBool() ? 20 : 176), (float)(Main.player[Projectile.owner].direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; Main.dust[num250].noGravity = true; } diff --git a/Projectiles/Melee/SoulScytheExplosion.cs b/Projectiles/Melee/SoulScytheExplosion.cs index 6dae9cfa4f..c04a25824c 100644 --- a/Projectiles/Melee/SoulScytheExplosion.cs +++ b/Projectiles/Melee/SoulScytheExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs index b76e0caf5c..ee105705d8 100644 --- a/Projectiles/Melee/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/StellarContemptEcho.cs b/Projectiles/Melee/StellarContemptEcho.cs index f8202cee55..eb29069ef3 100644 --- a/Projectiles/Melee/StellarContemptEcho.cs +++ b/Projectiles/Melee/StellarContemptEcho.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 58ee0da02b..6146c8cb4c 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Melee } // Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 6eac5089e3..00ce133d01 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee public const float MaxChargeDamageMult = 4f; public const float PiercingDamageMult = 0.6f; public const float DashDuration = 21f; - public const float IFrameRatio = 0.3f; // Amount given = Ratio * Charge, rounded down + public const float IFrameRatio = 0.35f; // Amount given = Ratio * Charge, rounded down public Player Owner => Main.player[Projectile.owner]; public ref float Charge => ref Projectile.ai[0]; diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs index a043a4154b..826d855d53 100644 --- a/Projectiles/Melee/TriactisHammerProj.cs +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -110,9 +110,9 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -120,10 +120,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -135,9 +135,9 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -145,10 +145,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/TumbleweedFlail.cs b/Projectiles/Melee/TumbleweedFlail.cs index da469ac0f9..1dfd79bdac 100644 --- a/Projectiles/Melee/TumbleweedFlail.cs +++ b/Projectiles/Melee/TumbleweedFlail.cs @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs index 1fcfea3c2f..ccbff086f2 100644 --- a/Projectiles/Melee/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index ceec3c4536..4a9bdf6248 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 value3 = Projectile.Center + (num12 + ((num9 == -1) ? 3.14159274f : 0f)).ToRotationVector2() * 30f; Vector2 vector2 = num12.ToRotationVector2(); Vector2 value4 = vector2.RotatedBy((double)(1.57079637f * (float)Projectile.spriteDirection), default); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust3 = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 33, player.velocity.X, player.velocity.Y, 150, default, 1f); dust3.velocity = Projectile.SafeDirectionTo(dust3.position) * 0.1f + dust3.velocity * 0.1f; diff --git a/Projectiles/Melee/UltimusCleaverDust.cs b/Projectiles/Melee/UltimusCleaverDust.cs index ff5f5c43ae..9cf40df931 100644 --- a/Projectiles/Melee/UltimusCleaverDust.cs +++ b/Projectiles/Melee/UltimusCleaverDust.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 135, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 33511a505b..41668b154f 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(), 0.5); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(), 0.5); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index f13a710fba..4f0304c20f 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Pets { if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { SoundEngine.PlaySound(SoundID.Meowmere with { Volume = SoundID.Meowmere.Volume * 4f}, Projectile.position); //nya } @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Pets { notlocalai1 = (float)(Main.rand.Next(30) * -10 - 300); SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { player.Hurt(PlayerDeathReason.ByOther(6), 500, 0); } diff --git a/Projectiles/Pets/KendraPet.cs b/Projectiles/Pets/KendraPet.cs index fd2b579417..ccfe64890e 100644 --- a/Projectiles/Pets/KendraPet.cs +++ b/Projectiles/Pets/KendraPet.cs @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Pets idleTimer = 0; } idleBarkTimer++; - if (idleBarkTimer > 1080 && Main.rand.NextBool(2)) + if (idleBarkTimer > 1080 && Main.rand.NextBool()) { SoundEngine.PlaySound(BarkSound, Projectile.position); chosenIdle = 3; diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index d142dff958..6cd8801ff3 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -74,13 +74,13 @@ namespace CalamityMod.Projectiles.Ranged if (crit) { var source = Projectile.GetSource_FromThis(); - int extraProjectileAmt = 8; + int extraProjectileAmt = 5; for (int x = 0; x < extraProjectileAmt; x++) { if (Projectile.owner == Main.myPlayer) { bool fromRight = x > 3; - CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, fromRight, 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 0.1f, Projectile.owner); + CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, fromRight, 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2), Projectile.knockBack * 0.1f, Projectile.owner); } } } diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index c8b4c7794c..c14beed2e1 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Ranged int charge2Damage = Projectile.damage * 20; float charge2KB = Projectile.knockBack * 3f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), charge2Damage, charge2KB, Projectile.owner); - Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5; + Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 6.5f; for (int i = 0; i <= 20; i++) { Dust dust = Dust.NewDustPerfect(tipPosition, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 7084312299..32c1e8a409 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // Bubbles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); bubble.timeLeft = 9 + Main.rand.Next(7); @@ -61,4 +61,4 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Wet, 240); } -} \ No newline at end of file +} diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index 9d059bb0dd..d0d43b354d 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 1285b01b87..086e3cebcf 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int randomDust = Utils.SelectRandom(Main.rand, new int[] { diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index 492e48d326..d23470740e 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int i = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 108, 0f, Projectile.velocity.Y * 0.5f); Main.dust[i].velocity.X *= 0.2f; diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index 49a06f56e1..00fabdce70 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 45a6a01827..a8c819d53f 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 2f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 1623c9d261..6ca0b0b80f 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index e7e3e35f1b..3616ee50d4 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 5; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Ranged return; Player player = Main.player[Projectile.owner]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int healAmt = Main.rand.Next(1, 4); player.statLife += healAmt; diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index fea561969f..fb2f1ab2ca 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index f86d9d5833..5944635129 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 235; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index 93e960d57c..56bb31c531 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 107, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = Projectile.alpha; diff --git a/Projectiles/Ranged/CardClub.cs b/Projectiles/Ranged/CardClub.cs index 3820a21694..642f8f584e 100644 --- a/Projectiles/Ranged/CardClub.cs +++ b/Projectiles/Ranged/CardClub.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardClubSplit.cs b/Projectiles/Ranged/CardClubSplit.cs index 5aefa123f7..5158234e2f 100644 --- a/Projectiles/Ranged/CardClubSplit.cs +++ b/Projectiles/Ranged/CardClubSplit.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index 1ae5443bff..cdcf920997 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(Projectile.position, 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged { int paper = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 30, 0f, 0f, 100, default, 2f); Main.dust[paper].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[paper].scale = 0.5f; Main.dust[paper].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index 30a71ceeb8..2a40acde52 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardSpade.cs b/Projectiles/Ranged/CardSpade.cs index f7f1a49eb3..e1de508f93 100644 --- a/Projectiles/Ranged/CardSpade.cs +++ b/Projectiles/Ranged/CardSpade.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/ChickenRocket.cs b/Projectiles/Ranged/ChickenRocket.cs index 6b9d34bb58..590ec1d1cf 100644 --- a/Projectiles/Ranged/ChickenRocket.cs +++ b/Projectiles/Ranged/ChickenRocket.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged { int d = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[d].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[d].scale = 0.5f; Main.dust[d].fadeIn = 1f + Main.rand.NextFloat(); diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs index af3c4e31e4..568b86eb9c 100644 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ b/Projectiles/Ranged/ClaretCannonProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged return; Player player = Main.player[Projectile.owner]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/Ranged/ContagionBall.cs b/Projectiles/Ranged/ContagionBall.cs index a61e0a21bd..e74a2fa25d 100644 --- a/Projectiles/Ranged/ContagionBall.cs +++ b/Projectiles/Ranged/ContagionBall.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 44, 0f, 0f, 100, default, 0.15f); Main.dust[num622].velocity *= 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index b2953b0830..ce12110be3 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 89; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index ca3ed1fb1d..7b9ca8f127 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int dustType = Main.rand.NextBool(4) ? 61 : 62; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[fire]; diff --git a/Projectiles/Ranged/DaemonsFlameArrow.cs b/Projectiles/Ranged/DaemonsFlameArrow.cs index 5f60b1de82..a8ec0b7f90 100644 --- a/Projectiles/Ranged/DaemonsFlameArrow.cs +++ b/Projectiles/Ranged/DaemonsFlameArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/DrizzlefishFire.cs b/Projectiles/Ranged/DrizzlefishFire.cs index f04b9dbb28..74defbd5af 100644 --- a/Projectiles/Ranged/DrizzlefishFire.cs +++ b/Projectiles/Ranged/DrizzlefishFire.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/DrizzlefishFireSplit.cs b/Projectiles/Ranged/DrizzlefishFireSplit.cs index c461999e0a..1cdd80e6ed 100644 --- a/Projectiles/Ranged/DrizzlefishFireSplit.cs +++ b/Projectiles/Ranged/DrizzlefishFireSplit.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/DrizzlefishFireball.cs b/Projectiles/Ranged/DrizzlefishFireball.cs index a5e4b7c0df..60f9d30381 100644 --- a/Projectiles/Ranged/DrizzlefishFireball.cs +++ b/Projectiles/Ranged/DrizzlefishFireball.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/ElementalFire.cs b/Projectiles/Ranged/ElementalFire.cs index 734170923d..456c13fcfc 100644 --- a/Projectiles/Ranged/ElementalFire.cs +++ b/Projectiles/Ranged/ElementalFire.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 66; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 2; num298++) { diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index c3689fac1a..9f58d3dedd 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 93f1a25810..42b2bf6bde 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.PurpleCosmilite; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/ExoFlare.cs b/Projectiles/Ranged/ExoFlare.cs index 1e4ce8e800..cc2ada2684 100644 --- a/Projectiles/Ranged/ExoFlare.cs +++ b/Projectiles/Ranged/ExoFlare.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.localAI[0] == 0f) { OffsetRotation = Main.rand.NextFloat(MathHelper.TwoPi); - OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool(2).ToDirectionInt(); + OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool().ToDirectionInt(); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index 86c98c3de0..7e08bb5004 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged Destination = Main.MouseWorld; Projectile.netUpdate = true; } - DustType = Main.rand.NextBool(2) ? 107 : 234; + DustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { DustType = 269; diff --git a/Projectiles/Ranged/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs index b06f8b5ad8..0ee05d7ec6 100644 --- a/Projectiles/Ranged/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 3a3f527c53..6dcb3b354f 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { //icicle dust - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 68, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.1f); Main.dust[index2].noGravity = true; diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 4026160245..45582a8f84 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.1f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 8f2a394759..e41a48bd43 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.1f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index aa3056eee4..a13a05b68b 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.5f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 2eb95e64c2..973d8d0e12 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { //icicle dust - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 68, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.1f); Main.dust[index2].noGravity = true; diff --git a/Projectiles/Ranged/KarasawaShot.cs b/Projectiles/Ranged/KarasawaShot.cs index bfc85c6e87..3d96a71e67 100644 --- a/Projectiles/Ranged/KarasawaShot.cs +++ b/Projectiles/Ranged/KarasawaShot.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? dust1 : dust2; + int randomDustType = Main.rand.NextBool() ? dust1 : dust2; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Dust dust = Main.dust[num54]; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? dust1 : dust2; + int randomDustType = Main.rand.NextBool() ? dust1 : dust2; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Dust dust = Main.dust[num56]; @@ -145,13 +145,13 @@ namespace CalamityMod.Projectiles.Ranged vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Projectile.Center; Vector2 vector7 = vector6 - Projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.3f, vector7.Y * 0.3f, 100, default, 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.3f, vector7.Y * 0.3f, 100, default, 2f); Main.dust[num228].noGravity = true; - int num229 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.2f, vector7.Y * 0.2f, 100, default, 2f); + int num229 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.2f, vector7.Y * 0.2f, 100, default, 2f); Main.dust[num229].noGravity = true; - int num230 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.1f, vector7.Y * 0.1f, 100, default, 2f); + int num230 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.1f, vector7.Y * 0.1f, 100, default, 2f); Main.dust[num230].noGravity = true; } diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 46fb65e4a2..f077b43a6e 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged } float dustOffsetX = Projectile.velocity.X * 0.5f; float dustOffsetY = Projectile.velocity.Y * 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int exo = Dust.NewDust(new Vector2(Projectile.position.X + 3f + dustOffsetX, Projectile.position.Y + 3f + dustOffsetY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, dustType, 0f, 0f, 100, default, 0.5f); Main.dust[exo].scale *= (float)Main.rand.Next(10) * 0.1f; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged //DO NOT REMOVE THIS PROJECTILE Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[exo].velocity *= 3f; Main.dust[exo].noGravity = true; Main.dust[exo].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[exo].scale = 0.5f; Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index 6c6f9789e9..7871c8fe72 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index 1a8ad087dd..eca174f82f 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 5f86100029..7353bc07aa 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index c6559bdbaa..ae1c4d6e6f 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 71509d5068..5967e345b4 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NeedlerProj.cs b/Projectiles/Ranged/NeedlerProj.cs index b3b592b700..cf0b371803 100644 --- a/Projectiles/Ranged/NeedlerProj.cs +++ b/Projectiles/Ranged/NeedlerProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index 1e034a2085..54554a809f 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 source = Vector2.Normalize(Projectile.velocity) * 9f; source = source.RotatedBy((d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; Vector2 dustVel = source - player.Center; - int index = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 4f); + int index = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 0, default, 4f); Main.dust[index].noGravity = true; Main.dust[index].velocity = dustVel; } diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index 05f3b90d64..af5b6cea7a 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustOffset = Vector2.UnitX * (float)-(float)Projectile.width / 2f; dustOffset += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); dustOffset = dustOffset.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int idx = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 160, default, 1f); + int idx = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 160, default, 1f); Main.dust[idx].scale = 1.1f; Main.dust[idx].noGravity = true; Main.dust[idx].position = Projectile.Center + dustOffset; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.rand.NextBool(16)) { Vector2 dustOffset = Vector2.UnitX.RotatedByRandom(Math.PI * 0.5).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[idx].velocity = dustOffset * 0.66f; Main.dust[idx].position = Projectile.Center + dustOffset * 12f; } @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.5f; if (Main.rand.NextBool(10)) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); } } } @@ -105,14 +105,14 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ExpandHitboxBy(144); for (int d = 0; d < 4; d++) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 50, default, 1.5f); } for (int d = 0; d < 20; d++) { - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 2.5f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 0, default, 2.5f); Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 3f; - idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f); + idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 50, default, 1.5f); Main.dust[idx].velocity *= 2f; Main.dust[idx].noGravity = true; } diff --git a/Projectiles/Ranged/NorfleetExplosion.cs b/Projectiles/Ranged/NorfleetExplosion.cs index a46d3dfb66..04d4ab5def 100644 --- a/Projectiles/Ranged/NorfleetExplosion.cs +++ b/Projectiles/Ranged/NorfleetExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.75f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.01f / 255f); Vector2 dustVel = CalamityUtils.RandomVelocity(120f, 36f, 108f, 1f); - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 100, default, 2f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[idx]; dust.noGravity = true; dust.position.X = Projectile.Center.X; diff --git a/Projectiles/Ranged/NovaChargeShot.cs b/Projectiles/Ranged/NovaChargeShot.cs index ebfc7e3cf3..fd4b429d33 100644 --- a/Projectiles/Ranged/NovaChargeShot.cs +++ b/Projectiles/Ranged/NovaChargeShot.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107); dust.noGravity = true; dust.scale = 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10); float trailScale = Main.rand.NextFloat(0.8f, 1.2f); diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index f04edf5c12..3dcea0ad0a 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Ranged { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index e7bed37ed1..b644ec8077 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -85,11 +85,11 @@ namespace CalamityMod.Projectiles.Ranged } else if (nullBuff == 8) { - target.velocity.Y = Main.rand.NextBool(2) ? 30f : -30f; + target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; } else { - target.velocity.X = Main.rand.NextBool(2) ? 30f : -30f; + target.velocity.X = Main.rand.NextBool() ? 30f : -30f; } } } diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs index dd12038695..0870f1d93a 100644 --- a/Projectiles/Ranged/OpalChargedStrike.cs +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 162, 0f, 0f, 0, default, Main.rand.NextFloat(1.2f, 1.5f))]; diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index a981847f69..ec441597ac 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -38,9 +38,6 @@ namespace CalamityMod.Projectiles.Ranged //Bypass defense modifiers.DefenseEffectiveness *= 0f; - - //Bypass DR - modifiers.FinalDamage /= 1f - target.Calamity().DR; } public override bool OnTileCollide(Vector2 oldVelocity) @@ -53,13 +50,13 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { OnHitEffects(target.Center, hit.Crit); - target.AddBuff(ModContent.BuffType(), 600); + target.AddBuff(ModContent.BuffType(), 300); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { OnHitEffects(target.Center, true); - target.AddBuff(ModContent.BuffType(), 600); + target.AddBuff(ModContent.BuffType(), 300); } private void OnHitEffects(Vector2 targetPos, bool crit) @@ -67,12 +64,12 @@ namespace CalamityMod.Projectiles.Ranged if (crit) { var source = Projectile.GetSource_FromThis(); - int bulletCount = 10; + int bulletCount = 6; for (int x = 0; x < bulletCount; x++) { if (Projectile.owner == Main.myPlayer) { - CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x < bulletCount / 2, 500f, 500f, 0f, 500f, 12f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2), Projectile.knockBack, Projectile.owner); + CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x < bulletCount / 2, 500f, 500f, 0f, 500f, 12f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.125), Projectile.knockBack, Projectile.owner); } } } diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index f42c9bea4f..38e26ccc67 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 811d4c1472..834c66469c 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundStyle sound = Main.rand.NextBool(2) ? SoundID.Item93 : SoundID.Item92; + SoundStyle sound = Main.rand.NextBool() ? SoundID.Item93 : SoundID.Item92; SoundEngine.PlaySound(sound with { Volume = sound.Volume * 0.5f}, Projectile.position); for (int i = 0; i < 5; i++) diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 5ad5d472d5..774405b0b0 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -174,13 +174,13 @@ namespace CalamityMod.Projectiles.Ranged source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; Vector2 dustVel = source - Projectile.Center; - int i = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.3f, dustVel.Y * 0.3f, 100, default, 2f); + int i = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.3f, dustVel.Y * 0.3f, 100, default, 2f); Main.dust[i].noGravity = true; - int j = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.2f, dustVel.Y * 0.2f, 100, default, 2f); + int j = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.2f, dustVel.Y * 0.2f, 100, default, 2f); Main.dust[j].noGravity = true; - int k = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.1f, dustVel.Y * 0.1f, 100, default, 2f); + int k = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.1f, dustVel.Y * 0.1f, 100, default, 2f); Main.dust[k].noGravity = true; } diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 2c3fd8ff9c..8aa6e000ea 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged num296 = 0.75f; } Projectile.ai[0] += 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index d07dd68663..62c6fbbf1e 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -214,7 +214,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index 9a2422341b..18f619bff8 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs index eac0973b80..92d0297eb4 100644 --- a/Projectiles/Ranged/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 14; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 3; num298++) { diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index 9b87514356..4de6b0acd1 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index d0622fc7b5..11a702be4d 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged Dust holyFire = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); holyFire.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { holyFire.scale = 0.5f; holyFire.fadeIn = Main.rand.NextFloat(1f, 2f); diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 6f123d21fe..589e6ebab6 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged { int terra = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 100, default, 2f); Main.dust[terra].velocity *= 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[terra].scale = 0.5f; Main.dust[terra].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraArrowSplit.cs b/Projectiles/Ranged/TerraArrowSplit.cs index 653381d853..060467f044 100644 --- a/Projectiles/Ranged/TerraArrowSplit.cs +++ b/Projectiles/Ranged/TerraArrowSplit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 2; i++) { int terraDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[terraDust].scale = 0.5f; Main.dust[terraDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs index 5dd563437f..cd8c65b926 100644 --- a/Projectiles/Ranged/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 107; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 3; num298++) { diff --git a/Projectiles/Ranged/ThePackMissile.cs b/Projectiles/Ranged/ThePackMissile.cs index 2b0ae32a08..70f84c2d0d 100644 --- a/Projectiles/Ranged/ThePackMissile.cs +++ b/Projectiles/Ranged/ThePackMissile.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 255, 0f, 0f, 0, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index a7a171ea4d..72e321a658 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < count; i++) { float angle = MathHelper.TwoPi * i / count; - angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); + angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool().ToDirectionInt(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), ModContent.ProjectileType(), Projectile.damage, 2.5f, Projectile.owner); } diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index 6d6ea64ed5..88d4867bf1 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged if (Time >= Ultima.FullChargeTime * 0.7f && Main.rand.NextBool(6)) { // To ensure that the sparks don't spawn on top of the laser itself. - float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool(2).ToDirectionInt(); + float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool().ToDirectionInt(); Vector2 sparkVelocity = Projectile.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY).RotatedByRandom(0.5f) * 13f; sparkVelocity = sparkVelocity.RotatedBy(offsetAngle); Projectile.NewProjectile(Projectile.GetSource_FromThis(), shotPosition, sparkVelocity, ModContent.ProjectileType(), damage / 3, knockBack, Projectile.owner); diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs index 3e1f679062..9971ef7004 100644 --- a/Projectiles/Ranged/UniversalGenesisStar.cs +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 16, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index dec8c6bebc..a326e21b0d 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int idx = Dust.NewDust(Projectile.position, 1, 1, 173, 0f, 0f, 0, default, 0.5f); Main.dust[idx].alpha = Projectile.alpha; diff --git a/Projectiles/Ranged/VeriumBulletProj.cs b/Projectiles/Ranged/VeriumBulletProj.cs index 100b2bf824..c88c124d7d 100644 --- a/Projectiles/Ranged/VeriumBulletProj.cs +++ b/Projectiles/Ranged/VeriumBulletProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int purple = Dust.NewDust(Projectile.position, 1, 1, 70, 0f, 0f, 0, default, 0.5f); Main.dust[purple].alpha = Projectile.alpha; diff --git a/Projectiles/Rogue/AntumbraShardProjectile.cs b/Projectiles/Rogue/AntumbraShardProjectile.cs index 33e4859a8c..ca9105c47e 100644 --- a/Projectiles/Rogue/AntumbraShardProjectile.cs +++ b/Projectiles/Rogue/AntumbraShardProjectile.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.damage /= 2; + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.damage < 1) { Projectile.damage = 1; diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index e9a8df3e96..20f7fcd4ba 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; using Terraria; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue { int boom = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 14, 0f, 0f, 100, default, 2f); Main.dust[boom].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boom].scale = 0.5f; Main.dust[boom].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs index 6c03431a3d..0a86d7795c 100644 --- a/Projectiles/Rogue/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 14, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BettyExplosion.cs b/Projectiles/Rogue/BettyExplosion.cs index 17b51eddb3..6f0ccdfe74 100644 --- a/Projectiles/Rogue/BettyExplosion.cs +++ b/Projectiles/Rogue/BettyExplosion.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue { int idx = Dust.NewDust(corner, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 2dc5990d2b..377d4ce7fe 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue } } - if (cannotLifesteal || Main.rand.NextBool(2)) //canGhostHeal be like lol + if (cannotLifesteal || Main.rand.NextBool()) //canGhostHeal be like lol return; Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Rogue/ButcherKnife.cs b/Projectiles/Rogue/ButcherKnife.cs index 0bc66569ee..0d8431d581 100644 --- a/Projectiles/Rogue/ButcherKnife.cs +++ b/Projectiles/Rogue/ButcherKnife.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 5, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index efe106f48e..9f96badba4 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, default, 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index 30f280a491..411b06d0be 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index eac8d72f3a..85f8d8bdaa 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DynamicPursuerProjectile.cs b/Projectiles/Rogue/DynamicPursuerProjectile.cs index 40ec986e73..8272ab76b5 100644 --- a/Projectiles/Rogue/DynamicPursuerProjectile.cs +++ b/Projectiles/Rogue/DynamicPursuerProjectile.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue if (potentialTarget != null) { Vector2 initialVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + blueGem, Projectile.SafeDirectionTo(potentialTarget.Center) * 3f, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, initialAngle, Main.rand.Next(100)); @@ -216,7 +216,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 220; i++) { - int type = Main.rand.NextBool(2) ? 261 : 107; + int type = Main.rand.NextBool() ? 261 : 107; Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type); dust.scale = Main.rand.NextFloat(1.6f, 2.2f); dust.velocity = Main.rand.NextVector2CircularEdge(75f, 75f); diff --git a/Projectiles/Rogue/EGloveSpark.cs b/Projectiles/Rogue/EGloveSpark.cs index 41205e477e..a34b4fe176 100644 --- a/Projectiles/Rogue/EGloveSpark.cs +++ b/Projectiles/Rogue/EGloveSpark.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Rogue/EclipseStealthBoom.png b/Projectiles/Rogue/EclipseStealthBoom.png index e8611cd39b..cdbfcfaa4f 100644 Binary files a/Projectiles/Rogue/EclipseStealthBoom.png and b/Projectiles/Rogue/EclipseStealthBoom.png differ diff --git a/Projectiles/Rogue/EclipsesSmol.png b/Projectiles/Rogue/EclipsesSmol.png index 854f31bb55..96e05053b1 100644 Binary files a/Projectiles/Rogue/EclipsesSmol.png and b/Projectiles/Rogue/EclipsesSmol.png differ diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index ae2d01d7b4..d6e77eb842 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs index 706544093d..5cd7371d12 100644 --- a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ExplosiveSun.cs b/Projectiles/Rogue/ExplosiveSun.cs index 427e5e673e..9782d9077c 100644 --- a/Projectiles/Rogue/ExplosiveSun.cs +++ b/Projectiles/Rogue/ExplosiveSun.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index c5d07ed181..6809d28912 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 10 == 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int spiritDamage = Projectile.damage / 2; Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index bbc8637dd2..08fe1454b4 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 4 == 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int spiritDamage = Projectile.damage / 2; Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 1cc2762da4..e33ccdde93 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -68,10 +68,10 @@ namespace CalamityMod.Projectiles.Rogue { Dust flame = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); flame.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) flame.scale = 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { flame.scale *= 0.5f; flame.fadeIn = Main.rand.NextFloat(1f, 2f); diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 3bb451b73d..338d6fecbc 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(Projectile.Center, 0.35f, 0f, 0.25f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust flame = Dust.NewDustDirect(Projectile.position, 1, 1, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 0.5f); flame.alpha = Projectile.alpha; diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 592d105bac..b0ed8687a2 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Projectile.Calamity().stealthStrike) Projectile.extraUpdates = 1; - if (Main.rand.NextBool(2) && !posthit) + if (Main.rand.NextBool() && !posthit) { Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 bloodSpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; Vector2 splatterDirection = (Projectile.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); - int sparkCount = Main.rand.Next(5); + int sparkCount = Main.rand.Next(4, 6); for (int i = 0; i < sparkCount; i++) { Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.5f) * Main.rand.NextFloat(5f, 9f); diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 5b327f881d..be57cb0c44 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Rogue ModContent.DustType(), ModContent.DustType() }); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); Main.dust[index].noGravity = true; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); Main.dust[index].noGravity = true; diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index 00b2204ef5..4c74b5db78 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MalachiteProj.cs b/Projectiles/Rogue/MalachiteProj.cs index a9f023f7b6..b59a60a770 100644 --- a/Projectiles/Rogue/MalachiteProj.cs +++ b/Projectiles/Rogue/MalachiteProj.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 4d7df94542..246121f0d8 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue { int dusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[dusty].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dusty].scale = 0.5f; Main.dust[dusty].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index 2b1f9ae01b..20a6eb530c 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity *= 1.25f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Rogue { int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[boomDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boomDust].scale = 0.5f; Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MeteorFistStealth.cs b/Projectiles/Rogue/MeteorFistStealth.cs index 2b84a03b68..b7da0abde4 100644 --- a/Projectiles/Rogue/MeteorFistStealth.cs +++ b/Projectiles/Rogue/MeteorFistStealth.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity *= 1.25f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue { int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[boomDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boomDust].scale = 0.5f; Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs index d545683fcb..1e9cccedac 100644 --- a/Projectiles/Rogue/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs index 4df2774bbe..35a9e6836a 100644 --- a/Projectiles/Rogue/NiceCock.cs +++ b/Projectiles/Rogue/NiceCock.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System.IO; using Terraria; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Rogue int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 267, 0f, 0f, 150, Main.rand.Next(colors), 2f); Main.dust[idx].velocity *= 3f; Main.dust[idx].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index d45b09ea78..faadd5b8ed 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/RealityRuptureLance.cs b/Projectiles/Rogue/RealityRuptureLance.cs index 524d425efb..4d3e0e5515 100644 --- a/Projectiles/Rogue/RealityRuptureLance.cs +++ b/Projectiles/Rogue/RealityRuptureLance.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue float radius = (20f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; Vector2 dustPosition = Projectile.Center; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; - Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 234 : 310); + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool() ? 234 : 310); dust.noGravity = true; dust.velocity = Projectile.velocity * 0.8f; dust.scale = Main.rand.NextFloat(1.1f, 1.7f); diff --git a/Projectiles/Rogue/RealityRuptureStealth.cs b/Projectiles/Rogue/RealityRuptureStealth.cs index d5c0e1887f..725f08fe11 100644 --- a/Projectiles/Rogue/RealityRuptureStealth.cs +++ b/Projectiles/Rogue/RealityRuptureStealth.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue { public class RealityRuptureStealth : ModProjectile, ILocalizedModType { - public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/RealityRuptureStealthHit") { Volume = 0.7f, PitchVariance = 0.3f}; + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/RealityRuptureStealthHit") { Volume = 1.2f, PitchVariance = 0.3f}; public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/RealityRupture"; public bool posthit = false; @@ -43,7 +43,11 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity *= 1.003f; Projectile.scale = 1.3f; - if (Main.rand.NextBool(2)) + Vector3 DustLight = new Vector3(0.209f, 0.140f, 0.202f); + Lighting.AddLight(Projectile.Center, DustLight * 8); + //Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.6f, 0.6f, 0.2f, 0.5f); + + if (Time % 2 == 0) { Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-2.5f, default) * 0.1f - Projectile.velocity / 2f; Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); @@ -51,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue GeneralParticleHandler.SpawnParticle(spark); } - if (Main.rand.NextBool(2)) + if (Time % 2 == 0) { Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(2.5f, default) * 0.1f - Projectile.velocity / 2f; Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); @@ -65,13 +69,17 @@ namespace CalamityMod.Projectiles.Rogue { SoundEngine.PlaySound(Hitsound, Projectile.position); posthit = true; - for (int i = 0; i < 7; i++) + for (int i = 0; i < 6; i++) { Vector2 vel = Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)); - float Scale = Main.rand.NextFloat(0.8f, 3.8f); - CrackParticle crack = new CrackParticle(Projectile.Center, vel, Color.Plum, new Vector2(1f, 1f), 0, Scale, Scale - 0.5f, Main.rand.Next(18, 23)); + float Scale = Main.rand.NextFloat(1.8f, 2.3f); + CrackParticle crack = new CrackParticle(Projectile.Center, vel, Color.Orchid, new Vector2(1f, 1f), 0, Scale, Scale - 0.5f, Main.rand.Next(18, 23)); GeneralParticleHandler.SpawnParticle(crack); } + Vector2 vel2 = Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(3f)); + float Scale2 = Main.rand.NextFloat(2.9f, 3.2f); + CrackParticle crack2 = new CrackParticle(Projectile.Center, vel2, Color.Plum, new Vector2(1f, 1f), 0, Scale2, Scale2 - 0.5f, Main.rand.Next(27, 32)); + GeneralParticleHandler.SpawnParticle(crack2); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 2, Projectile.owner, 0f); Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 8; } diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 6a69508887..28560e40b0 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -182,7 +182,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index ed4698b813..6342229e0a 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Main.dedServ) { - for (int i = 0; i < (Projectile.Calamity().stealthStrike && Main.rand.NextBool(2) ? 2 : 1); i++) + for (int i = 0; i < (Projectile.Calamity().stealthStrike && Main.rand.NextBool() ? 2 : 1); i++) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 130, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f); } diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index c1637e0468..42b66ca213 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 29ca0adbec..43f02517a0 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs index 0033d3317b..e0a45320eb 100644 --- a/Projectiles/Rogue/SpearofDestinyStealth.cs +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue float radius = (50f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; Vector2 dustPosition = Projectile.Center; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; - Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 279 : 159); + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool() ? 279 : 159); dust.noGravity = true; dust.velocity = Projectile.velocity * 0.5f; dust.scale = 1.3f; diff --git a/Projectiles/Rogue/Stormfrontspark.cs b/Projectiles/Rogue/Stormfrontspark.cs index 9318fffd30..054880e784 100644 --- a/Projectiles/Rogue/Stormfrontspark.cs +++ b/Projectiles/Rogue/Stormfrontspark.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y += 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 226, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 98779f7d7b..c97ea7d5eb 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { //dust and lighting - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Rogue } //dust effects - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue { int exo = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[exo].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[exo].scale = 0.5f; Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index d7e9c35c2c..ff3587775b 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { int num154 = 14; - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs index 8f358802ac..8032165b84 100644 --- a/Projectiles/Rogue/SupernovaSpike.cs +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.alpha = 0; } - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = Projectile.height = 32; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num298, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index eeee92356c..da274b40d5 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.myPlayer != Projectile.owner) return; - Vector2 spawnPosition = target.Center + Vector2.UnitY * Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(200f, 270f); + Vector2 spawnPosition = target.Center + Vector2.UnitY * Main.rand.NextBool().ToDirectionInt() * Main.rand.NextFloat(200f, 270f); spawnPosition.X += Main.rand.NextFloatDirection() * target.width * 0.45f; int damage = (int)(Projectile.damage * StealthSplitMultiplier); Vector2 shootVelocity = Vector2.UnitY * (target.Center.Y - spawnPosition.Y > 0f).ToDirectionInt() * Main.rand.NextFloat(14f, 16.5f); diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index e669301cd8..b24787b4ab 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < icicleAmt; i++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); } } } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index a17e413cf7..049c3c8573 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue { int water = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[water].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[water].scale = 0.5f; Main.dust[water].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 62b69e7d8f..86394c3e44 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Item.NewItem(Projectile.GetSource_DropAsItem(), (int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ModContent.ItemType()); } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index 3af410475b..a2a877dff9 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Summon private void OnHitEffects(Vector2 targetPos) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int projAmt = Main.rand.Next(1, 3); var source = Projectile.GetSource_FromThis(); diff --git a/Projectiles/Summon/BloodBreath.cs b/Projectiles/Summon/BloodBreath.cs index 41a5284cc0..ca1626dfeb 100644 --- a/Projectiles/Summon/BloodBreath.cs +++ b/Projectiles/Summon/BloodBreath.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon break; } Time++; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 5, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100); if (Main.rand.NextBool(3)) diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 2fe9807ca2..f9353b9175 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.Brimstone; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int brim = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[brim]; diff --git a/Projectiles/Summon/CosmicViperConcussionMissile.cs b/Projectiles/Summon/CosmicViperConcussionMissile.cs index be32dd0567..15f9f9c8e1 100644 --- a/Projectiles/Summon/CosmicViperConcussionMissile.cs +++ b/Projectiles/Summon/CosmicViperConcussionMissile.cs @@ -69,11 +69,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index c85f623980..381f6414f3 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -130,11 +130,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index de2247851f..5d7b20315b 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -176,11 +176,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs index 93ff28dd5d..91197b07e5 100644 --- a/Projectiles/Summon/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index df9fe99783..7b663641c3 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.myPlayer == Projectile.owner) { Vector2 initialVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), ArmPosition, initialVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, initialAngle, Main.rand.Next(100)); diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 5e33acbb23..9c14ce6548 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index c98aff69fa..784d0ece09 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon //dust if (Main.rand.NextBool(15)) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.localAI[0] += 1f; for (int i = 0; i < 60; i++) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 32c671a700..a0de92e05e 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Summon { for (int i = 0; i < 50; i++) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index bcde995cd2..7575ad1540 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -40,12 +40,12 @@ namespace CalamityMod.Projectiles.Summon float speedY = 1f; if (!speedXChoice) { - speedX = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedX = Main.rand.NextBool() ? 1.03f : 0.97f; speedXChoice = true; } if (!speedYChoice) { - speedY = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedY = Main.rand.NextBool() ? 1.03f : 0.97f; speedYChoice = true; } Projectile.velocity.X *= speedX; @@ -66,12 +66,12 @@ namespace CalamityMod.Projectiles.Summon num296 = 0.75f; } Projectile.ai[0] += 1f; - int num297 = Main.rand.NextBool(2) ? 68 : 67; + int num297 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { num297 = 80; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 0.8f); diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index f146bb983e..72a2ba68c9 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = Owner.Top - Vector2.UnitY * 45f + (Projectile.identity * 0.9f).ToRotationVector2() * 16f; Vector2 idealVelocity = Projectile.SafeDirectionTo(destination) * MathHelper.Lerp(2.3f, 8f, Utils.GetLerpValue(16f, 160f, Projectile.Distance(destination))); if (Projectile.velocity.Length() < 0.4f) - Projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool(2).ToDirectionInt()) * -3.6f; + Projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool().ToDirectionInt()) * -3.6f; else if (!Projectile.WithinRange(destination, 20f)) Projectile.velocity = Projectile.velocity * 0.9f + idealVelocity * 0.1f; diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 79e7aa366e..60d4f78487 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index 08393bb504..4a1f47f005 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index 7d753d7acc..5bd1922125 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index 6364d47e79..9eb4d9e887 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/HallowedStarSummon.cs b/Projectiles/Summon/HallowedStarSummon.cs index 73367adf00..fc11ae98db 100644 --- a/Projectiles/Summon/HallowedStarSummon.cs +++ b/Projectiles/Summon/HallowedStarSummon.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 16, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index 44efc43732..fbf65002d8 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item45, Projectile.position); int blue = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 59, 0f, 0f, 100, default, 1f); Main.dust[blue].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[blue].scale = 0.5f; Main.dust[blue].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index ec6f630692..41e40b0fcb 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon for (int j = 0; j < 40; j++) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Projectiles/Summon/IrradiatedAura.cs b/Projectiles/Summon/IrradiatedAura.cs index 50dcb40466..1fce516a5f 100644 --- a/Projectiles/Summon/IrradiatedAura.cs +++ b/Projectiles/Summon/IrradiatedAura.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon { randomDust = 33; } - for (int num468 = 0; num468 < (Main.rand.NextBool(2) ? 1 : 2); num468++) + for (int num468 = 0; num468 < (Main.rand.NextBool() ? 1 : 2); num468++) { int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f); if (randomDust == 89) diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index 55d6850511..a2955632be 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index e45415ea5a..0dff71e507 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.localAI[0] == 0f) { - Projectile.velocity.Y = Main.rand.NextFloat(8f, 11f) * Main.rand.NextBool(2).ToDirectionInt(); - Projectile.velocity.Y = Main.rand.NextFloat(3f, 5f) * Main.rand.NextBool(2).ToDirectionInt(); + Projectile.velocity.Y = Main.rand.NextFloat(8f, 11f) * Main.rand.NextBool().ToDirectionInt(); + Projectile.velocity.Y = Main.rand.NextFloat(3f, 5f) * Main.rand.NextBool().ToDirectionInt(); // This AI variable doubles as the random frame on which this UFO chooses to shoot its machine gun. Projectile.localAI[0] = Main.rand.Next(1, (int)MidnightSunBeacon.MachineGunRate); diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 6d923ced5f..577f6388f1 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -3,7 +3,6 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.NPCs.Providence; -using Humanizer; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -363,6 +362,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.localNPCHitCooldown = (SpawnedFromPSC ? 6 : 9); var currentAIState = getAiState; + + if (owner.Calamity().profanedCrystalAnim != -1) + currentAIState = MiniOffenseAIState.Vanity; var newAIState = updateAiState(owner, currentAIState); @@ -374,7 +376,7 @@ namespace CalamityMod.Projectiles.Summon // Find minion and charge if possible, make sure vanity minions are not chasing NPC potentialTarget = Projectile.Center.MinionHoming(3000f, owner); - switch (getAiState) + switch (currentAIState) { case MiniOffenseAIState.Vanity: case MiniOffenseAIState.Psa: diff --git a/Projectiles/Summon/MiniGuardianStars.cs b/Projectiles/Summon/MiniGuardianStars.cs index 9cf713480b..c912dc60e9 100644 --- a/Projectiles/Summon/MiniGuardianStars.cs +++ b/Projectiles/Summon/MiniGuardianStars.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[holy].velocity *= 3f; Main.dust[holy].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/PhantomicDagger.cs b/Projectiles/Summon/PhantomicDagger.cs index f77618ca96..b82c4fbe46 100644 --- a/Projectiles/Summon/PhantomicDagger.cs +++ b/Projectiles/Summon/PhantomicDagger.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/PhantomicShield.cs b/Projectiles/Summon/PhantomicShield.cs index 0606dc902a..9d40625051 100644 --- a/Projectiles/Summon/PhantomicShield.cs +++ b/Projectiles/Summon/PhantomicShield.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index 6ccb3f30e6..80e1acf742 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -323,7 +323,7 @@ namespace CalamityMod.Projectiles.Summon int smallBee = ModContent.ProjectileType(); int bigBee = ModContent.ProjectileType(); int projType = smallBee; - if (Owner.ownedProjectileCounts[bigBee] <= 0 && Main.rand.NextBool(2)) + if (Owner.ownedProjectileCounts[bigBee] <= 0 && Main.rand.NextBool()) projType = bigBee; if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, target.Center, 0, 0)) diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 69daafa3f1..db1042ee93 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon int holy = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].position = Projectile.Center; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 6ea949a880..f518c37b33 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -5,15 +5,16 @@ using System; using System.Collections.Generic; using System.IO; using CalamityMod.Buffs.Summon.Whips; -using CalamityMod.Items.Accessories; using static CalamityMod.Items.Accessories.ProfanedSoulCrystal; using CalamityMod.NPCs.Providence; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent; +using Vector2 = Microsoft.Xna.Framework.Vector2; namespace CalamityMod.Projectiles.Summon { @@ -389,7 +390,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -517,7 +518,7 @@ namespace CalamityMod.Projectiles.Summon { SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - if (Main.rand.NextBool(2) || Main.rand.NextBool(3)) //so it's not exactly 1 in 2, but it's not more or less consistently either. + if (Main.rand.NextBool() || Main.rand.NextBool(3)) //so it's not exactly 1 in 2, but it's not more or less consistently either. { Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); @@ -530,7 +531,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -794,7 +795,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -919,7 +920,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -1421,6 +1422,230 @@ namespace CalamityMod.Projectiles.Summon } } + #endregion + + #region Animation Projectiles + + public class PscTransformAnimation : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.NoLiquidDistortion[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 26; + Projectile.height = 26; + Projectile.ignoreWater = true; + Projectile.aiStyle = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = maxPscAnimTime; + Projectile.alpha = 255; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); + + var owner = Main.player[Projectile.owner]; + owner.Calamity().profanedCrystalAnim = Projectile.timeLeft; + + Projectile.Center = owner.Center; + + if (!owner.Calamity().profanedCrystal) + { + + owner.Calamity().profanedCrystalAnim = -1; + Projectile.active = false; + return; + } + + if (Projectile.timeLeft > 1) + { + int dustCount = (int)Math.Round(MathHelper.SmoothStep(1f, 3f, ((float)maxPscAnimTime - (float)owner.Calamity().profanedCrystalAnim) / (float)maxPscAnimTime)); + float outwardness = MathHelper.SmoothStep(40f, 75f, ((float)maxPscAnimTime - (float)owner.Calamity().profanedCrystalAnim) / (float)maxPscAnimTime); + float dustScale = MathHelper.Lerp(0.45f, 1f, ((float)maxPscAnimTime - (float)owner.Calamity().profanedCrystalAnim) / (float)maxPscAnimTime); + int[] validRockTypes = new int[] { 1, 3, 4, 5, 6 }; + int projectileCount = owner.ownedProjectileCounts[ModContent.ProjectileType()]; + bool shouldStickAround = projectileCount <= 20; + for (int i = 0; i < dustCount; i++) + { + Vector2 spawnPosition = Projectile.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f); + Vector2 dustVelocity = (Projectile.Center - spawnPosition) * 0.085f + owner.velocity; + + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + + Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState)); + dust.velocity = dustVelocity; + dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f); + dust.noGravity = true; + dust.noLight = true; + + if (Projectile.timeLeft % 3 == 0) + { + if (!Main.dedServ) + { + var startVec = Main.rand.NextVector2CircularEdge(250f, 250f); + var finalDist = Main.rand.NextFloat(50f, 50f); + var startColor = Main.dayTime ? Color.Orange : Color.Aquamarine; + Particle wtfIsAParticle = new ManaDrainStreak(owner, Main.rand.NextFloat(0.3f, 0.6f), startVec, finalDist, startColor, startColor * 1.5f, Main.rand.Next(20, 31), owner.Center); + GeneralParticleHandler.SpawnParticle(wtfIsAParticle); + } + + if (owner.whoAmI == Main.myPlayer) + { + spawnPosition = owner.Center; + spawnPosition.X += Main.rand.NextFloat(-500f, 500f); + spawnPosition.Y += Main.rand.NextFloat(-500f, 500f); + dustVelocity = (Projectile.Center - spawnPosition) * 0.085f + owner.velocity; + dustVelocity.Normalize(); + dustVelocity *= 16f; + int rockType = validRockTypes[Main.rand.Next(0, validRockTypes.Length)]; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, dustVelocity, ModContent.ProjectileType(), 0, 0f, Projectile.owner, shouldStickAround ? 1f : 0f, rockType); + } + } + } + } + else + { + owner.Calamity().profanedCrystalAnim = -1; + owner.Calamity().GeneralScreenShakePower = 5f; + DetermineTransformationEligibility(owner); + if (!Main.dedServ) + { + var color = GetColorForPsc(owner.Calamity().pscState, Main.dayTime) with {A = 255}; //WHY THE FUCK IS THE ALPHA INVERTED FOR THIS + Particle wtfIsAParticle = new DirectionalPulseRing(owner.Center, Vector2.Zero, color, Vector2.One, 0f, 0f, 2.5f, 75); + GeneralParticleHandler.SpawnParticle(wtfIsAParticle); + } + Kill(1); + } + } + + public override bool? CanDamage() => false; + + + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(Providence.SpawnSound, Projectile.position); + var Owner = Main.player[Projectile.owner]; + for (int i = 0; i < 20; i++) + { + Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10)); + Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero); + velocity *= Main.dayTime ? 3f : 6.9f; + var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f); + if (!Main.dayTime) + dust.noGravity = true; + } + + Projectile.active = false; + } + } + + public class PscTransformRocks : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/Typeless/ArtifactOfResilienceShard1"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.NoLiquidDistortion[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 26; + Projectile.height = 26; + Projectile.ignoreWater = true; + Projectile.aiStyle = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = maxPscAnimTime; + Projectile.alpha = 0; + Projectile.hide = true; + Projectile.scale = 0.1f; + } + + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + //Ah yes, overriding drawbehind, to draw in front of the player, flawless logic + overPlayers.Add(index); + } + + public override void AI() + { + var owner = Main.player[Projectile.owner]; + + if (!owner.Calamity().profanedCrystal) + { + Projectile.active = false; + return; + } + //scale up the proj + if (Projectile.scale < 1.25f) + Projectile.scale += 0.1f; + + //if it's not allowed to stick around, fade into oblivion + if ((Projectile.velocity.Length() <= 3f && Projectile.ai[0] == 0f) || Projectile.timeLeft <= 25) + Projectile.alpha += Projectile.ai[0] == 0f ? 20 : 10; + + //if the anim has finished, fade, regardless of where the projectile is + if (owner.Calamity().profanedCrystalAnim == -1) + Projectile.alpha += 15; + + //kill any projectiles that are fully faded + if (Projectile.alpha >= 255) + Projectile.active = false; + + //slow down upon reaching the player + if (Projectile.Hitbox.Intersects(owner.Hitbox)) + Projectile.velocity *= 0.1f; + else + { + var target = owner.Center - Projectile.Center; + target.Normalize(); + Projectile.velocity = target * 18f; + } + + } + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + int rockType = (int)MathHelper.Clamp(Projectile.ai[1], 1f, 6f); + Texture2D texture = ModContent.Request(Texture[..^1] + rockType.ToString()).Value; + + Vector2 drawOrigin = new Vector2(texture.Width / 2, texture.Height / 2); + Vector2 drawPos = Projectile.Center - Main.screenPosition; + drawPos -= new Vector2(texture.Width, texture.Height) * Projectile.scale / 2f; + drawPos += drawOrigin * Projectile.scale + new Vector2(0f, Projectile.gfxOffY); + Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height); + if (CalamityConfig.Instance.Afterimages) //handle afterimages manually since the utility broke it and didn't render correctly + { + for (int i = 0; i < Projectile.oldPos.Length; ++i) + { + drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES. + Color color = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); + Main.EntitySpriteDraw(texture, drawPos, frame, color, Projectile.rotation, drawOrigin, Projectile.scale, SpriteEffects.None, 0f); + } + } + else + { + Main.EntitySpriteDraw(texture, drawPos, frame, Color.White, Projectile.rotation, drawOrigin, Projectile.scale, SpriteEffects.None, 0f); + } + return false; + } + } + + #endregion #region Bab Projectiles @@ -1579,7 +1804,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = shouldAdjust ? 0.9f : 1f + (float)Main.rand.Next(10) * 0.1f; @@ -1854,7 +2079,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 95f996bbaa..586b58d78b 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item25, Projectile.position); int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index f462dff372..2c96352000 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 spawnOffset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(4f, 36f); Dust slime = Dust.NewDustPerfect(Projectile.Center + spawnOffset, 243); - slime.velocity = spawnOffset.RotatedBy(MathHelper.PiOver2 * Main.rand.NextBool(2).ToDirectionInt()) * 0.16f; + slime.velocity = spawnOffset.RotatedBy(MathHelper.PiOver2 * Main.rand.NextBool().ToDirectionInt()) * 0.16f; slime.scale = 1.2f; } } diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs index 432752186c..4e07ee7667 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Vector2 dustVel = shootDirection * dustSpeed; dustVel = dustVel.RotatedBy(-0.35f); dustVel = dustVel.RotatedByRandom(2.0f * 0.35f); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; Dust plasma = Dust.NewDustDirect(Projectile.TopLeft, Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); plasma.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 4f; @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Vector2 dustVel = shootDirection * dustSpeed; dustVel = dustVel.RotatedBy(-0.35f); dustVel = dustVel.RotatedByRandom(2.0f * 0.35f); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; Dust plasma = Dust.NewDustDirect(Projectile.TopLeft, Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); plasma.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(shootDirection.ToRotation()) * Projectile.width / 5f; diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index 2452049f2e..aa7275298c 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 4f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/VoidConcentrationOrb.cs b/Projectiles/Summon/VoidConcentrationOrb.cs index a2d8127062..c7491c846d 100644 --- a/Projectiles/Summon/VoidConcentrationOrb.cs +++ b/Projectiles/Summon/VoidConcentrationOrb.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs index be0189e31b..f9e013fb91 100644 --- a/Projectiles/Summon/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/AeroExplosive.cs b/Projectiles/Typeless/AeroExplosive.cs index a16b09d234..a0adffaebd 100644 --- a/Projectiles/Typeless/AeroExplosive.cs +++ b/Projectiles/Typeless/AeroExplosive.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Typeless { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 345456431a..abf56a2509 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Typeless { int starryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.2f); Main.dust[starryDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[starryDust].scale = 0.5f; Main.dust[starryDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/BlazingStarHeal.cs b/Projectiles/Typeless/BlazingStarHeal.cs index e094391bac..f249d0465e 100644 --- a/Projectiles/Typeless/BlazingStarHeal.cs +++ b/Projectiles/Typeless/BlazingStarHeal.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Typeless int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs index 23e0021a37..998a68dc9f 100644 --- a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs +++ b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Typeless int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/ChaoticGeyser.cs b/Projectiles/Typeless/ChaoticGeyser.cs index a30b15ad15..dad02e60d5 100644 --- a/Projectiles/Typeless/ChaoticGeyser.cs +++ b/Projectiles/Typeless/ChaoticGeyser.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 16f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index d496d7dec9..73b1ec37f6 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index 7b3c80544e..3dfcd49d41 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index 2946bbda23..579cb71456 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 199, 0f, 0f, 100, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs index 38c811ba78..d73aa76a73 100644 --- a/Projectiles/Typeless/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ai[0] += 4f; int num462 = 0; float scale = 0.7f; - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); if (Projectile.ai[1] == 0f) { scale = 1.5f; diff --git a/Projectiles/Typeless/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs index 51258111f5..839ded82f7 100644 --- a/Projectiles/Typeless/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/GoldenGunProj.cs b/Projectiles/Typeless/GoldenGunProj.cs index 24ded7aafd..07b10f848f 100644 --- a/Projectiles/Typeless/GoldenGunProj.cs +++ b/Projectiles/Typeless/GoldenGunProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,15 +39,15 @@ namespace CalamityMod.Projectiles.Typeless int num590 = 6; int num591 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num590, Projectile.position.Y + (float)num590), Projectile.width - num590 * 2, Projectile.height - num590 * 2, 170, 0f, 0f, 75, default, 1.2f); Dust dust = Main.dust[num591]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } @@ -80,19 +80,19 @@ namespace CalamityMod.Projectiles.Typeless { int num363 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 170, 0f, 0f, 75, default, 1.2f); Dust dust = Main.dust[num363]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale = 0.6f; } diff --git a/Projectiles/Typeless/HolyExplosion.cs b/Projectiles/Typeless/HolyExplosion.cs index 7392f0cbab..f4923d0adf 100644 --- a/Projectiles/Typeless/HolyExplosion.cs +++ b/Projectiles/Typeless/HolyExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs index 3469e7c19c..7631e2be14 100644 --- a/Projectiles/Typeless/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num622].velocity *= 3f; if (Projectile.ai[0] == 1) Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Typeless int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, Main.rand.NextFloat(1.2f, 1.8f)); Main.dust[num622].velocity *= 3f; Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs index 09251fdd67..38f0457374 100644 --- a/Projectiles/Typeless/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 55aaf897a8..ee5c35f589 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Typeless int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 234, 0f, 0f, 155, default, 0.8f); Main.dust[idx].velocity *= 0.3f; Main.dust[idx].position = Projectile.Center + offset * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = 1.4f; } @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[idx].velocity *= 0.3f; Main.dust[idx].noGravity = true; Main.dust[idx].position = Projectile.Center + offset * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/PauldronDash.cs b/Projectiles/Typeless/PauldronDash.cs index 96f5fe4b58..6ea9a1883e 100644 --- a/Projectiles/Typeless/PauldronDash.cs +++ b/Projectiles/Typeless/PauldronDash.cs @@ -39,12 +39,12 @@ namespace CalamityMod.Projectiles.Typeless for (int i = 0; i <= 8; i++) { - Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); dust.noGravity = false; } for (int i = 0; i <= 5; i++) { - Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); dust2.noGravity = false; } diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index 44fc8e37e4..1db8174d7f 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Typeless public static void FallingSandAI(this Projectile proj, int DustID, bool fired = true) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int i = Dust.NewDust(proj.position, proj.width, proj.height, DustID); Main.dust[i].velocity.X *= 0.4f; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 34efd37972..41fedf1e0e 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index cfadc95d13..6774138de3 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index 24f9350a7e..2e139843ca 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/WulfrumLureSignal.cs b/Projectiles/Typeless/WulfrumLureSignal.cs index 10f8b63c78..9616dbe7cb 100644 --- a/Projectiles/Typeless/WulfrumLureSignal.cs +++ b/Projectiles/Typeless/WulfrumLureSignal.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Typeless if (tries < 500) { - int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType() : Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType() ; + int npcToSpawn = Main.rand.NextBool() ? ModContent.NPCType() : Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType() ; int index = NPC.NewNPC(Projectile.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn, Target:player.whoAmI); for (int iy = 0; iy < 16; iy++) diff --git a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs index d1b309b92e..bbb693d06f 100644 --- a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Microsoft.Xna.Framework; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides projectile.velocity += new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); // Flavor fire dust effect. - int dustEffect = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, Main.rand.NextBool(2) ? 1f : -1f, Main.rand.NextBool(2) ? 1f : -1f); + int dustEffect = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, Main.rand.NextBool() ? 1f : -1f, Main.rand.NextBool() ? 1f : -1f); Main.dust[dustEffect].noGravity = true; return false; @@ -125,4 +125,4 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides #endregion } -} \ No newline at end of file +} diff --git a/Sounds/CommonCalamitySounds.cs b/Sounds/CommonCalamitySounds.cs index c82c20afea..d00d8db8a9 100644 --- a/Sounds/CommonCalamitySounds.cs +++ b/Sounds/CommonCalamitySounds.cs @@ -6,6 +6,8 @@ namespace CalamityMod.Sounds { public static readonly SoundStyle ExoHitSound = new("CalamityMod/Sounds/NPCHit/ExoHit", 4) { Volume = 0.4f }; + public static readonly SoundStyle ExoDeathSound = new("CalamityMod/Sounds/NPCKilled/ExoDeath") { MaxInstances = 1 }; + public static readonly SoundStyle OtherwordlyHitSound = new("CalamityMod/Sounds/NPCHit/OtherworldlyHit"); public static readonly SoundStyle AstralNPCHitSound = new("CalamityMod/Sounds/NPCHit/AstralEnemyHit", 3); diff --git a/Sounds/NPCKilled/ExoDeath.ogg b/Sounds/NPCKilled/ExoDeath.ogg new file mode 100644 index 0000000000..2fcf5c3b5e Binary files /dev/null and b/Sounds/NPCKilled/ExoDeath.ogg differ diff --git a/Tiles/Abyss/AbyssalPots.cs b/Tiles/Abyss/AbyssalPots.cs index 1e83f195c9..15ad3b67e2 100644 --- a/Tiles/Abyss/AbyssalPots.cs +++ b/Tiles/Abyss/AbyssalPots.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = 29; else type = 186; diff --git a/Tiles/Abyss/SulphurousCrateTile.cs b/Tiles/Abyss/SulphurousCrateTile.cs index 5975fdc8d3..bd4281ff65 100644 --- a/Tiles/Abyss/SulphurousCrateTile.cs +++ b/Tiles/Abyss/SulphurousCrateTile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = 44; else type = 33; diff --git a/Tiles/Astral/AstralCrateTile.cs b/Tiles/Astral/AstralCrateTile.cs index d4ce1fdae0..9de21644ba 100644 --- a/Tiles/Astral/AstralCrateTile.cs +++ b/Tiles/Astral/AstralCrateTile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Astral public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { type = ModContent.DustType(); } diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index e4cf50203c..a87c5751d0 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Tiles.Crags.Tree //chance to place a branch segment //also dont place branches below a certain threshold - if (Main.rand.NextBool(2) && branchSegmentDelay == 0 && k > 5) + if (Main.rand.NextBool() && branchSegmentDelay == 0 && k > 5) { if (k > 1 && k < 10) { diff --git a/Tiles/Furniture/TwinklerInABottleTile.cs b/Tiles/Furniture/TwinklerInABottleTile.cs index 4d01cc07ec..8a3a69b9c3 100644 --- a/Tiles/Furniture/TwinklerInABottleTile.cs +++ b/Tiles/Furniture/TwinklerInABottleTile.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Tiles.Furniture AdjTiles = new int[] { TileID.HangingLanterns, TileID.FireflyinaBottle, TileID.LightningBuginaBottle }; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 15; diff --git a/Tiles/FurnitureAbyss/AbyssLantern.cs b/Tiles/FurnitureAbyss/AbyssLantern.cs index edaac80a69..458ecc4871 100644 --- a/Tiles/FurnitureAbyss/AbyssLantern.cs +++ b/Tiles/FurnitureAbyss/AbyssLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss public class AbyssLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs index 38fbf7ec9b..0407e43ba6 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood public class AcidwoodLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index ddcddd6fb5..10eb94c4b3 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public class AncientLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index 3a0a81eb60..4c31af5d37 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public class AshenLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureBotanic/BotanicLantern.cs b/Tiles/FurnitureBotanic/BotanicLantern.cs index 67cd6358b2..c1de59b565 100644 --- a/Tiles/FurnitureBotanic/BotanicLantern.cs +++ b/Tiles/FurnitureBotanic/BotanicLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic public class BotanicLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs index 206bc2d0f7..8bb0c90656 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public class CosmiliteLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureEutrophic/EutrophicLantern.cs index 35ba95d681..6d7f2f9066 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public class EutrophicLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureExo/ExoLanternTile.cs b/Tiles/FurnitureExo/ExoLanternTile.cs index a5ffadf6c6..5820a74ed2 100644 --- a/Tiles/FurnitureExo/ExoLanternTile.cs +++ b/Tiles/FurnitureExo/ExoLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureExo public class ExoLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CanExplode(int i, int j) => false; diff --git a/Tiles/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index 245a0e748c..4b4e8d8d3f 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith public class MonolithLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs index 7a37da00d4..4e2caa8128 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly public class OtherworldlyLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs index 891ad168a6..54498835cc 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate public class PlaguedPlateLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 5ec2866a13..93797dadf5 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public class ProfanedLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs index b7feb61a0a..a32d2cec6b 100644 --- a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs +++ b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs @@ -20,17 +20,23 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious Main.tileLavaDeath[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.AnchorBottom = default(AnchorData); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.PlanterBox, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(Type); DustType = -1; TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); } } diff --git a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs index 1d013a5e6e..e07e0f5435 100644 --- a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs +++ b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs @@ -19,18 +19,24 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); TileObjectData.newTile.AnchorBottom = default(AnchorData); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.PlanterBox, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(Type); DustType = -1; TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); } } diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs index f4eb51dc06..1a5883322d 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious public class SacrilegiousLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureSilva/SilvaLantern.cs b/Tiles/FurnitureSilva/SilvaLantern.cs index 6a9c8c9082..fbc4f618b7 100644 --- a/Tiles/FurnitureSilva/SilvaLantern.cs +++ b/Tiles/FurnitureSilva/SilvaLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva public class SilvaLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index a8103457db..b8a00bd068 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel public class StatigelLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureStratus/StratusLantern.cs b/Tiles/FurnitureStratus/StratusLantern.cs index 446fbf300b..7f217506b3 100644 --- a/Tiles/FurnitureStratus/StratusLantern.cs +++ b/Tiles/FurnitureStratus/StratusLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus public class StratusLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureVoid/VoidLantern.cs b/Tiles/FurnitureVoid/VoidLantern.cs index ce0854ffc7..75f0dd3f61 100644 --- a/Tiles/FurnitureVoid/VoidLantern.cs +++ b/Tiles/FurnitureVoid/VoidLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid public class VoidLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureWulfrum/WulfrumLantern.cs b/Tiles/FurnitureWulfrum/WulfrumLantern.cs index 8491f92610..7519473955 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLantern.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLantern.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Tiles.FurnitureWulfrum AdjTiles = new int[] { TileID.HangingLanterns }; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); + public override bool CanExplode(int i, int j) => false; public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index d08e438078..661874ac55 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -62,17 +62,7 @@ namespace CalamityMod.Tiles } } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - Tile tile = Main.tile[i, j]; - TileObjectData data = TileObjectData.GetTileData(tile); - int topLeftX = i - tile.TileFrameX / 18 % data.Width; - int topLeftY = j - tile.TileFrameY / 18 % data.Height; - if (WorldGen.IsBelowANonHammeredPlatform(topLeftX, topLeftY)) - { - offsetY -= 8; - } - } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public static int GetBannerNPC(int style) { diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index d7cc036196..911be960cd 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -1251,6 +1251,11 @@ namespace CalamityMod TileObjectData.newTile.LavaDeath = !lavaImmune; TileObjectData.newTile.LavaPlacement = lavaImmune ? LiquidPlacement.Allowed : LiquidPlacement.NotAllowed; TileObjectData.newTile.StyleLineSkip = 2; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(mt.Type); // All hanging lanterns count as light sources. @@ -1261,6 +1266,19 @@ namespace CalamityMod mt.AdjTiles = new int[] { TileID.HangingLanterns }; } + // Allow hanging lanterns to move up when hung on platforms + internal static void PlatformHangOffset(int i, int j, ref int offsetY) + { + Tile tile = Main.tile[i, j]; + TileObjectData data = TileObjectData.GetTileData(tile); + int topLeftX = i - tile.TileFrameX / 18 % data.Width; + int topLeftY = j - tile.TileFrameY / 18 % data.Height; + if (WorldGen.IsBelowANonHammeredPlatform(topLeftX, topLeftY)) + { + offsetY -= 8; + } + } + /// /// Extension which initializes a ModTile to be a piano. /// diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 3bfa92bb67..6a294a5d54 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -225,7 +225,7 @@ namespace CalamityMod Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num3 += 0.05f; } diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index c3750f6de6..3d1f740579 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -391,7 +391,7 @@ namespace CalamityMod { target.AddBuff(buff, SecondsToFrames(timeBase * 3f), false); } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { target.AddBuff(buff, SecondsToFrames(timeBase * 2f), false); } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 926bee0dd5..ff3ca686ae 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -715,7 +715,7 @@ namespace CalamityMod { int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Utilities/WorldgenUtils.cs b/Utilities/WorldgenUtils.cs index 17e38c44b7..ae909a55d1 100644 --- a/Utilities/WorldgenUtils.cs +++ b/Utilities/WorldgenUtils.cs @@ -5,6 +5,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.ModLoader; +using Terraria.WorldBuilding; namespace CalamityMod { @@ -142,6 +144,19 @@ namespace CalamityMod return new Rectangle(cornerX, cornerY, width, height); } + + public static void AddProtectedStructure(Rectangle area, int padding = 0) + { + // Always add to the vanilla protected structures list. + GenVars.structures.AddProtectedStructure(area, padding); + + Rectangle paddedArea = new Rectangle(area.X, area.Y, area.Width, area.Height); + paddedArea.Inflate(padding, padding); + + // If Fargo's Mutant Mod is loaded, add to their Indestructible Rectangle list, which prevents structures from being trashed by Fargo's terrain tools. + Mod fargos = CalamityMod.Instance.fargos; + fargos?.Call("AddIndestructibleRectangle", paddedArea); + } } //tile runner, useful for caves and other stuff diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index fc2962c69c..52f5026c70 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -128,7 +128,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillWorkshopChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); break; } @@ -207,7 +207,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); break; } } @@ -284,7 +284,7 @@ namespace CalamityMod.World { bool hasPlacedMurasama = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedMurasama, new Action(FillHellLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); CalamityWorld.HellLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } @@ -371,7 +371,7 @@ namespace CalamityMod.World { bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); //Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; @@ -461,7 +461,7 @@ namespace CalamityMod.World { bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillIceLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); CalamityWorld.IceLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } @@ -549,7 +549,7 @@ namespace CalamityMod.World { bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillPlagueLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); CalamityWorld.JungleLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } @@ -681,7 +681,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillCavernLaboratoryChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); CalamityWorld.CavernLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } diff --git a/World/GiantHive.cs b/World/GiantHive.cs index 34798264e8..5584bbf17a 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -258,7 +258,7 @@ namespace CalamityMod.World } } - structures.AddProtectedStructure(new Rectangle(origin.X - 50, origin.Y - 50, 100, 100), 5); + CalamityUtils.AddProtectedStructure(new Rectangle(origin.X - 50, origin.Y - 50, 100, 100), 5); return true; } diff --git a/World/MechanicShed.cs b/World/MechanicShed.cs index 79769a48d3..c94c2e9f7d 100644 --- a/World/MechanicShed.cs +++ b/World/MechanicShed.cs @@ -44,7 +44,7 @@ namespace CalamityMod.World PlaceSchematic(mapKey, placementPoint, anchorType, ref place, new Action(FillMechanicChest)); Rectangle protectionArea = CalamityUtils.GetSchematicProtectionArea(schematic, placementPoint, anchorType); - structures.AddProtectedStructure(protectionArea, 30); + CalamityUtils.AddProtectedStructure(protectionArea, 30); } public static void FillMechanicChest(Chest chest, int Type, bool place) diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index f9a33db447..dd1b3ed3d9 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -131,7 +131,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillCorruptionShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X * 2, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X * 2, (int)schematicSize.Y), 4); break; } //FUCK YOU FUCK YOU FUCK YOU @@ -224,7 +224,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillCrimsonShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } //FUCK YOU TOO @@ -305,7 +305,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillDesertShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } @@ -328,7 +328,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), - new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Granite, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), + new ChestItem((Main.rand.NextBool() && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Granite, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++) @@ -376,7 +376,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillGraniteShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } @@ -410,7 +410,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.Eggnog, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(200, 349 + 1)), - new ChestItem(Main.rand.NextBool(2) ? ItemID.GasTrap : ItemID.Marshmallow, 1) + new ChestItem(Main.rand.NextBool() ? ItemID.GasTrap : ItemID.Marshmallow, 1) }; } @@ -459,7 +459,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillIceShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } @@ -481,7 +481,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), - new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Marble, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), + new ChestItem((Main.rand.NextBool() && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Marble, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++) @@ -538,7 +538,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillMarbleShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } @@ -644,7 +644,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillMushroomShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } } while (tries <= 20000); @@ -763,7 +763,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillSurfaceShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); // Generate entrance tunnel ShapeData data = new ShapeData(); @@ -777,7 +777,7 @@ namespace CalamityMod.World { bool _ = true; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _, new Action(FillSurfaceShrineChest)); - structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); break; } diff --git a/World/VernalPass.cs b/World/VernalPass.cs index 8280f23111..6ecbcf2eac 100644 --- a/World/VernalPass.cs +++ b/World/VernalPass.cs @@ -29,7 +29,7 @@ namespace CalamityMod.World // Add the Vernal Pass as a protected structure. Rectangle protectionArea = CalamityUtils.GetSchematicProtectionArea(schematic, placementPoint, anchorType); - structures.AddProtectedStructure(protectionArea, 30); + CalamityUtils.AddProtectedStructure(protectionArea, 30); } public static void FillVernalPassChests(Chest chest, int Type, bool firstItem)