diff --git a/Helper.cs b/Helper.cs index d33f5961..4bd6a245 100644 --- a/Helper.cs +++ b/Helper.cs @@ -248,7 +248,7 @@ public static float DistortFloat(float Float, float Percent) DistortNumber *= 10; Counter++; } - return Float + ((Main.rand.Next(0, (int)DistortNumber + 1) / (float)(Math.Pow(10, Counter))) * ((Main.rand.Next(2) == 0) ? -1 : 1)); + return Float + ((Main.rand.Next(0, (int)DistortNumber + 1) / (float)(Math.Pow(10, Counter))) * ((Main.rand.NextBool(2)) ? -1 : 1)); } public static void Explode(int index, int sizeX, int sizeY, ExtraAction visualAction = null) diff --git a/Ice/Items/FrozenPaxe.cs b/Ice/Items/FrozenPaxe.cs index 5e44dcfb..85c3e976 100644 --- a/Ice/Items/FrozenPaxe.cs +++ b/Ice/Items/FrozenPaxe.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 80); } diff --git a/Invasion/CyberLaser.cs b/Invasion/CyberLaser.cs index b99a41e7..746f11de 100644 --- a/Invasion/CyberLaser.cs +++ b/Invasion/CyberLaser.cs @@ -25,7 +25,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target1, int damage, float knockback, bool crit) { Player target = Main.player[Main.myPlayer]; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) target.AddBuff(mod.BuffType("Light"), 300); } diff --git a/Invasion/InvisibleSoul.cs b/Invasion/InvisibleSoul.cs index bd297f13..c095a22a 100644 --- a/Invasion/InvisibleSoul.cs +++ b/Invasion/InvisibleSoul.cs @@ -46,7 +46,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.AddBuff(164, 1000, true); } @@ -62,7 +62,7 @@ public override void HitEffect(int hitDirection, double damage) } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(3) == 1) + if (InvasionWorld.CyberWrath && Main.rand.NextBool(3)) { InvasionWorld.CyberWrathPoints1 += 3; //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); @@ -82,7 +82,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(5, 7)); } @@ -113,7 +113,7 @@ public override void AI() SecondState = true; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType(), 0f, 0f, 200, npc.color, 0.5f); Main.dust[num706].velocity *= 0.6f; diff --git a/Invasion/MiniSoul.cs b/Invasion/MiniSoul.cs index d34c8372..ad0c168d 100644 --- a/Invasion/MiniSoul.cs +++ b/Invasion/MiniSoul.cs @@ -40,7 +40,7 @@ public override void NPCLoot() private void SettingNumber() { - if (Main.rand.Next(2) == 1) + if (Main.rand.NextBool(2)) { num++; } @@ -61,7 +61,7 @@ public override void HitEffect(int hitDirection, double damage) } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(4) == 1) + if (InvasionWorld.CyberWrath && Main.rand.NextBool(4)) { InvasionWorld.CyberWrathPoints1 += 1; //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); diff --git a/Invasion/ParadoxBat.cs b/Invasion/ParadoxBat.cs index c1c8eda6..0fd2f72c 100644 --- a/Invasion/ParadoxBat.cs +++ b/Invasion/ParadoxBat.cs @@ -55,7 +55,7 @@ public override void HitEffect(int hitDirection, double damage) } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) + if (InvasionWorld.CyberWrath && Main.rand.NextBool(2)) { InvasionWorld.CyberWrathPoints1 += 1; //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); @@ -104,7 +104,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(3, 5)); } @@ -163,7 +163,7 @@ public override void AI() npc.position.Y = Main.player[npc.target].position.Y + (float)((250 * Math.Sin(npc.ai[3])) * -1); } } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType(), 0f, 0f, 200, npc.color, 0.5f); Main.dust[num706].velocity *= 0.6f; @@ -219,7 +219,7 @@ public override void AI() } npc.netUpdate = true; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType(), 0f, 0f, 200, npc.color, 0.4f); Main.dust[dust].velocity *= 0.4f; diff --git a/Invasion/ParadoxSun.cs b/Invasion/ParadoxSun.cs index 45e7d10c..da6b9dde 100644 --- a/Invasion/ParadoxSun.cs +++ b/Invasion/ParadoxSun.cs @@ -54,7 +54,7 @@ public override void HitEffect(int hitDirection, double damage) } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) + if (InvasionWorld.CyberWrath && Main.rand.NextBool(2)) { InvasionWorld.CyberWrathPoints1 += 2; //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); @@ -75,7 +75,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.AddBuff(31, 1000, true); } diff --git a/Invasion/ParadoxTitanBag.cs b/Invasion/ParadoxTitanBag.cs index e2dd6822..78ed1fea 100644 --- a/Invasion/ParadoxTitanBag.cs +++ b/Invasion/ParadoxTitanBag.cs @@ -34,7 +34,7 @@ public override void OpenBossBag(Player player) { player.TryGettingDevArmor(); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("ParadoxTitanMask")); } diff --git a/Invasion/Relayx.cs b/Invasion/Relayx.cs index 5105d206..df569fa0 100644 --- a/Invasion/Relayx.cs +++ b/Invasion/Relayx.cs @@ -38,7 +38,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); } @@ -46,9 +46,9 @@ public override void MeleeEffects(Player player, Rectangle hitbox) public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RelayxDragonBig"), item.damage + 200, 10, Main.myPlayer); } diff --git a/Invasion/RelayxDragon.cs b/Invasion/RelayxDragon.cs index d1748103..469ae56a 100644 --- a/Invasion/RelayxDragon.cs +++ b/Invasion/RelayxDragon.cs @@ -26,7 +26,7 @@ public override void SetDefaults() public override void AI() { projectile.spriteDirection = projectile.direction; - if (Main.rand.Next(3) == 1) + if (Main.rand.NextBool(3)) { int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); Main.dust[dust2].noGravity = true; diff --git a/Invasion/RelayxDragonBig.cs b/Invasion/RelayxDragonBig.cs index a02e7846..391ccef1 100644 --- a/Invasion/RelayxDragonBig.cs +++ b/Invasion/RelayxDragonBig.cs @@ -43,7 +43,7 @@ public override bool PreAI() public override void AI() { projectile.spriteDirection = projectile.direction; - if (Main.rand.Next(3) == 1) + if (Main.rand.NextBool(3)) { int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); Main.dust[dust2].noGravity = true; diff --git a/Invasion/RelayxProj.cs b/Invasion/RelayxProj.cs index 1311e2f0..c2e08a80 100644 --- a/Invasion/RelayxProj.cs +++ b/Invasion/RelayxProj.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(3) == 1) + if (Main.rand.NextBool(3)) { int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); Main.dust[dust2].noGravity = true; diff --git a/Invasion/Titan.cs b/Invasion/Titan.cs index 9062ebed..21d2beb8 100644 --- a/Invasion/Titan.cs +++ b/Invasion/Titan.cs @@ -174,7 +174,7 @@ public override void AI() { npc.TargetClosest(true); } - if (!Main.player[npc.target].dead && Main.rand.Next(2) == 0) + if (!Main.player[npc.target].dead && Main.rand.NextBool(2)) { npc.position.X = Main.player[npc.target].position.X + (float)((600 * Math.Cos(npc.ai[3])) * -1); npc.position.Y = Main.player[npc.target].position.Y + (float)((600 * Math.Sin(npc.ai[3])) * -1); @@ -203,7 +203,7 @@ public override void AI() npc.TargetClosest(true); } - if (!Main.player[npc.target].dead && Main.rand.Next(2) == 1) + if (!Main.player[npc.target].dead && Main.rand.NextBool(2)) { npc.position.X = Main.player[npc.target].position.X + (float)((600 * Math.Cos(npc.ai[3])) * -1); npc.position.Y = Main.player[npc.target].position.Y + (float)((600 * Math.Sin(npc.ai[3])) * -1); @@ -303,7 +303,7 @@ public override void NPCLoot() { npc.DropBossBags(); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxTitanMask")); } diff --git a/Invasion/TitanCrystal_.cs b/Invasion/TitanCrystal_.cs index 0d5c4855..fb1723d3 100644 --- a/Invasion/TitanCrystal_.cs +++ b/Invasion/TitanCrystal_.cs @@ -66,7 +66,7 @@ public override void OnHitPlayer(Player target, int damage, bool crit) { for (int k = 0; k < Player.maxBuffs; k++) { - if (target.buffType[k] > 0 && target.buffTime[k] > 0 && BuffLoader.CanBeCleared(target.buffType[k]) && Main.rand.Next(2) == 0) + if (target.buffType[k] > 0 && target.buffTime[k] > 0 && BuffLoader.CanBeCleared(target.buffType[k]) && Main.rand.NextBool(2)) { target.DelBuff(k); k--; diff --git a/Invasion/Violeum.cs b/Invasion/Violeum.cs index 01a73e04..f195dabf 100644 --- a/Invasion/Violeum.cs +++ b/Invasion/Violeum.cs @@ -46,11 +46,11 @@ public override void NPCLoot() { npc.DropBossBags(); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VioleumMask")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Crystyle")); } @@ -170,7 +170,7 @@ public override void AI() SecondState = true; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType(), 0f, 0f, 200, npc.color, 0.5f); Main.dust[num706].velocity *= 0.6f; @@ -287,7 +287,7 @@ public override void AI() } } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { float j = 0; diff --git a/Items/AlchemasterTreasureBag.cs b/Items/AlchemasterTreasureBag.cs index a4edc348..206ebf32 100644 --- a/Items/AlchemasterTreasureBag.cs +++ b/Items/AlchemasterTreasureBag.cs @@ -29,7 +29,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("AlchemasterMask")); } @@ -45,11 +45,11 @@ public override void OpenBossBag(Player player) { player.QuickSpawnItem(mod.ItemType("SparkingFlask"), Main.rand.Next(30, 78)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("TheGlorch")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BadApple")); } diff --git a/Items/AncientClaymore.cs b/Items/AncientClaymore.cs index c5fceec7..15ee1c0a 100644 --- a/Items/AncientClaymore.cs +++ b/Items/AncientClaymore.cs @@ -36,7 +36,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); } diff --git a/Items/AncientDragonBag.cs b/Items/AncientDragonBag.cs index 3696b2ed..10c0fb83 100644 --- a/Items/AncientDragonBag.cs +++ b/Items/AncientDragonBag.cs @@ -43,7 +43,7 @@ public override void OpenBossBag(Player player) break; } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("AncientDragonMask")); } diff --git a/Items/AncientSmasher.cs b/Items/AncientSmasher.cs index 2e2c2cc7..ef17bbc5 100644 --- a/Items/AncientSmasher.cs +++ b/Items/AncientSmasher.cs @@ -36,7 +36,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); } diff --git a/Items/AncientSolarWind.cs b/Items/AncientSolarWind.cs index 43b0ff4b..10c5dcf5 100644 --- a/Items/AncientSolarWind.cs +++ b/Items/AncientSolarWind.cs @@ -35,7 +35,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); } diff --git a/Items/AncientSunStaff.cs b/Items/AncientSunStaff.cs index 3f71cc3e..ac49cd03 100644 --- a/Items/AncientSunStaff.cs +++ b/Items/AncientSunStaff.cs @@ -38,7 +38,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); } diff --git a/Items/AndasBag.cs b/Items/AndasBag.cs index 31af14ee..03ff693c 100644 --- a/Items/AndasBag.cs +++ b/Items/AndasBag.cs @@ -49,7 +49,7 @@ public override void OpenBossBag(Player player) break; } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("AndasMask")); } diff --git a/Items/ArgiteBroadsword.cs b/Items/ArgiteBroadsword.cs index 9cb30545..0fe65a04 100644 --- a/Items/ArgiteBroadsword.cs +++ b/Items/ArgiteBroadsword.cs @@ -41,7 +41,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/ArgiteHamaxe.cs b/Items/ArgiteHamaxe.cs index 3164afdc..a98a8a4e 100644 --- a/Items/ArgiteHamaxe.cs +++ b/Items/ArgiteHamaxe.cs @@ -43,7 +43,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/ArgitePickaxe.cs b/Items/ArgitePickaxe.cs index e8e49954..0b191822 100644 --- a/Items/ArgitePickaxe.cs +++ b/Items/ArgitePickaxe.cs @@ -42,7 +42,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/Awakening.cs b/Items/Awakening.cs index 47270b73..092a30d7 100644 --- a/Items/Awakening.cs +++ b/Items/Awakening.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 13); } diff --git a/Items/Banhammer.cs b/Items/Banhammer.cs index 198431f9..fd37952d 100644 --- a/Items/Banhammer.cs +++ b/Items/Banhammer.cs @@ -42,7 +42,7 @@ public override void ModifyTooltips(List tooltips) public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 226); } diff --git a/Items/Bolter.cs b/Items/Bolter.cs index c2522416..5cf9f2f8 100644 --- a/Items/Bolter.cs +++ b/Items/Bolter.cs @@ -37,7 +37,7 @@ public override void SetStaticDefaults() public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { type = 41; } diff --git a/Items/BrassChainRepeater.cs b/Items/BrassChainRepeater.cs index af9d4df5..d4d3e41f 100644 --- a/Items/BrassChainRepeater.cs +++ b/Items/BrassChainRepeater.cs @@ -50,7 +50,7 @@ public override void UpdateInventory(Player player) public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { type = 260; } diff --git a/Items/BrutalliskBag.cs b/Items/BrutalliskBag.cs index 3f7168f2..ee7a291b 100644 --- a/Items/BrutalliskBag.cs +++ b/Items/BrutalliskBag.cs @@ -30,27 +30,27 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("BrutalliskMask")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("Awakening")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("SnakeDevourer")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("LightningStaff")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("QuetzalcoatlStave")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("TreasureGlaive")); } diff --git a/Items/CandyBlaster.cs b/Items/CandyBlaster.cs index 13509862..730ea955 100644 --- a/Items/CandyBlaster.cs +++ b/Items/CandyBlaster.cs @@ -37,7 +37,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Crusher.cs b/Items/Crusher.cs index ebb0acbe..65c1ce71 100644 --- a/Items/Crusher.cs +++ b/Items/Crusher.cs @@ -42,7 +42,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/CrystalPickaxe.cs b/Items/CrystalPickaxe.cs index 098c64f5..d3cea800 100644 --- a/Items/CrystalPickaxe.cs +++ b/Items/CrystalPickaxe.cs @@ -44,7 +44,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); } diff --git a/Items/CrystalWarhamaxe.cs b/Items/CrystalWarhamaxe.cs index c786cdf1..8b94db86 100644 --- a/Items/CrystalWarhamaxe.cs +++ b/Items/CrystalWarhamaxe.cs @@ -45,7 +45,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); } diff --git a/Items/CursedKnife.cs b/Items/CursedKnife.cs index 3bf5bebe..b41286a9 100644 --- a/Items/CursedKnife.cs +++ b/Items/CursedKnife.cs @@ -47,7 +47,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); } diff --git a/Items/CyberKingBag.cs b/Items/CyberKingBag.cs index 4cbb290c..3c0ee7f6 100644 --- a/Items/CyberKingBag.cs +++ b/Items/CyberKingBag.cs @@ -31,7 +31,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("CyberKingMask")); } diff --git a/Items/DarkEmperorBag.cs b/Items/DarkEmperorBag.cs index 1a0629f5..1fe87b80 100644 --- a/Items/DarkEmperorBag.cs +++ b/Items/DarkEmperorBag.cs @@ -30,15 +30,15 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("DarkEmperorMask")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(mod.ItemType("DrippingScythe")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(mod.ItemType("DelightfulClump")); } diff --git a/Items/Destructor.cs b/Items/Destructor.cs index 97b3b184..d5b5d443 100644 --- a/Items/Destructor.cs +++ b/Items/Destructor.cs @@ -36,7 +36,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override Vector2? HoldoutOffset() diff --git a/Items/Doomhammer.cs b/Items/Doomhammer.cs index 58f907e5..e4103f12 100644 --- a/Items/Doomhammer.cs +++ b/Items/Doomhammer.cs @@ -20,7 +20,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/EvilCornBag.cs b/Items/EvilCornBag.cs index adc588ba..5bcfa51c 100644 --- a/Items/EvilCornBag.cs +++ b/Items/EvilCornBag.cs @@ -31,7 +31,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("EvilCornMask")); } @@ -43,19 +43,19 @@ public override void OpenBossBag(Player player) { player.QuickSpawnItem(mod.ItemType("CornHeater")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.QuickSpawnItem(mod.ItemType("GrayKnightHelmet")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.QuickSpawnItem(mod.ItemType("GrayKnightBreastplate")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.QuickSpawnItem(mod.ItemType("KnightGreaves")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("CornSword")); } diff --git a/Items/FrostKingBag.cs b/Items/FrostKingBag.cs index d7a72ff4..410a703a 100644 --- a/Items/FrostKingBag.cs +++ b/Items/FrostKingBag.cs @@ -31,7 +31,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("FrostKingMask")); } diff --git a/Items/FungusBeetleBag.cs b/Items/FungusBeetleBag.cs index 5a69af73..5d80b647 100644 --- a/Items/FungusBeetleBag.cs +++ b/Items/FungusBeetleBag.cs @@ -29,7 +29,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("FungusBeetleMask")); } diff --git a/Items/Galaxon.cs b/Items/Galaxon.cs index 9aef4974..58605fc2 100644 --- a/Items/Galaxon.cs +++ b/Items/Galaxon.cs @@ -74,15 +74,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/GhostlyHowl.cs b/Items/GhostlyHowl.cs index bd9d7613..6fd2aec9 100644 --- a/Items/GhostlyHowl.cs +++ b/Items/GhostlyHowl.cs @@ -67,15 +67,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/GlobalItems.cs b/Items/GlobalItems.cs index 15575063..3872fbf5 100644 --- a/Items/GlobalItems.cs +++ b/Items/GlobalItems.cs @@ -10,12 +10,12 @@ public override void OpenVanillaBag(string context, Player player, int arg) { if (context == "bossBag") { - if (arg == ItemID.DestroyerBossBag && Main.rand.Next(6) == 0) + if (arg == ItemID.DestroyerBossBag && Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("Destructor")); } - if (arg == ItemID.SkeletronPrimeBossBag && Main.rand.Next(6) == 0) + if (arg == ItemID.SkeletronPrimeBossBag && Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("PrimeBlade")); } @@ -31,11 +31,11 @@ public override void OpenVanillaBag(string context, Player player, int arg) { player.QuickSpawnItem(mod.ItemType("GolemCore")); } - if (arg == ItemID.EyeOfCthulhuBossBag && Main.rand.Next(5) == 0) + if (arg == ItemID.EyeOfCthulhuBossBag && Main.rand.NextBool(5)) { player.QuickSpawnItem(mod.ItemType("EyeMonolith")); } - if (arg == ItemID.EyeOfCthulhuBossBag && Main.rand.Next(4) == 0) + if (arg == ItemID.EyeOfCthulhuBossBag && Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("MonsterTooth")); } @@ -45,7 +45,7 @@ public override void OpenVanillaBag(string context, Player player, int arg) player.QuickSpawnItem(mod.ItemType("EssenseofJungle"), Main.rand.Next(2, 3)); } - if (arg == ItemID.FishronBossBag && Main.rand.Next(6) == 0) + if (arg == ItemID.FishronBossBag && Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("DukeCannon")); } @@ -60,12 +60,12 @@ public override void OpenVanillaBag(string context, Player player, int arg) player.QuickSpawnItem(mod.ItemType("TearsofDeath"), Main.rand.Next(1, 3)); } - if (arg == ItemID.QueenBeeBossBag && Main.rand.Next(3) == 0) + if (arg == ItemID.QueenBeeBossBag && Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("YellowPuzzleFragment")); } - if (arg == ItemID.TwinsBossBag && Main.rand.Next(6) == 0) + if (arg == ItemID.TwinsBossBag && Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("MechaSprayer")); } diff --git a/Items/HeaterOfWorldsBag.cs b/Items/HeaterOfWorldsBag.cs index 8b22a431..b37992df 100644 --- a/Items/HeaterOfWorldsBag.cs +++ b/Items/HeaterOfWorldsBag.cs @@ -29,7 +29,7 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("HeaterOfWorldsMask")); } diff --git a/Items/HonestBlade.cs b/Items/HonestBlade.cs index 9120df0f..e0b0f7fe 100644 --- a/Items/HonestBlade.cs +++ b/Items/HonestBlade.cs @@ -43,7 +43,7 @@ public override void OnHitNPC(Player player, NPC target, int damage, float knock public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/IchorKnife.cs b/Items/IchorKnife.cs index 7d29a54f..fb9fe479 100644 --- a/Items/IchorKnife.cs +++ b/Items/IchorKnife.cs @@ -47,7 +47,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); } diff --git a/Items/Incinerator.cs b/Items/Incinerator.cs index 59b4b162..ff7d9124 100644 --- a/Items/Incinerator.cs +++ b/Items/Incinerator.cs @@ -50,7 +50,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override void AddRecipes() diff --git a/Items/Infernality.cs b/Items/Infernality.cs index ac3c4770..bc42d66a 100644 --- a/Items/Infernality.cs +++ b/Items/Infernality.cs @@ -44,7 +44,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/MagiumRod.cs b/Items/MagiumRod.cs index 40edff42..415906be 100644 --- a/Items/MagiumRod.cs +++ b/Items/MagiumRod.cs @@ -68,15 +68,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/Megalodon.cs b/Items/Megalodon.cs index ea18d5c3..7a3838e9 100644 --- a/Items/Megalodon.cs +++ b/Items/Megalodon.cs @@ -42,7 +42,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Megavolt.cs b/Items/Megavolt.cs index 6814bdb7..e8b5d7a4 100644 --- a/Items/Megavolt.cs +++ b/Items/Megavolt.cs @@ -67,15 +67,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/MeteorBlade.cs b/Items/MeteorBlade.cs index 46f647ca..68bad016 100644 --- a/Items/MeteorBlade.cs +++ b/Items/MeteorBlade.cs @@ -32,7 +32,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/MoltenLance.cs b/Items/MoltenLance.cs index 3ebdfd44..c77cde27 100644 --- a/Items/MoltenLance.cs +++ b/Items/MoltenLance.cs @@ -47,7 +47,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/MoneySack.cs b/Items/MoneySack.cs index 9bdfc243..a8c85003 100644 --- a/Items/MoneySack.cs +++ b/Items/MoneySack.cs @@ -30,11 +30,11 @@ public override void RightClick(Player player) player.QuickSpawnItem(71, Main.rand.Next(70, 98)); player.QuickSpawnItem(72, Main.rand.Next(50, 75)); player.QuickSpawnItem(73); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(73, Main.rand.Next(1, 3)); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(73, Main.rand.Next(5, 7)); } diff --git a/Items/Narsil.cs b/Items/Narsil.cs index f4b5ca11..696e2126 100644 --- a/Items/Narsil.cs +++ b/Items/Narsil.cs @@ -32,7 +32,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); } diff --git a/Items/NightDusk.cs b/Items/NightDusk.cs index 0fccdf15..6800822c 100644 --- a/Items/NightDusk.cs +++ b/Items/NightDusk.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/Obscuritron.cs b/Items/Obscuritron.cs index f942b402..7be40918 100644 --- a/Items/Obscuritron.cs +++ b/Items/Obscuritron.cs @@ -33,7 +33,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType()); } diff --git a/Items/Pandemonium.cs b/Items/Pandemonium.cs index 497f76cb..6723485a 100644 --- a/Items/Pandemonium.cs +++ b/Items/Pandemonium.cs @@ -54,7 +54,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX float SpeedX = speedX + Main.rand.Next(-15, 16) * 0.05f; float SpeedY = speedY + Main.rand.Next(-15, 16) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("PandemoniumBullet"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; } diff --git a/Items/ParatrooperShotgun.cs b/Items/ParatrooperShotgun.cs index abc5c640..984a783e 100644 --- a/Items/ParatrooperShotgun.cs +++ b/Items/ParatrooperShotgun.cs @@ -55,7 +55,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } } } diff --git a/Items/ParaxydeAxe.cs b/Items/ParaxydeAxe.cs index 32450460..2bbde7ef 100644 --- a/Items/ParaxydeAxe.cs +++ b/Items/ParaxydeAxe.cs @@ -44,7 +44,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/ParaxydeCleaver.cs b/Items/ParaxydeCleaver.cs index 5e084b73..bcf93134 100644 --- a/Items/ParaxydeCleaver.cs +++ b/Items/ParaxydeCleaver.cs @@ -44,7 +44,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/ParaxydeHammer.cs b/Items/ParaxydeHammer.cs index 372a701a..cd3c05fd 100644 --- a/Items/ParaxydeHammer.cs +++ b/Items/ParaxydeHammer.cs @@ -44,7 +44,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/ParaxydePickaxe.cs b/Items/ParaxydePickaxe.cs index 5e2638d6..bfd7f834 100644 --- a/Items/ParaxydePickaxe.cs +++ b/Items/ParaxydePickaxe.cs @@ -43,7 +43,7 @@ public override void AddRecipes() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/ParaxydeStave.cs b/Items/ParaxydeStave.cs index c2828ced..555e0ee4 100644 --- a/Items/ParaxydeStave.cs +++ b/Items/ParaxydeStave.cs @@ -54,7 +54,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/ParaxydeStormbow.cs b/Items/ParaxydeStormbow.cs index ed8a9b36..d8802cae 100644 --- a/Items/ParaxydeStormbow.cs +++ b/Items/ParaxydeStormbow.cs @@ -53,7 +53,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX { //type = 1; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { type = 522; } diff --git a/Items/PirateChest.cs b/Items/PirateChest.cs index 2b733625..e7540815 100644 --- a/Items/PirateChest.cs +++ b/Items/PirateChest.cs @@ -35,7 +35,7 @@ public override void RightClick(Player player) { player.QuickSpawnItem(2854); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(672); } @@ -55,11 +55,11 @@ public override void RightClick(Player player) { player.QuickSpawnItem(3033); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("HandCannon")); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("PirateFlag")); } @@ -67,11 +67,11 @@ public override void RightClick(Player player) { player.QuickSpawnItem(73, Main.rand.Next(9, 18)); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.QuickSpawnItem(19, Main.rand.Next(14, 19)); ; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.QuickSpawnItem(706, Main.rand.Next(14, 19)); ; } diff --git a/Items/PixieQueenBag.cs b/Items/PixieQueenBag.cs index 4bb38dd5..86b0d82e 100644 --- a/Items/PixieQueenBag.cs +++ b/Items/PixieQueenBag.cs @@ -29,23 +29,23 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("PixieQueenMask")); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("EtherealFeather")); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("PixiePulse")); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("HeartMagnet")); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { player.QuickSpawnItem(mod.ItemType("DopelgangerCandle")); } diff --git a/Items/PrizmaticSword.cs b/Items/PrizmaticSword.cs index a61eb889..30946e19 100644 --- a/Items/PrizmaticSword.cs +++ b/Items/PrizmaticSword.cs @@ -39,7 +39,7 @@ public override void OnHitNPC(Player player, NPC target, int damage, float knock public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/Quadratron.cs b/Items/Quadratron.cs index ee400c5f..6643a9b5 100644 --- a/Items/Quadratron.cs +++ b/Items/Quadratron.cs @@ -49,7 +49,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override void AddRecipes() diff --git a/Items/RedSteelBroadsword.cs b/Items/RedSteelBroadsword.cs index c6dc4bda..f37f3054 100644 --- a/Items/RedSteelBroadsword.cs +++ b/Items/RedSteelBroadsword.cs @@ -31,7 +31,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(31, 600); } diff --git a/Items/RedStorm.cs b/Items/RedStorm.cs index 1ff433d5..4ecb98f7 100644 --- a/Items/RedStorm.cs +++ b/Items/RedStorm.cs @@ -39,7 +39,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/RetributionofAbraxas.cs b/Items/RetributionofAbraxas.cs index 06ae45cb..a8e94019 100644 --- a/Items/RetributionofAbraxas.cs +++ b/Items/RetributionofAbraxas.cs @@ -33,7 +33,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/RoyalDaggers.cs b/Items/RoyalDaggers.cs index 2b6ace2e..abbe800e 100644 --- a/Items/RoyalDaggers.cs +++ b/Items/RoyalDaggers.cs @@ -68,15 +68,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/SacrificalPickaxe.cs b/Items/SacrificalPickaxe.cs index 89f519b5..df557474 100644 --- a/Items/SacrificalPickaxe.cs +++ b/Items/SacrificalPickaxe.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); } diff --git a/Items/ScourgeofFlames.cs b/Items/ScourgeofFlames.cs index 6c74c231..ffb60b00 100644 --- a/Items/ScourgeofFlames.cs +++ b/Items/ScourgeofFlames.cs @@ -48,7 +48,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/ShroomiteMinigun.cs b/Items/ShroomiteMinigun.cs index 48ad7d2a..9d168b46 100644 --- a/Items/ShroomiteMinigun.cs +++ b/Items/ShroomiteMinigun.cs @@ -40,7 +40,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } public override void AddRecipes() diff --git a/Items/ShroomiteRocketLauncher.cs b/Items/ShroomiteRocketLauncher.cs index c5389f3c..576bf14e 100644 --- a/Items/ShroomiteRocketLauncher.cs +++ b/Items/ShroomiteRocketLauncher.cs @@ -40,7 +40,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } public override void AddRecipes() diff --git a/Items/SpaceWhaleTreasureBag.cs b/Items/SpaceWhaleTreasureBag.cs index 2c577ced..ab04edba 100644 --- a/Items/SpaceWhaleTreasureBag.cs +++ b/Items/SpaceWhaleTreasureBag.cs @@ -29,32 +29,32 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("SpaceWhaleMask")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(mod.ItemType("StarLantern")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("SDL")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BlackHoleCannon")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("HornedWarHammer")); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { player.QuickSpawnItem(mod.ItemType("WhaleFlippers")); } diff --git a/Items/Sporaxe.cs b/Items/Sporaxe.cs index 98b691f2..2ed9ff89 100644 --- a/Items/Sporaxe.cs +++ b/Items/Sporaxe.cs @@ -58,7 +58,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/StarBound.cs b/Items/StarBound.cs index 895cdf74..c8c966ce 100644 --- a/Items/StarBound.cs +++ b/Items/StarBound.cs @@ -68,15 +68,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } diff --git a/Items/StormJellyfishBag.cs b/Items/StormJellyfishBag.cs index d02f77f7..1f72f711 100644 --- a/Items/StormJellyfishBag.cs +++ b/Items/StormJellyfishBag.cs @@ -29,27 +29,27 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("StormJellyfishMask")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("StormBlade")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Poseidon")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("JellyfishStaff")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BoltTome")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("StickyFlail")); } diff --git a/Items/Stormtron.cs b/Items/Stormtron.cs index 42ee417e..14986d54 100644 --- a/Items/Stormtron.cs +++ b/Items/Stormtron.cs @@ -55,7 +55,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override void AddRecipes() diff --git a/Items/Stynginator.cs b/Items/Stynginator.cs index 6ddd528f..8df67778 100644 --- a/Items/Stynginator.cs +++ b/Items/Stynginator.cs @@ -51,7 +51,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override void AddRecipes() diff --git a/Items/SuspiciousBag.cs b/Items/SuspiciousBag.cs index 5676d334..d99d113e 100644 --- a/Items/SuspiciousBag.cs +++ b/Items/SuspiciousBag.cs @@ -31,43 +31,43 @@ public override bool CanRightClick() public override void RightClick(Player player) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Doomstone"), Main.rand.Next(2, 5)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("ConcentratedEther"), Main.rand.Next(3, 10)); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("CandyBar"), Main.rand.Next(2, 6)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("VoidBar"), Main.rand.Next(2, 7)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("NightmareBar"), Main.rand.Next(2, 6)); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.QuickSpawnItem(mod.ItemType("Phantaplasm"), Main.rand.Next(3, 6)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("CarbonSteel"), Main.rand.Next(1, 3)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("ClusterShard"), Main.rand.Next(3, 36)); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { player.QuickSpawnItem(mod.ItemType("DeadTissue"), 1); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("ToothofAbraxas"), Main.rand.Next(2, 4)); } diff --git a/Items/TempleCannon.cs b/Items/TempleCannon.cs index 0fa027a6..46771cb8 100644 --- a/Items/TempleCannon.cs +++ b/Items/TempleCannon.cs @@ -49,7 +49,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override void AddRecipes() diff --git a/Items/TheCrescent.cs b/Items/TheCrescent.cs index 2456b2b6..7fb9ed17 100644 --- a/Items/TheCrescent.cs +++ b/Items/TheCrescent.cs @@ -36,7 +36,7 @@ public override void SetStaticDefaults() public override bool ConsumeAmmo(Player p) { - return Main.rand.Next(2) == 0; + return Main.rand.NextBool(2); } public override Vector2? HoldoutOffset() diff --git a/Items/TheGlorch.cs b/Items/TheGlorch.cs index e266b1e2..f55f2b2f 100644 --- a/Items/TheGlorch.cs +++ b/Items/TheGlorch.cs @@ -32,7 +32,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 1200); } @@ -40,7 +40,7 @@ public override void OnHitNPC(Player player, NPC target, int damage, float knock public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); } diff --git a/Items/TheUltimateBoomstick.cs b/Items/TheUltimateBoomstick.cs index a75877b8..24a2b0fe 100644 --- a/Items/TheUltimateBoomstick.cs +++ b/Items/TheUltimateBoomstick.cs @@ -44,7 +44,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX type = 638; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { type = 645; } diff --git a/Items/ToxicClaymore.cs b/Items/ToxicClaymore.cs index 17652ab1..62fca044 100644 --- a/Items/ToxicClaymore.cs +++ b/Items/ToxicClaymore.cs @@ -42,7 +42,7 @@ public override void AddRecipes() public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 1200); } diff --git a/Items/TrinityBag1.cs b/Items/TrinityBag1.cs index e9f100f8..9d5d533f 100644 --- a/Items/TrinityBag1.cs +++ b/Items/TrinityBag1.cs @@ -29,39 +29,39 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("HopeMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TrustMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TruthMask")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Banhammer")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BestNightmare")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("HonestBlade")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Volcannon")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("TrebleClef")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Revolwar")); } diff --git a/Items/TrinityBag2.cs b/Items/TrinityBag2.cs index 1d4e4014..3449c5c0 100644 --- a/Items/TrinityBag2.cs +++ b/Items/TrinityBag2.cs @@ -29,39 +29,39 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("HopeMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TrustMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TruthMask")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Banhammer")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BestNightmare")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("HonestBlade")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Volcannon")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("TrebleClef")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Revolwar")); } diff --git a/Items/TrinityBag3.cs b/Items/TrinityBag3.cs index 8fcbbcd9..2db82f82 100644 --- a/Items/TrinityBag3.cs +++ b/Items/TrinityBag3.cs @@ -29,39 +29,39 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("HopeMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TrustMask")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("TruthMask")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Banhammer")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BestNightmare")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("HonestBlade")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Volcannon")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("TrebleClef")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("Revolwar")); } diff --git a/Items/VoidKnife.cs b/Items/VoidKnife.cs index 97bd03dc..95060985 100644 --- a/Items/VoidKnife.cs +++ b/Items/VoidKnife.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("VoidKnifeExplosion"), damage, knockback, Main.myPlayer); - if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.Next(4) == 0) + if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(4)) { int NewLife = Main.rand.Next(19, 41); player.statLife += NewLife; diff --git a/Items/VultureKingBag.cs b/Items/VultureKingBag.cs index a83f9c43..8ef6ebfc 100644 --- a/Items/VultureKingBag.cs +++ b/Items/VultureKingBag.cs @@ -30,19 +30,19 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("VultureKingMask")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("CactusBow")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("SandKnife")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.QuickSpawnItem(mod.ItemType("VultureFeather")); } diff --git a/Items/WallofShadowBag.cs b/Items/WallofShadowBag.cs index 82900d5d..23391c1d 100644 --- a/Items/WallofShadowBag.cs +++ b/Items/WallofShadowBag.cs @@ -43,7 +43,7 @@ public override void OpenBossBag(Player player) break; } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("WallofShadowMask")); } diff --git a/NPCs/Alchemaster.cs b/NPCs/Alchemaster.cs index 2b74a73f..c11eb002 100644 --- a/NPCs/Alchemaster.cs +++ b/NPCs/Alchemaster.cs @@ -243,7 +243,7 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlchemasterMask")); } @@ -263,11 +263,11 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LongFuse")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheGlorch")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BadApple")); } diff --git a/NPCs/AlphaWolf.cs b/NPCs/AlphaWolf.cs index 58707e70..f0ca03a9 100644 --- a/NPCs/AlphaWolf.cs +++ b/NPCs/AlphaWolf.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(2, 3)); if (Main.rand.Next(25) == 0) npc.NewItem((short)mod.ItemType()); diff --git a/NPCs/AngerSoul.cs b/NPCs/AngerSoul.cs index e9d4bd6f..dad1b1cc 100644 --- a/NPCs/AngerSoul.cs +++ b/NPCs/AngerSoul.cs @@ -36,7 +36,7 @@ public override void SetDefaults() public override void AI() { npc.position += npc.velocity * 2f; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 64, 0f, 0f, 200, npc.color, 1f)].velocity *= 0.3F; } diff --git a/NPCs/Astrofly.cs b/NPCs/Astrofly.cs index e9b56c55..be3b43d6 100644 --- a/NPCs/Astrofly.cs +++ b/NPCs/Astrofly.cs @@ -41,9 +41,9 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(2, 5)); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 3)); } diff --git a/NPCs/Atis.cs b/NPCs/Atis.cs index d8a45d30..26790f41 100644 --- a/NPCs/Atis.cs +++ b/NPCs/Atis.cs @@ -58,7 +58,7 @@ public override void NPCLoot() npc.NewItem((short)mod.ItemType()); if (Main.rand.Next(25) == 0) npc.NewItem((short)mod.ItemType()); - //if (Main.hardMode && Main.rand.Next(2) == 0) + //if (Main.hardMode && Main.rand.NextBool(2)) // npc.NewItem((short)mod.ItemType("RawMeat")); if (Main.rand.NextBool()) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 2)); diff --git a/NPCs/Avenger.cs b/NPCs/Avenger.cs index e909fbf2..e6035073 100644 --- a/NPCs/Avenger.cs +++ b/NPCs/Avenger.cs @@ -57,9 +57,9 @@ public override void HitEffect(int hitDirection, double damage) public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 3)); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 5)); if (Main.rand.Next(10) == 0) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 3)); diff --git a/NPCs/Banshee.cs b/NPCs/Banshee.cs index 2ad45965..6beb71b7 100644 --- a/NPCs/Banshee.cs +++ b/NPCs/Banshee.cs @@ -72,13 +72,13 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { npc.NewItem((short)ItemID.Sapphire, 2); npc.NewItem((short)ItemID.Ruby, 2); npc.NewItem((short)ItemID.Emerald, 2); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { npc.NewItem((short)ItemID.Topaz, 2); npc.NewItem((short)ItemID.Amethyst, 2); diff --git a/NPCs/Barmadillo.cs b/NPCs/Barmadillo.cs index d5d9d28d..e37a0eaa 100644 --- a/NPCs/Barmadillo.cs +++ b/NPCs/Barmadillo.cs @@ -68,7 +68,7 @@ public override void HitEffect(int hitDirection, double damage) public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 3)); if (Main.rand.NextBool()) npc.NewItem((short)mod.ItemType(), Main.rand.Next(2, 4)); diff --git a/NPCs/BetaWolf.cs b/NPCs/BetaWolf.cs index 69f1fbc7..92f8b0d7 100644 --- a/NPCs/BetaWolf.cs +++ b/NPCs/BetaWolf.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem((short)mod.ItemType(), Main.rand.Next(1, 2)); if (Main.rand.Next(25) == 0) npc.NewItem((short)mod.ItemType()); diff --git a/NPCs/BoneArcher.cs b/NPCs/BoneArcher.cs index 88b6eb30..0140467f 100644 --- a/NPCs/BoneArcher.cs +++ b/NPCs/BoneArcher.cs @@ -41,7 +41,7 @@ public override void NPCLoot() npc.NewItem(ItemID.Hook); if (Main.rand.NextBool()) npc.NewItem(ItemID.WoodenArrow, Main.rand.Next(1, 3)); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.FlamingArrow, Main.rand.Next(1, 3)); if (Main.rand.Next(20) == 0) npc.NewItem((short)mod.ItemType()); diff --git a/NPCs/BoneFlyer.cs b/NPCs/BoneFlyer.cs index a973b753..8b1b0d83 100644 --- a/NPCs/BoneFlyer.cs +++ b/NPCs/BoneFlyer.cs @@ -36,9 +36,9 @@ public override void NPCLoot() { if (Main.rand.NextBool()) npc.NewItem(ItemID.Bone, Main.rand.Next(1, 3)); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) npc.NewItem(ItemID.HealingPotion, Main.rand.Next(1, 3)); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) npc.NewItem(ItemID.ManaPotion, Main.rand.Next(1, 3)); } diff --git a/NPCs/Bosses/AndasBoss/SpiritFire.cs b/NPCs/Bosses/AndasBoss/SpiritFire.cs index 1d7acfeb..38097d9b 100644 --- a/NPCs/Bosses/AndasBoss/SpiritFire.cs +++ b/NPCs/Bosses/AndasBoss/SpiritFire.cs @@ -45,12 +45,12 @@ public override void AI() } projectile.ai[0] += 1f; int num297 = 6; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { int num299 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - if ((num297 == 6 && Main.rand.Next(3) == 0)) + if ((num297 == 6 && Main.rand.NextBool(3))) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/NPCs/Bosses/AndasBoss/TrueAndas.cs b/NPCs/Bosses/AndasBoss/TrueAndas.cs index 9ea77e4d..71e4538d 100644 --- a/NPCs/Bosses/AndasBoss/TrueAndas.cs +++ b/NPCs/Bosses/AndasBoss/TrueAndas.cs @@ -206,7 +206,7 @@ public override void NPCLoot() Helper.DropItems(npc.position, npc.Size, new Drop(mod.ItemType("Inferno"), 1, 1), new Drop(mod.ItemType("GehennaStaff"), 1, 1), new Drop(mod.ItemType("Pandemonium"), 1, 1), new Drop(mod.ItemType("VulcanBlade"), 1, 1), new Drop(mod.ItemType("HellStorm"), 1, 1)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3544, Main.rand.Next(10, 25)); - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AndasMask")); } diff --git a/NPCs/Bosses/CogLord/CogLord.cs b/NPCs/Bosses/CogLord/CogLord.cs index c49b5e96..fe658654 100644 --- a/NPCs/Bosses/CogLord/CogLord.cs +++ b/NPCs/Bosses/CogLord/CogLord.cs @@ -346,19 +346,19 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChip")); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CogLordMask")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassRapier")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChainRepeater")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassStave")); } diff --git a/NPCs/Bosses/CogLord/Items/CogLordBag.cs b/NPCs/Bosses/CogLord/Items/CogLordBag.cs index 87111708..40bce994 100644 --- a/NPCs/Bosses/CogLord/Items/CogLordBag.cs +++ b/NPCs/Bosses/CogLord/Items/CogLordBag.cs @@ -30,19 +30,19 @@ public override bool CanRightClick() public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType("CogLordMask")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BrassRapier")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BrassChainRepeater")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.QuickSpawnItem(mod.ItemType("BrassStave")); } diff --git a/NPCs/Bosses/Motherboard/Items/MotherboardBag.cs b/NPCs/Bosses/Motherboard/Items/MotherboardBag.cs index 2db45226..1d72a18e 100644 --- a/NPCs/Bosses/Motherboard/Items/MotherboardBag.cs +++ b/NPCs/Bosses/Motherboard/Items/MotherboardBag.cs @@ -37,7 +37,7 @@ public override void OpenBossBag(Player player) player.QuickSpawnItem(ItemID.GreaterHealingPotion, Main.rand.Next(5, 16)); player.QuickSpawnItem(ItemID.HallowedBar, Main.rand.Next(15, 36)); - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { player.QuickSpawnItem(mod.ItemType()); } diff --git a/NPCs/Bosses/Motherboard/Motherboard.cs b/NPCs/Bosses/Motherboard/Motherboard.cs index 1c9209d2..e932d587 100644 --- a/NPCs/Bosses/Motherboard/Motherboard.cs +++ b/NPCs/Bosses/Motherboard/Motherboard.cs @@ -536,7 +536,7 @@ public override void NPCLoot() { this.NewItem(ItemID.HallowedBar, Main.rand.Next(15, 35)); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { this.NewItem((short)mod.ItemType()); } @@ -546,7 +546,7 @@ public override void NPCLoot() { this.NewItem((short)mod.ItemType()); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { this.NewItem((short)mod.ItemType()); } diff --git a/NPCs/Bosses/NovaPillar/NovaPillar.cs b/NPCs/Bosses/NovaPillar/NovaPillar.cs index 1540d436..72a853f7 100644 --- a/NPCs/Bosses/NovaPillar/NovaPillar.cs +++ b/NPCs/Bosses/NovaPillar/NovaPillar.cs @@ -65,7 +65,7 @@ public override void AI() { npc.ai[3]--; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust dust21 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, 241, 0f, 0f, 0, default(Color), 1f)]; dust21.position = npc.Center + Vector2.UnitY.RotatedByRandom(2.0943951606750488) * new Vector2(npc.width / 2, npc.height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f); @@ -74,7 +74,7 @@ public override void AI() } for (int num1940 = 0; num1940 < 3; num1940++) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust dust22 = Main.dust[Dust.NewDust(npc.Top + new Vector2(-(float)npc.width * (0.33f - 0.11f * num1940), -20f), (int)(npc.width * (0.66f - 0.22f * num1940)), 20, 135, 0f, 0f, 0, default(Color), 1f)]; dust22.velocity.X = 0f; @@ -102,7 +102,7 @@ public override void AI() npc.Opacity = 1f - (npc.ai[1] - 120f) / 60f; } int dustID = 59; - if (Main.rand.Next(5) == 0 && npc.ai[1] < 120f) + if (Main.rand.NextBool(5) && npc.ai[1] < 120f) { for (int i = 0; i < 3; i++) { @@ -119,7 +119,7 @@ public override void AI() { for (int num1362 = 0; num1362 < 3; num1362++) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust dust5 = Main.dust[Dust.NewDust(npc.Top + new Vector2(-(float)npc.width * (0.33f - 0.11f * num1362), -20f), (int)(npc.width * (0.66f - 0.22f * num1362)), 20, dustID)]; dust5.velocity.X = 0f; @@ -130,7 +130,7 @@ public override void AI() } } } - if (Main.rand.Next(5) == 0 && npc.ai[1] < 150f) + if (Main.rand.NextBool(5) && npc.ai[1] < 150f) { for (int i = 0; i < 3; i++) { diff --git a/NPCs/Bosses/NovaPillar/Projectiles/NovaAlchemistProjectile.cs b/NPCs/Bosses/NovaPillar/Projectiles/NovaAlchemistProjectile.cs index 697ffe91..dd031560 100644 --- a/NPCs/Bosses/NovaPillar/Projectiles/NovaAlchemistProjectile.cs +++ b/NPCs/Bosses/NovaPillar/Projectiles/NovaAlchemistProjectile.cs @@ -43,10 +43,10 @@ public override void AI() projectile.ai[0] += 1f; if (projectile.ai[0] <= 50f) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector106 = projectile.ai[1].ToRotationVector2(); - Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.Next(2) == 0).ToDirectionInt() * Main.rand.Next(10, 21); + Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.NextBool(2)).ToDirectionInt() * Main.rand.Next(10, 21); Vector2 value60 = vector106 * Main.rand.Next(-80, 81); Vector2 vector108 = value60 - vector107; vector108 /= 10f; @@ -72,7 +72,7 @@ public override void AI() projectile.scale = (projectile.ai[0] - 50f) / 40f; projectile.alpha = 255 - (int)(255f * projectile.scale); Vector2 vector111 = projectile.ai[1].ToRotationVector2(); - Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.Next(2) == 0).ToDirectionInt() * Main.rand.Next(10, 21); + Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.NextBool(2)).ToDirectionInt() * Main.rand.Next(10, 21); vector111 *= (float)Main.rand.Next(-80, 81); Vector2 vector112 = vector111 - value61; vector112 /= 10f; @@ -130,7 +130,7 @@ public override void AI() } projectile.scale = 1f; projectile.alpha = 0; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector116 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); Dust dust20 = Main.dust[Dust.NewDust(projectile.Center - vector116 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; diff --git a/NPCs/Bosses/NovaPillar/Projectiles/NovaFlask_Proj.cs b/NPCs/Bosses/NovaPillar/Projectiles/NovaFlask_Proj.cs index 15905c23..6d988b38 100644 --- a/NPCs/Bosses/NovaPillar/Projectiles/NovaFlask_Proj.cs +++ b/NPCs/Bosses/NovaPillar/Projectiles/NovaFlask_Proj.cs @@ -106,7 +106,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/NPCs/Brutallisk.cs b/NPCs/Brutallisk.cs index 0a3d705e..e0d91524 100644 --- a/NPCs/Brutallisk.cs +++ b/NPCs/Brutallisk.cs @@ -522,23 +522,23 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SnakeDevourer")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Awakening")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightningStaff")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("QuetzalcoatlStave")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TreasureGlaive")); } @@ -558,7 +558,7 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskTrophy")); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskMask")); } diff --git a/NPCs/ColossalTortoise.cs b/NPCs/ColossalTortoise.cs index 774bcfed..876ea993 100644 --- a/NPCs/ColossalTortoise.cs +++ b/NPCs/ColossalTortoise.cs @@ -45,7 +45,7 @@ public override void NPCLoot() { if (Main.rand.NextBool()) npc.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) npc.NewItem(mod.ItemType(), Main.rand.Next(10, 55)); } diff --git a/NPCs/CometHead.cs b/NPCs/CometHead.cs index 7b6aa1ab..f5f3d466 100644 --- a/NPCs/CometHead.cs +++ b/NPCs/CometHead.cs @@ -40,9 +40,9 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType()); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/ConjurerSkeleton.cs b/NPCs/ConjurerSkeleton.cs index d214403c..a9cb75d3 100644 --- a/NPCs/ConjurerSkeleton.cs +++ b/NPCs/ConjurerSkeleton.cs @@ -36,7 +36,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) npc.NewItem(ItemID.MagicHat); if (Main.rand.Next(20) == 0) npc.NewItem(mod.ItemType()); diff --git a/NPCs/CoreBug.cs b/NPCs/CoreBug.cs index 3542f041..5b061624 100644 --- a/NPCs/CoreBug.cs +++ b/NPCs/CoreBug.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/CoreSlime.cs b/NPCs/CoreSlime.cs index 1b8d812c..bd5084ce 100644 --- a/NPCs/CoreSlime.cs +++ b/NPCs/CoreSlime.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/Coretaur.cs b/NPCs/Coretaur.cs index b932373d..626706a8 100644 --- a/NPCs/Coretaur.cs +++ b/NPCs/Coretaur.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/CreatorofNightmares.cs b/NPCs/CreatorofNightmares.cs index b1dafaaa..88d3c2dd 100644 --- a/NPCs/CreatorofNightmares.cs +++ b/NPCs/CreatorofNightmares.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/CyberKing.cs b/NPCs/CyberKing.cs index 3f4981c0..c193be40 100644 --- a/NPCs/CyberKing.cs +++ b/NPCs/CyberKing.cs @@ -408,7 +408,7 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingTrophy")); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingMask")); } diff --git a/NPCs/DarkDruid.cs b/NPCs/DarkDruid.cs index da4f4bac..83d5b6ea 100644 --- a/NPCs/DarkDruid.cs +++ b/NPCs/DarkDruid.cs @@ -65,11 +65,11 @@ public override void NPCLoot() { if (Main.rand.Next(20) == 0) npc.NewItem(mod.ItemType()); - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) npc.NewItem(ItemID.Ruby); - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) npc.NewItem(ItemID.Topaz); - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) npc.NewItem(ItemID.Diamond); if (Main.rand.NextBool()) npc.NewItem(mod.ItemType(), Main.rand.Next(1, 5)); diff --git a/NPCs/DarkDruidMinion.cs b/NPCs/DarkDruidMinion.cs index d45e787d..dcb34518 100644 --- a/NPCs/DarkDruidMinion.cs +++ b/NPCs/DarkDruidMinion.cs @@ -33,7 +33,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.Heart); } diff --git a/NPCs/DarkServant.cs b/NPCs/DarkServant.cs index 7531aeda..8d9010bc 100644 --- a/NPCs/DarkServant.cs +++ b/NPCs/DarkServant.cs @@ -54,7 +54,7 @@ public override void HitEffect(int hitDirection, double damage) public override void NPCLoot() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) npc.NewItem(mod.ItemType()); } } diff --git a/NPCs/DarkSlime.cs b/NPCs/DarkSlime.cs index d696f1a3..4044f791 100644 --- a/NPCs/DarkSlime.cs +++ b/NPCs/DarkSlime.cs @@ -50,7 +50,7 @@ public override void HitEffect(int hitDirection, double damage) public override void NPCLoot() { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) npc.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); } } diff --git a/NPCs/Deimos.cs b/NPCs/Deimos.cs index bb881aa2..f5749487 100644 --- a/NPCs/Deimos.cs +++ b/NPCs/Deimos.cs @@ -40,7 +40,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color); Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color); diff --git a/NPCs/DevourerofPlanets.cs b/NPCs/DevourerofPlanets.cs index b7f91c2a..0a6096a3 100644 --- a/NPCs/DevourerofPlanets.cs +++ b/NPCs/DevourerofPlanets.cs @@ -43,7 +43,7 @@ public override void NPCLoot() npc.NewItem(mod.ItemType(), Main.rand.Next(2, 5)); if (Main.rand.Next(10) == 0) npc.NewItem(mod.ItemType()); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/Dranix.cs b/NPCs/Dranix.cs index 0215168a..9e44fea9 100644 --- a/NPCs/Dranix.cs +++ b/NPCs/Dranix.cs @@ -41,7 +41,7 @@ public override void AI() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/DreadBeetle.cs b/NPCs/DreadBeetle.cs index 6c2538d4..6029c70d 100644 --- a/NPCs/DreadBeetle.cs +++ b/NPCs/DreadBeetle.cs @@ -36,7 +36,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/EvilCorn.cs b/NPCs/EvilCorn.cs index 5c57b4b7..ff273671 100644 --- a/NPCs/EvilCorn.cs +++ b/NPCs/EvilCorn.cs @@ -80,7 +80,7 @@ public override void SetDefaults() #region "Вылёт попкорна при ударе" public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); base.OnHitByItem(player, item, damage, knockback, crit); } @@ -93,7 +93,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); base.OnHitByProjectile(projectile, damage, knockback, crit); } @@ -581,7 +581,7 @@ void NormalDefense() { if (npc.velocity.Y <= 0) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, DustID.GoldCoin); npc.frame = getFrame(22); @@ -605,7 +605,7 @@ void NormalDefense() } while (!WorldGen.SolidTile((int)npc.Center.X / 16, ((int)npc.position.Y + npc.height) / 16 + 1)) npc.position.Y += 8; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, DustID.GoldCoin); npc.frame = getFrame(21); @@ -640,7 +640,7 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornMask")); } @@ -648,19 +648,19 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornTrophy")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightHelmet")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightBreastplate")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightGreaves")); } - if (!Main.expertMode && Main.rand.Next(2) == 0) + if (!Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornSword")); } diff --git a/NPCs/ExuberantHound.cs b/NPCs/ExuberantHound.cs index 8f912602..26dfdedf 100644 --- a/NPCs/ExuberantHound.cs +++ b/NPCs/ExuberantHound.cs @@ -112,7 +112,7 @@ public override void NPCLoot() { if (Main.rand.NextBool()) npc.NewItem(mod.ItemType("ConcentratedEther"), Main.rand.Next(2, 4)); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) npc.NewItem(mod.ItemType("ToothofAbraxas"), Main.rand.Next(1, 3)); } diff --git a/NPCs/FatFlinx.cs b/NPCs/FatFlinx.cs index 7598d9cc..d1302a69 100644 --- a/NPCs/FatFlinx.cs +++ b/NPCs/FatFlinx.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/FireBeetle.cs b/NPCs/FireBeetle.cs index 969fea3c..4cd4d76c 100644 --- a/NPCs/FireBeetle.cs +++ b/NPCs/FireBeetle.cs @@ -41,9 +41,9 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.HellstoneBar, 3); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType(), 3); } diff --git a/NPCs/FrostBeetle.cs b/NPCs/FrostBeetle.cs index 3af0535b..6ea76368 100644 --- a/NPCs/FrostBeetle.cs +++ b/NPCs/FrostBeetle.cs @@ -47,7 +47,7 @@ public override void NPCLoot() npc.NewItem(ItemID.IceBlock, 3); if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType(), 3); - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) npc.NewItem(mod.ItemType()); } diff --git a/NPCs/FrostKing.cs b/NPCs/FrostKing.cs index 0a633720..aa105413 100644 --- a/NPCs/FrostKing.cs +++ b/NPCs/FrostKing.cs @@ -297,7 +297,7 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostKingMask")); } diff --git a/NPCs/FungusBeetle.cs b/NPCs/FungusBeetle.cs index d5ae5e28..e16a4813 100644 --- a/NPCs/FungusBeetle.cs +++ b/NPCs/FungusBeetle.cs @@ -47,7 +47,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusBeetleMask")); } @@ -215,7 +215,7 @@ public override void AI() SecondState = true; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 67, 0f, 0f, 200, npc.color, 0.5f); Main.dust[num706].velocity *= 0.6f; diff --git a/NPCs/GhostWarrior.cs b/NPCs/GhostWarrior.cs index c8a97031..dc44489c 100644 --- a/NPCs/GhostWarrior.cs +++ b/NPCs/GhostWarrior.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) npc.NewItem(mod.ItemType()); if (Main.rand.NextBool(2)) npc.NewItem(mod.ItemType()); diff --git a/NPCs/GiantGastropod.cs b/NPCs/GiantGastropod.cs index 325c84d3..2b016630 100644 --- a/NPCs/GiantGastropod.cs +++ b/NPCs/GiantGastropod.cs @@ -40,7 +40,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 72, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/GiantMeteorHead.cs b/NPCs/GiantMeteorHead.cs index 86a39583..ebb82683 100644 --- a/NPCs/GiantMeteorHead.cs +++ b/NPCs/GiantMeteorHead.cs @@ -39,7 +39,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/GoblinAssassin.cs b/NPCs/GoblinAssassin.cs index a61ddc64..0591ea08 100644 --- a/NPCs/GoblinAssassin.cs +++ b/NPCs/GoblinAssassin.cs @@ -568,7 +568,7 @@ public override void NPCLoot() NetMessage.SendData(78, -1, -1, null, Main.invasionProgress, Main.invasionProgressMax, Main.invasionProgressIcon, 0f, 0, 0, 0); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.SpikyBall, Main.rand.Next(1, 16)); if (Main.rand.Next(200) == 0) npc.NewItem(ItemID.Harpoon); diff --git a/NPCs/GoblinBomber.cs b/NPCs/GoblinBomber.cs index fd8700c5..428968e9 100644 --- a/NPCs/GoblinBomber.cs +++ b/NPCs/GoblinBomber.cs @@ -309,7 +309,7 @@ public override void HitEffect(int hitDirection, double damage) { int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -376,7 +376,7 @@ public override void NPCLoot() NetMessage.SendData(78, -1, -1, null, Main.invasionProgress, Main.invasionProgressMax, Main.invasionProgressIcon, 0f, 0, 0, 0); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.SpikyBall, Main.rand.Next(1, 16)); if (Main.rand.Next(200) == 0) npc.NewItem(ItemID.Harpoon); diff --git a/NPCs/GoblinStandardBearer_Balloon.cs b/NPCs/GoblinStandardBearer_Balloon.cs index 52377bf9..008d3804 100644 --- a/NPCs/GoblinStandardBearer_Balloon.cs +++ b/NPCs/GoblinStandardBearer_Balloon.cs @@ -106,7 +106,7 @@ public override void NPCLoot() NetMessage.SendData(78, -1, -1, null, Main.invasionProgress, Main.invasionProgressMax, Main.invasionProgressIcon, 0f, 0, 0, 0); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) npc.NewItem(ItemID.SpikyBall, Main.rand.Next(1, 16)); if (Main.rand.Next(200) == 0) npc.NewItem(ItemID.Harpoon); diff --git a/NPCs/Hallower.cs b/NPCs/Hallower.cs index ad1b85b6..6840512a 100644 --- a/NPCs/Hallower.cs +++ b/NPCs/Hallower.cs @@ -59,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 55, 0f, 0f, 200, npc.color)].velocity *= 0.3f; if (Main.rand.Next(40) == 0) Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 1); diff --git a/NPCs/HappySoul.cs b/NPCs/HappySoul.cs index 4ebdd849..514ef319 100644 --- a/NPCs/HappySoul.cs +++ b/NPCs/HappySoul.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void AI() { npc.position += npc.velocity * 2f; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 62, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/HeadlessZombie.cs b/NPCs/HeadlessZombie.cs index 44d2f21a..9f41af7d 100644 --- a/NPCs/HeadlessZombie.cs +++ b/NPCs/HeadlessZombie.cs @@ -36,7 +36,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/HeavyZombie.cs b/NPCs/HeavyZombie.cs index d65160cb..867e9e46 100644 --- a/NPCs/HeavyZombie.cs +++ b/NPCs/HeavyZombie.cs @@ -36,15 +36,15 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) npc.NewItem(mod.ItemType()); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) npc.NewItem(ItemID.SilverBar, Main.rand.Next(2, 4)); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) npc.NewItem(ItemID.IronBar, Main.rand.Next(2, 4)); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) npc.NewItem(ItemID.LeadBar, Main.rand.Next(2, 4)); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) npc.NewItem(ItemID.TungstenBar, Main.rand.Next(2, 4)); } diff --git a/NPCs/Hellgron.cs b/NPCs/Hellgron.cs index 2710514e..a3d119aa 100644 --- a/NPCs/Hellgron.cs +++ b/NPCs/Hellgron.cs @@ -40,7 +40,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f)].velocity *= 0.3f; } diff --git a/NPCs/Hellhound.cs b/NPCs/Hellhound.cs index 6b7b552d..091c2bce 100644 --- a/NPCs/Hellhound.cs +++ b/NPCs/Hellhound.cs @@ -41,7 +41,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color)].velocity *= 0.3F; Vector2 vector72 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); diff --git a/NPCs/IceBlazer.cs b/NPCs/IceBlazer.cs index 0d150862..dd187a00 100644 --- a/NPCs/IceBlazer.cs +++ b/NPCs/IceBlazer.cs @@ -41,7 +41,7 @@ public override void NPCLoot() { if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType()); - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/IndifferenceSoul.cs b/NPCs/IndifferenceSoul.cs index e7631791..c8def90b 100644 --- a/NPCs/IndifferenceSoul.cs +++ b/NPCs/IndifferenceSoul.cs @@ -41,7 +41,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) public override void AI() { npc.position += npc.velocity * 2f; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 200, npc.color, 1f); Main.dust[num706].velocity *= 0.3f; diff --git a/NPCs/IronGiant.cs b/NPCs/IronGiant.cs index 4f0cd244..ab2305ba 100644 --- a/NPCs/IronGiant.cs +++ b/NPCs/IronGiant.cs @@ -39,7 +39,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) this.NewItem(mod.ItemType()); if (Main.rand.Next(10) == 0) this.NewItem(ItemID.DepthMeter); diff --git a/NPCs/LihzahrdWarrior.cs b/NPCs/LihzahrdWarrior.cs index b335e72d..de6bdaa1 100644 --- a/NPCs/LihzahrdWarrior.cs +++ b/NPCs/LihzahrdWarrior.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(ItemID.LunarTabletFragment); } diff --git a/NPCs/Luminion.cs b/NPCs/Luminion.cs index fcdaf52f..ccab627d 100644 --- a/NPCs/Luminion.cs +++ b/NPCs/Luminion.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) this.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); if (Main.rand.NextBool()) this.NewItem(ItemID.LunarBar, Main.rand.Next(3, 8)); diff --git a/NPCs/MagiumKeeper.cs b/NPCs/MagiumKeeper.cs index 582e4567..e3d2b346 100644 --- a/NPCs/MagiumKeeper.cs +++ b/NPCs/MagiumKeeper.cs @@ -215,7 +215,7 @@ public override void AI() int num54 = Dust.NewDust(vector11, 1, 1, 59, 0f, 0f, 0, default(Color), 3f); Main.dust[num54].velocity = -value5 * 0.3f; Main.dust[num54].alpha = 100; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num54].noGravity = true; Main.dust[num54].scale += 0.3f; diff --git a/NPCs/MagiumSword.cs b/NPCs/MagiumSword.cs index 3dc1019e..f4eafdda 100644 --- a/NPCs/MagiumSword.cs +++ b/NPCs/MagiumSword.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 59, 0f, 0f, 200, npc.color, 2f)].velocity *= 0.3f; } diff --git a/NPCs/MagmaLeechBody.cs b/NPCs/MagmaLeechBody.cs index 941ad103..a9010140 100644 --- a/NPCs/MagmaLeechBody.cs +++ b/NPCs/MagmaLeechBody.cs @@ -40,7 +40,7 @@ public override void OnHitPlayer(Player player, int damage, bool crit) public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); diff --git a/NPCs/MagmaLeechHead.cs b/NPCs/MagmaLeechHead.cs index 106c9b65..cdbd4625 100644 --- a/NPCs/MagmaLeechHead.cs +++ b/NPCs/MagmaLeechHead.cs @@ -55,7 +55,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); diff --git a/NPCs/MagmaLeechTail.cs b/NPCs/MagmaLeechTail.cs index e40606d2..bfcbe076 100644 --- a/NPCs/MagmaLeechTail.cs +++ b/NPCs/MagmaLeechTail.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); diff --git a/NPCs/Minotaur.cs b/NPCs/Minotaur.cs index 565c9f85..84d6024f 100644 --- a/NPCs/Minotaur.cs +++ b/NPCs/Minotaur.cs @@ -37,7 +37,7 @@ public override void NPCLoot() { if (Main.rand.NextBool()) this.NewItem(mod.ItemType()); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/NorthWind.cs b/NPCs/NorthWind.cs index 7dae0ced..557cb19c 100644 --- a/NPCs/NorthWind.cs +++ b/NPCs/NorthWind.cs @@ -41,7 +41,7 @@ public override void NPCLoot() { if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType()); - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/OmegaWolf.cs b/NPCs/OmegaWolf.cs index f9d51e10..fa56ce2d 100644 --- a/NPCs/OmegaWolf.cs +++ b/NPCs/OmegaWolf.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType()); if (Main.rand.Next(25) == 0) this.NewItem(mod.ItemType()); diff --git a/NPCs/Phobos.cs b/NPCs/Phobos.cs index 85927bc1..acc42961 100644 --- a/NPCs/Phobos.cs +++ b/NPCs/Phobos.cs @@ -39,7 +39,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color, 1f); diff --git a/NPCs/PixieQueen.cs b/NPCs/PixieQueen.cs index 3683aa10..51e8a974 100644 --- a/NPCs/PixieQueen.cs +++ b/NPCs/PixieQueen.cs @@ -491,7 +491,7 @@ public override void AI() if (Main.netMode != 1) { int num1061; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num1061 = mod.NPCType("AquaticAberration"); //Aquatic entity spawns } @@ -589,7 +589,7 @@ public override void AI() } if (npc.ai[1] >= 280 && npc.ai[1] < 320) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { npc.velocity.X *= 10.00f; npc.velocity.Y *= 10.00f; @@ -631,7 +631,7 @@ public override void OnHitPlayer(Player player, int damage, bool crit) player.AddBuff(BuffID.Slow, 60, true); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.AddBuff(BuffID.Cursed, 60, true); } @@ -760,23 +760,23 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieQueenMask")); } - if (!Main.expertMode && Main.rand.Next(6) == 0) + if (!Main.expertMode && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EtherealFeather")); } - if (!Main.expertMode && Main.rand.Next(6) == 0) + if (!Main.expertMode && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixiePulse")); } - if (!Main.expertMode && Main.rand.Next(6) == 0) + if (!Main.expertMode && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeartMagnet")); } - if (!Main.expertMode && Main.rand.Next(6) == 0) + if (!Main.expertMode && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DopelgangerCandle")); } diff --git a/NPCs/PixieQueenGuardian.cs b/NPCs/PixieQueenGuardian.cs index 797480a6..2dfe6836 100644 --- a/NPCs/PixieQueenGuardian.cs +++ b/NPCs/PixieQueenGuardian.cs @@ -35,10 +35,10 @@ public override void SetDefaults() public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) player.AddBuff(BuffID.Confused, 1800, true); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) player.AddBuff(BuffID.Slow, 1800, true); } diff --git a/NPCs/Polaris.cs b/NPCs/Polaris.cs index e2f00d49..fb8391a7 100644 --- a/NPCs/Polaris.cs +++ b/NPCs/Polaris.cs @@ -41,7 +41,7 @@ public override void NPCLoot() this.NewItem(mod.ItemType()); if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType()); - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/Rogue.cs b/NPCs/Rogue.cs index a3b1c49e..4fc04dce 100644 --- a/NPCs/Rogue.cs +++ b/NPCs/Rogue.cs @@ -36,7 +36,7 @@ public override void NPCLoot() { if (Main.rand.NextBool(2)) this.NewItem(ItemID.WoodenArrow, Main.rand.Next(2, 6)); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) this.NewItem(ItemID.FlamingArrow, Main.rand.Next(2, 6)); if (Main.rand.Next(15) == 0) @@ -52,9 +52,9 @@ public override void NPCLoot() if (Main.rand.Next(15) == 0) this.NewItem(ItemID.Diamond, Main.rand.Next(1, 3)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(ItemID.ThrowingKnife, Main.rand.Next(2, 6)); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(ItemID.PoisonedKnife, Main.rand.Next(2, 4)); } diff --git a/NPCs/RuinGhost2.cs b/NPCs/RuinGhost2.cs index ec040095..b305554c 100644 --- a/NPCs/RuinGhost2.cs +++ b/NPCs/RuinGhost2.cs @@ -45,9 +45,9 @@ public override void AI() public override void NPCLoot() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(mod.ItemType(), 1); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(mod.ItemType(), 1); } diff --git a/NPCs/Scavenger.cs b/NPCs/Scavenger.cs index a9d0477c..45946904 100644 --- a/NPCs/Scavenger.cs +++ b/NPCs/Scavenger.cs @@ -85,7 +85,7 @@ public override void NPCLoot() { if (!Main.hardMode) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) this.NewItem(29, Main.rand.Next(1, 3)); if (Main.rand.NextBool()) @@ -104,7 +104,7 @@ public override void NPCLoot() this.NewItem(178, Main.rand.Next(5, 16)); if (Main.rand.NextBool()) this.NewItem(182, Main.rand.Next(5, 16)); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); if (Main.rand.NextBool()) this.NewItem(227, Main.rand.Next(2, 11)); @@ -115,21 +115,21 @@ public override void NPCLoot() } else { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(2161, Main.rand.Next(1, 3)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(2351, Main.rand.Next(1, 6)); if (Main.rand.Next(10) == 0) this.NewItem(723); if (Main.rand.Next(50) == 0) this.NewItem(855); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(499, Main.rand.Next(1, 6)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(500, Main.rand.Next(1, 6)); if (Main.rand.Next(15) == 0) this.NewItem(1242); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(1291, Main.rand.Next(1, 3)); if (Main.rand.Next(50) == 0) this.NewItem(1321); @@ -155,7 +155,7 @@ public override void NPCLoot() this.NewItem(3091); if (Main.rand.Next(80) == 0) this.NewItem(3092); - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) this.NewItem(2674, Main.rand.Next(1, 6)); if (Main.rand.Next(15) == 0) this.NewItem(2675, Main.rand.Next(1, 10)); @@ -173,9 +173,9 @@ public override void NPCLoot() this.NewItem(423, Main.rand.Next(1, 10)); if (Main.rand.Next(45) == 0) this.NewItem(497); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(502, Main.rand.Next(1, 10)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(501, Main.rand.Next(1, 15)); if (Main.rand.Next(26) == 0) this.NewItem(507); diff --git a/NPCs/SkeletonKnight.cs b/NPCs/SkeletonKnight.cs index a40958e4..f636959c 100644 --- a/NPCs/SkeletonKnight.cs +++ b/NPCs/SkeletonKnight.cs @@ -36,9 +36,9 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(ItemID.Cobweb, Main.rand.Next(3, 6)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(ItemID.Bone, Main.rand.Next(1, 3)); if (Main.rand.Next(20) == 0) diff --git a/NPCs/SnowEater.cs b/NPCs/SnowEater.cs index 3c40f90e..b2ece52c 100644 --- a/NPCs/SnowEater.cs +++ b/NPCs/SnowEater.cs @@ -127,14 +127,14 @@ public override void AI() { npc.noGravity = false; npc.noTileCollide = false; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num690 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + npc.height - 8f), npc.width + 8, 24, 80, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); Dust expr_28A1C_cp_0 = Main.dust[num690]; expr_28A1C_cp_0.velocity.X = expr_28A1C_cp_0.velocity.X * 0.4f; Dust expr_28A3C_cp_0 = Main.dust[num690]; expr_28A3C_cp_0.velocity.Y = expr_28A3C_cp_0.velocity.Y * -1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num690].noGravity = true; Main.dust[num690].scale += 0.2f; @@ -149,9 +149,9 @@ public override void AI() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType()); - if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + if (NPC.downedMoonlord && Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/SoulofHope.cs b/NPCs/SoulofHope.cs index 3fab9b30..19131361 100644 --- a/NPCs/SoulofHope.cs +++ b/NPCs/SoulofHope.cs @@ -206,7 +206,7 @@ public override void AI() void CreateDust() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) Dust.NewDust(npc.position, npc.width, npc.height, 62); } @@ -335,17 +335,17 @@ public override void NPCLoot() } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HopeMask")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Banhammer")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BestNightmare")); } diff --git a/NPCs/SoulofTrust.cs b/NPCs/SoulofTrust.cs index 32166587..996f01cc 100644 --- a/NPCs/SoulofTrust.cs +++ b/NPCs/SoulofTrust.cs @@ -163,7 +163,7 @@ public override void AI() NPC.NewNPC((int)npc.position.X + 100, (int)npc.position.Y - 50, 418); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 0.5f); Main.dust[num706].velocity *= 0.6f; @@ -248,7 +248,7 @@ public override void AI() void CreateDust() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) Dust.NewDust(npc.position, npc.width, npc.height, 6); } @@ -358,17 +358,17 @@ public override void NPCLoot() } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThrustMask")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Volcannon")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HonestBlade")); } diff --git a/NPCs/SoulofTruth.cs b/NPCs/SoulofTruth.cs index 58d3c13d..d95a8775 100644 --- a/NPCs/SoulofTruth.cs +++ b/NPCs/SoulofTruth.cs @@ -195,13 +195,13 @@ public override void AI() SetStage(true); SetRotation(); CreateDust(); - if (Power && Main.rand.Next(5) == 0) + if (Power && Main.rand.NextBool(5)) Shoot(); } void CreateDust() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) Dust.NewDust(npc.position, npc.width, npc.height, 59); } @@ -333,17 +333,17 @@ public override void NPCLoot() } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThruthMask")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrebleClef")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Revolwar")); } diff --git a/NPCs/SpaceWhale.cs b/NPCs/SpaceWhale.cs index b82e7fef..9f38783b 100644 --- a/NPCs/SpaceWhale.cs +++ b/NPCs/SpaceWhale.cs @@ -792,7 +792,7 @@ public override void NPCLoot() TremorWorld.DropComet(); //return; } - if (TremorWorld.Boss.SpaceWhale.IsDowned() && Main.rand.Next(3) == 0) + if (TremorWorld.Boss.SpaceWhale.IsDowned() && Main.rand.NextBool(3)) { Main.NewText("A comet has struck the ground!", 117, 187, 253); TremorWorld.DropComet(); @@ -800,36 +800,36 @@ public override void NPCLoot() } TremorWorld.Boss.SpaceWhale.Downed(); - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleMask")); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleTrophy")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SDL")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("BlackHoleCannon")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("HornedWarHammer")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("StarLantern")); } - if (!Main.expertMode && Main.rand.Next(8) == 0) + if (!Main.expertMode && Main.rand.NextBool(8)) { Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("WhaleFlippers")); } diff --git a/NPCs/SpaceWhaleMinion.cs b/NPCs/SpaceWhaleMinion.cs index 7d39f37c..28c4f7e1 100644 --- a/NPCs/SpaceWhaleMinion.cs +++ b/NPCs/SpaceWhaleMinion.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f)].velocity *= 0.3f; } diff --git a/NPCs/Spaceman.cs b/NPCs/Spaceman.cs index c3ba97da..d97bedd2 100644 --- a/NPCs/Spaceman.cs +++ b/NPCs/Spaceman.cs @@ -43,9 +43,9 @@ public override void AI() public override void NPCLoot() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(ItemID.Meteorite, Main.rand.Next(1, 6)); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) this.NewItem(ItemID.MeteoriteBar, Main.rand.Next(1, 3)); if (Main.rand.Next(46) == 0) this.NewItem(ItemID.SpaceGun, Main.rand.Next(1)); diff --git a/NPCs/SpiderMan.cs b/NPCs/SpiderMan.cs index 16f7470d..7a9e8883 100644 --- a/NPCs/SpiderMan.cs +++ b/NPCs/SpiderMan.cs @@ -34,7 +34,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) this.NewItem(ItemID.SpiderFang, Main.rand.Next(60, 150)); } diff --git a/NPCs/SquidZombie.cs b/NPCs/SquidZombie.cs index 513340b6..1689acd9 100644 --- a/NPCs/SquidZombie.cs +++ b/NPCs/SquidZombie.cs @@ -38,7 +38,7 @@ public override void NPCLoot() { if (Main.rand.Next(24) == 0) this.NewItem(mod.ItemType()); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/Squoma.cs b/NPCs/Squoma.cs index d921e640..c97fd3f2 100644 --- a/NPCs/Squoma.cs +++ b/NPCs/Squoma.cs @@ -36,7 +36,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); } diff --git a/NPCs/StormJellyfish.cs b/NPCs/StormJellyfish.cs index 9614add1..e5242afd 100644 --- a/NPCs/StormJellyfish.cs +++ b/NPCs/StormJellyfish.cs @@ -136,27 +136,27 @@ public override void NPCLoot() npc.DropBossBags(); } - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormJellyfishMask")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormBlade")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Poseidon")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("JellyfishStaff")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BoltTome")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StickyFlail")); } diff --git a/NPCs/TheAxeman.cs b/NPCs/TheAxeman.cs index 6351e25c..21d1eb7f 100644 --- a/NPCs/TheAxeman.cs +++ b/NPCs/TheAxeman.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/TheDarkEmperorTwo.cs b/NPCs/TheDarkEmperorTwo.cs index 403edb22..36ad706a 100644 --- a/NPCs/TheDarkEmperorTwo.cs +++ b/NPCs/TheDarkEmperorTwo.cs @@ -395,7 +395,7 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorMask")); } @@ -403,11 +403,11 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorTrophy")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DrippingScythe")); } - if (!Main.expertMode && Main.rand.Next(5) == 0) + if (!Main.expertMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DelightfulClump")); } diff --git a/NPCs/TheGirl.cs b/NPCs/TheGirl.cs index 38c207a4..482af2ab 100644 --- a/NPCs/TheGirl.cs +++ b/NPCs/TheGirl.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/ThinMan.cs b/NPCs/ThinMan.cs index c538d484..3f4799dd 100644 --- a/NPCs/ThinMan.cs +++ b/NPCs/ThinMan.cs @@ -37,7 +37,7 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) this.NewItem(mod.ItemType()); } diff --git a/NPCs/ThunderBones.cs b/NPCs/ThunderBones.cs index c9d3bf8b..fec30b62 100644 --- a/NPCs/ThunderBones.cs +++ b/NPCs/ThunderBones.cs @@ -35,7 +35,7 @@ public override void SetDefaults() public override void AI() { - if (Main.rand.Next(9) == 0) + if (Main.rand.NextBool(9)) Main.dust[Dust.NewDust(npc.position, npc.width, npc.height, 180, 0f, 0f, 200, npc.color)].velocity *= 0.3f; } diff --git a/NPCs/TremorGlobalNPC.cs b/NPCs/TremorGlobalNPC.cs index 58fbe4b5..07e67fc6 100644 --- a/NPCs/TremorGlobalNPC.cs +++ b/NPCs/TremorGlobalNPC.cs @@ -40,7 +40,7 @@ public override void DrawEffects(NPC npc, ref Color drawColor) dust.noGravity = true; dust.velocity *= 1.8f; dust.velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { dust.noGravity = false; dust.scale *= 0.5f; diff --git a/NPCs/TremorNPC.cs b/NPCs/TremorNPC.cs index 18004f20..2b51b788 100644 --- a/NPCs/TremorNPC.cs +++ b/NPCs/TremorNPC.cs @@ -14,93 +14,93 @@ public override void NPCLoot(NPC npc) { if (npc.type == 147) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 150) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 154) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 155) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 161) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 167) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 168) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 169) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 184) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 185) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 197) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 206) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } if (npc.type == 431) { - if (Main.rand.Next(7) == 1) + if (Main.rand.NextBool(7)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); } } - if (npc.type == 77 && Main.rand.Next(3) == 0) + if (npc.type == 77 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheRib")); } - if (npc.type == 110 && Main.rand.Next(3) == 0) + if (npc.type == 110 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheRib")); } - if (npc.type == 483 && Main.rand.Next(4) == 0) + if (npc.type == 483 && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); } - if (npc.type == 481 && Main.rand.Next(4) == 0) + if (npc.type == 481 && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); @@ -124,13 +124,13 @@ public override void NPCLoot(NPC npc) mod.ItemType("PossessedGreaves")); } - if (!Main.expertMode && npc.type == 127 && Main.rand.Next(6) == 0) + if (!Main.expertMode && npc.type == 127 && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PrimeBlade")); } - if (!Main.expertMode && npc.type == 134 && Main.rand.Next(6) == 0) + if (!Main.expertMode && npc.type == 134 && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Destructor")); @@ -155,13 +155,13 @@ public override void NPCLoot(NPC npc) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stigmata")); } - if (npc.type == 62 && Main.rand.Next(2) == 0) + if (npc.type == 62 && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonBlood")); } - if (npc.type == 66 && Main.rand.Next(2) == 0) + if (npc.type == 66 && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonBlood")); @@ -172,25 +172,25 @@ public override void NPCLoot(NPC npc) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LongBow")); } - if (npc.type == 127 && Main.rand.Next(3) == 0) + if (npc.type == 127 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderHead")); } - if (npc.type == 125 && Main.rand.Next(5) == 0) + if (npc.type == 125 && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderBody")); } - if (npc.type == 126 && Main.rand.Next(5) == 0) + if (npc.type == 126 && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderBody")); } - if (npc.type == 134 && Main.rand.Next(3) == 0) + if (npc.type == 134 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderLegs")); @@ -268,7 +268,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("ButcherMask")); } - if (npc.type == 175 && Main.rand.Next(2) == 0) + if (npc.type == 175 && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThornBall"), Main.rand.Next(6, 15)); @@ -292,7 +292,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("MechanicalBrain")); } - if (npc.type == 532 && Main.rand.Next(3) == 0) + if (npc.type == 532 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); @@ -316,43 +316,43 @@ public override void NPCLoot(NPC npc) mod.ItemType("AncientMeteorHelmet")); } - if (npc.type == 346 && Main.rand.Next(7) == 0) + if (npc.type == 346 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SantaNK1Mask")); } - if (npc.type == 345 && Main.rand.Next(7) == 0) + if (npc.type == 345 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceQueenMask")); } - if (npc.type == 344 && Main.rand.Next(7) == 0) + if (npc.type == 344 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EverscreamMask")); } - if (npc.type == 327 && Main.rand.Next(7) == 0) + if (npc.type == 327 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PumpkingMask")); } - if (npc.type == 328 && Main.rand.Next(7) == 0) + if (npc.type == 328 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PumpkingMask")); } - if (npc.type == 325 && Main.rand.Next(7) == 0) + if (npc.type == 325 && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MourningWoodMask")); } - if (npc.type == 491 && Main.rand.Next(3) == 0) + if (npc.type == 491 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PirateChest")); @@ -376,7 +376,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("IonBlaster")); } - if (npc.type == 513 && Main.rand.Next(3) == 0) + if (npc.type == 513 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); @@ -385,20 +385,20 @@ public override void NPCLoot(NPC npc) if ((npc.type == 3 || npc.type == 132 || npc.type == 186 || npc.type == 187 || npc.type == 188 || npc.type == 189 || npc.type == 200 || npc.type == 132 || npc.type == 319 || npc.type == 320 || npc.type == 321 || npc.type == 331 || npc.type == 332 || npc.type == 430 || npc.type == 432 || - npc.type == 433 || npc.type == 434 || npc.type == 435 || npc.type == 436) && Main.rand.Next(3) == 0) + npc.type == 433 || npc.type == 434 || npc.type == 435 || npc.type == 436) && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); } - if ((npc.type == 48 || npc.type == 75 || npc.type == 87) && Main.rand.Next(3) == 0) + if ((npc.type == 48 || npc.type == 75 || npc.type == 87) && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AirFragment")); } if ((npc.type == 58 || npc.type == 65 || npc.type == 63 || npc.type == 64 || npc.type == 102 || - npc.type == 103 || npc.type == 157) && Main.rand.Next(2) == 0) + npc.type == 103 || npc.type == 157) && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaFragment")); @@ -406,14 +406,14 @@ public override void NPCLoot(NPC npc) if ((npc.type == 10 || npc.type == 95 || npc.type == 56 || npc.type == 153 || npc.type == 175 || npc.type == 176 || npc.type == 205 || npc.type == 231 || npc.type == 232 || npc.type == 233 || - npc.type == 234 || npc.type == 235 || npc.type == 236 || npc.type == 237) && Main.rand.Next(4) == 0) + npc.type == 234 || npc.type == 235 || npc.type == 236 || npc.type == 237) && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EarthFragment")); } if ((npc.type == 24 || npc.type == 59 || npc.type == 60 || npc.type == 151 || npc.type == 62 || - npc.type == 66) && Main.rand.Next(3) == 0) + npc.type == 66) && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment")); @@ -460,17 +460,17 @@ public override void NPCLoot(NPC npc) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Narsil")); } - if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenHelmet")); } - if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenBreastplate")); } - if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenLeggings")); @@ -482,7 +482,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("CorruptorStaff")); } - if (npc.type == 266 && Main.rand.Next(3) == 0) + if (npc.type == 266 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CreeperStaff")); @@ -501,7 +501,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("SuspiciousBag")); } - if (NPC.downedMoonlord && Main.player[Main.myPlayer].ZoneDungeon && Main.rand.Next(4) == 0) + if (NPC.downedMoonlord && Main.player[Main.myPlayer].ZoneDungeon && Main.rand.NextBool(4)) { if (npc.lifeMax > 200 && !Main.expertMode) { @@ -520,7 +520,7 @@ public override void NPCLoot(NPC npc) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorruptorGun")); } - if ((npc.type == 69 || npc.type == 508) && Main.rand.Next(6) == 0) + if ((npc.type == 69 || npc.type == 508) && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AntlionShell")); @@ -540,7 +540,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("GreenClaw")); } if ((npc.type == 498 || npc.type == 499 || npc.type == 500 || npc.type == 501 || npc.type == 502 || - npc.type == 503 || npc.type == 504 || npc.type == 505 || npc.type == 506) && Main.rand.Next(2) == 0) + npc.type == 503 || npc.type == 504 || npc.type == 505 || npc.type == 506) && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SalamanderSkin"), Main.rand.Next(2)); @@ -558,7 +558,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("TriangleMask")); } - if ((npc.type == 35) && Main.rand.Next(6) == 0) + if ((npc.type == 35) && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheArtifact")); @@ -580,7 +580,7 @@ public override void NPCLoot(NPC npc) //if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || // npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || // npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.NextBool(8)) //{ // Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, // mod.ItemType("RedSteelArmorPiece")); @@ -589,7 +589,7 @@ public override void NPCLoot(NPC npc) //if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || // npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || // npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.NextBool(8)) //{ // Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, // mod.ItemType("FaultyRedSteelShield")); @@ -598,7 +598,7 @@ public override void NPCLoot(NPC npc) //if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || // npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || // npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + // npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.NextBool(8)) //{ // Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, // mod.ItemType("ChippyRedSteelSword")); @@ -609,7 +609,7 @@ public override void NPCLoot(NPC npc) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheBrain")); } - if ((npc.type == 490) && Main.rand.Next(4) == 0) + if ((npc.type == 490) && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DrippingRoot")); @@ -620,20 +620,20 @@ public override void NPCLoot(NPC npc) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkMass")); } - if ((npc.type == 164 || npc.type == 165) && Main.rand.Next(5) == 0) + if ((npc.type == 164 || npc.type == 165) && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SpiderMeat"), Main.rand.Next(1, 3)); } if ((npc.type == 98 || npc.type == 94 || npc.type == 101 || npc.type == 170 || npc.type == 180 || - npc.type == 182) && NPC.downedMoonlord && Main.rand.Next(7) == 0) + npc.type == 182) && NPC.downedMoonlord && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ClusterShard"), Main.rand.Next(1, 2)); } - if ((npc.type == 175 || npc.type == 205 || npc.type == 226) && NPC.downedMoonlord && Main.rand.Next(4) == 0) + if ((npc.type == 175 || npc.type == 205 || npc.type == 226) && NPC.downedMoonlord && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonCapsule"), Main.rand.Next(1, 2)); @@ -663,25 +663,25 @@ public override void NPCLoot(NPC npc) mod.ItemType("TearsofDeath"), Main.rand.Next(1, 3)); } - if (npc.type == 169 && Main.rand.Next(5) == 0) + if (npc.type == 169 && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore"), Main.rand.Next(1, 3)); } - if (npc.type == 431 && Main.rand.Next(8) == 0) + if (npc.type == 431 && Main.rand.NextBool(8)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); } - if (npc.type == 161 && Main.rand.Next(8) == 0) + if (npc.type == 161 && Main.rand.NextBool(8)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); } - if (npc.type == 477 && Main.rand.Next(4) == 0) + if (npc.type == 477 && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroAmulet")); @@ -705,13 +705,13 @@ public override void NPCLoot(NPC npc) mod.ItemType("KeyKnife")); } - if (!Main.expertMode && npc.type == 4 && Main.rand.Next(5) == 0) + if (!Main.expertMode && npc.type == 4 && Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeMonolith")); } - if (!Main.expertMode && npc.type == 4 && Main.rand.Next(3) == 0) + if (!Main.expertMode && npc.type == 4 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MonsterTooth"), Main.rand.Next(20, 40)); @@ -753,7 +753,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("EssenseofJungle"), Main.rand.Next(2, 3)); } - if (npc.type == 370 && !Main.expertMode && Main.rand.Next(6) == 0) + if (npc.type == 370 && !Main.expertMode && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DukesCannon"), Main.rand.Next(2, 3)); @@ -789,7 +789,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("UnstableCrystal")); } - if (npc.type == 17 && Main.rand.Next(2) == 0) + if (npc.type == 17 && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MoneySack"), Main.rand.Next(2, 4)); @@ -801,7 +801,7 @@ public override void NPCLoot(NPC npc) mod.ItemType("MultidimensionalFragment"), Main.rand.Next(6, 12)); } - if (!Main.expertMode && npc.type == 222 && Main.rand.Next(3) == 0) + if (!Main.expertMode && npc.type == 222 && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YellowPuzzleFragment")); @@ -831,13 +831,13 @@ public override void NPCLoot(NPC npc) mod.ItemType("RichMahoganySeed")); } - if (!Main.expertMode && npc.type == 126 && !NPC.AnyNPCs(125) && Main.rand.Next(6) == 0) + if (!Main.expertMode && npc.type == 126 && !NPC.AnyNPCs(125) && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MechaSprayer")); } - if (!Main.expertMode && npc.type == 125 && !NPC.AnyNPCs(126) && Main.rand.Next(6) == 0) + if (!Main.expertMode && npc.type == 125 && !NPC.AnyNPCs(126) && Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MechaSprayer")); diff --git a/NPCs/WallOfShadow.cs b/NPCs/WallOfShadow.cs index f30d5854..367a05b8 100644 --- a/NPCs/WallOfShadow.cs +++ b/NPCs/WallOfShadow.cs @@ -767,7 +767,7 @@ public override void NPCLoot() Helper.DropItems(npc.position, npc.Size, new Drop(mod.ItemType("HeavyBeamCannon"), 1, 1), new Drop(mod.ItemType("Bolter"), 1, 1), new Drop(mod.ItemType("StrikerBlade"), 1, 1), new Drop(0, 0, 0)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarknessCloth"), Main.rand.Next(8, 15)); - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WallofShadowMask")); } diff --git a/NPCs/WoodlingWarrior.cs b/NPCs/WoodlingWarrior.cs index 94d91268..92938892 100644 --- a/NPCs/WoodlingWarrior.cs +++ b/NPCs/WoodlingWarrior.cs @@ -39,7 +39,7 @@ public override void NPCLoot() { if (Main.rand.NextBool()) this.NewItem(ItemID.Wood, Main.rand.Next(1, 6)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); } diff --git a/NPCs/Zootaloo.cs b/NPCs/Zootaloo.cs index c453b929..b6b28c7a 100644 --- a/NPCs/Zootaloo.cs +++ b/NPCs/Zootaloo.cs @@ -36,9 +36,9 @@ public override void SetDefaults() public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) this.NewItem(mod.ItemType(), Main.rand.Next(1, 3)); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) this.NewItem(mod.ItemType(), Main.rand.Next(5, 13)); } diff --git a/NPCs/npcVultureKing.cs b/NPCs/npcVultureKing.cs index ea0e5295..b2f5345f 100644 --- a/NPCs/npcVultureKing.cs +++ b/NPCs/npcVultureKing.cs @@ -223,7 +223,7 @@ public override void NPCLoot() int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(7) == 0) + if (!Main.expertMode && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingMask")); } @@ -231,15 +231,15 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingTrophy")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CactusBow")); } - if (!Main.expertMode && Main.rand.Next(3) == 0) + if (!Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SandKnife")); } - if (!Main.expertMode && Main.rand.Next(4) == 0) + if (!Main.expertMode && Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureFeather")); } diff --git a/Projectiles/Alchemic/BasicFlaskPro.cs b/Projectiles/Alchemic/BasicFlaskPro.cs index 14f17cef..7006769b 100644 --- a/Projectiles/Alchemic/BasicFlaskPro.cs +++ b/Projectiles/Alchemic/BasicFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/BigHealingFlackPro.cs b/Projectiles/Alchemic/BigHealingFlackPro.cs index e2ecf1e2..077187e6 100644 --- a/Projectiles/Alchemic/BigHealingFlackPro.cs +++ b/Projectiles/Alchemic/BigHealingFlackPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/BigManaFlaskPro.cs b/Projectiles/Alchemic/BigManaFlaskPro.cs index 92fd2853..448739d9 100644 --- a/Projectiles/Alchemic/BigManaFlaskPro.cs +++ b/Projectiles/Alchemic/BigManaFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/BigPoisonFlaskPro.cs b/Projectiles/Alchemic/BigPoisonFlaskPro.cs index adafe7ca..1aab48ef 100644 --- a/Projectiles/Alchemic/BigPoisonFlaskPro.cs +++ b/Projectiles/Alchemic/BigPoisonFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/BigVenomFlaskPro.cs b/Projectiles/Alchemic/BigVenomFlaskPro.cs index d25136c4..56385437 100644 --- a/Projectiles/Alchemic/BigVenomFlaskPro.cs +++ b/Projectiles/Alchemic/BigVenomFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/Blasts/FieryBlast.cs b/Projectiles/Alchemic/Blasts/FieryBlast.cs index bd65bfe8..4aaea6f3 100644 --- a/Projectiles/Alchemic/Blasts/FieryBlast.cs +++ b/Projectiles/Alchemic/Blasts/FieryBlast.cs @@ -40,7 +40,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/Alchemic/Blasts/FrostBlast.cs b/Projectiles/Alchemic/Blasts/FrostBlast.cs index 0398d928..14a4b1ea 100644 --- a/Projectiles/Alchemic/Blasts/FrostBlast.cs +++ b/Projectiles/Alchemic/Blasts/FrostBlast.cs @@ -40,7 +40,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/Alchemic/Blasts/PoisonBlast.cs b/Projectiles/Alchemic/Blasts/PoisonBlast.cs index 1ac0bbff..083cedf3 100644 --- a/Projectiles/Alchemic/Blasts/PoisonBlast.cs +++ b/Projectiles/Alchemic/Blasts/PoisonBlast.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/Alchemic/Blasts/PurpleBlast.cs b/Projectiles/Alchemic/Blasts/PurpleBlast.cs index a6ae9970..23605565 100644 --- a/Projectiles/Alchemic/Blasts/PurpleBlast.cs +++ b/Projectiles/Alchemic/Blasts/PurpleBlast.cs @@ -40,7 +40,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 180, false); } diff --git a/Projectiles/Alchemic/Blasts/ShadowBlast.cs b/Projectiles/Alchemic/Blasts/ShadowBlast.cs index 035e4ef8..28e34834 100644 --- a/Projectiles/Alchemic/Blasts/ShadowBlast.cs +++ b/Projectiles/Alchemic/Blasts/ShadowBlast.cs @@ -40,7 +40,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/Blasts/SparkingBlast.cs b/Projectiles/Alchemic/Blasts/SparkingBlast.cs index a2be021e..c4901430 100644 --- a/Projectiles/Alchemic/Blasts/SparkingBlast.cs +++ b/Projectiles/Alchemic/Blasts/SparkingBlast.cs @@ -40,7 +40,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/BoomFlaskPro.cs b/Projectiles/Alchemic/BoomFlaskPro.cs index 0a8dcd62..99aa6547 100644 --- a/Projectiles/Alchemic/BoomFlaskPro.cs +++ b/Projectiles/Alchemic/BoomFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } @@ -160,7 +160,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Alchemic/BurningFlaskPro.cs b/Projectiles/Alchemic/BurningFlaskPro.cs index b4775767..9feb1bc7 100644 --- a/Projectiles/Alchemic/BurningFlaskPro.cs +++ b/Projectiles/Alchemic/BurningFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/Bursts/BoomSkull.cs b/Projectiles/Alchemic/Bursts/BoomSkull.cs index 34535971..44f8149a 100644 --- a/Projectiles/Alchemic/Bursts/BoomSkull.cs +++ b/Projectiles/Alchemic/Bursts/BoomSkull.cs @@ -39,7 +39,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Alchemic/Bursts/BoomSkullburst.cs b/Projectiles/Alchemic/Bursts/BoomSkullburst.cs index 429eeb77..9635672b 100644 --- a/Projectiles/Alchemic/Bursts/BoomSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/BoomSkullburst.cs @@ -30,7 +30,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Alchemic/Bursts/FieryBurst.cs b/Projectiles/Alchemic/Bursts/FieryBurst.cs index 14a35b2f..64198b3e 100644 --- a/Projectiles/Alchemic/Bursts/FieryBurst.cs +++ b/Projectiles/Alchemic/Bursts/FieryBurst.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/FierySkull.cs b/Projectiles/Alchemic/Bursts/FierySkull.cs index 2bbaef65..a56fec7e 100644 --- a/Projectiles/Alchemic/Bursts/FierySkull.cs +++ b/Projectiles/Alchemic/Bursts/FierySkull.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/FierySkullburst.cs b/Projectiles/Alchemic/Bursts/FierySkullburst.cs index 4635b6f1..c87bd96c 100644 --- a/Projectiles/Alchemic/Bursts/FierySkullburst.cs +++ b/Projectiles/Alchemic/Bursts/FierySkullburst.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/FrostBurst.cs b/Projectiles/Alchemic/Bursts/FrostBurst.cs index bdb578be..ef3b318b 100644 --- a/Projectiles/Alchemic/Bursts/FrostBurst.cs +++ b/Projectiles/Alchemic/Bursts/FrostBurst.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/FrostSkull.cs b/Projectiles/Alchemic/Bursts/FrostSkull.cs index 4e55d353..9c9c0a58 100644 --- a/Projectiles/Alchemic/Bursts/FrostSkull.cs +++ b/Projectiles/Alchemic/Bursts/FrostSkull.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/FrostSkullburst.cs b/Projectiles/Alchemic/Bursts/FrostSkullburst.cs index aeb0d7e3..c62a4ece 100644 --- a/Projectiles/Alchemic/Bursts/FrostSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/FrostSkullburst.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PoisonBurst.cs b/Projectiles/Alchemic/Bursts/PoisonBurst.cs index 84df1924..2e33e98e 100644 --- a/Projectiles/Alchemic/Bursts/PoisonBurst.cs +++ b/Projectiles/Alchemic/Bursts/PoisonBurst.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PoisonSkull.cs b/Projectiles/Alchemic/Bursts/PoisonSkull.cs index 7c62bd05..f10c0893 100644 --- a/Projectiles/Alchemic/Bursts/PoisonSkull.cs +++ b/Projectiles/Alchemic/Bursts/PoisonSkull.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PoisonSkullburst.cs b/Projectiles/Alchemic/Bursts/PoisonSkullburst.cs index 06a71b92..dee04775 100644 --- a/Projectiles/Alchemic/Bursts/PoisonSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/PoisonSkullburst.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PurpleBurst.cs b/Projectiles/Alchemic/Bursts/PurpleBurst.cs index 3f967dce..334329f9 100644 --- a/Projectiles/Alchemic/Bursts/PurpleBurst.cs +++ b/Projectiles/Alchemic/Bursts/PurpleBurst.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PurpleSkull.cs b/Projectiles/Alchemic/Bursts/PurpleSkull.cs index 39e8a628..f648fcaa 100644 --- a/Projectiles/Alchemic/Bursts/PurpleSkull.cs +++ b/Projectiles/Alchemic/Bursts/PurpleSkull.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/PurpleSkullburst.cs b/Projectiles/Alchemic/Bursts/PurpleSkullburst.cs index 30ec6b55..31cbba71 100644 --- a/Projectiles/Alchemic/Bursts/PurpleSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/PurpleSkullburst.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/ShadowBurst.cs b/Projectiles/Alchemic/Bursts/ShadowBurst.cs index 1d1e6d9b..e3f15e35 100644 --- a/Projectiles/Alchemic/Bursts/ShadowBurst.cs +++ b/Projectiles/Alchemic/Bursts/ShadowBurst.cs @@ -28,7 +28,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/ShadowSkull.cs b/Projectiles/Alchemic/Bursts/ShadowSkull.cs index 7e764c02..9ac85570 100644 --- a/Projectiles/Alchemic/Bursts/ShadowSkull.cs +++ b/Projectiles/Alchemic/Bursts/ShadowSkull.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/Bursts/ShadowSkullburst.cs b/Projectiles/Alchemic/Bursts/ShadowSkullburst.cs index 675954c0..b029ee58 100644 --- a/Projectiles/Alchemic/Bursts/ShadowSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/ShadowSkullburst.cs @@ -24,7 +24,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/ClusterFlaskPro.cs b/Projectiles/Alchemic/ClusterFlaskPro.cs index af38eab9..afb26506 100644 --- a/Projectiles/Alchemic/ClusterFlaskPro.cs +++ b/Projectiles/Alchemic/ClusterFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/CrystalFlaskPro.cs b/Projectiles/Alchemic/CrystalFlaskPro.cs index 4f95b663..067ee906 100644 --- a/Projectiles/Alchemic/CrystalFlaskPro.cs +++ b/Projectiles/Alchemic/CrystalFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/DukeFlaskPro.cs b/Projectiles/Alchemic/DukeFlaskPro.cs index 7d225f33..5c17817b 100644 --- a/Projectiles/Alchemic/DukeFlaskPro.cs +++ b/Projectiles/Alchemic/DukeFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs b/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs index 7df660b7..81773aa6 100644 --- a/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } @@ -160,7 +160,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs b/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs index 84d28381..5c65d8e9 100644 --- a/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs b/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs index 12f81067..8861b0ca 100644 --- a/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/FieryCloudPro.cs b/Projectiles/Alchemic/FieryCloudPro.cs index 8975322b..ef7869c4 100644 --- a/Projectiles/Alchemic/FieryCloudPro.cs +++ b/Projectiles/Alchemic/FieryCloudPro.cs @@ -24,7 +24,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/Alchemic/FreezeFlaskPro.cs b/Projectiles/Alchemic/FreezeFlaskPro.cs index fb26ef70..97b8c729 100644 --- a/Projectiles/Alchemic/FreezeFlaskPro.cs +++ b/Projectiles/Alchemic/FreezeFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/FrostCloudPro.cs b/Projectiles/Alchemic/FrostCloudPro.cs index 12feeab3..6e9146df 100644 --- a/Projectiles/Alchemic/FrostCloudPro.cs +++ b/Projectiles/Alchemic/FrostCloudPro.cs @@ -24,7 +24,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/Alchemic/GoldFlaskPro.cs b/Projectiles/Alchemic/GoldFlaskPro.cs index a60dbec3..e820aafd 100644 --- a/Projectiles/Alchemic/GoldFlaskPro.cs +++ b/Projectiles/Alchemic/GoldFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/LesserHealingFlackPro.cs b/Projectiles/Alchemic/LesserHealingFlackPro.cs index b7a13dba..44744c6a 100644 --- a/Projectiles/Alchemic/LesserHealingFlackPro.cs +++ b/Projectiles/Alchemic/LesserHealingFlackPro.cs @@ -76,7 +76,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/LesserManaFlaskPro.cs b/Projectiles/Alchemic/LesserManaFlaskPro.cs index 3780b577..e09a7c29 100644 --- a/Projectiles/Alchemic/LesserManaFlaskPro.cs +++ b/Projectiles/Alchemic/LesserManaFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/LesserPoisonFlaskPro.cs b/Projectiles/Alchemic/LesserPoisonFlaskPro.cs index ddc3cf1a..b64d56a9 100644 --- a/Projectiles/Alchemic/LesserPoisonFlaskPro.cs +++ b/Projectiles/Alchemic/LesserPoisonFlaskPro.cs @@ -76,7 +76,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/LesserVenomFlaskPro.cs b/Projectiles/Alchemic/LesserVenomFlaskPro.cs index 112161e2..862d9bd4 100644 --- a/Projectiles/Alchemic/LesserVenomFlaskPro.cs +++ b/Projectiles/Alchemic/LesserVenomFlaskPro.cs @@ -72,7 +72,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/MoonDustFlaskPro.cs b/Projectiles/Alchemic/MoonDustFlaskPro.cs index 2b11455e..b02e277b 100644 --- a/Projectiles/Alchemic/MoonDustFlaskPro.cs +++ b/Projectiles/Alchemic/MoonDustFlaskPro.cs @@ -76,7 +76,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/PhantomFlaskPro.cs b/Projectiles/Alchemic/PhantomFlaskPro.cs index ffb319a7..83cf4cb3 100644 --- a/Projectiles/Alchemic/PhantomFlaskPro.cs +++ b/Projectiles/Alchemic/PhantomFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/PlagueFlaskPro.cs b/Projectiles/Alchemic/PlagueFlaskPro.cs index 3b1d7a50..53a5dfe3 100644 --- a/Projectiles/Alchemic/PlagueFlaskPro.cs +++ b/Projectiles/Alchemic/PlagueFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/PoisonCloudPro.cs b/Projectiles/Alchemic/PoisonCloudPro.cs index ad90eb0f..3737e867 100644 --- a/Projectiles/Alchemic/PoisonCloudPro.cs +++ b/Projectiles/Alchemic/PoisonCloudPro.cs @@ -23,7 +23,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/Alchemic/PurpleCloudPro.cs b/Projectiles/Alchemic/PurpleCloudPro.cs index b7ff9edc..96eaaf44 100644 --- a/Projectiles/Alchemic/PurpleCloudPro.cs +++ b/Projectiles/Alchemic/PurpleCloudPro.cs @@ -23,7 +23,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(70, 180, false); } diff --git a/Projectiles/Alchemic/ShadowCloudPro.cs b/Projectiles/Alchemic/ShadowCloudPro.cs index 6bf67f8d..18f77c78 100644 --- a/Projectiles/Alchemic/ShadowCloudPro.cs +++ b/Projectiles/Alchemic/ShadowCloudPro.cs @@ -34,7 +34,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Alchemic/SparkingFlaskPro.cs b/Projectiles/Alchemic/SparkingFlaskPro.cs index 8bb2cdad..ca010376 100644 --- a/Projectiles/Alchemic/SparkingFlaskPro.cs +++ b/Projectiles/Alchemic/SparkingFlaskPro.cs @@ -78,7 +78,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/SuperHealingFlaskPro.cs b/Projectiles/Alchemic/SuperHealingFlaskPro.cs index 7d08cbcd..96a006a8 100644 --- a/Projectiles/Alchemic/SuperHealingFlaskPro.cs +++ b/Projectiles/Alchemic/SuperHealingFlaskPro.cs @@ -76,7 +76,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/SuperManaFlaskPro.cs b/Projectiles/Alchemic/SuperManaFlaskPro.cs index 4b42f79d..f27576ce 100644 --- a/Projectiles/Alchemic/SuperManaFlaskPro.cs +++ b/Projectiles/Alchemic/SuperManaFlaskPro.cs @@ -76,7 +76,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Alchemic/ToxicFlaskPro.cs b/Projectiles/Alchemic/ToxicFlaskPro.cs index 85bfc7a5..aaff6723 100644 --- a/Projectiles/Alchemic/ToxicFlaskPro.cs +++ b/Projectiles/Alchemic/ToxicFlaskPro.cs @@ -77,7 +77,7 @@ public override void AI() num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/AncientClaymorePro.cs b/Projectiles/AncientClaymorePro.cs index cbe76dbb..da241556 100644 --- a/Projectiles/AncientClaymorePro.cs +++ b/Projectiles/AncientClaymorePro.cs @@ -33,7 +33,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/AncientDaggerPro.cs b/Projectiles/AncientDaggerPro.cs index 6b6a0532..14e35725 100644 --- a/Projectiles/AncientDaggerPro.cs +++ b/Projectiles/AncientDaggerPro.cs @@ -36,7 +36,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/AncientFlailPro.cs b/Projectiles/AncientFlailPro.cs index 6580dbc1..b46e8f33 100644 --- a/Projectiles/AncientFlailPro.cs +++ b/Projectiles/AncientFlailPro.cs @@ -65,7 +65,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AncientSunExplosionPro"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/AncientSolarWindPro.cs b/Projectiles/AncientSolarWindPro.cs index 40a2a843..8646e1c7 100644 --- a/Projectiles/AncientSolarWindPro.cs +++ b/Projectiles/AncientSolarWindPro.cs @@ -76,7 +76,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/AngelTearsPro.cs b/Projectiles/AngelTearsPro.cs index 791d9050..7ab258b3 100644 --- a/Projectiles/AngelTearsPro.cs +++ b/Projectiles/AngelTearsPro.cs @@ -42,7 +42,7 @@ public override void AI() Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num97 = 4; int num98 = Dust.NewDust(new Vector2(projectile.position.X + num97, projectile.position.Y + num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default(Color), 0.6f); diff --git a/Projectiles/ArgiteSpherePro.cs b/Projectiles/ArgiteSpherePro.cs index 95488d16..7b93be3e 100644 --- a/Projectiles/ArgiteSpherePro.cs +++ b/Projectiles/ArgiteSpherePro.cs @@ -50,7 +50,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.6f, projectile.velocity.Y * 0.6f); } @@ -62,7 +62,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/BestNightmarePro.cs b/Projectiles/BestNightmarePro.cs index 1463fc12..ff32cd92 100644 --- a/Projectiles/BestNightmarePro.cs +++ b/Projectiles/BestNightmarePro.cs @@ -42,11 +42,11 @@ public override void AI() { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 61, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } diff --git a/Projectiles/BloodyArrow.cs b/Projectiles/BloodyArrow.cs index 05518346..96de1261 100644 --- a/Projectiles/BloodyArrow.cs +++ b/Projectiles/BloodyArrow.cs @@ -36,7 +36,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/Bounce.cs b/Projectiles/Bounce.cs index ac0d6ceb..1704f1cb 100644 --- a/Projectiles/Bounce.cs +++ b/Projectiles/Bounce.cs @@ -57,7 +57,7 @@ public override void AI() public void CreateDust() { - if (Main.rand.Next(2) == 1) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType()); Main.dust[dust].scale = 0.9f; diff --git a/Projectiles/BrainiacWavePro.cs b/Projectiles/BrainiacWavePro.cs index 6f169c15..f5501295 100644 --- a/Projectiles/BrainiacWavePro.cs +++ b/Projectiles/BrainiacWavePro.cs @@ -53,7 +53,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/BurningFist.cs b/Projectiles/BurningFist.cs index 82e009ec..5914a9dd 100644 --- a/Projectiles/BurningFist.cs +++ b/Projectiles/BurningFist.cs @@ -50,7 +50,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/ChaosStarPro.cs b/Projectiles/ChaosStarPro.cs index 2d1acab6..3f422fd3 100644 --- a/Projectiles/ChaosStarPro.cs +++ b/Projectiles/ChaosStarPro.cs @@ -43,7 +43,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/CorfirePro.cs b/Projectiles/CorfirePro.cs index 059ed9da..b68f16f9 100644 --- a/Projectiles/CorfirePro.cs +++ b/Projectiles/CorfirePro.cs @@ -31,7 +31,7 @@ public override void AI() } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(39, 280, false); } @@ -39,7 +39,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(39, 280, false); } diff --git a/Projectiles/CornJavelinPro.cs b/Projectiles/CornJavelinPro.cs index 019cd8b4..c5b5f813 100644 --- a/Projectiles/CornJavelinPro.cs +++ b/Projectiles/CornJavelinPro.cs @@ -33,7 +33,7 @@ public override void Kill(int timeLeft) } Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("CornJavelin")); }; diff --git a/Projectiles/CrSpear.cs b/Projectiles/CrSpear.cs index 1a97628e..70bb89ae 100644 --- a/Projectiles/CrSpear.cs +++ b/Projectiles/CrSpear.cs @@ -42,7 +42,7 @@ public override void Kill(int timeLeft) public void CreateDust() { - if (Main.rand.Next(2) == 1) + if (Main.rand.NextBool(2)) { /* TODO: CrystalD does not exist int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType()); diff --git a/Projectiles/CursedBreathPro.cs b/Projectiles/CursedBreathPro.cs index 33e05ecd..e4fe805a 100644 --- a/Projectiles/CursedBreathPro.cs +++ b/Projectiles/CursedBreathPro.cs @@ -33,7 +33,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(39, 60); } @@ -41,7 +41,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(39, 60); } diff --git a/Projectiles/CyclonePro.cs b/Projectiles/CyclonePro.cs index 1efb6840..b4e402f0 100644 --- a/Projectiles/CyclonePro.cs +++ b/Projectiles/CyclonePro.cs @@ -28,7 +28,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 10f && Main.rand.Next(3) == 0) + if (projectile.localAI[1] > 10f && Main.rand.NextBool(3)) { int num816 = 6; for (int num817 = 0; num817 < num816; num817++) diff --git a/Projectiles/DangerBladePro.cs b/Projectiles/DangerBladePro.cs index 93db7e83..3d75c800 100644 --- a/Projectiles/DangerBladePro.cs +++ b/Projectiles/DangerBladePro.cs @@ -38,7 +38,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/DarkBubblePro.cs b/Projectiles/DarkBubblePro.cs index f04b2873..766f025e 100644 --- a/Projectiles/DarkBubblePro.cs +++ b/Projectiles/DarkBubblePro.cs @@ -45,7 +45,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/DeadFlowerPro.cs b/Projectiles/DeadFlowerPro.cs index 10b283bf..daa3d447 100644 --- a/Projectiles/DeadFlowerPro.cs +++ b/Projectiles/DeadFlowerPro.cs @@ -58,7 +58,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/DeathHooksPro.cs b/Projectiles/DeathHooksPro.cs index 20f9f3d0..40256725 100644 --- a/Projectiles/DeathHooksPro.cs +++ b/Projectiles/DeathHooksPro.cs @@ -61,7 +61,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DeathFear"), 480, false); } @@ -78,7 +78,7 @@ public override void Kill(int timeLeft) public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DeathFear"), 480, false); } diff --git a/Projectiles/DiamondBeamPro.cs b/Projectiles/DiamondBeamPro.cs index 2a0fdb40..eba8e712 100644 --- a/Projectiles/DiamondBeamPro.cs +++ b/Projectiles/DiamondBeamPro.cs @@ -194,7 +194,7 @@ public override void AI() //Imported dust code from source because I'm lazy for (int i = 0; i < 2; ++i) { - float num1 = projectile.velocity.ToRotation() + (Main.rand.Next(2) == 1 ? -1.0f : 1.0f) * 1.57f; + float num1 = projectile.velocity.ToRotation() + (Main.rand.NextBool(2) ? -1.0f : 1.0f) * 1.57f; float num2 = (float)(Main.rand.NextDouble() * 0.8f + 1.0f); Vector2 dustVel = new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); Dust dust = Main.dust[Dust.NewDust(dustPos, 0, 0, 64, dustVel.X, dustVel.Y, 0, new Color(), 1f)]; @@ -206,7 +206,7 @@ public override void AI() //dust.noGravity = true; //dust.scale = 0.88f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Vector2 offset = projectile.velocity.RotatedBy(1.57f, new Vector2()) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; //Dust dust = Main.dust[Dust.NewDust(dustPos + offset - Vector2.One * 4f, 8, 8, 31, 0.0f, 0.0f, 100, new Color(), 1.5f)]; diff --git a/Projectiles/DissolverPro.cs b/Projectiles/DissolverPro.cs index e44f9bac..0f0dc6cf 100644 --- a/Projectiles/DissolverPro.cs +++ b/Projectiles/DissolverPro.cs @@ -23,7 +23,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(69, 280, false); } @@ -40,7 +40,7 @@ public override void AI() public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(69, 280, false); } diff --git a/Projectiles/DivineClaymorePro.cs b/Projectiles/DivineClaymorePro.cs index 9b10c772..19ca0f8f 100644 --- a/Projectiles/DivineClaymorePro.cs +++ b/Projectiles/DivineClaymorePro.cs @@ -41,7 +41,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/DivineRingPro.cs b/Projectiles/DivineRingPro.cs index ab362fe8..cb2fa320 100644 --- a/Projectiles/DivineRingPro.cs +++ b/Projectiles/DivineRingPro.cs @@ -50,7 +50,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/DragonBreathPro.cs b/Projectiles/DragonBreathPro.cs index cef8a913..1ac7b6a4 100644 --- a/Projectiles/DragonBreathPro.cs +++ b/Projectiles/DragonBreathPro.cs @@ -34,7 +34,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(BuffID.OnFire, 80, false); } @@ -42,7 +42,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(BuffID.OnFire, 80, false); } diff --git a/Projectiles/DragonHead.cs b/Projectiles/DragonHead.cs index 88c609f5..7102bdfb 100644 --- a/Projectiles/DragonHead.cs +++ b/Projectiles/DragonHead.cs @@ -65,7 +65,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 400, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/DreadGun.cs b/Projectiles/DreadGun.cs index a5d4ab45..a86b2644 100644 --- a/Projectiles/DreadGun.cs +++ b/Projectiles/DreadGun.cs @@ -32,7 +32,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/EaterofDreamsPro.cs b/Projectiles/EaterofDreamsPro.cs index 13b46f90..af9e3db0 100644 --- a/Projectiles/EaterofDreamsPro.cs +++ b/Projectiles/EaterofDreamsPro.cs @@ -48,12 +48,12 @@ public override void AI() } projectile.ai[0] += 1f; int num297 = 27; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { 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(Color), 1f); - if ((num297 == 235 && Main.rand.Next(3) == 0)) + if ((num297 == 235 && Main.rand.NextBool(3))) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Emeraldy.cs b/Projectiles/Emeraldy.cs index 789b688d..32906471 100644 --- a/Projectiles/Emeraldy.cs +++ b/Projectiles/Emeraldy.cs @@ -40,7 +40,7 @@ public override bool PreAI() public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 61, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1f); } diff --git a/Projectiles/EternalAgonyPro.cs b/Projectiles/EternalAgonyPro.cs index 327f2a94..8b630c06 100644 --- a/Projectiles/EternalAgonyPro.cs +++ b/Projectiles/EternalAgonyPro.cs @@ -28,7 +28,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(153, 280, false); } @@ -36,7 +36,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(153, 280, false); } diff --git a/Projectiles/ExampleLaser.cs b/Projectiles/ExampleLaser.cs index 8d9d369e..711d1d4d 100644 --- a/Projectiles/ExampleLaser.cs +++ b/Projectiles/ExampleLaser.cs @@ -194,7 +194,7 @@ public override void AI() //Imported dust code from source because I'm lazy for (int i = 0; i < 2; ++i) { - float num1 = projectile.velocity.ToRotation() + (Main.rand.Next(2) == 1 ? -1.0f : 1.0f) * 1.57f; + float num1 = projectile.velocity.ToRotation() + (Main.rand.NextBool(2) ? -1.0f : 1.0f) * 1.57f; float num2 = (float)(Main.rand.NextDouble() * 0.8f + 1.0f); Vector2 dustVel = new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); Dust dust = Main.dust[Dust.NewDust(dustPos, 0, 0, 226, dustVel.X, dustVel.Y, 0, new Color(), 1f)]; @@ -206,7 +206,7 @@ public override void AI() dust.noGravity = true; dust.scale = 0.88f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Vector2 offset = projectile.velocity.RotatedBy(1.57f, new Vector2()) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; Dust dust = Main.dust[Dust.NewDust(dustPos + offset - Vector2.One * 4f, 8, 8, 31, 0.0f, 0.0f, 100, new Color(), 1.5f)]; diff --git a/Projectiles/FallenSnakePro.cs b/Projectiles/FallenSnakePro.cs index 1efdeab2..63543d24 100644 --- a/Projectiles/FallenSnakePro.cs +++ b/Projectiles/FallenSnakePro.cs @@ -23,7 +23,7 @@ public override void SetStaticDefaults() public override bool PreAI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 13, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } diff --git a/Projectiles/FieryKunai.cs b/Projectiles/FieryKunai.cs index 8f6fd507..5b4fe3b0 100644 --- a/Projectiles/FieryKunai.cs +++ b/Projectiles/FieryKunai.cs @@ -39,7 +39,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } @@ -50,7 +50,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/FlamesofDespairPro.cs b/Projectiles/FlamesofDespairPro.cs index d1d54e16..2e561e43 100644 --- a/Projectiles/FlamesofDespairPro.cs +++ b/Projectiles/FlamesofDespairPro.cs @@ -30,7 +30,7 @@ public override void SetStaticDefaults() public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -61,7 +61,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/FrostJavelinPro.cs b/Projectiles/FrostJavelinPro.cs index 5b61113f..c3e197d6 100644 --- a/Projectiles/FrostJavelinPro.cs +++ b/Projectiles/FrostJavelinPro.cs @@ -26,7 +26,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(44, 280, false); } @@ -34,7 +34,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(44, 280, false); } diff --git a/Projectiles/FrostbittenBallPro.cs b/Projectiles/FrostbittenBallPro.cs index 4153d0ea..c6e0608f 100644 --- a/Projectiles/FrostbittenBallPro.cs +++ b/Projectiles/FrostbittenBallPro.cs @@ -34,7 +34,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(44, 280, false); } @@ -42,7 +42,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(44, 280, false); } diff --git a/Projectiles/FungusBlueSword.cs b/Projectiles/FungusBlueSword.cs index 46b324ef..8c25e926 100644 --- a/Projectiles/FungusBlueSword.cs +++ b/Projectiles/FungusBlueSword.cs @@ -35,7 +35,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(31, 180, false); } diff --git a/Projectiles/FungusSpear.cs b/Projectiles/FungusSpear.cs index 3a7ac2e5..7262f3a3 100644 --- a/Projectiles/FungusSpear.cs +++ b/Projectiles/FungusSpear.cs @@ -20,7 +20,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(31, 120, false); } diff --git a/Projectiles/FungusYellowSword.cs b/Projectiles/FungusYellowSword.cs index 3e07b2ce..5b35960c 100644 --- a/Projectiles/FungusYellowSword.cs +++ b/Projectiles/FungusYellowSword.cs @@ -41,7 +41,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(72, 180, false); } diff --git a/Projectiles/GloomSphere.cs b/Projectiles/GloomSphere.cs index 9daef53b..66727048 100644 --- a/Projectiles/GloomSphere.cs +++ b/Projectiles/GloomSphere.cs @@ -31,7 +31,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 27, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/GoldFishPro.cs b/Projectiles/GoldFishPro.cs index bb3e153a..f0423b3a 100644 --- a/Projectiles/GoldFishPro.cs +++ b/Projectiles/GoldFishPro.cs @@ -33,7 +33,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/GoldenMacePro.cs b/Projectiles/GoldenMacePro.cs index adc2c298..14a12b9f 100644 --- a/Projectiles/GoldenMacePro.cs +++ b/Projectiles/GoldenMacePro.cs @@ -79,7 +79,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(72, 500, false); } diff --git a/Projectiles/GrassGlaviePro.cs b/Projectiles/GrassGlaviePro.cs index a44c53d2..4c70a43a 100644 --- a/Projectiles/GrassGlaviePro.cs +++ b/Projectiles/GrassGlaviePro.cs @@ -21,7 +21,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } @@ -30,7 +30,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Gurumaster.cs b/Projectiles/Gurumaster.cs index c7074093..a65ec985 100644 --- a/Projectiles/Gurumaster.cs +++ b/Projectiles/Gurumaster.cs @@ -58,7 +58,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/HallowedSprayPro.cs b/Projectiles/HallowedSprayPro.cs index 59fb98dd..9d2e9558 100644 --- a/Projectiles/HallowedSprayPro.cs +++ b/Projectiles/HallowedSprayPro.cs @@ -48,12 +48,12 @@ public override void AI() } projectile.ai[0] += 1f; int num297 = 57; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { 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(Color), 1f); - if ((num297 == 235 && Main.rand.Next(3) == 0)) + if ((num297 == 235 && Main.rand.NextBool(3))) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/HolyJavelinPro.cs b/Projectiles/HolyJavelinPro.cs index d1472e3e..a6ac10e8 100644 --- a/Projectiles/HolyJavelinPro.cs +++ b/Projectiles/HolyJavelinPro.cs @@ -27,7 +27,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 320, false); } @@ -45,7 +45,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/HorrificKnifePro.cs b/Projectiles/HorrificKnifePro.cs index 454a245a..5ff8d3dc 100644 --- a/Projectiles/HorrificKnifePro.cs +++ b/Projectiles/HorrificKnifePro.cs @@ -44,7 +44,7 @@ public override void Kill(int timeLeft) public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(mod.BuffType("DeathFear"), 480, false); } diff --git a/Projectiles/IceBullet.cs b/Projectiles/IceBullet.cs index c19e196f..6df1ed8e 100644 --- a/Projectiles/IceBullet.cs +++ b/Projectiles/IceBullet.cs @@ -33,7 +33,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(44, 180, false); } diff --git a/Projectiles/IchorBreathPro.cs b/Projectiles/IchorBreathPro.cs index 3038be09..1dc2757a 100644 --- a/Projectiles/IchorBreathPro.cs +++ b/Projectiles/IchorBreathPro.cs @@ -33,7 +33,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(69, 60); } @@ -41,7 +41,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(69, 60); } diff --git a/Projectiles/Igniter.cs b/Projectiles/Igniter.cs index fe72c0bf..a92c0ef2 100644 --- a/Projectiles/Igniter.cs +++ b/Projectiles/Igniter.cs @@ -57,7 +57,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/Minions/BlueSakuraPro.cs b/Projectiles/Minions/BlueSakuraPro.cs index 9dd9f998..42cba8d6 100644 --- a/Projectiles/Minions/BlueSakuraPro.cs +++ b/Projectiles/Minions/BlueSakuraPro.cs @@ -46,7 +46,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void AI() { - if(Main.rand.Next(8) == 0) + if(Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 41, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } diff --git a/Projectiles/Minions/MeteorScepterPro.cs b/Projectiles/Minions/MeteorScepterPro.cs index 1022a3dc..5edeaecc 100644 --- a/Projectiles/Minions/MeteorScepterPro.cs +++ b/Projectiles/Minions/MeteorScepterPro.cs @@ -46,7 +46,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void AI() { - if(Main.rand.Next(3) == 0) + if(Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } diff --git a/Projectiles/Minions/ShadowStaffPro.cs b/Projectiles/Minions/ShadowStaffPro.cs index f4107691..1716106f 100644 --- a/Projectiles/Minions/ShadowStaffPro.cs +++ b/Projectiles/Minions/ShadowStaffPro.cs @@ -50,7 +50,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { TremorPlayer modPlayer = Main.player[projectile.owner].GetModPlayer(mod); - if(modPlayer.shadowArmSF && Main.rand.Next(3) == 0) + if(modPlayer.shadowArmSF && Main.rand.NextBool(3)) { target.AddBuff(153, 180, false); } diff --git a/Projectiles/Minions/WhiteSakuraPro.cs b/Projectiles/Minions/WhiteSakuraPro.cs index dab027f0..dc120e4e 100644 --- a/Projectiles/Minions/WhiteSakuraPro.cs +++ b/Projectiles/Minions/WhiteSakuraPro.cs @@ -46,7 +46,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void AI() { - if(Main.rand.Next(8) == 0) + if(Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); } diff --git a/Projectiles/Minions/ZombatStaffPro.cs b/Projectiles/Minions/ZombatStaffPro.cs index 12d7a716..aa4d76cc 100644 --- a/Projectiles/Minions/ZombatStaffPro.cs +++ b/Projectiles/Minions/ZombatStaffPro.cs @@ -33,7 +33,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if(Main.rand.Next(4) == 0) + if(Main.rand.NextBool(4)) { target.AddBuff(20, 240, false); } diff --git a/Projectiles/MythrilBolt.cs b/Projectiles/MythrilBolt.cs index dc318a34..70e3fd68 100644 --- a/Projectiles/MythrilBolt.cs +++ b/Projectiles/MythrilBolt.cs @@ -66,7 +66,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 61, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/NastyJavelinPro.cs b/Projectiles/NastyJavelinPro.cs index 7e47be6e..03aac425 100644 --- a/Projectiles/NastyJavelinPro.cs +++ b/Projectiles/NastyJavelinPro.cs @@ -38,7 +38,7 @@ public override void Kill(int timeLeft) } Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("NastyJavelin")); }; diff --git a/Projectiles/NightmareArrowPro.cs b/Projectiles/NightmareArrowPro.cs index 38192dfb..83d54807 100644 --- a/Projectiles/NightmareArrowPro.cs +++ b/Projectiles/NightmareArrowPro.cs @@ -26,7 +26,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DeathFear"), 480, false); } @@ -43,7 +43,7 @@ public override void Kill(int timeLeft) public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DeathFear"), 480, false); } diff --git a/Projectiles/PalladiumBolt.cs b/Projectiles/PalladiumBolt.cs index 8d533796..d1dfe1df 100644 --- a/Projectiles/PalladiumBolt.cs +++ b/Projectiles/PalladiumBolt.cs @@ -65,7 +65,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 64, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/ParaxydeKnifePro.cs b/Projectiles/ParaxydeKnifePro.cs index 92534566..aa0b73d4 100644 --- a/Projectiles/ParaxydeKnifePro.cs +++ b/Projectiles/ParaxydeKnifePro.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/PhantomSpear.cs b/Projectiles/PhantomSpear.cs index 8d880b0a..c7a67200 100644 --- a/Projectiles/PhantomSpear.cs +++ b/Projectiles/PhantomSpear.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/PirahnaPro.cs b/Projectiles/PirahnaPro.cs index 330de00c..33d11679 100644 --- a/Projectiles/PirahnaPro.cs +++ b/Projectiles/PirahnaPro.cs @@ -32,7 +32,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/PoisonJavelinPro.cs b/Projectiles/PoisonJavelinPro.cs index 9a395f1f..e7d5d870 100644 --- a/Projectiles/PoisonJavelinPro.cs +++ b/Projectiles/PoisonJavelinPro.cs @@ -28,7 +28,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 320, false); } @@ -46,7 +46,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 2, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/PoisonedKunai.cs b/Projectiles/PoisonedKunai.cs index 25a38f9a..a64c410d 100644 --- a/Projectiles/PoisonedKunai.cs +++ b/Projectiles/PoisonedKunai.cs @@ -32,7 +32,7 @@ public override void Kill(int timeLeft) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } @@ -43,7 +43,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(20, 180, false); } diff --git a/Projectiles/PumpkinPro.cs b/Projectiles/PumpkinPro.cs index e07930fa..33c865ab 100644 --- a/Projectiles/PumpkinPro.cs +++ b/Projectiles/PumpkinPro.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/RockminePro.cs b/Projectiles/RockminePro.cs index 2b69490e..042e9188 100644 --- a/Projectiles/RockminePro.cs +++ b/Projectiles/RockminePro.cs @@ -62,7 +62,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/SacredCrossPro.cs b/Projectiles/SacredCrossPro.cs index ae9e715c..fcca6662 100644 --- a/Projectiles/SacredCrossPro.cs +++ b/Projectiles/SacredCrossPro.cs @@ -61,7 +61,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 3.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/SaturatedDaggerPro.cs b/Projectiles/SaturatedDaggerPro.cs index f11c21ce..da637ece 100644 --- a/Projectiles/SaturatedDaggerPro.cs +++ b/Projectiles/SaturatedDaggerPro.cs @@ -36,7 +36,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/ScorcherPro.cs b/Projectiles/ScorcherPro.cs index 38fb8f09..9a485bb6 100644 --- a/Projectiles/ScorcherPro.cs +++ b/Projectiles/ScorcherPro.cs @@ -70,7 +70,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/ScorcherStar.cs b/Projectiles/ScorcherStar.cs index 299ef4ed..d70a874d 100644 --- a/Projectiles/ScorcherStar.cs +++ b/Projectiles/ScorcherStar.cs @@ -43,7 +43,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/ScorcherTwo.cs b/Projectiles/ScorcherTwo.cs index af58b6fa..f9c1c2d8 100644 --- a/Projectiles/ScorcherTwo.cs +++ b/Projectiles/ScorcherTwo.cs @@ -27,7 +27,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/ShadowCutterPro.cs b/Projectiles/ShadowCutterPro.cs index e72f3983..afbd4dc1 100644 --- a/Projectiles/ShadowCutterPro.cs +++ b/Projectiles/ShadowCutterPro.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/ShadowForkPro.cs b/Projectiles/ShadowForkPro.cs index 0bc52ec8..4e263329 100644 --- a/Projectiles/ShadowForkPro.cs +++ b/Projectiles/ShadowForkPro.cs @@ -22,7 +22,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 37, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/ShadowR.cs b/Projectiles/ShadowR.cs index e75168c5..a8dd6d60 100644 --- a/Projectiles/ShadowR.cs +++ b/Projectiles/ShadowR.cs @@ -78,7 +78,7 @@ public override void Kill(int timeLeft) public void CreateDust() { - if (Main.rand.Next(2) == 1) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType()); Main.dust[dust].scale = 0.9f; diff --git a/Projectiles/SparkingCloudPro.cs b/Projectiles/SparkingCloudPro.cs index a99154fe..a0fb11b0 100644 --- a/Projectiles/SparkingCloudPro.cs +++ b/Projectiles/SparkingCloudPro.cs @@ -26,7 +26,7 @@ public override void SetStaticDefaults() public override void OnHitPlayer(Player target, int damage, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(24, 180, false); } diff --git a/Projectiles/SpearofJusticePro.cs b/Projectiles/SpearofJusticePro.cs index a965dde6..7aa607f4 100644 --- a/Projectiles/SpearofJusticePro.cs +++ b/Projectiles/SpearofJusticePro.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/SpectreTaroCard.cs b/Projectiles/SpectreTaroCard.cs index 19384aaa..efb6243c 100644 --- a/Projectiles/SpectreTaroCard.cs +++ b/Projectiles/SpectreTaroCard.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 176, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/StarminePro.cs b/Projectiles/StarminePro.cs index bb7b80ab..cb47df3a 100644 --- a/Projectiles/StarminePro.cs +++ b/Projectiles/StarminePro.cs @@ -30,7 +30,7 @@ public override void SetStaticDefaults() public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -61,7 +61,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/StormBladePro.cs b/Projectiles/StormBladePro.cs index d6983004..ad165258 100644 --- a/Projectiles/StormBladePro.cs +++ b/Projectiles/StormBladePro.cs @@ -30,7 +30,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 2.5f); } diff --git a/Projectiles/SuperBigCannonPro.cs b/Projectiles/SuperBigCannonPro.cs index e95c04b6..4a77f921 100644 --- a/Projectiles/SuperBigCannonPro.cs +++ b/Projectiles/SuperBigCannonPro.cs @@ -32,7 +32,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/TheGhostClaymorePro.cs b/Projectiles/TheGhostClaymorePro.cs index 07d1b583..7302f247 100644 --- a/Projectiles/TheGhostClaymorePro.cs +++ b/Projectiles/TheGhostClaymorePro.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/ToxicRazorknifePro.cs b/Projectiles/ToxicRazorknifePro.cs index 8247ea8a..4da4c65b 100644 --- a/Projectiles/ToxicRazorknifePro.cs +++ b/Projectiles/ToxicRazorknifePro.cs @@ -27,7 +27,7 @@ public override void SetStaticDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(BuffID.Poisoned, 280, false); } @@ -35,7 +35,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(BuffID.Poisoned, 280, false); } diff --git a/Projectiles/TrueBloodCarnage.cs b/Projectiles/TrueBloodCarnage.cs index f662d8a6..f3c963ee 100644 --- a/Projectiles/TrueBloodCarnage.cs +++ b/Projectiles/TrueBloodCarnage.cs @@ -34,7 +34,7 @@ public override void SetStaticDefaults() public override void AI() { projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/VoidBladePro.cs b/Projectiles/VoidBladePro.cs index 0a32a49b..4d1101a4 100644 --- a/Projectiles/VoidBladePro.cs +++ b/Projectiles/VoidBladePro.cs @@ -36,7 +36,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/VoidRingPro.cs b/Projectiles/VoidRingPro.cs index 74d35cf5..327c0877 100644 --- a/Projectiles/VoidRingPro.cs +++ b/Projectiles/VoidRingPro.cs @@ -43,7 +43,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/VulcanBladePro.cs b/Projectiles/VulcanBladePro.cs index 1451a99f..059c9fc1 100644 --- a/Projectiles/VulcanBladePro.cs +++ b/Projectiles/VulcanBladePro.cs @@ -35,7 +35,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/VulcanBladeRing.cs b/Projectiles/VulcanBladeRing.cs index 4ee3a860..b08c8747 100644 --- a/Projectiles/VulcanBladeRing.cs +++ b/Projectiles/VulcanBladeRing.cs @@ -65,7 +65,7 @@ public override void Kill(int timeLeft) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num629].scale = 0.5f; Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/WhiteGoldDagger.cs b/Projectiles/WhiteGoldDagger.cs index ccf07550..64193276 100644 --- a/Projectiles/WhiteGoldDagger.cs +++ b/Projectiles/WhiteGoldDagger.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/WhiteGoldKnife.cs b/Projectiles/WhiteGoldKnife.cs index 3c95a624..b740b74c 100644 --- a/Projectiles/WhiteGoldKnife.cs +++ b/Projectiles/WhiteGoldKnife.cs @@ -37,7 +37,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Projectiles/WraithWrathPro.cs b/Projectiles/WraithWrathPro.cs index 11ea5285..13ac5c0a 100644 --- a/Projectiles/WraithWrathPro.cs +++ b/Projectiles/WraithWrathPro.cs @@ -57,7 +57,7 @@ public override void Kill(int timeLeft) for (int num158 = 0; num158 < 20; num158++) { int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; diff --git a/Tiles/LunarRootTile.cs b/Tiles/LunarRootTile.cs index 76df0530..0f1c06bb 100644 --- a/Tiles/LunarRootTile.cs +++ b/Tiles/LunarRootTile.cs @@ -30,11 +30,11 @@ public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 16, 16, 3460, Main.rand.Next(1,3)); } - if(Main.rand.Next(2) == 0) + if(Main.rand.NextBool(2)) { Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("LunarRoot"), Main.rand.Next(1,5)); } - if(Main.rand.Next(4) == 0) + if(Main.rand.NextBool(4)) { Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("NightCore"), Main.rand.Next(1,2)); diff --git a/TremorPlayer.cs b/TremorPlayer.cs index 33f12afc..97e679cc 100644 --- a/TremorPlayer.cs +++ b/TremorPlayer.cs @@ -470,7 +470,7 @@ public override void ReceiveCustomBiomes(BinaryReader reader) public void OnHit(float x, float y, Entity victim) { - if (onHitShadaggers && Main.rand.Next(4) == 0) + if (onHitShadaggers && Main.rand.NextBool(4)) { player.petalTimer = 20; if (x < player.position.X + player.width / 2) diff --git a/TremorUtils.cs b/TremorUtils.cs index 0a464ee4..172c8a80 100644 --- a/TremorUtils.cs +++ b/TremorUtils.cs @@ -162,7 +162,7 @@ public static bool NextBool(this UnifiedRandom rand, int total) => rand.Next(total) == 0; public static bool NextBool(this UnifiedRandom rand, int chance, int total) - => rand.Next(total) < chance; + => rand.Next(total) <= chance; public static void DrawNPCGlowMask(SpriteBatch spriteBatch, NPC npc, Texture2D texture) { diff --git a/ZombieEvent/Items/CursedCleaverPro.cs b/ZombieEvent/Items/CursedCleaverPro.cs index 9e990833..10b63ee1 100644 --- a/ZombieEvent/Items/CursedCleaverPro.cs +++ b/ZombieEvent/Items/CursedCleaverPro.cs @@ -22,7 +22,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(39, 500, false); } @@ -30,7 +30,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(39, 500, false); } diff --git a/ZombieEvent/Items/IchorCleaverPro.cs b/ZombieEvent/Items/IchorCleaverPro.cs index ade7ba81..56220e98 100644 --- a/ZombieEvent/Items/IchorCleaverPro.cs +++ b/ZombieEvent/Items/IchorCleaverPro.cs @@ -22,7 +22,7 @@ public override void SetDefaults() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(69, 500, false); } @@ -30,7 +30,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void OnHitPvp(Player target, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { target.AddBuff(69, 500, false); } diff --git a/ZombieEvent/Items/RupicideClub.cs b/ZombieEvent/Items/RupicideClub.cs index b2af04c3..63d1eb8f 100644 --- a/ZombieEvent/Items/RupicideClub.cs +++ b/ZombieEvent/Items/RupicideClub.cs @@ -32,7 +32,7 @@ public override void SetStaticDefaults() public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/ZombieEvent/Items/RupicideRepeater.cs b/ZombieEvent/Items/RupicideRepeater.cs index 0de42059..875f7a07 100644 --- a/ZombieEvent/Items/RupicideRepeater.cs +++ b/ZombieEvent/Items/RupicideRepeater.cs @@ -56,7 +56,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX { type = 1; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, 686, damage, knockBack, Main.myPlayer); Main.projectile[proj].hostile = false; diff --git a/ZombieEvent/Mobs/Arsonist.cs b/ZombieEvent/Mobs/Arsonist.cs index ee7ee5d2..493b8799 100644 --- a/ZombieEvent/Mobs/Arsonist.cs +++ b/ZombieEvent/Mobs/Arsonist.cs @@ -40,7 +40,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); Main.dust[num706].velocity *= 0.3f; @@ -78,7 +78,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8, Main.rand.Next(1, 2)); }; diff --git a/ZombieEvent/Mobs/Dapperblook.cs b/ZombieEvent/Mobs/Dapperblook.cs index 258e2787..c9c70d8a 100644 --- a/ZombieEvent/Mobs/Dapperblook.cs +++ b/ZombieEvent/Mobs/Dapperblook.cs @@ -51,7 +51,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedInk")); } diff --git a/ZombieEvent/Mobs/DiceZombie.cs b/ZombieEvent/Mobs/DiceZombie.cs index f25cc42f..9eaa0618 100644 --- a/ZombieEvent/Mobs/DiceZombie.cs +++ b/ZombieEvent/Mobs/DiceZombie.cs @@ -58,7 +58,7 @@ public override void NPCLoot() Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType(), Main.rand.Next(1, 3)); }; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType()); }; diff --git a/ZombieEvent/Mobs/Dopelganger.cs b/ZombieEvent/Mobs/Dopelganger.cs index a08be4c3..ddce3d88 100644 --- a/ZombieEvent/Mobs/Dopelganger.cs +++ b/ZombieEvent/Mobs/Dopelganger.cs @@ -49,7 +49,7 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorCleaver")); }; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedCloth"), Main.rand.Next(1, 3)); }; @@ -58,12 +58,12 @@ public override void NPCLoot() public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.AddBuff(39, 600, true); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.AddBuff(69, 600, true); } diff --git a/ZombieEvent/Mobs/FarmerZombie.cs b/ZombieEvent/Mobs/FarmerZombie.cs index 7febc27b..e003e6cf 100644 --- a/ZombieEvent/Mobs/FarmerZombie.cs +++ b/ZombieEvent/Mobs/FarmerZombie.cs @@ -39,19 +39,19 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Tomato"), Main.rand.Next(1, 2)); }; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Potato"), Main.rand.Next(1, 2)); }; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Carrot"), Main.rand.Next(1, 6)); }; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Wheat"), Main.rand.Next(1, 6)); }; diff --git a/ZombieEvent/Mobs/PetrifiedZombie1.cs b/ZombieEvent/Mobs/PetrifiedZombie1.cs index 3ee45221..cd8e0f4e 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie1.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie1.cs @@ -61,7 +61,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Rupicide"), Main.rand.Next(1, 3)); }; diff --git a/ZombieEvent/Mobs/PetrifiedZombie2.cs b/ZombieEvent/Mobs/PetrifiedZombie2.cs index 2af6ea06..1e05341b 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie2.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie2.cs @@ -61,7 +61,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Rupicide"), Main.rand.Next(1, 3)); }; diff --git a/ZombieEvent/Mobs/PetrifiedZombie3.cs b/ZombieEvent/Mobs/PetrifiedZombie3.cs index affbc8b5..2be1fd3e 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie3.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie3.cs @@ -61,7 +61,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Rupicide"), Main.rand.Next(1, 3)); }; diff --git a/ZombieEvent/Mobs/Scourge.cs b/ZombieEvent/Mobs/Scourge.cs index 70144cc9..915598a3 100644 --- a/ZombieEvent/Mobs/Scourge.cs +++ b/ZombieEvent/Mobs/Scourge.cs @@ -57,7 +57,7 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorCleaver")); }; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedCloth"), Main.rand.Next(1, 3)); }; @@ -66,12 +66,12 @@ public override void NPCLoot() public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.AddBuff(39, 600, true); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.AddBuff(69, 600, true); } diff --git a/ZombieEvent/Mobs/SuperDapperblook.cs b/ZombieEvent/Mobs/SuperDapperblook.cs index d1c5fa1e..b3eda254 100644 --- a/ZombieEvent/Mobs/SuperDapperblook.cs +++ b/ZombieEvent/Mobs/SuperDapperblook.cs @@ -51,7 +51,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedInk")); } diff --git a/ZombieEvent/Mobs/SuperScourge.cs b/ZombieEvent/Mobs/SuperScourge.cs index ae84b81a..bf0f04f3 100644 --- a/ZombieEvent/Mobs/SuperScourge.cs +++ b/ZombieEvent/Mobs/SuperScourge.cs @@ -57,7 +57,7 @@ public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorCleaver")); }; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedCloth"), Main.rand.Next(1, 3)); }; @@ -66,7 +66,7 @@ public override void NPCLoot() public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.AddBuff(153, 600, true); } diff --git a/ZombieEvent/Mobs/SuperTheHaunt.cs b/ZombieEvent/Mobs/SuperTheHaunt.cs index b26f465e..57504137 100644 --- a/ZombieEvent/Mobs/SuperTheHaunt.cs +++ b/ZombieEvent/Mobs/SuperTheHaunt.cs @@ -51,7 +51,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedInk")); } diff --git a/ZombieEvent/Mobs/TheHaunt.cs b/ZombieEvent/Mobs/TheHaunt.cs index 24e0d431..a7eeee67 100644 --- a/ZombieEvent/Mobs/TheHaunt.cs +++ b/ZombieEvent/Mobs/TheHaunt.cs @@ -51,7 +51,7 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedInk")); } diff --git a/ZombieEvent/Mobs/Zombomber.cs b/ZombieEvent/Mobs/Zombomber.cs index 3d45d814..b4538321 100644 --- a/ZombieEvent/Mobs/Zombomber.cs +++ b/ZombieEvent/Mobs/Zombomber.cs @@ -40,11 +40,11 @@ public override void NPCLoot() int centerX = (int)(npc.position.X + npc.width / 2) / 16; int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 168, Main.rand.Next(2, 3)); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 166, Main.rand.Next(2, 3)); }