diff --git a/Buffs/DamageOverTime/AstralInfectionDebuff.cs b/Buffs/DamageOverTime/AstralInfectionDebuff.cs index 935c00aecd..30c06e6559 100644 --- a/Buffs/DamageOverTime/AstralInfectionDebuff.cs +++ b/Buffs/DamageOverTime/AstralInfectionDebuff.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); - Particle orb = new GenericBloom(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, 0.055f, 8); + Particle orb = new GenericBloom(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.055f, 8); GeneralParticleHandler.SpawnParticle(orb); } } @@ -49,9 +49,9 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); Vector2 npcSize2 = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.1f + (0.0000007f * npc.width * npc.height), 0f, 20); + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.1f + (0.0000007f * npc.width * npc.height), 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); - Particle orb = new GenericBloom(npcSize2, Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, 0.065f + (0.0000007f * npc.width * npc.height), 8); + Particle orb = new GenericBloom(npcSize2, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.065f + (0.0000007f * npc.width * npc.height), 8); GeneralParticleHandler.SpawnParticle(orb); } } diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index 33a4f169bd..a16cd403c0 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Buffs.DamageOverTime dust.noGravity = true; for (int i = 0; i < 3; i++) { - Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool(2) ? 90 : ModContent.DustType(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, hasDebuffResistance ? 0.4f : 1.4f); + Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool() ? 90 : ModContent.DustType(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, hasDebuffResistance ? 0.4f : 1.4f); dust2.noGravity = true; } } @@ -58,7 +58,7 @@ namespace CalamityMod.Buffs.DamageOverTime dust.scale = 1.6f; for (int i = 0; i < 3; i++) { - Dust dust2 = Dust.NewDustDirect(npc.position + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2), npc.width, npc.height, Main.rand.NextBool(2) ? 90 : ModContent.DustType()); + Dust dust2 = Dust.NewDustDirect(npc.position + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2), npc.width, npc.height, Main.rand.NextBool() ? 90 : ModContent.DustType()); dust2.noGravity = true; dust2.velocity = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + npc.velocity; dust2.scale = 1.4f; diff --git a/Buffs/DamageOverTime/GodSlayerInferno.cs b/Buffs/DamageOverTime/GodSlayerInferno.cs index 31f173cf1f..c92b632676 100644 --- a/Buffs/DamageOverTime/GodSlayerInferno.cs +++ b/Buffs/DamageOverTime/GodSlayerInferno.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(NPC npc, ref Color drawColor) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); SparkParticle spark = new SparkParticle(npcSize, new Vector2(0, Main.rand.NextFloat(-5f, 5f)), false, Main.rand.Next(11, 13), Main.rand.NextFloat(0.2f, 0.5f), Main.rand.NextBool(7) ? Color.Aqua : Color.Fuchsia); diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index a40358c3b2..d3c4582b09 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2) && drawInfo.shadow == 0f) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool(2) ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } @@ -58,7 +58,7 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool(2) ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f); + CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index 71a3c71d83..7f0f2bddb1 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2) && drawInfo.shadow == 0f) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool(2) ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++) @@ -57,7 +57,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(3)) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool(2) ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f); + CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } for (int i = 0; i < 2; i++) diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index 5c62e01774..134a167a8e 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Buffs.DamageOverTime } if (Main.rand.NextBool(5)) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool(2) ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); GeneralParticleHandler.SpawnParticle(pulse); } } @@ -56,7 +56,7 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(NPC npc, ref Color drawColor) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 298, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.2f + +(0.000003f * npc.width * npc.height)); @@ -69,9 +69,9 @@ namespace CalamityMod.Buffs.DamageOverTime Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.4f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-4.5f, -6f)), Main.rand.NextBool(2) ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.12f + (0.0000007f * npc.width * npc.height), 0f, 45); + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-4.5f, -6f)), Main.rand.NextBool() ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.12f + (0.0000007f * npc.width * npc.height), 0f, 45); GeneralParticleHandler.SpawnParticle(pulse); } } diff --git a/Buffs/StatBuffs/ProfanedCrystalBuff.cs b/Buffs/StatBuffs/ProfanedCrystalBuff.cs index 28132af176..2663398aae 100644 --- a/Buffs/StatBuffs/ProfanedCrystalBuff.cs +++ b/Buffs/StatBuffs/ProfanedCrystalBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,21 +31,18 @@ namespace CalamityMod.Buffs.StatBuffs Player player = Main.player[Main.myPlayer]; if (player.Calamity().profanedCrystalBuffs) { - if (player.Calamity().endoCooper) + bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + if (empowered) { - tip = this.GetLocalizedValue("NerfedEndo"); - } - else if (player.Calamity().magicHat) - { - tip = this.GetLocalizedValue("NerfedHat"); + tip += "\n" + this.GetLocalizedValue("Empowered"); } else { bool offense = (Main.dayTime && !player.wet) || player.lavaWet; tip += "\n" + (offense ? this.GetLocalization("Offense").Format(this.GetLocalizedValue(player.lavaWet ? "Lava" : "Day")) - : this.GetLocalization("Defense").Format(this.GetLocalizedValue(player.honeyWet ? "Honey" : (player.wet ? "Water" : "Night")))); + : this.GetLocalization("Defense").Format(this.GetLocalizedValue(player.honeyWet ? "Honey" : (player.wet ? "Water" : "Night")))); - if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) + if (!Main.dayTime) tip += "\n" + this.GetLocalizedValue("Enrage"); } } diff --git a/Buffs/StatBuffs/RageMode.cs b/Buffs/StatBuffs/RageMode.cs index 500bc4291c..116a319cc2 100644 --- a/Buffs/StatBuffs/RageMode.cs +++ b/Buffs/StatBuffs/RageMode.cs @@ -54,10 +54,10 @@ namespace CalamityMod.Buffs.StatBuffs modPlayer.ragePulseTimer++; int dustID = modPlayer.heartOfDarkness ? 240 : 114; - if (modPlayer.shatteredCommunity && Main.rand.NextBool(2)) + if (modPlayer.shatteredCommunity && Main.rand.NextBool()) dustID = 112; //special dust visual for Shattered Community - if (modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity && Main.rand.NextBool(2)) + if (modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity && Main.rand.NextBool()) dustID = 90; //special dust visual for Heart of Darkness if (modPlayer.ragePulseTimer == 60) diff --git a/Buffs/Summon/Whips/ProfanedCrystalWhipBuff.cs b/Buffs/Summon/Whips/ProfanedCrystalWhipBuff.cs new file mode 100644 index 0000000000..ce02a61469 --- /dev/null +++ b/Buffs/Summon/Whips/ProfanedCrystalWhipBuff.cs @@ -0,0 +1,47 @@ +using static CalamityMod.Items.Accessories.ProfanedSoulCrystal; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon.Whips +{ + public class ProfanedCrystalWhipBuff : ModBuff + { + public override string Texture => "CalamityMod/Buffs/Summon/Whips/SentinalLash"; + public override void SetStaticDefaults() + { + Main.debuff[Type] = false; + Main.buffNoSave[Type] = true; + } + + public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) + { + Player player = Main.player[Main.myPlayer]; + bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered; + if (empowered) + { + tip += "\n" + this.GetLocalizedValue("Empowered"); + } + } + + public override void Update(Player player, ref int buffIndex) + { + if (player.Calamity().profanedCrystalStatePrevious < (int)ProfanedSoulCrystalState.Buffs) + { + player.ClearBuff(Type); + return; + } + + var whipBuffs = new int[] + { + BuffID.CoolWhipPlayerBuff, BuffID.ScytheWhipPlayerBuff, BuffID.SwordWhipPlayerBuff, + BuffID.ThornWhipPlayerBuff + }; + + foreach (int buff in whipBuffs) + { + player.ClearBuff(buff); + } + } + } +} diff --git a/Buffs/Summon/Whips/ProfanedCrystalWhipDebuff.cs b/Buffs/Summon/Whips/ProfanedCrystalWhipDebuff.cs new file mode 100644 index 0000000000..c96bfe1509 --- /dev/null +++ b/Buffs/Summon/Whips/ProfanedCrystalWhipDebuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.NPCs; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon.Whips +{ + public class ProfanedCrystalWhipDebuff : ModBuff + { + public override string Texture => "CalamityMod/Buffs/Summon/Whips/SentinalLash"; + + public override void SetStaticDefaults() + { + BuffID.Sets.IsAnNPCWhipDebuff[Type] = true; + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + // var whipBuffs = new int[] + // { + // BuffID.BlandWhipEnemyDebuff, BuffID.FlameWhipEnemyDebuff, BuffID.BoneWhipNPCDebuff, + // BuffID.ScytheWhipEnemyDebuff, BuffID.CoolWhipNPCDebuff, BuffID.MaceWhipNPCDebuff, + // BuffID.RainbowWhipNPCDebuff, BuffID.SwordWhipNPCDebuff, BuffID.ThornWhipNPCDebuff + // }; + + //kill whip stacking for psc purposes + for (int buff = 0; buff < NPC.maxBuffs; buff++) + { + if(npc.buffTime[buff] > 0 && BuffID.Sets.IsAnNPCWhipDebuff[npc.buffType[buff]] && npc.buffType[buff] != Type) + npc.RequestBuffRemoval(npc.buffType[buff]); + } + } + } +} diff --git a/Buffs/Summon/Whips/SentinalLash.png b/Buffs/Summon/Whips/SentinalLash.png new file mode 100644 index 0000000000..412f2d47da Binary files /dev/null and b/Buffs/Summon/Whips/SentinalLash.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d35c325281..e192264e41 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1066,12 +1066,14 @@ namespace CalamityMod.CalPlayer public bool abyssalDivingSuitForce; public bool abyssalDivingSuitPower; public bool profanedCrystal; - public bool profanedCrystalPrevious; + public int profanedCrystalStatePrevious; public bool profanedCrystalForce; public bool profanedCrystalBuffs; public bool profanedCrystalHide; public KeyValuePair profanedCrystalWingCounter = new KeyValuePair(0, 10); public KeyValuePair profanedCrystalAnimCounter = new KeyValuePair(0, 10); + public int pscState; + public Color pscLerpColor = Color.White; public bool aquaticHeartPrevious; public bool aquaticHeart; public bool aquaticHeartHide; @@ -2081,8 +2083,10 @@ namespace CalamityMod.CalPlayer aquaticHeartPrevious = aquaticHeart; aquaticHeart = aquaticHeartHide = aquaticHeartForce = aquaticHeartPower = false; - profanedCrystalPrevious = profanedCrystal; + profanedCrystalStatePrevious = pscState; profanedCrystal = profanedCrystalBuffs = profanedCrystalForce = profanedCrystalHide = false; + pscState = 0; + pscLerpColor = Color.White; snowmanPrevious = snowman; snowman = snowmanHide = snowmanForce = snowmanPower = false; @@ -3082,7 +3086,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < dustPerSegment; ++i) { bool electricity = Main.rand.NextBool(4); - int dustID = electricity ? (Main.rand.NextBool(2) ? 132 : 131) : ModContent.DustType(); + int dustID = electricity ? (Main.rand.NextBool() ? 132 : 131) : ModContent.DustType(); float interpolant = i + 0.5f; float spreadSpeed = Main.rand.NextFloat(0.5f, maxDustVelSpread); @@ -3265,7 +3269,7 @@ namespace CalamityMod.CalPlayer Main.dust[idx].velocity *= 2f; Main.dust[idx].scale *= 1.2f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = Main.rand.NextFloat(0.75f, 1f); Main.dust[idx].scale = Main.rand.NextFloat(0.25f, 0.75f); @@ -4050,18 +4054,18 @@ namespace CalamityMod.CalPlayer } else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) { - Player.legs = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs); + Player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", EquipType.Legs); Player.body = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Head); - Player.wings = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Wings); + Player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", EquipType.Head); + Player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", EquipType.Wings); Player.face = -1; - bool enrage = !profanedCrystalForce && profanedCrystalBuffs && Player.statLife <= (int)(Player.statLifeMax2 * 0.5); + bool enrage = pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; if (profanedCrystalWingCounter.Value == 0) { int key = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 7); + profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 8); } Player.wingFrame = profanedCrystalWingCounter.Key; @@ -4707,7 +4711,7 @@ namespace CalamityMod.CalPlayer for (int x = 0; x < numSpears; x++) { float angle = MathHelper.TwoPi / numSpears * x; - int proj = Projectile.NewProjectile(source, Main.projectile[i].Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(source, Main.projectile[i].Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, pscState, 0f); Main.projectile[proj].originalDamage = dam; } spearsFired++; @@ -4756,7 +4760,9 @@ namespace CalamityMod.CalPlayer public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs { - if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs)) + bool validEquipSlot = Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || + Player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); + if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && validEquipSlot) { bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground AnimationType animType = AnimationType.Walk; @@ -4836,7 +4842,7 @@ namespace CalamityMod.CalPlayer public override void OnConsumeMana(Item item, int manaConsumed) { CalamityPlayer modPlayer = Player.Calamity(); - if (Main.rand.NextBool(2) && modPlayer.lifeManaEnchant) + if (Main.rand.NextBool() && modPlayer.lifeManaEnchant) { if (Main.myPlayer == Player.whoAmI) { diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index def12e18b3..9b3d759305 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -125,7 +125,7 @@ namespace CalamityMod.CalPlayer { if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 229, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -140,7 +140,7 @@ namespace CalamityMod.CalPlayer { if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 246, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -160,7 +160,7 @@ namespace CalamityMod.CalPlayer Lighting.AddLight((int)Player.Center.X / 16, (int)Player.Center.Y / 16, 100 / 235f, 1 / 235f, 250 / 235f); if (!Player.StandingStill() && !Player.mount.Active) { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + if (Main.rand.NextBool() && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; @@ -191,7 +191,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(8) && drawInfo.shadow == 0f) { - int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); + int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool() ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[de_dust2].noGravity = true; Main.dust[de_dust2].velocity *= 0.5f; drawInfo.DustCache.Add(de_dust2); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 9b62bff05c..829251d404 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -92,7 +92,7 @@ namespace CalamityMod.CalPlayer dust.velocity *= 0.4f; dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.noGravity = true; @@ -126,7 +126,7 @@ namespace CalamityMod.CalPlayer dust.velocity *= 0.4f; dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.cNeck, Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale *= 1f + Main.rand.Next(40) * 0.01f; dust.noGravity = true; @@ -241,7 +241,7 @@ namespace CalamityMod.CalPlayer dust.scale *= 1f + Main.rand.Next(40) * 0.01f; // Change this accordingly if we have a proper equipped sprite. dust.shader = GameShaders.Armor.GetSecondaryShader(Player.cBody, Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + Main.rand.Next(40) * 0.01f; } @@ -1741,7 +1741,7 @@ namespace CalamityMod.CalPlayer if (pSoulShieldDurability <= 0) { pSoulShieldDurability = 0; - SoundEngine.PlaySound(SoundID.Lavafall, Player.Center); + SoundEngine.PlaySound(SoundID.DD2_BetsyFlameBreath, Player.Center); Player.Calamity().GeneralScreenShakePower += anyShieldBroke ? 0.5f : 2f; anyShieldBroke = true; } @@ -2081,7 +2081,7 @@ namespace CalamityMod.CalPlayer { int dust = Dust.NewDust(Player.position, Player.width, Player.height, 31, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -2108,7 +2108,7 @@ namespace CalamityMod.CalPlayer { int ice = Dust.NewDust(Player.position, Player.width, Player.height, 67, 0f, 0f, 100, default, 2f); Main.dust[ice].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ice].scale = 0.5f; Main.dust[ice].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 6e0bd68c43..05886270c4 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -679,7 +679,7 @@ namespace CalamityMod.CalPlayer if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { Player.lifeRegen += 2; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, 5, 0f, 0f, 200, new Color(99, 54, 84), 2f); Main.dust[regen].noGravity = true; @@ -788,7 +788,7 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; - bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool() : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); @@ -832,7 +832,7 @@ namespace CalamityMod.CalPlayer // Normally 1.25 while resting and 0.5 while not Player.lifeRegen += (int)(baseRegenRate * 0.75f); - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2)) + if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool()) { int regen = Dust.NewDust(Player.position, Player.width, Player.height, 12, 0f, 0f, 200, Color.OrangeRed, 1f); Main.dust[regen].noGravity = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c6d2ba21cd..94de51cddb 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -246,7 +246,7 @@ namespace CalamityMod.CalPlayer float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 6f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); Vector2 velOffset = Vector2.Zero; - Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 160 : 307, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 160 : 307, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.alpha = 100; @@ -256,10 +256,10 @@ namespace CalamityMod.CalPlayer { float sparkscale = (Player.velocity.X * Player.direction * 0.07f); Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * 2, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue); GeneralParticleHandler.SpawnParticle(spark); Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * -2, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue); GeneralParticleHandler.SpawnParticle(spark2); } if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox @@ -287,7 +287,7 @@ namespace CalamityMod.CalPlayer float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 8f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); Vector2 velOffset = Vector2.Zero; - Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 35 : 127, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 35 : 127, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.alpha = 100; @@ -295,10 +295,10 @@ namespace CalamityMod.CalPlayer } float sparkscale = (Player.velocity.X * Player.direction * 0.08f); Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * -3, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark); Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * 3, default) * 0.1f - Player.velocity / 2f; - SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark2); if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox @@ -1135,14 +1135,54 @@ namespace CalamityMod.CalPlayer if (healCounter <= 0) { - bool enrage = Player.statLife < (int)(Player.statLifeMax2 * 0.5); - - healCounter = (!enrage && profanedCrystalBuffs) ? 360 : 300; + healCounter = 300; if (Player.whoAmI == Main.myPlayer) { Player.statLife += 15; Player.HealEffect(15); + + if (profanedCrystal) + { + var healerID = ModContent.ProjectileType(); + var healer = Main.projectile.FirstOrDefault(proj => proj.active && proj.owner == Main.myPlayer && proj.type == healerID, null); + if (healer != null) + { + float distanceFromHealer = Vector2.Distance(healer.Center, Player.Center); + int maxHealDustIterations = (int)distanceFromHealer; + int maxDust = 40; + int dustDivisor = maxHealDustIterations / maxDust; + if (dustDivisor < 2) + dustDivisor = 2; + + Vector2 dustLineStart = healer.Center; + Vector2 dustLineEnd = Player.Center; + Vector2 currentDustPos = default; + Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(MathHelper.Pi); + Vector2 value5 = new Vector2(2.1f, 2f); + Color dustColor = Main.hslToRgb(Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X, 1f, 0.5f); + dustColor.A = 255; + for (int i = 0; i < maxHealDustIterations; i++) + { + if (i % dustDivisor == 0) + { + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxHealDustIterations); + int dust = Dust.NewDust(currentDustPos, 0, 0, 267, 0f, 0f, 0, dustColor, 1f); + Main.dust[dust].position = currentDustPos; + Main.dust[dust].velocity = spinningpoint.RotatedBy(MathHelper.TwoPi * i / maxHealDustIterations) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f) + Player.velocity; + Main.dust[dust].noGravity = true; + Main.dust[dust].scale = 1f; + Main.dust[dust].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust2 = Dust.CloneDust(dust); + Dust dust3 = dust2; + dust3.scale /= 2f; + dust3 = dust2; + dust3.fadeIn /= 2f; + dust2.color = new Color(255, 255, 255, 255); + } + } + } + } } } } @@ -1512,7 +1552,7 @@ namespace CalamityMod.CalPlayer Main.dust[green].noGravity = true; Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[green].shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -1543,7 +1583,7 @@ namespace CalamityMod.CalPlayer dust.noGravity = true; dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -1614,7 +1654,7 @@ namespace CalamityMod.CalPlayer dust.noGravity = true; dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -2691,7 +2731,7 @@ namespace CalamityMod.CalPlayer if (profanedCrystalBuffs) { - bool offenseBuffs = (Main.dayTime && !Player.wet) || Player.lavaWet; + bool offenseBuffs = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Buffs || (Main.dayTime && !Player.wet) || Player.lavaWet; if (offenseBuffs) flightTimeMult += 0.1; } @@ -3102,7 +3142,11 @@ namespace CalamityMod.CalPlayer int babDamage = profanedCrystal ? 346 : 52; if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) - Projectile.NewProjectile(source, Player.Center, Vector2.UnitY * -6f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + { + var babH = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -6f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, babCheck); + babH.originalDamage = babDamage; + } + if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { @@ -3112,7 +3156,7 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { - float spearCounter = profanedCrystal ? 0f : 15f; + float spearCounter = profanedCrystal ? 60 * 8 : 15f; var babO = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -1f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, babCheck, spearCounter); babO.originalDamage = babDamage; } @@ -3123,7 +3167,7 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - Player.scope = false; //this is so it doesn't mess with the balance of ranged transform attacks over the others + bool empowered = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; Player.lavaImmune = true; Player.fireWalk = true; Player.buffImmune[ModContent.BuffType()] = Main.dayTime; @@ -3131,36 +3175,27 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.OnFire] = true; Player.buffImmune[BuffID.Burning] = true; Player.buffImmune[BuffID.Daybreak] = true; - bool offenseBuffs = (Main.dayTime && !Player.wet) || Player.lavaWet; + bool offenseBuffs = (Main.dayTime && !Player.wet) || Player.lavaWet || empowered; if (offenseBuffs) { Player.GetDamage() += 0.15f; Player.GetKnockback() += 0.15f; Player.moveSpeed += 0.1f; - Player.statDefense -= 15; + if (!empowered) + Player.statDefense -= 15; Player.ignoreWater = true; + Player.GetAttackSpeed(DamageClass.SummonMeleeSpeed) += 1f; //this only ever affects psc whip and should not be problematic } - else + else if (empowered || !offenseBuffs) { - Player.moveSpeed -= 0.1f; Player.endurance += 0.05f; Player.statDefense += 15; Player.lifeRegen += 5; } - bool enrage = Player.statLife <= (int)(Player.statLifeMax2 * 0.5); + bool enrage = pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; if (!ZoneAbyss) //No abyss memes. Lighting.AddLight(Player.Center, enrage ? 1.2f : offenseBuffs ? 1f : 0.2f, enrage ? 0.21f : offenseBuffs ? 0.2f : 0.01f, 0); - if (enrage) - { - bool special = ProfanedSoulCrystal.testerNames.Any(name => name.Equals(Player.name)); - for (int i = 0; i < 3; i++) - { - int fire = Dust.NewDust(Player.position, Player.width, Player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); - Main.dust[fire].scale = special ? 1.169f : 2f; - Main.dust[fire].noGravity = true; - Main.dust[fire].velocity *= special ? 10f : 6.9f; - } - } + } } @@ -3636,9 +3671,15 @@ namespace CalamityMod.CalPlayer int maxDurability = profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ProfanedSoulArtifact.ShieldDurabilityMax; + int delay = profanedCrystalBuffs + ? ProfanedSoulCrystal.ShieldRechargeDelay + : ProfanedSoulArtifact.ShieldRechargeDelay; + int totalRecharge = profanedCrystalBuffs + ? ProfanedSoulCrystal.TotalShieldRechargeTime + : ProfanedSoulArtifact.TotalShieldRechargeTime; if (pSoulShieldDurability == 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShieldRecharge.ID)) - Player.AddCooldown(ProfanedSoulShieldRecharge.ID, ProfanedSoulArtifact.ShieldRechargeDelay); + Player.AddCooldown(ProfanedSoulShieldRecharge.ID, delay); // If the shield has greater than zero durability but that durability is not on the cooldown rack, add it to the cooldown rack. if (pSoulShieldDurability > 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShield.ID)) @@ -3656,7 +3697,7 @@ namespace CalamityMod.CalPlayer playedProfanedSoulShieldSound = true; // This number is not an integer, and stores exact per-frame recharge progress. - pSoulShieldPartialRechargeProgress += maxDurability / (float)ProfanedSoulArtifact.TotalShieldRechargeTime; + pSoulShieldPartialRechargeProgress += maxDurability / (float)totalRecharge; // Floor the value to get whole number of shield points recharged this frame. int pointsActuallyRecharged = (int)MathF.Floor(pSoulShieldPartialRechargeProgress); diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index d5077bb159..b220d0860a 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -162,7 +162,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4)) target.AddBuff(BuffID.OnFire3, 360); - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) target.AddBuff(BuffID.OnFire3, 240); else target.AddBuff(BuffID.OnFire3, 120); @@ -335,7 +335,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4)) target.AddBuff(BuffID.OnFire3, 360); - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) target.AddBuff(BuffID.OnFire3, 240); else target.AddBuff(BuffID.OnFire3, 120); @@ -895,7 +895,7 @@ namespace CalamityMod.CalPlayer for (int dustexplode = 0; dustexplode < 360; dustexplode++) { Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode)); - int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool(2) ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f); + int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool() ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f); Main.dust[d].noGravity = true; Main.dust[d].position = proj.Center; Main.dust[d].velocity *= 0.1f; @@ -907,7 +907,7 @@ namespace CalamityMod.CalPlayer { for (int i = 0; i < 3; i++) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int type = -1; switch (Main.rand.Next(15)) @@ -1062,7 +1062,13 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 300); if (profanedCrystalBuffs) - target.AddBuff(Main.dayTime ? BuffType() : BuffType(), 600); + { + bool empowered = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + if (empowered || Main.dayTime) + target.AddBuff(BuffType(), 600); + if (empowered || !Main.dayTime) + target.AddBuff(BuffType(), 600); + } if (divineBless) target.AddBuff(BuffType(), 60); @@ -1210,7 +1216,7 @@ namespace CalamityMod.CalPlayer if ((target.damage > 5 || target.boss) && !target.SpawnedFromStatue) { - if (bloodflareThrowing && proj.CountsAsClass() && crit && Main.rand.NextBool(2)) + if (bloodflareThrowing && proj.CountsAsClass() && crit && Main.rand.NextBool()) { float projHitMult = 0.03f; projHitMult -= proj.numHits * 0.015f; @@ -1243,7 +1249,7 @@ namespace CalamityMod.CalPlayer { if (manaOverloader && otherHealTypes) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { float healMult = 0.2f; healMult -= proj.numHits * 0.05f; diff --git a/CalPlayer/Dashes/AsgardsValorDash.cs b/CalPlayer/Dashes/AsgardsValorDash.cs index c3ff2c8611..27368abd27 100644 --- a/CalPlayer/Dashes/AsgardsValorDash.cs +++ b/CalPlayer/Dashes/AsgardsValorDash.cs @@ -46,7 +46,7 @@ namespace CalamityMod.CalPlayer.Dashes holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); holyFireDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) holyFireDashDust.fadeIn = 0.5f; } } diff --git a/CalPlayer/Dashes/DeepDiverDash.cs b/CalPlayer/Dashes/DeepDiverDash.cs index 43620c3d0a..61d2d5ab11 100644 --- a/CalPlayer/Dashes/DeepDiverDash.cs +++ b/CalPlayer/Dashes/DeepDiverDash.cs @@ -39,7 +39,7 @@ namespace CalamityMod.CalPlayer.Dashes iceDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); iceDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); iceDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) iceDashDust.fadeIn = 0.5f; } diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index 71b2ddb356..9f46dd1b95 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -46,7 +46,7 @@ namespace CalamityMod.CalPlayer.Dashes holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); holyFireDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) holyFireDashDust.fadeIn = 0.5f; } diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index 50ba65437a..ac567d7484 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -44,7 +44,7 @@ namespace CalamityMod.CalPlayer.Dashes plagueDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); plagueDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); plagueDashDust.noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) plagueDashDust.fadeIn = 0.5f; } diff --git a/Items/Accessories/BloomStone.cs b/Items/Accessories/BloomStone.cs index d927134cb7..d016818e8c 100644 --- a/Items/Accessories/BloomStone.cs +++ b/Items/Accessories/BloomStone.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Accessories // On grass, grow flowers. if (groundTile.TileType == TileID.Grass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { walkTile.Get().HasTile = true; walkTile.TileType = TileID.Plants; @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Accessories // On hallowed grass, grow hallowed flowers. else if (groundTile.TileType == TileID.HallowedGrass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { walkTile.Get().HasTile = true; walkTile.TileType = TileID.HallowedPlants; diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index bbd8401e12..629e88b5ce 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using CalamityMod.CalPlayer; +using static CalamityMod.Items.Accessories.ProfanedSoulCrystal; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Plates; using CalamityMod.Items.Placeables.Ores; @@ -51,8 +52,9 @@ namespace CalamityMod.Items.Accessories // Do not render the shield if its visibility is off (or it does not exist) bool isVanityOnly = modPlayer.pSoulShieldVisible && !modPlayer.pSoulArtifact; + bool shouldNotDraw = modPlayer.andromedaState >= AndromedaPlayerState.LargeRobot; //I am not dealing with drawing that :taxevasion: bool shieldExists = isVanityOnly || modPlayer.pSoulShieldDurability > 0; - if (!modPlayer.pSoulShieldVisible || modPlayer.drawnAnyShieldThisFrame || !shieldExists) + if (!modPlayer.pSoulShieldVisible || modPlayer.drawnAnyShieldThisFrame || shouldNotDraw || !shieldExists) continue; // Scale the shield is drawn at. @@ -62,8 +64,9 @@ namespace CalamityMod.Items.Accessories if (!alreadyDrawnShieldForPlayer) { CalamityPlayer localModPlayer = Main.LocalPlayer.Calamity(); + DetermineTransformationEligibility(localModPlayer.Player); var psc = localModPlayer.profanedCrystalBuffs; - scale += psc ? 0.025f : 0f; + scale += ((ProfanedSoulCrystalState)localModPlayer.pscState) == ProfanedSoulCrystalState.Empowered ? 0.05f : psc ? 0.025f : 0f; float visualShieldStrength = 1f; if (!isVanityOnly) { @@ -92,11 +95,13 @@ namespace CalamityMod.Items.Accessories shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); // Profaned Soul shields are not team specific - Color shieldColor = new Color(231, 160, 56); - if (psc && ProfanedSoulCrystal.testerNames.Any(name => name.Equals(localModPlayer.Player.name))) - shieldColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); - else if (psc) - shieldColor = new Color(255, 110, 56); + Color shieldColor = GetColorForPsc(localModPlayer.pscState, Main.dayTime); + if (modPlayer.pscState >= (int)(ProfanedSoulCrystalState.Buffs)) + { + bool tester = contributorNames.Any(name => name.Equals(localModPlayer.Player.name)); + shieldColor = tester ? CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25) * 0.8f, 6f) : + GetLerpedColorForPsc(modPlayer); + } Color primaryEdgeColor = new Color(230, 199, 102) * 0.8f; Color secondaryEdgeColor = new Color(249, 231, 217) * 0.8f; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 33c9795789..40d57b83ad 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.StatBuffs; +using System; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; @@ -7,6 +8,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System.Collections.Generic; using System.Linq; +using CalamityMod.Buffs.Summon.Whips; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -18,22 +20,96 @@ namespace CalamityMod.Items.Accessories //Developer item, dedicatee: Mishiro Usui/Amber Sienna public class ProfanedSoulCrystal : ModItem, ILocalizedModType { - public static string[] testerNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro" }; + public static string[] contributorNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro", "LordMetarex", "Memes" }; public static int ShieldDurabilityMax = 125; public new string LocalizationCategory => "Items.Accessories"; + public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); + public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(4); + internal const int maxMinionRequirement = 10; + + public enum ProfanedSoulCrystalState + { + Vanity, //pre scal/draedon or insufficient minion slots + Buffs, //regular psc, offense guardian functionality + Enraged, //psc but night, some attacks are faster + Empowered //psc but no other minions, healer guardian functionality, inherits all other functionality (except vanity) and goes even further beyond, any remaining attack changes are here + } + + private static ProfanedSoulCrystalState GetPscStateFor(Player player) + { + if (!player.Calamity().profanedCrystalBuffs) + return ProfanedSoulCrystalState.Vanity; //vanity if no buffs + + var noMinions = player.slotsMinions == 0; + var noSentries = !Main.projectile.Any(proj => proj.active && proj.owner == player.whoAmI && proj.sentry); + if (noMinions && noSentries) + return ProfanedSoulCrystalState.Empowered; //immediately check for empowered as it overrides everything else + + return !Main.dayTime ? ProfanedSoulCrystalState.Enraged : //check for enrage + ProfanedSoulCrystalState.Buffs; //return buffs as the sole remaining option + } + + internal static Color GetColorForPsc(int pscState, bool day, int alpha = 0) + { + return ((ProfanedSoulCrystalState)pscState) switch + { + ProfanedSoulCrystalState.Vanity => new Color(231, 160, 56, alpha), + ProfanedSoulCrystalState.Buffs => new Color(255, 110, 56, alpha), + ProfanedSoulCrystalState.Enraged => new Color(145, 208, 188, alpha), + ProfanedSoulCrystalState.Empowered => day ? new Color(255, 75, 13, alpha) : new Color(84, 186, 163, alpha), + _ => Color.White //defaults to white, should not be white + }; + } + + internal static Color GetLerpedColorForPsc(CalamityPlayer calPlayer) + { + if (calPlayer.pscLerpColor != Color.White) + return calPlayer.pscLerpColor; //already set the lerp colour this frame, calculating it again is redundant + + bool day = Main.dayTime; + double totalTime = Main.dayTime ? Main.dayLength : Main.dayLength + Main.nightLength; + double currentTime = Main.time; + double midday = Main.dayLength / 2; + double midnight = Main.nightLength / 2; + Color dayColor = GetColorForPsc(calPlayer.pscState, day); + Color nightColor = GetColorForPsc(calPlayer.pscState > (int)ProfanedSoulCrystalState.Enraged + ? (int)ProfanedSoulCrystalState.Empowered + : (int)ProfanedSoulCrystalState.Enraged, false); + var targetColor = Main.dayTime ? dayColor : nightColor; + var nonTargetColor = Main.dayTime ? nightColor : dayColor; + var targetTime = Main.dayTime ? midday : midnight; + var interpolant = Utils.GetLerpValue(totalTime, targetTime, currentTime, false); + var result = Color.White; + if (!Main.dayTime && Main.time > midnight) + { + result = Color.Lerp(nightColor, dayColor, 2f - (float)interpolant); + } + + else if (Main.dayTime && Main.time > midday) + { + result = Color.Lerp(nightColor, dayColor, (float)interpolant); + } + + if (result == Color.White) + { + result = Color.Lerp(nonTargetColor, targetColor, (Main.time < midday ? 2f : 0f) - (float)interpolant); + } + + + calPlayer.pscLerpColor = result; + return result; + } /** * Notes: Drops from providence if the only damage source during the fight is from typeless damage or the profaned soul and the owners of those babs do not have profaned crystal. * All projectiles are in ProfanedSoulCrystalProjectiles.cs in the summon projectile directory - * The projectiles being created/fired on click happens in CalamityGlobalItem (there's a region specially for it so ctrl + f is your friend) * the day/night buffs are in calamityplayermisceffects - * the bab projectiles are the same, just refactored ai to be more adhering to DRY principle * bab spears being fired happens at the bottom of calplayer * Animation of legs is postupdate, animation of wings is frameeffects. * Projectiles transformed are ONLY affected by alldamage and summon damage bonuses, likewise the weapon's base damage/usetime is NOT taken into account. - * You enrage below or at 50% hp. + * The on-hit effect for the whip is in globalnpc */ public override void Load() { @@ -41,9 +117,12 @@ namespace CalamityMod.Items.Accessories return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHead", EquipType.Head, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHeadNight", EquipType.Head, this, "PscNightHead"); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransBody", EquipType.Body, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegs", EquipType.Legs, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegsNight", EquipType.Legs, this, "PscNightLegs"); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWings", EquipType.Wings, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWingsNight", EquipType.Wings, this, "PscNightWings"); } public override void SetStaticDefaults() @@ -60,6 +139,11 @@ namespace CalamityMod.Items.Accessories int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; + ArmorIDs.Legs.Sets.OverridesLegs[equipSlotLegs] = true; + + int equipSlotNightLegs = EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); + ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotNightLegs] = true; + ArmorIDs.Legs.Sets.OverridesLegs[equipSlotNightLegs] = true; } public override void SetDefaults() @@ -93,7 +177,7 @@ namespace CalamityMod.Items.Accessories else { string manaCost = (100 * Main.player[Main.myPlayer].manaCost).ToString("N0"); - string full = this.GetLocalization("FullTooltip").Format(manaCost); + string full = this.GetLocalization("FullTooltip").Format(maxMinionRequirement, manaCost); tooltips.FindAndReplace("[STATUS]", full); } } @@ -115,15 +199,15 @@ namespace CalamityMod.Items.Accessories { player.Calamity().profanedCrystalHide = false; player.Calamity().profanedCrystalForce = true; - player.Calamity().pSoulShieldVisible = true; } internal static void DetermineTransformationEligibility(Player player) { //short circuit immediately if profanedcrystalbuffs has already been set - if (!player.Calamity().profanedCrystalBuffs && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) + if (!player.Calamity().profanedCrystalBuffs && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; + player.Calamity().pscState = (int)GetPscStateFor(player); //update psc state, default is 0 which is the same as the int value of vanity } } @@ -137,50 +221,51 @@ namespace CalamityMod.Items.Accessories int weaponType = item.CountsAsClass() ? 1 : item.CountsAsClass() ? 2 : item.CountsAsClass() ? 3 : - item.CountsAsClass() ? 4 : -1; + item.CountsAsClass() ? 4 : + item.CountsAsClass() ? 5 : -1; if (weaponType > 0) { - if (player.Calamity().profanedSoulWeaponType != weaponType || player.Calamity().profanedSoulWeaponUsage >= 300) + if (player.Calamity().profanedSoulWeaponType != weaponType || player.Calamity().profanedSoulWeaponUsage >= 370) { player.Calamity().profanedSoulWeaponType = weaponType; player.Calamity().profanedSoulWeaponUsage = 0; } Vector2 correctedVelocity = Main.MouseWorld - player.Center; correctedVelocity.Normalize(); - bool shouldNerf = player.Calamity().endoCooper || player.Calamity().magicHat; //No bonkers damage memes thank you very much. - bool enrage = player.statLife <= (int)(player.statLifeMax2 * 0.5); + bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered; + bool enraged = player.Calamity().pscState >= (int)ProfanedSoulCrystalState.Enraged; if (item.CountsAsClass()) { - if (player.Calamity().profanedSoulWeaponUsage % (enrage ? 4 : 6) == 0) + if (player.Calamity().profanedSoulWeaponUsage % (enraged ? 4 : 6) == 0) { - if (player.Calamity().profanedSoulWeaponUsage > 0 && player.Calamity().profanedSoulWeaponUsage % (enrage ? 20 : 30) == 0) //every 5 shots is a shotgun spread + if (player.Calamity().profanedSoulWeaponUsage > 0 && player.Calamity().profanedSoulWeaponUsage % (enraged ? 20 : 30) == 0) //every 5 shots is a shotgun spread { int numProj = 5; - correctedVelocity *= 12f; - int spread = 3; + correctedVelocity *= 20f; + int spread = -6; for (int i = 0; i < numProj; i++) { - Vector2 perturbedspeed = new Vector2(correctedVelocity.X, correctedVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); - - int spearBaseDamage = shouldNerf ? 175 : 350; + Vector2 perturbedspeed = new Vector2(correctedVelocity.X, correctedVelocity.Y).RotatedBy(MathHelper.ToRadians(spread)); + int separation = (i * 4) - 8; + int spearBaseDamage = 350; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - int proj = Projectile.NewProjectile(source, player.Center.X, player.Center.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f); + int proj = Projectile.NewProjectile(source, player.Center.X, player.Center.Y - separation, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].DamageType = DamageClass.Summon; Main.projectile[proj].originalDamage = spearBaseDamage; } - spread -= Main.rand.Next(2, 4); + spread += 3; SoundEngine.PlaySound(SoundID.Item20, player.Center); } player.Calamity().profanedSoulWeaponUsage = 0; } else { - int spearBaseDamage = shouldNerf ? 125 : 250; + int spearBaseDamage = 250; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - int proj = Projectile.NewProjectile(source, player.Center, correctedVelocity * 6.9f, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f); + int proj = Projectile.NewProjectile(source, player.Center, correctedVelocity * 14f, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].DamageType = DamageClass.Summon; @@ -195,14 +280,14 @@ namespace CalamityMod.Items.Accessories } else if (item.CountsAsClass()) { - if (enrage || Main.rand.NextBool(2)) //100% chance if 50% or lower, else 1 in 2 chance + if (enraged || Main.rand.NextBool()) //100% chance if 50% or lower, else 1 in 2 chance { correctedVelocity *= 20f; Vector2 perturbedspeed = new Vector2(correctedVelocity.X + Main.rand.Next(-3, 4), correctedVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(3)); - bool isSmallBoomer = Main.rand.NextDouble() <= (enrage ? 0.2 : 0.3); // 20% chance if enraged, else 30% This is intentional due to literally doubling the amount of projectiles fired. + bool isSmallBoomer = Main.rand.NextDouble() <= (enraged && !empowered ? 0.2 : 0.3); // 20% chance if enraged, else 30% This is intentional due to literally doubling the amount of projectiles fired. bool isThiccBoomer = isSmallBoomer && Main.rand.NextDouble() <= 0.05; // 5% int projType = isSmallBoomer ? isThiccBoomer ? 1 : 2 : 3; - int boomBaseDamage = shouldNerf ? 100 : 200; + int boomBaseDamage = 200; int boomDamage = (int)player.GetTotalDamage().ApplyTo(boomBaseDamage); switch (projType) { @@ -250,20 +335,20 @@ namespace CalamityMod.Items.Accessories player.statMana -= manaCost; correctedVelocity *= 25f; SoundEngine.PlaySound(SoundID.Item20, player.Center); - int magefireBaseDamage = shouldNerf ? 450 : 900; + int magefireBaseDamage = 900; int magefireDamage = (int)player.GetTotalDamage().ApplyTo(magefireBaseDamage); if (player.HasBuff(BuffID.ManaSickness)) { int sickPenalty = (int)(magefireDamage * (0.05f * ((player.buffTime[player.FindBuffIndex(BuffID.ManaSickness)] + 60) / 60))); magefireDamage -= sickPenalty; } - int proj = Projectile.NewProjectile(source, player.position, correctedVelocity, ModContent.ProjectileType(), magefireDamage, 1f, player.whoAmI, enrage ? 1f : 0f); + int proj = Projectile.NewProjectile(source, player.position, correctedVelocity, ModContent.ProjectileType(), magefireDamage, 1f, player.whoAmI, empowered ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].DamageType = DamageClass.Summon; Main.projectile[proj].originalDamage = magefireBaseDamage; } - player.Calamity().profanedSoulWeaponUsage = enrage ? 20 : 25; + player.Calamity().profanedSoulWeaponUsage = enraged ? 20 : 25; } if (player.Calamity().profanedSoulWeaponUsage > 0) player.Calamity().profanedSoulWeaponUsage--; @@ -274,15 +359,16 @@ namespace CalamityMod.Items.Accessories { player.Calamity().profanedSoulWeaponUsage = 0; } - if (player.Calamity().profanedSoulWeaponUsage >= (enrage ? 69 : 180)) + + if (player.Calamity().profanedSoulWeaponUsage >= (empowered ? 120 : 360)) { float crystalCount = 36f; for (float i = 0; i < crystalCount; i++) { float angle = MathHelper.TwoPi / crystalCount * i; - int shardBaseDamage = shouldNerf ? 88 : 176; + int shardBaseDamage = 176; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].DamageType = DamageClass.Summon; @@ -292,22 +378,63 @@ namespace CalamityMod.Items.Accessories } player.Calamity().profanedSoulWeaponUsage = 0; } - else if (player.Calamity().profanedSoulWeaponUsage % (enrage ? 5 : 10) == 0) + else if (player.Calamity().profanedSoulWeaponUsage % (empowered ? 5 : 10) == 0) { - float angle = MathHelper.TwoPi / (enrage ? 9 : 18) * (player.Calamity().profanedSoulWeaponUsage / (enrage ? 1 : 10)); - int shardBaseDamage = shouldNerf ? 110 : 220; + int chains = empowered ? 3 : 1; + int totalShardProjectiles = empowered ? 360 / 5 : 360 / 10; + int shardBaseDamage = empowered ? 125 : 220; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 1f, 0f); - if (proj.WithinBounds(Main.maxProjectiles)) + + float interval = totalShardProjectiles / chains * (empowered ? 5f : 10f); + double patternInterval = Math.Floor(player.Calamity().profanedSoulWeaponUsage / interval); + if (patternInterval % 2 == 0) { - Main.projectile[proj].DamageType = DamageClass.Summon; - Main.projectile[proj].originalDamage = shardBaseDamage; + double radians = MathHelper.TwoPi / chains; + double angleA = radians * 0.5; + double angleB = MathHelper.ToRadians(90f) - angleA; + float velocityX = (float)(2f * Math.Sin(angleA) / Math.Sin(angleB)); + Vector2 spinningPoint = new Vector2(velocityX, -2f); + for (int i = 0; i < chains; i++) + { + Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(player.Calamity().profanedSoulWeaponUsage)); + vector2.Normalize(); + int proj = Projectile.NewProjectile(source, player.Center, vector2 * 12f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 1f, 0f); + if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].DamageType = DamageClass.Summon; + Main.projectile[proj].originalDamage = shardBaseDamage; + } + } + + SoundEngine.PlaySound(SoundID.Item20, player.Center); } - SoundEngine.PlaySound(SoundID.Item20, player.Center); } - player.Calamity().profanedSoulWeaponUsage += enrage ? 1 : 2; - if (!enrage && player.Calamity().profanedSoulWeaponUsage % 2 != 0) - player.Calamity().profanedSoulWeaponUsage--; + player.Calamity().profanedSoulWeaponUsage += !empowered ? 2 : 1; + + } + else if (item.CountsAsClass()) + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + { + player.Calamity().profanedSoulWeaponUsage = 0; + } + + if (player.Calamity().profanedSoulWeaponUsage == 0) + { + int whipBaseDamage = 250; + int whipDamage = (int)player.GetTotalDamage().ApplyTo(whipBaseDamage); + var buffed = player.HasBuff(); + correctedVelocity *= buffed ? 10f : 8f; + int permittedDistance = player.HasBuff() ? 10 : 8; + correctedVelocity.X = Math.Clamp(correctedVelocity.X, -permittedDistance, permittedDistance); + correctedVelocity.Y = Math.Clamp(correctedVelocity.Y, -permittedDistance, permittedDistance); + + player.direction = correctedVelocity.X > 0 ? 1 : -1; + Projectile.NewProjectile(source, player.Center, correctedVelocity, ModContent.ProjectileType(), whipDamage, 1f, player.whoAmI); + player.Calamity().profanedSoulWeaponUsage = 10; + } + + player.Calamity().profanedSoulWeaponUsage--; } } return false; diff --git a/Items/Accessories/ProfanedSoulTransHeadNight.png b/Items/Accessories/ProfanedSoulTransHeadNight.png new file mode 100644 index 0000000000..8073c055e1 Binary files /dev/null and b/Items/Accessories/ProfanedSoulTransHeadNight.png differ diff --git a/Items/Accessories/ProfanedSoulTransLegsNight.png b/Items/Accessories/ProfanedSoulTransLegsNight.png new file mode 100644 index 0000000000..e739124df2 Binary files /dev/null and b/Items/Accessories/ProfanedSoulTransLegsNight.png differ diff --git a/Items/Accessories/Vanity/Mishiro_Back.png b/Items/Accessories/Vanity/Mishiro_Back.png new file mode 100644 index 0000000000..c6c97a9410 Binary files /dev/null and b/Items/Accessories/Vanity/Mishiro_Back.png differ diff --git a/Items/Accessories/Vanity/Mishiro_Body.png b/Items/Accessories/Vanity/Mishiro_Body.png new file mode 100644 index 0000000000..878d7e2a08 Binary files /dev/null and b/Items/Accessories/Vanity/Mishiro_Body.png differ diff --git a/Items/Accessories/Vanity/Mishiro_Head.png b/Items/Accessories/Vanity/Mishiro_Head.png new file mode 100644 index 0000000000..88cdc03944 Binary files /dev/null and b/Items/Accessories/Vanity/Mishiro_Head.png differ diff --git a/Items/Accessories/Vanity/Mishiro_Legs.png b/Items/Accessories/Vanity/Mishiro_Legs.png new file mode 100644 index 0000000000..663bbb35ba Binary files /dev/null and b/Items/Accessories/Vanity/Mishiro_Legs.png differ diff --git a/Items/Accessories/Vanity/OracleHeadphones.cs b/Items/Accessories/Vanity/OracleHeadphones.cs new file mode 100644 index 0000000000..d06022a3b0 --- /dev/null +++ b/Items/Accessories/Vanity/OracleHeadphones.cs @@ -0,0 +1,85 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories.Vanity +{ + public class OracleHeadphones : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void Load() + { + if (Main.netMode != NetmodeID.Server) + { + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Head", EquipType.Head, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Body", EquipType.Body, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Legs", EquipType.Legs, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Back", EquipType.Back, this); + } + } + + public override void SetStaticDefaults() + { + + if (Main.netMode == NetmodeID.Server) + return; + + int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); + ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; + + int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); + ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; + ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; + + int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); + ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; + } + + public override void SetDefaults() + { + Item.width = 22; + Item.height = 30; + Item.accessory = true; + Item.value = Item.buyPrice(0, 1, 0, 0); + Item.rare = ItemRarityID.LightRed; + Item.vanity = true; + Item.Calamity().devItem = true; + } + + public override void UpdateVanity(Player player) + { + player.GetModPlayer().vanityEquipped = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (!hideVisual) + { + player.GetModPlayer().vanityEquipped = true; + } + } + } + + public class OracleHeadphonesPlayer : ModPlayer + { + public bool vanityEquipped = false; + + public override void ResetEffects() + { + vanityEquipped = false; + } + + public override void FrameEffects() + { + if (vanityEquipped) + { + Player.back = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Back); + Player.legs = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Legs); + Player.body = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Body); + Player.head = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Head); + + //Player.HideAccessories(); + } + } + } +} diff --git a/Items/Accessories/Vanity/OracleHeadphones.png b/Items/Accessories/Vanity/OracleHeadphones.png new file mode 100644 index 0000000000..0881b54cda Binary files /dev/null and b/Items/Accessories/Vanity/OracleHeadphones.png differ diff --git a/Items/Accessories/Wings/ProfanedSoulTransWingsNight.png b/Items/Accessories/Wings/ProfanedSoulTransWingsNight.png new file mode 100644 index 0000000000..7ccd140ab5 Binary files /dev/null and b/Items/Accessories/Wings/ProfanedSoulTransWingsNight.png differ diff --git a/Items/Accessories/Wings/TracersElysian.cs b/Items/Accessories/Wings/TracersElysian.cs index 06dddf9908..94cddc43e6 100644 --- a/Items/Accessories/Wings/TracersElysian.cs +++ b/Items/Accessories/Wings/TracersElysian.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool(2) ? 206 : 173, 0f, 0f, 100, default, 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool() ? 206 : 173, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; if (Main.rand.NextBool(10)) diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index c71e0fd373..d7b1382c6a 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer //On grass, grow flowers if (Main.tile[x, y + 1].TileType == TileID.Grass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { tile.Get().HasTile = true; tile.TileType = TileID.Plants; @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer //On hallowed grass, grow hallowed flowers else if (Main.tile[x, y + 1].TileType == TileID.HallowedGrass) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { tile.Get().HasTile = true; tile.TileType = TileID.HallowedPlants; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 77f8fd128c..d66d5d8a7d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -647,17 +647,8 @@ namespace CalamityMod.Items public override bool AltFunctionUse(Item item, Player player) { - if (player.Calamity().profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) + if (player.Calamity().profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) { - NPC closest = Main.MouseWorld.ClosestNPCAt(1000f, true); - if (closest != null) - { - //TODO look into this, it does not work as expected! - //Does not draw the ring, mostly, which leads to uncertainty of it's functionality - //Maybe just move it to a whip transform :wires: - player.MinionAttackTargetNPC = closest.whoAmI; - player.UpdateMinionTarget(); - } return false; } if (player.ActiveItem().type == ModContent.ItemType()) @@ -751,7 +742,7 @@ namespace CalamityMod.Items for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[projj].position, Main.projectile[projj].width, Main.projectile[projj].height, DustID.Ice); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } @@ -790,9 +781,8 @@ namespace CalamityMod.Items } // Conversion for Profaned Soul Crystal - // DO NOT CHECK TRANSFORM ELIGIBILITY HERE - // It causes issues with actually restricting the transformed attacks when the player fails the ~~vibe check~~ minion requirement check - if (modPlayer.profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) + bool autoreuse = item.autoReuse || item.CountsAsClass(); + if (modPlayer.profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && autoreuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) return player.altFunctionUse == 0 ? ProfanedSoulCrystal.TransformItemUsage(item, player) : AltFunctionUse(item, player); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 94f17ba775..be2793f1fc 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) + nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh) if (item.type == ModContent.ItemType()) nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); if (item.type == ModContent.ItemType()) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 77760a1694..3d5e695f68 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items { #region CATEGORY 1: Weapon Balancing { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(65), ShootSpeedRatio(1.25f)) }, - { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(18), DamageExact(61)) }, + { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(15)) }, { ItemID.AdamantiteSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(77)) }, { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, { ItemID.AmethystStaff, Do(ManaExact(2)) }, @@ -63,16 +63,14 @@ namespace CalamityMod.Items { ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed // Charged Blaster Cannon is now an earlier Last Prism-like, so it will probably need careful balance attention. // { ItemID.ChargedBlasterCannon, Do(DamageRatio(1.33f)) }, - { ItemID.ChlorophyteArrow, Do(DamageRatio(1.1f)) }, { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed) }, { ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, UseRatio(0.8f), DamageExact(70)) }, { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(80), UseExact(10)) }, - { ItemID.ChlorophyteShotbow, Do(PointBlank, DamageExact(80), UseExact(50)) }, { ItemID.ChristmasTreeSword, Do(AutoReuse, UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, { ItemID.ClingerStaff, Do(DamageExact(118)) }, { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(90)) }, - { ItemID.CobaltRepeater, Do(PointBlank, DamageExact(50), UseExact(20)) }, + { ItemID.CobaltRepeater, Do(PointBlank, UseExact(20)) }, { ItemID.CobaltSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(80)) }, { ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise { ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery @@ -111,7 +109,7 @@ namespace CalamityMod.Items { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) }, { ItemID.FlyingKnife, Do(DamageExact(70)) }, - { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(110)) }, + { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update { ItemID.Gatligator, Do(PointBlank, UseExact(6)) }, { ItemID.GoldenShower, Do(DamageExact(44)) }, @@ -121,15 +119,15 @@ namespace CalamityMod.Items { ItemID.GreenPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, { ItemID.GrenadeLauncher, Do(DamageRatio(1.5f)) }, { ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) }, - { ItemID.HallowedRepeater, Do(PointBlank, UseExact(14), DamageExact(57)) }, - { ItemID.Handgun, Do(PointBlank, UseExact(27), DamageExact(36)) }, + { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, + { ItemID.Handgun, Do(PointBlank, UseExact(22), DamageExact(36)) }, { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, { ItemID.HighVelocityBullet, Do(DamageExact(15)) }, { ItemID.IceBlade, Do(UseMeleeSpeed) }, - { ItemID.IceBoomerang, Do(DamageExact(25), UseExact(25), ShootSpeedExact(9)) }, + { ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) }, { ItemID.IceBow, Do(PointBlank, AutoReuse, DamageRatio(3f), UseRatio(2.5f)) }, // Uses ratios due to remix seed { ItemID.IceRod, Do(UseExact(6), DamageExact(30), ShootSpeedExact(20)) }, - { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(90), ShootSpeedExact(20f)) }, + { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(84), ShootSpeedExact(20f)) }, { ItemID.InfernoFork, Do(DamageRatio(1.2f)) }, { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, { ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) }, @@ -158,18 +156,18 @@ namespace CalamityMod.Items { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) }, - { ItemID.MythrilRepeater, Do(PointBlank, DamageExact(58), UseExact(19)) }, + { ItemID.MythrilRepeater, Do(PointBlank, UseExact(18)) }, { ItemID.MythrilSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(100)) }, { ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) }, { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.OrangePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(98), ShootSpeedRatio(1.25f)) }, - { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(86), UseExact(27)) }, + { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) }, { ItemID.OrichalcumSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(82)) }, { ItemID.PainterPaintballGun, Do(PointBlank, DamageExact(8)) }, { ItemID.PaladinsHammer, Do(DamageExact(100), ShootSpeedExact(23)) }, { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(96)) }, - { ItemID.PalladiumRepeater, Do(PointBlank, UseExact(25), DamageExact(75)) }, + { ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(100)) }, { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageRatio(2.31f), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) }, { ItemID.PearlwoodSword, Do(UseTurn, DamageRatio(1.5f)) }, @@ -231,7 +229,7 @@ namespace CalamityMod.Items { ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.TheUndertaker, Do(PointBlank, AutoReuse, DamageExact(15)) }, { ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear - { ItemID.TitaniumRepeater, Do(PointBlank, UseExact(29), DamageExact(122)) }, + { ItemID.TitaniumRepeater, Do(PointBlank, DamageExact(52)) }, { ItemID.TitaniumSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(77)) }, { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(72), ShootSpeedRatio(1.25f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, @@ -417,6 +415,7 @@ namespace CalamityMod.Items { ItemID.Blowpipe, pointBlank }, { ItemID.BorealWoodBow, pointBlank }, { ItemID.ChainGun, pointBlank }, + { ItemID.ChlorophyteShotbow, pointBlank }, { ItemID.CopperBow, pointBlank }, { ItemID.DartPistol, pointBlank }, { ItemID.DD2PhoenixBow, pointBlank }, // Phantom Phoenix diff --git a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs index df2385d6b8..bdbdcf864b 100644 --- a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs +++ b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { velocity = velocity.RotatedByRandom(MathHelper.ToRadians(10f)); int shotType = ModContent.ProjectileType(); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { shotType = ModContent.ProjectileType(); } diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 9da8a15c25..c5d9095915 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); if (d != null) { d.customData = 0.02f; diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index 79e208f270..0d8198880f 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.56f, 40, 65, -0.13f, 0.13f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.56f, 40, 65, -0.13f, 0.13f); if (d != null) { d.customData = 0.02f; diff --git a/Items/TreasureBags/MiscGrabBags/StarterBag.cs b/Items/TreasureBags/MiscGrabBags/StarterBag.cs index 74be667d81..abf1bf8068 100644 --- a/Items/TreasureBags/MiscGrabBags/StarterBag.cs +++ b/Items/TreasureBags/MiscGrabBags/StarterBag.cs @@ -99,6 +99,17 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags } itemLoot.AddIf(getsRedBow, ModContent.ItemType()); + + // Mishiro dev vanity + // Name specific: "Amber" or "Mishiro" + static bool getsOracleHeadphones(DropAttemptInfo info) + { + string playerName = info.player.name; + return playerName is "Amber" or "Mishiro"; + } + + itemLoot.AddIf(getsOracleHeadphones, ModContent.ItemType()); + } } } diff --git a/Items/Weapons/Magic/AuguroftheElements.cs b/Items/Weapons/Magic/AuguroftheElements.cs index 47f921ea19..50bfc5e410 100644 --- a/Items/Weapons/Magic/AuguroftheElements.cs +++ b/Items/Weapons/Magic/AuguroftheElements.cs @@ -46,12 +46,12 @@ namespace CalamityMod.Items.Weapons.Magic value2.Normalize(); value2 *= Item.shootSpeed; float num91 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index f38afbf721..c72df30e95 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic { counter++; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 speed = velocity.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-15, 16))); speed.Normalize(); @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Magic velocity.Y += Main.rand.Next(-40, 41) * 0.05f; Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, counter % 2 == 0 ? 1f : 0f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int noteProj = Utils.SelectRandom(Main.rand, new int[] { diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index 980c7c3469..a3d0c6b179 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -51,12 +51,12 @@ namespace CalamityMod.Items.Weapons.Magic value2.Normalize(); value2 *= Item.shootSpeed; float num91 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/TomeofFates.cs b/Items/Weapons/Magic/TomeofFates.cs index 3c2190b6fc..ce91cbf567 100644 --- a/Items/Weapons/Magic/TomeofFates.cs +++ b/Items/Weapons/Magic/TomeofFates.cs @@ -53,12 +53,12 @@ namespace CalamityMod.Items.Weapons.Magic value2 *= Item.shootSpeed; int projChoice = Main.rand.Next(7); float num91 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num92 *= -1f; } diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index efb9479a46..a761ac63b7 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Magic { type = ModContent.ProjectileType(); } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { type = ModContent.ProjectileType(); } diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index b37ee00df4..a1d33cf7d0 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Melee { for (int i = 0; i < 3; i++) { - Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0.7f, 55, 110, -0.07f, 0.07f); + Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.7f, 55, 110, -0.07f, 0.07f); if (d != null) { d.customData = 0.03f; diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index 8ff58fbb13..cedac8448a 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 94; Item.height = 92; Item.DamageType = DamageClass.Melee; - Item.damage = 455; + Item.damage = 432; Item.knockBack = 2.5f; Item.useAnimation = 19; Item.useTime = 19; diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 94a5cbe023..8c8d88e7e0 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee { int idx = Dust.NewDust(target.position, target.width, target.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index aede17f8de..3d4820dad3 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - type = Main.rand.NextBool(2) ? type : ModContent.ProjectileType(); + type = Main.rand.NextBool() ? type : ModContent.ProjectileType(); Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * 0.8), knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 76fa47e506..5a4c74effc 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num146++; } diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index fc422b4042..f462729e04 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(4)) { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool(2) ? 164 : 229); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool() ? 164 : 229); } } diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index 5b8310b62d..5e2ee3cefd 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num146++; } diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index e464576e79..1d36541e02 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee xDist *= speedMult; yDist *= speedMult; int knifeAmt = 3; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { knifeAmt++; } diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 9214d7fad1..6039f8ddb1 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Melee/StygianShield.cs b/Items/Weapons/Melee/StygianShield.cs index 47679d5003..c9a676e7ca 100644 --- a/Items/Weapons/Melee/StygianShield.cs +++ b/Items/Weapons/Melee/StygianShield.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; // Held stats - public const int HeldDefense = 12; - public const int DisableDashDuration = 120; + public const int HeldDefense = 16; + public const int DisableDashDuration = 90; public int ThrownShieldID = ModContent.ProjectileType(); - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HeldDefense, DisableDashDuration / 60); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HeldDefense, (DisableDashDuration / 60D).ToString("N1")); public override void SetDefaults() { @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.damage = 200; + Item.damage = 250; Item.DamageType = DamageClass.MeleeNoSpeed; Item.useAnimation = Item.useTime = 40; // This is only for the "Very slow" tooltip. The real use time should be faster Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 1ce2eb2bb7..57afc04611 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (target.life <= (target.lifeMax * 0.2f) && target.canGhostHeal) { - if (!CalamityPlayer.areThereAnyDamnBosses || Main.rand.NextBool(2)) + if (!CalamityPlayer.areThereAnyDamnBosses || Main.rand.NextBool()) { int heartDrop = CalamityPlayer.areThereAnyDamnBosses ? 1 : Main.rand.Next(1, 3); for (int i = 0; i < heartDrop; i++) @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index ea03b39e33..356878287a 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 42; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 250; + Item.damage = 220; Item.knockBack = 7.5f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index e2f4d6f1ae..793fc210c8 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 50; + Item.damage = 40; Item.DamageType = DamageClass.Ranged; Item.width = 54; Item.height = 26; diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index fcc0bd297c..0b750a6875 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (int i = 0; i < icicleAmt; i++) { Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2)); - Projectile.NewProjectile(source, position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), damage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, perturbedspeed, (Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType()), damage, 0f, player.whoAmI, 0f, 0f); spread2 -= Main.rand.Next(1,4); } return false; diff --git a/Items/Weapons/Summon/CindersOfLament.cs b/Items/Weapons/Summon/CindersOfLament.cs index cf7988de5a..8ea9cce618 100644 --- a/Items/Weapons/Summon/CindersOfLament.cs +++ b/Items/Weapons/Summon/CindersOfLament.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = ModContent.ProjectileType(); int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); if (Main.projectile.IndexInRange(p)) diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index aef847d348..ce81847306 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, DustID.Ice); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 0c9e45cabc..f30bc2b7d8 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int j = 0; j < 22; j++) { Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 927bcceda9..a5e212a07c 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -791,19 +791,33 @@ ProfanedCrystalBuff: { Description: You are an emissary of the profaned goddess now! Offense: The {0} empowers your offensive capabilities Lava: heat of the lava - Day: light of the sun + Day: light of day Defense: The {0} your flames, empowering your defensive capabilities Water: water douses Honey: honey cools Night: darkness of night cools - Enrage: Your weakened life force fuels your desperate attacks - NerfedEndo: An ascended ice construct is suppressing your true potential... - NerfedHat: A magical hat overwhelms your senses, squandering your true potential... + Enrage: In the absence of the day's warmth, your flames burn brighter + Empowered: + ''' + By forgoing any additional minion support, your full potential has been unleashed + [c/F05A5A:You are the last ace, in the lost hand of this campaign.] + ''' LockedSlots: Your profaned soul is constrained by your insufficient summoning powers LockedExos: The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations LockedSCal: The profaned soul within has been defiled by the powerful magic of a supreme witch } +ProfanedCrystalWhipDebuff: { + DisplayName: Profaned Crystal Whip Debuff + Description: Your flesh has been torn asunder by a profaned crystalline whip! +} + +ProfanedCrystalWhipBuff: { + DisplayName: Profaned Crystal Whip Empowerment + Description: The guardians have been empowered by the profaned crystal whip! + Empowered: Their full potential has been unleashed, and nobody is safe from their wrath +} + RageMode: { DisplayName: Rage Mode Description: Total damage multiplied by 1.35x diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 0caada6a59..bbac9206d2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -392,7 +392,7 @@ CorruptFlask: { Tooltip: ''' 4% increased damage reduction and +6 defense while in the corruption - Grants immunity to the Cursed Inferno debuff + Grants immunity to the Brain Rot debuff ''' } @@ -537,8 +537,7 @@ DimensionalSoulArtifact: { Tooltip: ''' Power - Boosts all damage by 25%, but at what cost? - Increases all damage taken by 15% + Boosts all damage by 25%, but at the cost of increasing damage taken by 15% ''' } @@ -1278,14 +1277,15 @@ ProfanedSoulCrystal: { Reject: Merchants will reject a defiled soul such as this. FullTooltip: ''' - Requires 10 minion slots to use in order to grant the following effects + Requires {0} minion slots to use in order to grant the following effects All non-summon weapons are converted into powerful summon variations - Falling below 50% life will empower these attacks + Having no other minions will empower these attacks [c/F05A5A:Transforms Melee attacks into a barrage of spears] - [c/3A83E4:Transforms Magic attacks into a powerful splitting fireball for {0} mana per cast] + [c/3A83E4:Transforms Magic attacks into a powerful splitting fireball for {1} mana per cast] [c/85E092:Transforms Ranged attacks into a flurry of fireballs and meteors] [c/E94571:Transforms Rogue attacks into a deadly crystalline spiral] - Summons and empowers the profaned babs to fight alongside you + [c/E299FF:Transforms Whip attacks into an empowering profaned crystal whip] + Summons and empowers the profaned soul guardians to fight alongside you Provides buffs depending on the time of day Thinking back, it was a boring life [c/FFBF49:And so we burn it all in the name of purity] @@ -1888,6 +1888,11 @@ RedBow: { Tooltip: "'Pelusa's favorite bow'" } +OracleHeadphones: { + DisplayName: Oracle Headphones + Tooltip: "'Hey game's over!'" +} + Popo: { DisplayName: Magic Scarf and Hat Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 4529ea1314..fd340d717c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -515,7 +515,7 @@ GleamingDagger: { } GodsParanoia: { - DisplayName: God's Paranoia + DisplayName: Gods' Paranoia Tooltip: ''' Hurls up to 10 speedy homing spiky balls diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index e14524390e..1fe7cfb25c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -166,8 +166,10 @@ MidnightSunUFO.DisplayName: Midnight Sun UFO MiniGuardianAttack.DisplayName: Offensive Guardian MiniGuardianDefense.DisplayName: Defensive Guardian MiniGuardianHealer.DisplayName: Healer Guardian +MiniGuardianHolyRay.DisplayName: Bab Holy Ray MiniGuardianRock.DisplayName: Rocky Road MiniGuardianSpear.DisplayName: Bab Spear +MiniGuardianStars.DisplayName: Bab Star MiniSandShark.DisplayName: Mini Sand Shark MK2FlaskSummon.DisplayName: Fuel Cell Flask MK2RocketHoming.DisplayName: Plague Rocket @@ -315,4 +317,7 @@ HopeShredder.DisplayName: Hope Shredder HopeShredderArrow.DisplayName: Hope Shredder Arrow HopeShredderArrowSplit.DisplayName: Hope Shredder Split Arrow StellarTorusSummon.DisplayName: Stellar Torus Summon -StellarTorusBeam.DisplayName: Stellar Torus Beam \ No newline at end of file +StellarTorusBeam.DisplayName: Stellar Torus Beam +MiniGuardianFireball.DisplayName: Mini Guardian Fireball +MiniGuardianFireballSplit.DisplayName: Mini Guardian Fireball Split +ProfanedCrystalWhip.DisplayName: Profaned Crystal Whip \ No newline at end of file diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 81425f34d7..37670fd456 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Abyss int min = 6; int max = 9; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index 5a1e53a9c6..ae27431687 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.AcidRain Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; Main.dust[dust].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index ec06f3f5ae..c303aa1459 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.AcidRain { if (NPC.ai[0] == 0f) { - NPC.ai[0] = Main.rand.NextBool(2).ToDirectionInt(); + NPC.ai[0] = Main.rand.NextBool().ToDirectionInt(); NPC.netUpdate = true; } if (NPC.collideX) diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index d51eba85b6..90ae7aa4e8 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -492,7 +492,7 @@ namespace CalamityMod.NPCs.AcidRain int damageBoom = 200; for (iBoom = 0; iBoom < 25; iBoom++) { - int projectileType = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int projectileType = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.AcidRain { int num622 = Dust.NewDust(NPC.position, NPC.width, NPC.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index f31da29918..baa847bb42 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.Astral { int purple = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[purple].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[purple].scale = 0.5f; Main.dust[purple].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 10806b5498..97c1bd3230 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astral } else if (NPC.ai[1] >= 140f) //oozin dust at the "mouth" { - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); int d = Dust.NewDust(spawnPoint - new Vector2(5), 10, 10, dustType); Main.dust[d].velocity = NPC.velocity * 0.3f; Main.dust[d].customData = true; @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.Astral for (int i = 0; i < numDust; i++) { Vector2 vel = (angle + Main.rand.NextFloat(-0.04f, 0.04f)).ToRotationVector2(); - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); Dust d = Dust.NewDustPerfect(NPC.Center, dustType, vel * Main.rand.NextFloat(1.8f, 2.2f)); d.customData = NPC; diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 84fe1953db..a793112a20 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -48,7 +48,7 @@ namespace CalamityMod.NPCs.Astral for (int i = 0; i < 6; i++) { int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 2 * hit.HitDirection, -2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = true; Main.dust[dust].scale = 1.2f * NPC.scale; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index fb33d6dce8..4b79fc386c 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -444,7 +444,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 8fdd94864a..90390664c8 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int dust = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); Main.dust[dust].velocity *= 1.66f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -355,7 +355,7 @@ namespace CalamityMod.NPCs.AstrumAureus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index c2e1cdf2ac..9904695fef 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 2b468f8585..2f2e2d5781 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 3dc727e6df..5747de46ef 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.AstrumDeus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 1fcaad3998..65a4ec0463 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 0c022ec63b..48b41ad3c8 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index 7b8c9ea787..f3e564e480 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index a3b4255154..82937e480f 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.CalClone { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 957acaa7d4..bc1b2865d9 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.CalClone { int red = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[red].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[red].scale = 0.5f; Main.dust[red].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index b8c41e9cf5..d058a3a086 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -837,12 +837,12 @@ namespace CalamityMod.NPCs int min = 12; int max = 16; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) playerPosX += Main.rand.Next(min, max); else playerPosX -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) playerPosY += Main.rand.Next(min, max); else playerPosY -= Main.rand.Next(min, max); @@ -3169,7 +3169,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index a9b28b37ac..48a955524b 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -720,7 +720,7 @@ namespace CalamityMod.NPCs int dustIdx = Dust.NewDust(spawnPosiion, 1, 1, 27, 0f, 0f, 0, default, 1f); Main.dust[dustIdx].velocity = -dustVelocity * 0.3f; Main.dust[dustIdx].alpha = 100; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dustIdx].noGravity = true; Main.dust[dustIdx].scale += 0.3f; @@ -5497,7 +5497,7 @@ namespace CalamityMod.NPCs } if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num121 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num121]; @@ -5507,7 +5507,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num122 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 174, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 1f); Dust dust = Main.dust[num122]; @@ -5519,7 +5519,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.RaggedCaster || npc.type == NPCID.RaggedCasterOpenCoat) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num123 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 175, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 0.1f); Dust dust = Main.dust[num123]; @@ -5535,7 +5535,7 @@ namespace CalamityMod.NPCs Lighting.AddLight(npc.Top, 0.6f, 0.6f, 0.3f); return false; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num124 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Dust dust = Main.dust[num124]; @@ -6627,13 +6627,13 @@ namespace CalamityMod.NPCs { npc.noGravity = false; npc.noTileCollide = false; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int sand = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 32, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); Dust dust = Main.dust[sand]; dust.velocity.X *= 0.4f; dust.velocity.Y *= -1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale += 0.2f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8a58b2cd0b..213070c6af 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon.Whips; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; @@ -59,6 +60,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent; @@ -3841,8 +3843,11 @@ namespace CalamityMod.NPCs { for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; + if (!BuffID.Sets.IsAnNPCWhipDebuff[k]) + npc.buffImmune[k] = true; } + NPCDebuffImmunityData debuffData = new NPCDebuffImmunityData { ImmuneToAllBuffsThatAreNotWhips = true }; + NPCID.Sets.DebuffImmunitySets[npc.type] = debuffData; if (npc.townNPC || NPCID.Sets.ActsLikeTownNPC[npc.type]) { @@ -4729,6 +4734,23 @@ namespace CalamityMod.NPCs } } } + //BuffType cannot be used in switch case, so that has to be handled outside of it + //Verify that the owner of the proj has psc state higher or equal to psc buffs + if (npc.HasBuff() && Main.player[proj.owner].Calamity().pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Buffs) + { + var empowered = Main.player[proj.owner].Calamity().pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + //20% is balanced for non empowered, while 40% helps ensure psc remains balanced at empowered tier + //Some PSC projectiles receive a reduced amount of benefit from this, for balancing purposes + modifiers.ScalingBonusDamage += (empowered ? 0.4f : 0.2f) * TagDamageMult; + if (Main.netMode != NetmodeID.Server) + { + var color = ProvUtils.GetProjectileColor((int)(Main.dayTime ? Providence.Providence.BossMode.Day : Providence.Providence.BossMode.Night), 0); + float power = Math.Min(npc.height / 100f, 3f); + var position = new Vector2(Main.rand.NextFloat(npc.Left.X, npc.Right.X), Main.rand.NextFloat(npc.Top.Y, npc.Bottom.Y)); + var particle = new FlameParticle(position, 50, 0.25f, power, color * (Main.dayTime ? 1f : 1.25f), color * (Main.dayTime ? 1.25f : 1f)); + GeneralParticleHandler.SpawnParticle(particle); + } + } } #endregion @@ -5053,8 +5075,8 @@ namespace CalamityMod.NPCs Vector2 iceLabCenter = CalamityWorld.IceLabCenter / 16f; for (int i = 0; i < 8; i++) { - int checkPositionX = (int)(playerCenterX + Main.rand.Next(30, 54) * Main.rand.NextBool(2).ToDirectionInt()); - int checkPositionY = (int)(playerCenterY + Main.rand.Next(24, 45) * Main.rand.NextBool(2).ToDirectionInt()); + int checkPositionX = (int)(playerCenterX + Main.rand.Next(30, 54) * Main.rand.NextBool().ToDirectionInt()); + int checkPositionY = (int)(playerCenterY + Main.rand.Next(24, 45) * Main.rand.NextBool().ToDirectionInt()); Vector2 checkPosition = new Vector2(checkPositionX, checkPositionY); Tile aboveSpawnTile = CalamityUtils.ParanoidTileRetrieval(checkPositionX, checkPositionY - 1); @@ -5352,7 +5374,7 @@ namespace CalamityMod.NPCs // TODO -- These debuff visuals cannot be moved because they correspond to vanilla debuffs if (electrified > 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDustDirect(npc.position, npc.width, npc.height, 226, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), 0, default, 0.35f); } @@ -5365,7 +5387,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -5380,7 +5402,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index fdb8d83703..e5f539dd01 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1003,7 +1003,7 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.DarksunEclipse"); else if (Main.rand.NextBool(5) && Main.LocalPlayer.ZoneGlowshroom) { - if (Main.rand.NextBool(2) && fapsol != -1) + if (Main.rand.NextBool() && fapsol != -1) chat = CalamityUtils.GetText("Vanilla.DryadChat.DrunkPrincessShroom").Format(Main.npc[fapsol].GivenName); else chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.Mushroom"); @@ -1066,7 +1066,7 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.PainterChat.Crimson"); if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneSnow) { - if (Main.rand.NextBool(2) && permadong != -1) + if (Main.rand.NextBool() && permadong != -1) chat = CalamityUtils.GetText("Vanilla.PainterChat.Archmage").Format(Main.npc[permadong].GivenName); else chat = CalamityUtils.GetTextValue("Vanilla.PainterChat.Tundra"); diff --git a/NPCs/CalamityPolarityNPC.cs b/NPCs/CalamityPolarityNPC.cs index 0807e237cf..f3454b8521 100644 --- a/NPCs/CalamityPolarityNPC.cs +++ b/NPCs/CalamityPolarityNPC.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs curPolarity--; //Polarity particles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Color sparkColor = AdamantiteParticleAccelerator.LightColors[CurPolarity < 0 ? 1 : 0]; Particle spark = new ElectricSpark(npc.Center + Main.rand.NextVector2Circular(npc.width / 2f, npc.height / 2f), Main.rand.NextVector2CircularEdge(20f, 20f) * 0.4f, Color.Lerp(Color.White, sparkColor, 0.4f), sparkColor, Main.rand.NextFloat(0.5f, 1.2f), Main.rand.Next(20, 40), bloomScale: 2.5f); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 43433125a2..9701cdbc4a 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.CeaselessVoid int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 7973ed421d..d447e426b4 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -898,7 +898,7 @@ namespace CalamityMod.NPCs.Crabulon { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 2be4f47ffe..72d8388085 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Crags { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 1bcc5a4835..55f40e6d24 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -816,12 +816,12 @@ namespace CalamityMod.NPCs.Cryogen int min = 16; int max = 20; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -1254,7 +1254,7 @@ namespace CalamityMod.NPCs.Cryogen { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 21590d8360..246b7cc930 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.Cryogen { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index ad15015911..953fa54f05 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 9df1c84fcc..3a3476c303 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index a8ad499c87..5549188e1a 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 8792fd74db..e1660807f8 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -484,7 +484,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 0bc7aff722..2eea41b221 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -933,7 +933,7 @@ namespace CalamityMod.NPCs.DevourerofGods Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } - shotSpacing_Phase2[3] -= Main.rand.NextBool(2) ? 180 : 200; + shotSpacing_Phase2[3] -= Main.rand.NextBool() ? 180 : 200; } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -2813,7 +2813,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index e8f2c650bc..4c043d0e79 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index 5cfec8a4c8..99458991a0 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { if (NPC.ai[1] == 0) { - NPC.ai[2] = Main.rand.NextBool(2) ? -1 : 1; + NPC.ai[2] = Main.rand.NextBool() ? -1 : 1; } NPC.ai[1]++; NPC.velocity.X = NPC.ai[2] * 2; diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index bea4d4e741..9f8d5e76b0 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { if (!Initialized) { - NPC.velocity = Vector2.UnitX * Main.rand.NextBool(2).ToDirectionInt() * 1.5f; + NPC.velocity = Vector2.UnitX * Main.rand.NextBool().ToDirectionInt() * 1.5f; Initialized = true; } @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.DraedonLabThings if (CalamityUtils.ParanoidTileRetrieval((int)(NPC.Center.X / 16), (int)(NPC.Center.Y / 16)).WallType == WallID.None || ClimbTime > 620f) { CurrentState = BehaviorState.WalkAround; - NPC.velocity = new Vector2(Main.rand.NextBool(2).ToDirectionInt() * 1.2f, 3f); + NPC.velocity = new Vector2(Main.rand.NextBool().ToDirectionInt() * 1.2f, 3f); NPC.rotation = 0f; NPC.netUpdate = true; } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index bb9512608c..ef2011df87 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1187,7 +1187,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (i < 50) dustVelocity = 4f; - int dust1 = Dust.NewDust(NPC.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int dust1 = Dust.NewDust(NPC.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float dustVelX = Main.dust[dust1].velocity.X; float dustVelY = Main.dust[dust1].velocity.Y; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index d466c300df..304c83fd4e 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.GreatSandShark int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 32, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -642,7 +642,7 @@ namespace CalamityMod.NPCs.GreatSandShark { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 6592faa79a..a75f68f6d3 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -573,7 +573,7 @@ namespace CalamityMod.NPCs.HiveMind int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, 14, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.HiveMind int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, 14, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -787,8 +787,8 @@ namespace CalamityMod.NPCs.HiveMind { for (int i = 0; i < 10; i++) { - int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); - int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); + int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool() ? -1 : 1); + int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool() ? -1 : 1); if (!WorldGen.SolidTile(posX, posY) && Collision.CanHit(new Vector2(posX * 16, posY * 16), 1, 1, player.position, player.width, player.height)) { NPC.ai[1] = posX; @@ -1095,7 +1095,7 @@ namespace CalamityMod.NPCs.HiveMind { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index b0f2f01e1a..f51fa76ae3 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -748,7 +748,7 @@ namespace CalamityMod.NPCs.Leviathan { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 8d819f1183..5fe8e3fa18 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.NormalNPCs targetVec.X *= targetDist; targetVec.Y *= targetDist; int damage = adultWyrmAlive ? (Main.expertMode ? 150 : 200) : (Main.expertMode ? 30 : 40); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetVec, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 8db62b7754..8aa442bb97 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.NormalNPCs { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index f836dd9740..d386772c90 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Randomly chooses to go clockwise or anti-clockwise around the player. if (!checkedRotationDir) { - rotationDir = (Main.rand.NextBool(2)).ToDirectionInt(); + rotationDir = (Main.rand.NextBool()).ToDirectionInt(); checkedRotationDir = true; NPC.netUpdate = true; } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 0dae3655ef..cc5fa62cf0 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.NormalNPCs int ruby = Dust.NewDust(NPC.Center, NPC.width, NPC.height, 90, dustVel.X, dustVel.Y, 100, default, 2f); Main.dust[ruby].velocity *= 1.5f; Main.dust[ruby].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ruby].scale = 0.5f; Main.dust[ruby].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.NormalNPCs { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 849490a8d2..efc5eb884b 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using System; +using CalamityMod.Items.Accessories.Vanity; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -417,6 +418,7 @@ namespace CalamityMod.NPCs.NormalNPCs npcLoot.AddIf(() => NPC.downedGolemBoss, ItemID.MartianConduitPlating, 1, 10, 30); npcLoot.Add(ModContent.ItemType(), 2); npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ModContent.ItemType(), (DateTime.Now.Day == 25 && DateTime.Now.Month == 5) ? 5 : 20); var postML = npcLoot.DefineConditionalDropSet(() => NPC.downedMoonlord); postML.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 8, 12, 11, 16)); } diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 4bc53f4294..7562a87a01 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (tries < 500) { - int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType() : ModContent.NPCType(); + int npcToSpawn = Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType(); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn); } } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index a12a5b9f06..e8994c00aa 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.OldDuke { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index d329949c9d..f355d92fc8 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.OldDuke int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 3ffbb331b2..68925efc27 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.localAI[1] >= 6f) { //Leak projectiles everywhere and start healing - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); int spread = Main.rand.Next(-45, 46); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 170, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -335,7 +335,7 @@ namespace CalamityMod.NPCs.Perforator float dustVelocityYAdd = Math.Abs(Main.dust[num622].velocity.Y) * 0.5f; if (Main.dust[num622].velocity.Y < 0f) Main.dust[num622].velocity.Y = 2f + dustVelocityYAdd; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 170, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator Main.dust[num624].velocity *= 2f; } - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; if (Main.getGoodWorld) @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.Perforator { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 81dbf63782..a05634df2b 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -632,7 +632,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 690cfacf93..7895b13f7c 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index c0116e2067..7bf16570f0 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index b504457e6b..5449c22bac 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -912,7 +912,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity *= 0.75f; gaussMode = true; } - else if (Main.rand.NextBool(2) && Main.zenithWorld) + else if (Main.rand.NextBool() && Main.zenithWorld) { type = ModContent.ProjectileType(); baseVelocity *= 0.4f; @@ -1156,7 +1156,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 10f58b4c96..bc79c19f80 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 9a05d34a14..02370543e0 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -551,7 +551,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 462485cb74..c23fe9e9a5 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -773,7 +773,7 @@ namespace CalamityMod.NPCs.Polterghast int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -927,7 +927,7 @@ namespace CalamityMod.NPCs.Polterghast int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -973,7 +973,7 @@ namespace CalamityMod.NPCs.Polterghast double deltaAngle = rotation / numProj; double offsetAngle; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numProj; i++) @@ -1313,7 +1313,7 @@ namespace CalamityMod.NPCs.Polterghast { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Polterplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 32c25068bb..c7b8761c08 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -467,7 +467,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 185, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 0.6f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7fbbf20fbb..816f212fa0 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1325,7 +1325,7 @@ namespace CalamityMod.NPCs.Providence player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -2541,7 +2541,7 @@ namespace CalamityMod.NPCs.Providence int fire = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; Main.dust[fire].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 4c32163b90..e6ed4e136f 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 995504074e..50a59b8c75 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.Ravager { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 8f57fb78b2..da2bb1d95d 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Signus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 1a9a83dea1..b5fd703e4f 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -296,12 +296,12 @@ namespace CalamityMod.NPCs.Signus int min = 14; int max = 18; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.Signus int num622 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.Signus int num623 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num623].velocity *= 3f; Main.dust[num623].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num623].scale = 0.5f; Main.dust[num623].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -969,7 +969,7 @@ namespace CalamityMod.NPCs.Signus { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 539130907e..5542aebf97 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.SlimeGod int damage = NPC.GetProjectileDamage(type); if (Main.zenithWorld) { - type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); } if (!NPC.wet) { diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 017f4582e6..ac07830de4 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.SlimeGod color.A = 150; int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, color, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -367,7 +367,7 @@ namespace CalamityMod.NPCs.SlimeGod color.A = 150; int dust2 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, color, 2f); Main.dust[dust2].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust2].scale = 0.5f; Main.dust[dust2].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index e7f442c334..dc279b91d3 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -700,7 +700,7 @@ namespace CalamityMod.NPCs.SlimeGod { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, dustColor, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 6f72cf4ebe..656e68f6f8 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -713,7 +713,7 @@ namespace CalamityMod.NPCs.SlimeGod { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, NPC.alpha, dustColor, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 5faf00cefb..ff92fcd7c0 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 467e5fde64..21ffbdd4cf 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -896,7 +896,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index ff664b375a..e50b446d82 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -327,7 +327,7 @@ namespace CalamityMod.NPCs.StormWeaver { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index cd835819c1..73816facfa 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.SunkenSea Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; Main.dust[dust].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 5169d0bf88..1d23f095fa 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.SunkenSea } else if (NPC.ai[2] == 2f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num5 = Dust.NewDust(NPC.position, NPC.width, NPC.height, 226, 0f, 0f, 200, default, 1.5f); Main.dust[num5].noGravity = true; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 6504b97afa..fc97720873 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 3cffd4d0eb..128d74bc3b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -752,7 +752,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { Vector2 dustSpawnPosition = NPC.Bottom; float horizontalSpawnOffset = bodyWidth * Main.rand.NextFloat(0.42f, 0.5f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) horizontalSpawnOffset *= -1f; dustSpawnPosition.X += horizontalSpawnOffset; @@ -2084,7 +2084,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust brimstoneMagic = Dust.NewDustPerfect(handPosition, 264); brimstoneMagic.velocity = Vector2.UnitY.RotatedByRandom(0.14f) * Main.rand.NextFloat(-3.5f, -3f) + NPC.velocity; @@ -2621,7 +2621,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust brimstoneMagic = Dust.NewDustPerfect(handPosition, 264); brimstoneMagic.velocity = Vector2.UnitY.RotatedByRandom(0.14f) * Main.rand.NextFloat(-3.5f, -3f) + NPC.velocity; @@ -2965,9 +2965,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas heart.ModNPC().ChainEndpoints.Add(endpoint); } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { - endpoint.X = heart.Center.X + Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(45f, 360f); + endpoint.X = heart.Center.X + Main.rand.NextBool().ToDirectionInt() * Main.rand.NextFloat(45f, 360f); endpoint.X = MathHelper.Clamp(endpoint.X, safeBox.Left, safeBox.Right); heart.ModNPC().ChainEndpoints.Add(endpoint); } @@ -3373,7 +3373,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(NPC.position, NPC.width, NPC.height, cirrus ? (int)CalamityDusts.PurpleCosmilite : (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 0b8321e09e..0422546da0 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 0ab38a2510..9d9e4cf183 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 3e360bd064..a590d1a31d 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.TownNPCs { int brimstone = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[brimstone].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[brimstone].scale = 0.5f; Main.dust[brimstone].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index 4e926fe89a..00af992ebc 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -304,12 +304,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses min += teleportDistanceIncrease; max += teleportDistanceIncrease; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num801 += Main.rand.Next(min, max); else num801 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num802 += Main.rand.Next(min, max); else num802 -= Main.rand.Next(min, max); @@ -466,12 +466,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int min = 18 + teleportDistanceIncrease; int max = 26 + teleportDistanceIncrease; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num810 += Main.rand.Next(min, max); else num810 -= Main.rand.Next(min, max); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) num811 += Main.rand.Next(min, max); else num811 -= Main.rand.Next(min, max); diff --git a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs index e21cf78504..9758dde5b4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs @@ -332,7 +332,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num622 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs index 0df1f70898..9c90497a5c 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num622 = Dust.NewDust(vector, npc.width / 2, npc.height / 2, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 2f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index 60347ca386..5d9e8ebfd4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer); - if (projectileType == ProjectileID.ThornBall && (Main.rand.NextBool(2) || !Main.zenithWorld)) + if (projectileType == ProjectileID.ThornBall && (Main.rand.NextBool() || !Main.zenithWorld)) Main.projectile[proj].tileCollide = false; } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index a02c92c873..b8c931934c 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2398,7 +2398,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 0f) NPC.ai[1] = 450 * Math.Sign((NPC.Center - targetData.Center).X); - teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); + teleportLocation = Main.rand.NextBool() ? (revenge ? 500 : 600) : (revenge ? -500 : -600); Vector2 center = targetData.Center + new Vector2(-NPC.ai[1], teleportLocation); NPC.Center = center; } @@ -3125,7 +3125,7 @@ namespace CalamityMod.NPCs.Yharon { int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Particles/CrackParticle.cs b/Particles/CrackParticle.cs index 0ebfc60c20..5743457e80 100644 --- a/Particles/CrackParticle.cs +++ b/Particles/CrackParticle.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Particles private float FinalScale; private Vector2 Squish; private Color BaseColor; + public float opacity; public int Stop = 0; public CrackParticle(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime) @@ -43,12 +44,14 @@ namespace CalamityMod.Particles if (Stop > 1) Velocity *= 0; Color = BaseColor; + + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); } public override void CustomDraw(SpriteBatch spriteBatch) { Texture2D tex = ModContent.Request(Texture).Value; - spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color * opacity, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); } } diff --git a/Particles/FlameParticle.cs b/Particles/FlameParticle.cs new file mode 100644 index 0000000000..128a7e2286 --- /dev/null +++ b/Particles/FlameParticle.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Particles +{ + public class FlameParticle : Particle + { + public override string Texture => "CalamityMod/Particles/Fire"; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + public override int FrameVariants => 3; + public float RelativePower; + + + + public Color BrightColor; + public Color DarkColor; + + + public FlameParticle(Vector2 position, int lifetime, float scale, float relativePower, Color brightColor, Color darkColor) + { + Position = position; + Velocity = Vector2.Zero; + Velocity.X = (Main.rand.NextFloat(1f, -1f)); + Scale = scale; + Variant = Main.rand.Next(3); + Lifetime = lifetime; + RelativePower = relativePower; + BrightColor = brightColor; + DarkColor = darkColor; + } + + public override void Update() + { + Scale += RelativePower * 0.01f; + Position.Y -= RelativePower * 1.25f; + + Color = Color.Lerp(BrightColor, DarkColor, LifetimeCompletion); + Color = Color.Lerp(Color, Color.White, Utils.GetLerpValue(0.1f, 0.25f, LifetimeCompletion, true) * Utils.GetLerpValue(0.4f, 0.25f, LifetimeCompletion, true) * 0.7f); + Color *= Utils.GetLerpValue(0f, 0.15f, LifetimeCompletion, true) * Utils.GetLerpValue(1f, 0.8f, LifetimeCompletion, true) * 0.6f; + Color *= 1.5f; + Color.A = 50; + } + } +} diff --git a/Particles/TitaniumRailgunShell.cs b/Particles/TitaniumRailgunShell.cs index b8b086a3cb..28352abf9a 100644 --- a/Particles/TitaniumRailgunShell.cs +++ b/Particles/TitaniumRailgunShell.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Particles if (Opacity <= 0.01f) GeneralParticleHandler.RemoveParticle(this); - if (LifetimeCompletion < 0.2f && Main.rand.NextBool(2)) + if (LifetimeCompletion < 0.2f && Main.rand.NextBool()) { Vector2 dustPosition = Position + Main.rand.NextVector2Circular(8f, 8f); diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index f79934f0ea..713f37392b 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Boss if (num640 < 50) num641 = 4f; - int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float num644 = Main.dust[num643].velocity.X; float num645 = Main.dust[num643].velocity.Y; diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index eba33bc8af..686826706e 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -216,10 +216,10 @@ namespace CalamityMod.Projectiles.Boss for (int num621 = 0; num621 < 12; num621++) { - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDustType, 0f, 0f, 100, default, 2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -227,7 +227,7 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDustType, 0f, 0f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 5f; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index ba8af2a34b..eb1aaf9d5d 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Main.dust[num56].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Boss if (num640 < 50) num641 = 4f; - int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f); + int num643 = Dust.NewDust(Projectile.Center, 6, 6, Main.rand.NextBool() ? 107 : 110, 0f, 0f, 100, default, 1f); float num644 = Main.dust[num643].velocity.X; float num645 = Main.dust[num643].velocity.Y; diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index cfb5d98722..8cc17235dd 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.Brimstone; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.1f, Projectile.velocity.Y * 0.1f, 100, default, 1f); Dust dust = Main.dust[fire]; diff --git a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs index 7474c0e3ea..dc02dcb714 100644 --- a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs +++ b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss { int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 0, default, 1.2f); Main.dust[dust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dust].scale = 0.5f; Main.dust[dust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 8061370fe3..8c5c3e30db 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index d25618c96c..66b4d5f4eb 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index e62390945e..9ff9326689 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index fd8fd42f1c..970a41e123 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Ectoplasm, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index d5a274e4f1..4514a6b39f 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index d6caaf9508..06f0b596ad 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 01d6cda48a..20bec96090 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 7c7701e21a..5e19c87710 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 4b2d24ce1a..a92b3bb7d3 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.NextFloat(0.1f, 1f); diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 5a1978f9df..7285cde7b5 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) Projectile.velocity.X *= 1.5f; diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 2dd15c56b2..5f7b867522 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 40b0888c85..beefd2c47a 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 56929b8276..c8865ae2ed 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 053e79fd50..b940eec81b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Boss int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 263fa60282..ec1b8562dd 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 7900f264ee..7041858f4a 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index fc2b7ec2df..8cba1a823b 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 6774adf70d..b2f6c8a002 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index b565a975b9..6038a979f5 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 45edf89dff..213b749959 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) Projectile.velocity.X *= 1.5f; diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 6cb97a3c18..12d35a5f38 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.ai[0] == breakThreshold && Main.zenithWorld) { - Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; + Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; } if (Projectile.timeLeft == 720) diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index a5a1c06e47..cb02116a03 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 0ae356e8bf..98d7293148 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index ec7c43fcf3..82a9038ddc 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 3c5a358042..1f75613049 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 1.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index f6435549f2..a9aea616c2 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 1.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/OldDukeSummonDrop.cs b/Projectiles/Boss/OldDukeSummonDrop.cs index 11348b06f1..509944c523 100644 --- a/Projectiles/Boss/OldDukeSummonDrop.cs +++ b/Projectiles/Boss/OldDukeSummonDrop.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { // 1 to 3 seconds of poisoned target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(1, 4)); diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 42a738a6d9..5f1563b047 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index f132a6932b..6372dcfda0 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index db1dc45b34..a73bcea192 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < totalProjectiles; i++) { Vector2 vector = new Vector2(0f, -8f).RotatedBy(radians * i); - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector, type, Projectile.damage, 0f, Main.myPlayer); } } @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index d74c361d00..99960b56d5 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index 1e154f55a2..4e81eb7532 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 537ccfdf12..0a23c7e12a 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index ccd8a0cadb..83c800e849 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1347,10 +1347,10 @@ namespace CalamityMod.Projectiles for (int i = 0; i < 8; i++) { - int randomDustType = Main.rand.NextBool(2) ? 125 : 148; + int randomDustType = Main.rand.NextBool() ? 125 : 148; Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 2f); dust.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale = 0.5f; dust.fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -1358,7 +1358,7 @@ namespace CalamityMod.Projectiles } for (int i = 0; i < 10; i++) { - int randomDustType = Main.rand.NextBool(2) ? 125 : 148; + int randomDustType = Main.rand.NextBool() ? 125 : 148; Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 3f); dust.noGravity = true; dust.velocity *= 5f; @@ -2224,6 +2224,18 @@ namespace CalamityMod.Projectiles break; } + // Jack O Lantern Launcher projectile tweak + if (projectile.type == ProjectileID.JackOLantern) + { + if (projectile.ai[0] >= 20f) + { + // Offset the gravity until 30 frames later + projectile.ai[2]++; + if (projectile.ai[2] < 30f) + projectile.velocity.Y -= 0.5f; + } + } + // Random velocities for Bouncy Boulders in GFB if (projectile.type == ProjectileID.BouncyBoulder && Main.zenithWorld) { @@ -2377,7 +2389,7 @@ namespace CalamityMod.Projectiles } break; case 2: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust cflame = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f); cflame.noGravity = true; @@ -2386,7 +2398,7 @@ namespace CalamityMod.Projectiles } break; case 3: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust fire = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f); fire.noGravity = true; @@ -2395,7 +2407,7 @@ namespace CalamityMod.Projectiles } break; case 4: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust gold = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f + (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 1.1f); gold.noGravity = true; @@ -2403,7 +2415,7 @@ namespace CalamityMod.Projectiles } break; case 5: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust ichor = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 169, 0f, 0f, 100); ichor.velocity.X += projectile.direction; @@ -2412,7 +2424,7 @@ namespace CalamityMod.Projectiles } break; case 6: - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust nanite = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 135, 0f, 0f, 100); nanite.velocity.X += projectile.direction; diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index 9f24c66d94..8997eefdf8 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { for (int i = 0; i < 220; i++) { - int type = Main.rand.NextBool(2) ? 261 : 107; + int type = Main.rand.NextBool() ? 261 : 107; Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type); dust.scale = Main.rand.NextFloat(1.6f, 2.2f); dust.velocity = Main.rand.NextVector2CircularEdge(75f, 75f); diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index 3ab5d148e1..b5025c525a 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { float angle = MathHelper.TwoPi / 120f * i; Dust dust = Dust.NewDustPerfect(Target.Center + angle.ToRotationVector2() * 25f, 226); - dust.velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 9f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 9f) * Main.rand.NextBool().ToDirectionInt(); dust.velocity = dust.velocity.RotatedBy(dust.velocity.ToRotation() * -0.02f); dust.velocity *= 2.1f; dust.noGravity = true; diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index ac590c7381..7cd3ea53d4 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Enemy int dustID = Main.rand.NextBool(3) ? ModContent.DustType() : ModContent.DustType(); Dust astralParticle = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1.2f); astralParticle.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { astralParticle.scale = 0.5f; astralParticle.fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/CragmawBeam.cs b/Projectiles/Enemy/CragmawBeam.cs index e8d660fd83..2e9b7207b3 100644 --- a/Projectiles/Enemy/CragmawBeam.cs +++ b/Projectiles/Enemy/CragmawBeam.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Enemy { for (int i = 0; i < 4; i++) { - float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool(2).ToDirectionInt() * MathHelper.PiOver2; + float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool().ToDirectionInt() * MathHelper.PiOver2; float speed = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 velocity = theta.ToRotationVector2() * speed; Dust dust = Dust.NewDustDirect(beamEndPosiiton, 0, 0, (int)CalamityDusts.SulfurousSeaAcid, velocity.X, velocity.Y, 0, default, 1f); diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 884230862b..2be98d51c6 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 613786aaa2..f99194b621 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs index 908cf23f31..26ae691ba3 100644 --- a/Projectiles/Enemy/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/GammaBeam.cs b/Projectiles/Enemy/GammaBeam.cs index 366dd1e4aa..47a519e3a9 100644 --- a/Projectiles/Enemy/GammaBeam.cs +++ b/Projectiles/Enemy/GammaBeam.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Enemy { for (int i = 0; i < 4; i++) { - float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool(2).ToDirectionInt() * MathHelper.PiOver2; + float theta = Projectile.velocity.ToRotation() + Main.rand.NextBool().ToDirectionInt() * MathHelper.PiOver2; float speed = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 velocity = theta.ToRotationVector2() * speed; Dust dust = Dust.NewDustDirect(beamEndPosiiton, 0, 0, (int)CalamityDusts.SulfurousSeaAcid, velocity.X, velocity.Y, 0, default, 1f); diff --git a/Projectiles/Enemy/HorsWaterBlast.cs b/Projectiles/Enemy/HorsWaterBlast.cs index d10c1cf442..0efe16c723 100644 --- a/Projectiles/Enemy/HorsWaterBlast.cs +++ b/Projectiles/Enemy/HorsWaterBlast.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/InkBombHostile.cs b/Projectiles/Enemy/InkBombHostile.cs index 2b8185a639..37d5a2e072 100644 --- a/Projectiles/Enemy/InkBombHostile.cs +++ b/Projectiles/Enemy/InkBombHostile.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Enemy { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 54, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index e16fe27a22..580ceac880 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -31,11 +31,11 @@ namespace CalamityMod.Projectiles.Enemy { Lighting.AddLight(Projectile.Center, 0.1f * Projectile.Opacity, 1f * Projectile.Opacity, 0f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Projectile.velocity *= 0.95f; - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) Projectile.velocity *= 0.9f; - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) Projectile.velocity *= 0.85f; else Projectile.velocity *= 0.8f; diff --git a/Projectiles/Environment/AcidDrop.cs b/Projectiles/Environment/AcidDrop.cs index 4dfa85231c..ceedcbaaec 100644 --- a/Projectiles/Environment/AcidDrop.cs +++ b/Projectiles/Environment/AcidDrop.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Environment if (info.Damage <= 0) return; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { // 1 to 3 seconds of poisoned target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(1, 4)); diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index c1f545a66e..d90618b0eb 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Healing { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs index 69b8fb94d2..a03c5821e0 100644 --- a/Projectiles/Magic/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/Ancient.cs b/Projectiles/Magic/Ancient.cs index d5c8acded6..29ce6a3375 100644 --- a/Projectiles/Magic/Ancient.cs +++ b/Projectiles/Magic/Ancient.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Magic int dustType = 22; int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[idx]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 2f; diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index ee8316c3bd..b16c9649fc 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic int dustType = 22; int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[idx]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 2f; diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index 4d560c68c1..4f7b862cc8 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Magic { int idx = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/ClamorNoctusStar.cs b/Projectiles/Magic/ClamorNoctusStar.cs index 53f2161d92..f7bc348210 100644 --- a/Projectiles/Magic/ClamorNoctusStar.cs +++ b/Projectiles/Magic/ClamorNoctusStar.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 20, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/CoralSpike.cs b/Projectiles/Magic/CoralSpike.cs index a0bf5e5c61..c63b6a524b 100644 --- a/Projectiles/Magic/CoralSpike.cs +++ b/Projectiles/Magic/CoralSpike.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public ref float ChargeCompletion => ref Projectile.ai[0]; - public static int DustPick => Main.rand.NextBool(2) ? 255 : Main.rand.NextBool() ? 282 : Main.rand.NextBool() ? 281 : 280; + public static int DustPick => Main.rand.NextBool() ? 255 : Main.rand.NextBool() ? 282 : Main.rand.NextBool() ? 281 : 280; public override void SetDefaults() { diff --git a/Projectiles/Magic/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs index 2b109401db..9d3e351d6a 100644 --- a/Projectiles/Magic/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic // Dust, randomly if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector140 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust28 = Main.dust[Dust.NewDust(Projectile.Center - vector140 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num1014 = 0; num1014 < 1; num1014 = num3 + 1) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector142 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust30 = Main.dust[Dust.NewDust(Projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; diff --git a/Projectiles/Magic/GhastlySubBlast.cs b/Projectiles/Magic/GhastlySubBlast.cs index 9cab92f7c6..d3e9531288 100644 --- a/Projectiles/Magic/GhastlySubBlast.cs +++ b/Projectiles/Magic/GhastlySubBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity *= 6f / Projectile.velocity.Length(); } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num1028 = Dust.NewDust(Projectile.Center, 8, 8, 60, 0f, 0f, 0, default, 1f); Main.dust[num1028].position = Projectile.Center; diff --git a/Projectiles/Magic/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs index beaa194058..15dc5a5d4f 100644 --- a/Projectiles/Magic/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.ToRadians(90); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.6f); if (Projectile.timeLeft < 60) diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index d9e20f3489..ed6cc4df7c 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Magic { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[ecto].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ecto].scale = 0.5f; Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Magic { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[ecto].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[ecto].scale = 0.5f; Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs index ba54aec123..c2a57704a7 100644 --- a/Projectiles/Magic/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index 596d8f97c2..c2b29e4ddd 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[1]++; for (int j = 0; j < 3; j++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Magic } else { - int direct = Main.rand.NextBool(2) ? 1 : -1; + int direct = Main.rand.NextBool() ? 1 : -1; Vector2 dir1 = new Vector2(0f, 10f) * direct; int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, dir1.X, dir1.Y, 50, default, 1.3f); Main.dust[dust1].noGravity = true; Main.dust[dust1].velocity = dir1; - int direct2 = Main.rand.NextBool(2) ? 1 : -1; + int direct2 = Main.rand.NextBool() ? 1 : -1; Vector2 dir2 = new Vector2(10f, 0f) * direct2; int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, dir2.X, dir2.Y, 50, default, 1.3f); Main.dust[dust2].noGravity = true; @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 10; i++) { - int dtype1 = Main.rand.NextBool(2) ? 68 : 67; + int dtype1 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype1 = 80; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 270; i++) { - int dtype2 = Main.rand.NextBool(2) ? 68 : 67; + int dtype2 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype2 = 80; @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.Damage(); for (int i = 0; i < 180; i++) { - int dtype3 = Main.rand.NextBool(2) ? 68 : 67; + int dtype3 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dtype3 = 80; diff --git a/Projectiles/Magic/IceBlock.cs b/Projectiles/Magic/IceBlock.cs index 5b36943843..2c3097c93f 100644 --- a/Projectiles/Magic/IceBlock.cs +++ b/Projectiles/Magic/IceBlock.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 40; i++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; diff --git a/Projectiles/Magic/IceBlockIcicle.cs b/Projectiles/Magic/IceBlockIcicle.cs index 00bb7952a4..e3d2a4a69f 100644 --- a/Projectiles/Magic/IceBlockIcicle.cs +++ b/Projectiles/Magic/IceBlockIcicle.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 20; i++) { - int dustType = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dustType = 80; diff --git a/Projectiles/Magic/LightBall.cs b/Projectiles/Magic/LightBall.cs index 578897bf9c..af78682d23 100644 --- a/Projectiles/Magic/LightBall.cs +++ b/Projectiles/Magic/LightBall.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/ManaChargedCoral.cs b/Projectiles/Magic/ManaChargedCoral.cs index 0afd3c7660..ff9757e8f3 100644 --- a/Projectiles/Magic/ManaChargedCoral.cs +++ b/Projectiles/Magic/ManaChargedCoral.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Magic //particles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15f, 15f), 45, Vector2.UnitY * -7f, Alpha: Main.rand.Next(100) + 120, Scale: Main.rand.NextFloat(1f, 2f)); dust.noGravity = true; @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity.Y = Math.Clamp(Projectile.velocity.Y, 0, Math.Max(18f, fallSpeed)); //Sharticles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15f, 15f), 15, Projectile.velocity * 0.3f, Alpha: Main.rand.Next(100) + 120, Scale: Main.rand.NextFloat(1f, 2f)); dust.noGravity = true; diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index 2cfeb972f8..4547e0fe9d 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Magic { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/NebulaCloudCore.cs b/Projectiles/Magic/NebulaCloudCore.cs index 93d663a69a..39da6ca5e6 100644 --- a/Projectiles/Magic/NebulaCloudCore.cs +++ b/Projectiles/Magic/NebulaCloudCore.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic // Emit pretty as fuck dust. if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 vector93 = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi); Dust dust45 = Main.dust[Dust.NewDust(Projectile.Center - vector93 * 45f, 0, 0, Utils.SelectRandom(Main.rand, 86, 90))]; diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 03a806ac9b..e0b5d5cf70 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 endOfLaser = Projectile.Center + Projectile.velocity * (LaserLength - Main.rand.NextFloat(12f, 72f)); Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Projectile.owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int type = ModContent.ProjectileType(); int damage = 0; diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 4b8436a00c..be83fe8146 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index b890cdc58e..0e90f7f3bb 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs index 855c462864..1cf678f1eb 100644 --- a/Projectiles/Magic/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.noGravity = true; dust.scale *= 4f; diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 864cffd213..8a92982407 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic } for (int i = 0; i < 60; i++) { - Dust brimstoneMagic = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(2) ? (int)CalamityDusts.Brimstone : 27); + Dust brimstoneMagic = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? (int)CalamityDusts.Brimstone : 27); brimstoneMagic.velocity = Main.rand.NextVector2Circular(18f, 18f); brimstoneMagic.scale = 1.7f; brimstoneMagic.noGravity = true; diff --git a/Projectiles/Magic/VortexElementalBeam.cs b/Projectiles/Magic/VortexElementalBeam.cs index 2a0a5b21db..de347f1fab 100644 --- a/Projectiles/Magic/VortexElementalBeam.cs +++ b/Projectiles/Magic/VortexElementalBeam.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 dustSpawnPosition = Vector2.Lerp(Projectile.oldPos[i], Projectile.oldPos[i + 1], j / 8f); dustSpawnPosition += Projectile.Size * 0.5f; - Dust electricity = Dust.NewDustPerfect(dustSpawnPosition, Main.rand.NextBool(2) ? 226 : 229); + Dust electricity = Dust.NewDustPerfect(dustSpawnPosition, Main.rand.NextBool() ? 226 : 229); electricity.velocity = Vector2.Zero; electricity.scale = Main.rand.NextFloat(1.1f, 1.18f); electricity.noGravity = true; diff --git a/Projectiles/Magic/WyvernFeatherGreen.cs b/Projectiles/Magic/WyvernFeatherGreen.cs index f967f2febf..f3c92a4d7c 100644 --- a/Projectiles/Magic/WyvernFeatherGreen.cs +++ b/Projectiles/Magic/WyvernFeatherGreen.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 61, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/WyvernFeatherPink.cs b/Projectiles/Magic/WyvernFeatherPink.cs index f0381789b5..c8650fa92b 100644 --- a/Projectiles/Magic/WyvernFeatherPink.cs +++ b/Projectiles/Magic/WyvernFeatherPink.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 242, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Magic/WyvernFeatherPurple.cs b/Projectiles/Magic/WyvernFeatherPurple.cs index 473e8038a4..3ecd3e229c 100644 --- a/Projectiles/Magic/WyvernFeatherPurple.cs +++ b/Projectiles/Magic/WyvernFeatherPurple.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/AegisFlame.cs b/Projectiles/Melee/AegisFlame.cs index c390af24b6..7e782a0e22 100644 --- a/Projectiles/Melee/AegisFlame.cs +++ b/Projectiles/Melee/AegisFlame.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index 6842f104f5..ef77df7943 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee for (int num157 = 0; num157 < 2; num157++) { - int num158 = Dust.NewDust(new Vector2(Projectile.position.X + 4f, Projectile.position.Y + 4f), Projectile.width - 8, Projectile.height - 8, Main.rand.NextBool(2) ? 5 : 6, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 2f); + int num158 = Dust.NewDust(new Vector2(Projectile.position.X + 4f, Projectile.position.Y + 4f), Projectile.width - 8, Projectile.height - 8, Main.rand.NextBool() ? 5 : 6, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 2f); Main.dust[num158].position -= Projectile.velocity * 2f; Main.dust[num158].noGravity = true; Dust expr_7A4A_cp_0_cp_0 = Main.dust[num158]; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/BloodExplosion.cs b/Projectiles/Melee/BloodExplosion.cs index 1ad3eeeae0..6657e3bdfc 100644 --- a/Projectiles/Melee/BloodExplosion.cs +++ b/Projectiles/Melee/BloodExplosion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Blood, 0f, 0f, 100, default, 1.5f); Main.dust[index].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[index].scale = 0.5f; Main.dust[index].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/Brimblast.cs b/Projectiles/Melee/Brimblast.cs index 32d6fe6e62..42b93f9ce6 100644 --- a/Projectiles/Melee/Brimblast.cs +++ b/Projectiles/Melee/Brimblast.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 4f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Melee/BrimlanceStandingFire.cs b/Projectiles/Melee/BrimlanceStandingFire.cs index fcea82e68a..5a011c9c82 100644 --- a/Projectiles/Melee/BrimlanceStandingFire.cs +++ b/Projectiles/Melee/BrimlanceStandingFire.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs index 1cdd9d1f8e..ac1cd322d6 100644 --- a/Projectiles/Melee/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.Y *= 1.05f; Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; Projectile.velocity.Y += Projectile.ai[0]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index be8cae2632..1c16658c09 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee // for spawning the side beams for (int i = 0; i < 2; i++) { - int directionSign = Main.rand.NextBool(2).ToDirectionInt(); + int directionSign = Main.rand.NextBool().ToDirectionInt(); Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501)); Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner); diff --git a/Projectiles/Melee/DragonRageFireball.cs b/Projectiles/Melee/DragonRageFireball.cs index 1da2623e7b..b4694228c0 100644 --- a/Projectiles/Melee/DragonRageFireball.cs +++ b/Projectiles/Melee/DragonRageFireball.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 16cf2799b6..b5f306b037 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector2 = num12.ToRotationVector2(); Vector2 value4 = vector2.RotatedBy(MathHelper.PiOver2 * Projectile.spriteDirection); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 244, player.velocity.X, player.velocity.Y, 150, default, 1f); dust.velocity = Projectile.SafeDirectionTo(dust.position) * 0.1f + dust.velocity * 0.1f; diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index b36d0c5830..2d3e77208a 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index bf627db606..5f16b42a05 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/EutrophicScimitarProj.cs b/Projectiles/Melee/EutrophicScimitarProj.cs index 6ecd525924..224631e6f9 100644 --- a/Projectiles/Melee/EutrophicScimitarProj.cs +++ b/Projectiles/Melee/EutrophicScimitarProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 226, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.5f); } diff --git a/Projectiles/Melee/EutrophicSpark.cs b/Projectiles/Melee/EutrophicSpark.cs index 17184a2ade..dbc92223f8 100644 --- a/Projectiles/Melee/EutrophicSpark.cs +++ b/Projectiles/Melee/EutrophicSpark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 92d74dc7aa..d26bb9b959 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = Projectile.velocity.ToRotation(); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Color dustColor = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.9f); Dust must = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20f, 20f) + Projectile.velocity, 267, Projectile.velocity * -2.6f, 0, dustColor); diff --git a/Projectiles/Melee/FallenPaladinsHammerEcho.cs b/Projectiles/Melee/FallenPaladinsHammerEcho.cs index 9ecacb7c6c..ffa8d34c22 100644 --- a/Projectiles/Melee/FallenPaladinsHammerEcho.cs +++ b/Projectiles/Melee/FallenPaladinsHammerEcho.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs index 3b61e3f8ec..5449be8ca2 100644 --- a/Projectiles/Melee/FallenPaladinsHammerProj.cs +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Melee } //Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs index 4cbad91841..f0307e9f50 100644 --- a/Projectiles/Melee/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector3 = Vector2.UnitX * (float)-(float)Projectile.width / 2f; vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); vector3 = vector3.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int num9 = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool(2) ? 164 : 229, 0f, 0f, 160, default, 1f); + int num9 = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool() ? 164 : 229, 0f, 0f, 160, default, 1f); Main.dust[num9].noGravity = true; Main.dust[num9].position = Projectile.Center + vector3; Main.dust[num9].velocity = Projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index 7699be7196..98690631bb 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index 5e0f3f7d22..c644028d7c 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Melee } //Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/GayBeam.cs b/Projectiles/Melee/GayBeam.cs index 90c68438cc..ab1d83b2ed 100644 --- a/Projectiles/Melee/GayBeam.cs +++ b/Projectiles/Melee/GayBeam.cs @@ -233,7 +233,7 @@ namespace CalamityMod.Projectiles.Melee break; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 267, 0f, 0f, alpha, color, 1.5f); Main.dust[dust].noGravity = true; @@ -377,7 +377,7 @@ namespace CalamityMod.Projectiles.Melee { bool fromRight = x == 1; if (x == 2) - fromRight = Main.rand.NextBool(2); + fromRight = Main.rand.NextBool(); if (Projectile.owner == Main.myPlayer) { var source = Projectile.GetSource_FromThis(); diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index 4c86847f47..f5a21f5f72 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(Projectile.Center, 0f, 0.2f, 0.4f); Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; Projectile.velocity.Y += Projectile.ai[0]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 20, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 739d61b3df..d1df22217a 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index e2a86a28ff..320fa0c215 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs index 44a60a69b5..453558eb2d 100644 --- a/Projectiles/Melee/InsidiousHarpoon.cs +++ b/Projectiles/Melee/InsidiousHarpoon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index 591b66fcad..7b25c6095f 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee } int num564 = 8; - int num565 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num564, Projectile.position.Y + (float)num564), Projectile.width - num564 * 2, Projectile.height - num564 * 2, Main.rand.NextBool(2) ? 5 : 6, 0f, 0f, 0, default, 1f); + int num565 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num564, Projectile.position.Y + (float)num564), Projectile.width - num564 * 2, Projectile.height - num564 * 2, Main.rand.NextBool() ? 5 : 6, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num565]; dust.velocity *= 0.5f; dust = Main.dust[num565]; @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs index 57e6788d96..f3d37f56f8 100644 --- a/Projectiles/Melee/PhosphorescentGauntletPunches.cs +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee dust.noGravity = true; dust.fadeIn = 1f; dust.velocity += player.velocity; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.position += Utils.RandomVector2(Main.rand, -4f, 4f); dust.scale += Main.rand.NextFloat(); diff --git a/Projectiles/Melee/PrismRay.cs b/Projectiles/Melee/PrismRay.cs index 6b9298933c..194ddd6467 100644 --- a/Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee Utils.PlotTileLine(StartingPosition, Projectile.Center, 8f, DelegateMethods.CastLight); if (Projectile.localAI[0] == 0f) { - Projectile.direction = Main.rand.NextBool(2).ToDirectionInt(); + Projectile.direction = Main.rand.NextBool().ToDirectionInt(); Projectile.localAI[0] = 1f; } Projectile.rotation = Time / 20f * MathHelper.TwoPi * Projectile.direction; diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index 1f13f27b8d..bb7a487ff3 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee } Lighting.AddLight(Projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int rainbow = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 267, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, alpha, Main.rand.Next(colors)); Main.dust[rainbow].noGravity = true; diff --git a/Projectiles/Melee/PwnagehammerEcho.cs b/Projectiles/Melee/PwnagehammerEcho.cs index b660e89eac..da61efd72c 100644 --- a/Projectiles/Melee/PwnagehammerEcho.cs +++ b/Projectiles/Melee/PwnagehammerEcho.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index 339523d068..fe143e4435 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.X *= 0.9511f; Projectile.velocity.Y += 0.502f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/RSSolarFlare.cs b/Projectiles/Melee/RSSolarFlare.cs index 233f821c17..f8817afdc7 100644 --- a/Projectiles/Melee/RSSolarFlare.cs +++ b/Projectiles/Melee/RSSolarFlare.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 159, 0f, 0f, 100, default, 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/SeashineSwordProj.cs b/Projectiles/Melee/SeashineSwordProj.cs index 5460bc1842..ce59610eb5 100644 --- a/Projectiles/Melee/SeashineSwordProj.cs +++ b/Projectiles/Melee/SeashineSwordProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.25f / 255f, (255 - Projectile.alpha) * 0.25f / 255f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 187, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 1.2f); } diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs index f855f9c6a8..263b671986 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords { if (Main.rand.NextBool(5)) { - int num250 = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (Main.rand.NextBool(2) ? 20 : 176), (float)(Main.player[Projectile.owner].direction * 2), 0f, 150, default, 1.3f); + int num250 = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (Main.rand.NextBool() ? 20 : 176), (float)(Main.player[Projectile.owner].direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; Main.dust[num250].noGravity = true; } diff --git a/Projectiles/Melee/SoulScytheExplosion.cs b/Projectiles/Melee/SoulScytheExplosion.cs index 6dae9cfa4f..c04a25824c 100644 --- a/Projectiles/Melee/SoulScytheExplosion.cs +++ b/Projectiles/Melee/SoulScytheExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs index b76e0caf5c..ee105705d8 100644 --- a/Projectiles/Melee/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/StellarContemptEcho.cs b/Projectiles/Melee/StellarContemptEcho.cs index f8202cee55..eb29069ef3 100644 --- a/Projectiles/Melee/StellarContemptEcho.cs +++ b/Projectiles/Melee/StellarContemptEcho.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 58ee0da02b..6146c8cb4c 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Melee } // Spawn dust as the hammer travels. - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 2e265130b7..6eac5089e3 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Projectiles.Melee public const float MinChargeTime = 15f; public const float MaxChargeTime = 60f; public const float MaxChargeDistance = 800f; // 50 blocks - public const float MaxChargeDamageMult = 6f; + public const float MaxChargeDamageMult = 4f; public const float PiercingDamageMult = 0.6f; public const float DashDuration = 21f; - public const float IFrameRatio = 0.2f; // Amount given = Ratio * Charge, rounded down + public const float IFrameRatio = 0.3f; // Amount given = Ratio * Charge, rounded down public Player Owner => Main.player[Projectile.owner]; public ref float Charge => ref Projectile.ai[0]; diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs index a043a4154b..826d855d53 100644 --- a/Projectiles/Melee/TriactisHammerProj.cs +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -110,9 +110,9 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -120,10 +120,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -135,9 +135,9 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; @@ -145,10 +145,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, Main.rand.NextBool() ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/TumbleweedFlail.cs b/Projectiles/Melee/TumbleweedFlail.cs index da469ac0f9..1dfd79bdac 100644 --- a/Projectiles/Melee/TumbleweedFlail.cs +++ b/Projectiles/Melee/TumbleweedFlail.cs @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs index 1fcfea3c2f..ccbff086f2 100644 --- a/Projectiles/Melee/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index ceec3c4536..4a9bdf6248 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 value3 = Projectile.Center + (num12 + ((num9 == -1) ? 3.14159274f : 0f)).ToRotationVector2() * 30f; Vector2 vector2 = num12.ToRotationVector2(); Vector2 value4 = vector2.RotatedBy((double)(1.57079637f * (float)Projectile.spriteDirection), default); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust3 = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 33, player.velocity.X, player.velocity.Y, 150, default, 1f); dust3.velocity = Projectile.SafeDirectionTo(dust3.position) * 0.1f + dust3.velocity * 0.1f; diff --git a/Projectiles/Melee/UltimusCleaverDust.cs b/Projectiles/Melee/UltimusCleaverDust.cs index ff5f5c43ae..9cf40df931 100644 --- a/Projectiles/Melee/UltimusCleaverDust.cs +++ b/Projectiles/Melee/UltimusCleaverDust.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 135, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 33511a505b..41668b154f 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(), 0.5); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(), 0.5); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index f13a710fba..4f0304c20f 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Pets { if (Main.rand.NextBool(3)) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { SoundEngine.PlaySound(SoundID.Meowmere with { Volume = SoundID.Meowmere.Volume * 4f}, Projectile.position); //nya } @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Pets { notlocalai1 = (float)(Main.rand.Next(30) * -10 - 300); SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { player.Hurt(PlayerDeathReason.ByOther(6), 500, 0); } diff --git a/Projectiles/Pets/KendraPet.cs b/Projectiles/Pets/KendraPet.cs index fd2b579417..ccfe64890e 100644 --- a/Projectiles/Pets/KendraPet.cs +++ b/Projectiles/Pets/KendraPet.cs @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Pets idleTimer = 0; } idleBarkTimer++; - if (idleBarkTimer > 1080 && Main.rand.NextBool(2)) + if (idleBarkTimer > 1080 && Main.rand.NextBool()) { SoundEngine.PlaySound(BarkSound, Projectile.position); chosenIdle = 3; diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 7084312299..32c1e8a409 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // Bubbles - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); bubble.timeLeft = 9 + Main.rand.Next(7); @@ -61,4 +61,4 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Wet, 240); } -} \ No newline at end of file +} diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index 9d059bb0dd..d0d43b354d 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 1285b01b87..086e3cebcf 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int randomDust = Utils.SelectRandom(Main.rand, new int[] { diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index 492e48d326..d23470740e 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int i = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 108, 0f, Projectile.velocity.Y * 0.5f); Main.dust[i].velocity.X *= 0.2f; diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index 49a06f56e1..00fabdce70 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 45a6a01827..a8c819d53f 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 2f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 1623c9d261..6ca0b0b80f 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index e7e3e35f1b..3616ee50d4 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 5; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Ranged return; Player player = Main.player[Projectile.owner]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int healAmt = Main.rand.Next(1, 4); player.statLife += healAmt; diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index fea561969f..fb2f1ab2ca 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index f86d9d5833..5944635129 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 235; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index 93e960d57c..56bb31c531 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 107, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = Projectile.alpha; diff --git a/Projectiles/Ranged/CardClub.cs b/Projectiles/Ranged/CardClub.cs index 3820a21694..642f8f584e 100644 --- a/Projectiles/Ranged/CardClub.cs +++ b/Projectiles/Ranged/CardClub.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardClubSplit.cs b/Projectiles/Ranged/CardClubSplit.cs index 5aefa123f7..5158234e2f 100644 --- a/Projectiles/Ranged/CardClubSplit.cs +++ b/Projectiles/Ranged/CardClubSplit.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index 1ae5443bff..cdcf920997 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(Projectile.position, 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged { int paper = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 30, 0f, 0f, 100, default, 2f); Main.dust[paper].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[paper].scale = 0.5f; Main.dust[paper].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index 30a71ceeb8..2a40acde52 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/CardSpade.cs b/Projectiles/Ranged/CardSpade.cs index f7f1a49eb3..e1de508f93 100644 --- a/Projectiles/Ranged/CardSpade.cs +++ b/Projectiles/Ranged/CardSpade.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); Projectile.rotation -= (MathHelper.ToRadians(90) * Projectile.direction); Projectile.spriteDirection = Projectile.direction; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num137 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/ChickenRocket.cs b/Projectiles/Ranged/ChickenRocket.cs index 6b9d34bb58..590ec1d1cf 100644 --- a/Projectiles/Ranged/ChickenRocket.cs +++ b/Projectiles/Ranged/ChickenRocket.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged { int d = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[d].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[d].scale = 0.5f; Main.dust[d].fadeIn = 1f + Main.rand.NextFloat(); diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs index af3c4e31e4..568b86eb9c 100644 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ b/Projectiles/Ranged/ClaretCannonProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged return; Player player = Main.player[Projectile.owner]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/Ranged/ContagionBall.cs b/Projectiles/Ranged/ContagionBall.cs index a61e0a21bd..e74a2fa25d 100644 --- a/Projectiles/Ranged/ContagionBall.cs +++ b/Projectiles/Ranged/ContagionBall.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 44, 0f, 0f, 100, default, 0.15f); Main.dust[num622].velocity *= 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index b2953b0830..ce12110be3 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 89; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index ca3ed1fb1d..7b9ca8f127 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int dustType = Main.rand.NextBool(4) ? 61 : 62; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[fire]; diff --git a/Projectiles/Ranged/DaemonsFlameArrow.cs b/Projectiles/Ranged/DaemonsFlameArrow.cs index 5f60b1de82..a8ec0b7f90 100644 --- a/Projectiles/Ranged/DaemonsFlameArrow.cs +++ b/Projectiles/Ranged/DaemonsFlameArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/DrizzlefishFire.cs b/Projectiles/Ranged/DrizzlefishFire.cs index f04b9dbb28..74defbd5af 100644 --- a/Projectiles/Ranged/DrizzlefishFire.cs +++ b/Projectiles/Ranged/DrizzlefishFire.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/DrizzlefishFireSplit.cs b/Projectiles/Ranged/DrizzlefishFireSplit.cs index c461999e0a..1cdd80e6ed 100644 --- a/Projectiles/Ranged/DrizzlefishFireSplit.cs +++ b/Projectiles/Ranged/DrizzlefishFireSplit.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/DrizzlefishFireball.cs b/Projectiles/Ranged/DrizzlefishFireball.cs index a5e4b7c0df..60f9d30381 100644 --- a/Projectiles/Ranged/DrizzlefishFireball.cs +++ b/Projectiles/Ranged/DrizzlefishFireball.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 235; if (Projectile.ai[1] == 1f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dustType = 35; } diff --git a/Projectiles/Ranged/ElementalFire.cs b/Projectiles/Ranged/ElementalFire.cs index 734170923d..456c13fcfc 100644 --- a/Projectiles/Ranged/ElementalFire.cs +++ b/Projectiles/Ranged/ElementalFire.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 66; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 2; num298++) { diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index c3689fac1a..9f58d3dedd 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 93f1a25810..42b2bf6bde 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.PurpleCosmilite; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/ExoFlare.cs b/Projectiles/Ranged/ExoFlare.cs index 1e4ce8e800..cc2ada2684 100644 --- a/Projectiles/Ranged/ExoFlare.cs +++ b/Projectiles/Ranged/ExoFlare.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.localAI[0] == 0f) { OffsetRotation = Main.rand.NextFloat(MathHelper.TwoPi); - OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool(2).ToDirectionInt(); + OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool().ToDirectionInt(); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index 86c98c3de0..7e08bb5004 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged Destination = Main.MouseWorld; Projectile.netUpdate = true; } - DustType = Main.rand.NextBool(2) ? 107 : 234; + DustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { DustType = 269; diff --git a/Projectiles/Ranged/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs index b06f8b5ad8..0ee05d7ec6 100644 --- a/Projectiles/Ranged/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 3a3f527c53..6dcb3b354f 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { //icicle dust - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 68, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.1f); Main.dust[index2].noGravity = true; diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 4026160245..45582a8f84 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.1f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 8f2a394759..e41a48bd43 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.1f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index aa3056eee4..a13a05b68b 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.velocity *= 1.5f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int num252 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 2eb95e64c2..973d8d0e12 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { //icicle dust - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 68, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.1f); Main.dust[index2].noGravity = true; diff --git a/Projectiles/Ranged/KarasawaShot.cs b/Projectiles/Ranged/KarasawaShot.cs index bfc85c6e87..3d96a71e67 100644 --- a/Projectiles/Ranged/KarasawaShot.cs +++ b/Projectiles/Ranged/KarasawaShot.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? dust1 : dust2; + int randomDustType = Main.rand.NextBool() ? dust1 : dust2; int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Dust dust = Main.dust[num54]; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = Main.rand.NextBool(2) ? dust1 : dust2; + int randomDustType = Main.rand.NextBool() ? dust1 : dust2; int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); Dust dust = Main.dust[num56]; @@ -145,13 +145,13 @@ namespace CalamityMod.Projectiles.Ranged vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Projectile.Center; Vector2 vector7 = vector6 - Projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.3f, vector7.Y * 0.3f, 100, default, 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.3f, vector7.Y * 0.3f, 100, default, 2f); Main.dust[num228].noGravity = true; - int num229 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.2f, vector7.Y * 0.2f, 100, default, 2f); + int num229 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.2f, vector7.Y * 0.2f, 100, default, 2f); Main.dust[num229].noGravity = true; - int num230 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, vector7.X * 0.1f, vector7.Y * 0.1f, 100, default, 2f); + int num230 = Dust.NewDust(vector6 + vector7, 0, 0, Main.rand.NextBool() ? dust1 : dust2, vector7.X * 0.1f, vector7.Y * 0.1f, 100, default, 2f); Main.dust[num230].noGravity = true; } diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 46fb65e4a2..f077b43a6e 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged } float dustOffsetX = Projectile.velocity.X * 0.5f; float dustOffsetY = Projectile.velocity.Y * 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int exo = Dust.NewDust(new Vector2(Projectile.position.X + 3f + dustOffsetX, Projectile.position.Y + 3f + dustOffsetY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, dustType, 0f, 0f, 100, default, 0.5f); Main.dust[exo].scale *= (float)Main.rand.Next(10) * 0.1f; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged //DO NOT REMOVE THIS PROJECTILE Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[exo].velocity *= 3f; Main.dust[exo].noGravity = true; Main.dust[exo].noLight = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[exo].scale = 0.5f; Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index 6c6f9789e9..7871c8fe72 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index 1a8ad087dd..eca174f82f 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 5f86100029..7353bc07aa 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index c6559bdbaa..ae1c4d6e6f 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 71509d5068..5967e345b4 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NeedlerProj.cs b/Projectiles/Ranged/NeedlerProj.cs index b3b592b700..cf0b371803 100644 --- a/Projectiles/Ranged/NeedlerProj.cs +++ b/Projectiles/Ranged/NeedlerProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index 1e034a2085..54554a809f 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 source = Vector2.Normalize(Projectile.velocity) * 9f; source = source.RotatedBy((d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; Vector2 dustVel = source - player.Center; - int index = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 4f); + int index = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 0, default, 4f); Main.dust[index].noGravity = true; Main.dust[index].velocity = dustVel; } diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index 05f3b90d64..af5b6cea7a 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustOffset = Vector2.UnitX * (float)-(float)Projectile.width / 2f; dustOffset += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); dustOffset = dustOffset.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int idx = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 160, default, 1f); + int idx = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 160, default, 1f); Main.dust[idx].scale = 1.1f; Main.dust[idx].noGravity = true; Main.dust[idx].position = Projectile.Center + dustOffset; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.rand.NextBool(16)) { Vector2 dustOffset = Vector2.UnitX.RotatedByRandom(Math.PI * 0.5).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[idx].velocity = dustOffset * 0.66f; Main.dust[idx].position = Projectile.Center + dustOffset * 12f; } @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.5f; if (Main.rand.NextBool(10)) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); } } } @@ -105,14 +105,14 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ExpandHitboxBy(144); for (int d = 0; d < 4; d++) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 50, default, 1.5f); } for (int d = 0; d < 20; d++) { - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 2.5f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 0, default, 2.5f); Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 3f; - idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f); + idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 50, default, 1.5f); Main.dust[idx].velocity *= 2f; Main.dust[idx].noGravity = true; } diff --git a/Projectiles/Ranged/NorfleetExplosion.cs b/Projectiles/Ranged/NorfleetExplosion.cs index a46d3dfb66..04d4ab5def 100644 --- a/Projectiles/Ranged/NorfleetExplosion.cs +++ b/Projectiles/Ranged/NorfleetExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.75f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.01f / 255f); Vector2 dustVel = CalamityUtils.RandomVelocity(120f, 36f, 108f, 1f); - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 100, default, 2f); + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool() ? 221 : 244, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[idx]; dust.noGravity = true; dust.position.X = Projectile.Center.X; diff --git a/Projectiles/Ranged/NovaChargeShot.cs b/Projectiles/Ranged/NovaChargeShot.cs index ebfc7e3cf3..fd4b429d33 100644 --- a/Projectiles/Ranged/NovaChargeShot.cs +++ b/Projectiles/Ranged/NovaChargeShot.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107); dust.noGravity = true; dust.scale = 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10); float trailScale = Main.rand.NextFloat(0.8f, 1.2f); diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index f04edf5c12..3dcea0ad0a 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Ranged { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index e7bed37ed1..b644ec8077 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -85,11 +85,11 @@ namespace CalamityMod.Projectiles.Ranged } else if (nullBuff == 8) { - target.velocity.Y = Main.rand.NextBool(2) ? 30f : -30f; + target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; } else { - target.velocity.X = Main.rand.NextBool(2) ? 30f : -30f; + target.velocity.X = Main.rand.NextBool() ? 30f : -30f; } } } diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs index dd12038695..0870f1d93a 100644 --- a/Projectiles/Ranged/OpalChargedStrike.cs +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 162, 0f, 0f, 0, default, Main.rand.NextFloat(1.2f, 1.5f))]; diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index f42c9bea4f..38e26ccc67 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 811d4c1472..834c66469c 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundStyle sound = Main.rand.NextBool(2) ? SoundID.Item93 : SoundID.Item92; + SoundStyle sound = Main.rand.NextBool() ? SoundID.Item93 : SoundID.Item92; SoundEngine.PlaySound(sound with { Volume = sound.Volume * 0.5f}, Projectile.position); for (int i = 0; i < 5; i++) diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 5ad5d472d5..774405b0b0 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -174,13 +174,13 @@ namespace CalamityMod.Projectiles.Ranged source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; Vector2 dustVel = source - Projectile.Center; - int i = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.3f, dustVel.Y * 0.3f, 100, default, 2f); + int i = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.3f, dustVel.Y * 0.3f, 100, default, 2f); Main.dust[i].noGravity = true; - int j = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.2f, dustVel.Y * 0.2f, 100, default, 2f); + int j = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.2f, dustVel.Y * 0.2f, 100, default, 2f); Main.dust[j].noGravity = true; - int k = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool(2) ? dust1 : dust2, dustVel.X * 0.1f, dustVel.Y * 0.1f, 100, default, 2f); + int k = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.1f, dustVel.Y * 0.1f, 100, default, 2f); Main.dust[k].noGravity = true; } diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 2c3fd8ff9c..8aa6e000ea 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged num296 = 0.75f; } Projectile.ai[0] += 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 1; num298++) { diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index d07dd68663..62c6fbbf1e 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -214,7 +214,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index 9a2422341b..18f619bff8 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[fire].scale = 0.5f; Main.dust[fire].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs index eac0973b80..92d0297eb4 100644 --- a/Projectiles/Ranged/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 14; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 3; num298++) { diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index 9b87514356..4de6b0acd1 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index d0622fc7b5..11a702be4d 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged Dust holyFire = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); holyFire.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { holyFire.scale = 0.5f; holyFire.fadeIn = Main.rand.NextFloat(1f, 2f); diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 6f123d21fe..589e6ebab6 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged { int terra = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 100, default, 2f); Main.dust[terra].velocity *= 1.2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[terra].scale = 0.5f; Main.dust[terra].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraArrowSplit.cs b/Projectiles/Ranged/TerraArrowSplit.cs index 653381d853..060467f044 100644 --- a/Projectiles/Ranged/TerraArrowSplit.cs +++ b/Projectiles/Ranged/TerraArrowSplit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 2; i++) { int terraDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[terraDust].scale = 0.5f; Main.dust[terraDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs index 5dd563437f..cd8c65b926 100644 --- a/Projectiles/Ranged/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.ai[0] += 1f; int num297 = 107; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { for (int num298 = 0; num298 < 3; num298++) { diff --git a/Projectiles/Ranged/ThePackMissile.cs b/Projectiles/Ranged/ThePackMissile.cs index 2b0ae32a08..70f84c2d0d 100644 --- a/Projectiles/Ranged/ThePackMissile.cs +++ b/Projectiles/Ranged/ThePackMissile.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 255, 0f, 0f, 0, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index a7a171ea4d..72e321a658 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < count; i++) { float angle = MathHelper.TwoPi * i / count; - angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); + angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool().ToDirectionInt(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), ModContent.ProjectileType(), Projectile.damage, 2.5f, Projectile.owner); } diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index 6d6ea64ed5..88d4867bf1 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged if (Time >= Ultima.FullChargeTime * 0.7f && Main.rand.NextBool(6)) { // To ensure that the sparks don't spawn on top of the laser itself. - float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool(2).ToDirectionInt(); + float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool().ToDirectionInt(); Vector2 sparkVelocity = Projectile.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY).RotatedByRandom(0.5f) * 13f; sparkVelocity = sparkVelocity.RotatedBy(offsetAngle); Projectile.NewProjectile(Projectile.GetSource_FromThis(), shotPosition, sparkVelocity, ModContent.ProjectileType(), damage / 3, knockBack, Projectile.owner); diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs index 3e1f679062..9971ef7004 100644 --- a/Projectiles/Ranged/UniversalGenesisStar.cs +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 16, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index dec8c6bebc..a326e21b0d 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int idx = Dust.NewDust(Projectile.position, 1, 1, 173, 0f, 0f, 0, default, 0.5f); Main.dust[idx].alpha = Projectile.alpha; diff --git a/Projectiles/Ranged/VeriumBulletProj.cs b/Projectiles/Ranged/VeriumBulletProj.cs index 100b2bf824..c88c124d7d 100644 --- a/Projectiles/Ranged/VeriumBulletProj.cs +++ b/Projectiles/Ranged/VeriumBulletProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int purple = Dust.NewDust(Projectile.position, 1, 1, 70, 0f, 0f, 0, default, 0.5f); Main.dust[purple].alpha = Projectile.alpha; diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index e9a8df3e96..20f7fcd4ba 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; using Terraria; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue { int boom = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 14, 0f, 0f, 100, default, 2f); Main.dust[boom].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boom].scale = 0.5f; Main.dust[boom].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs index 6c03431a3d..0a86d7795c 100644 --- a/Projectiles/Rogue/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 14, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BettyExplosion.cs b/Projectiles/Rogue/BettyExplosion.cs index 17b51eddb3..6f0ccdfe74 100644 --- a/Projectiles/Rogue/BettyExplosion.cs +++ b/Projectiles/Rogue/BettyExplosion.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue { int idx = Dust.NewDust(corner, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 2dc5990d2b..377d4ce7fe 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue } } - if (cannotLifesteal || Main.rand.NextBool(2)) //canGhostHeal be like lol + if (cannotLifesteal || Main.rand.NextBool()) //canGhostHeal be like lol return; Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Rogue/ButcherKnife.cs b/Projectiles/Rogue/ButcherKnife.cs index 0bc66569ee..0d8431d581 100644 --- a/Projectiles/Rogue/ButcherKnife.cs +++ b/Projectiles/Rogue/ButcherKnife.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 5, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index efe106f48e..9f96badba4 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, default, 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index 30f280a491..411b06d0be 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index eac8d72f3a..85f8d8bdaa 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/DynamicPursuerProjectile.cs b/Projectiles/Rogue/DynamicPursuerProjectile.cs index 40ec986e73..8272ab76b5 100644 --- a/Projectiles/Rogue/DynamicPursuerProjectile.cs +++ b/Projectiles/Rogue/DynamicPursuerProjectile.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue if (potentialTarget != null) { Vector2 initialVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + blueGem, Projectile.SafeDirectionTo(potentialTarget.Center) * 3f, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, initialAngle, Main.rand.Next(100)); @@ -216,7 +216,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 220; i++) { - int type = Main.rand.NextBool(2) ? 261 : 107; + int type = Main.rand.NextBool() ? 261 : 107; Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type); dust.scale = Main.rand.NextFloat(1.6f, 2.2f); dust.velocity = Main.rand.NextVector2CircularEdge(75f, 75f); diff --git a/Projectiles/Rogue/EGloveSpark.cs b/Projectiles/Rogue/EGloveSpark.cs index 41205e477e..a34b4fe176 100644 --- a/Projectiles/Rogue/EGloveSpark.cs +++ b/Projectiles/Rogue/EGloveSpark.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index ae2d01d7b4..d6e77eb842 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs index 706544093d..5cd7371d12 100644 --- a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ExplosiveSun.cs b/Projectiles/Rogue/ExplosiveSun.cs index 427e5e673e..9782d9077c 100644 --- a/Projectiles/Rogue/ExplosiveSun.cs +++ b/Projectiles/Rogue/ExplosiveSun.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index c5d07ed181..6809d28912 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 10 == 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int spiritDamage = Projectile.damage / 2; Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index bbc8637dd2..08fe1454b4 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 4 == 0) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int spiritDamage = Projectile.damage / 2; Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 1cc2762da4..e33ccdde93 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -68,10 +68,10 @@ namespace CalamityMod.Projectiles.Rogue { Dust flame = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); flame.velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) flame.scale = 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { flame.scale *= 0.5f; flame.fadeIn = Main.rand.NextFloat(1f, 2f); diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 3bb451b73d..338d6fecbc 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(Projectile.Center, 0.35f, 0f, 0.25f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust flame = Dust.NewDustDirect(Projectile.position, 1, 1, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 0.5f); flame.alpha = Projectile.alpha; diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 592d105bac..b0ed8687a2 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Projectile.Calamity().stealthStrike) Projectile.extraUpdates = 1; - if (Main.rand.NextBool(2) && !posthit) + if (Main.rand.NextBool() && !posthit) { Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 bloodSpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; Vector2 splatterDirection = (Projectile.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); - int sparkCount = Main.rand.Next(5); + int sparkCount = Main.rand.Next(4, 6); for (int i = 0; i < sparkCount; i++) { Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.5f) * Main.rand.NextFloat(5f, 9f); diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 5b327f881d..be57cb0c44 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Rogue ModContent.DustType(), ModContent.DustType() }); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); Main.dust[index].noGravity = true; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); Main.dust[index].noGravity = true; diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index 00b2204ef5..4c74b5db78 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MalachiteProj.cs b/Projectiles/Rogue/MalachiteProj.cs index a9f023f7b6..b59a60a770 100644 --- a/Projectiles/Rogue/MalachiteProj.cs +++ b/Projectiles/Rogue/MalachiteProj.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 4d7df94542..246121f0d8 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue { int dusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[dusty].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[dusty].scale = 0.5f; Main.dust[dusty].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index 2b1f9ae01b..20a6eb530c 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity *= 1.25f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Rogue { int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[boomDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boomDust].scale = 0.5f; Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MeteorFistStealth.cs b/Projectiles/Rogue/MeteorFistStealth.cs index 2b84a03b68..b7da0abde4 100644 --- a/Projectiles/Rogue/MeteorFistStealth.cs +++ b/Projectiles/Rogue/MeteorFistStealth.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity *= 1.25f; } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue { int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[boomDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[boomDust].scale = 0.5f; Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs index d545683fcb..1e9cccedac 100644 --- a/Projectiles/Rogue/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs index 4df2774bbe..35a9e6836a 100644 --- a/Projectiles/Rogue/NiceCock.cs +++ b/Projectiles/Rogue/NiceCock.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System.IO; using Terraria; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Rogue int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 267, 0f, 0f, 150, Main.rand.Next(colors), 2f); Main.dust[idx].velocity *= 3f; Main.dust[idx].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index d45b09ea78..faadd5b8ed 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/RealityRuptureLance.cs b/Projectiles/Rogue/RealityRuptureLance.cs index 524d425efb..4d3e0e5515 100644 --- a/Projectiles/Rogue/RealityRuptureLance.cs +++ b/Projectiles/Rogue/RealityRuptureLance.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue float radius = (20f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; Vector2 dustPosition = Projectile.Center; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; - Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 234 : 310); + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool() ? 234 : 310); dust.noGravity = true; dust.velocity = Projectile.velocity * 0.8f; dust.scale = Main.rand.NextFloat(1.1f, 1.7f); diff --git a/Projectiles/Rogue/RealityRuptureStealth.cs b/Projectiles/Rogue/RealityRuptureStealth.cs index d5c0e1887f..725f08fe11 100644 --- a/Projectiles/Rogue/RealityRuptureStealth.cs +++ b/Projectiles/Rogue/RealityRuptureStealth.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue { public class RealityRuptureStealth : ModProjectile, ILocalizedModType { - public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/RealityRuptureStealthHit") { Volume = 0.7f, PitchVariance = 0.3f}; + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/RealityRuptureStealthHit") { Volume = 1.2f, PitchVariance = 0.3f}; public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/RealityRupture"; public bool posthit = false; @@ -43,7 +43,11 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity *= 1.003f; Projectile.scale = 1.3f; - if (Main.rand.NextBool(2)) + Vector3 DustLight = new Vector3(0.209f, 0.140f, 0.202f); + Lighting.AddLight(Projectile.Center, DustLight * 8); + //Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.6f, 0.6f, 0.2f, 0.5f); + + if (Time % 2 == 0) { Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-2.5f, default) * 0.1f - Projectile.velocity / 2f; Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); @@ -51,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue GeneralParticleHandler.SpawnParticle(spark); } - if (Main.rand.NextBool(2)) + if (Time % 2 == 0) { Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(2.5f, default) * 0.1f - Projectile.velocity / 2f; Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); @@ -65,13 +69,17 @@ namespace CalamityMod.Projectiles.Rogue { SoundEngine.PlaySound(Hitsound, Projectile.position); posthit = true; - for (int i = 0; i < 7; i++) + for (int i = 0; i < 6; i++) { Vector2 vel = Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)); - float Scale = Main.rand.NextFloat(0.8f, 3.8f); - CrackParticle crack = new CrackParticle(Projectile.Center, vel, Color.Plum, new Vector2(1f, 1f), 0, Scale, Scale - 0.5f, Main.rand.Next(18, 23)); + float Scale = Main.rand.NextFloat(1.8f, 2.3f); + CrackParticle crack = new CrackParticle(Projectile.Center, vel, Color.Orchid, new Vector2(1f, 1f), 0, Scale, Scale - 0.5f, Main.rand.Next(18, 23)); GeneralParticleHandler.SpawnParticle(crack); } + Vector2 vel2 = Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(3f)); + float Scale2 = Main.rand.NextFloat(2.9f, 3.2f); + CrackParticle crack2 = new CrackParticle(Projectile.Center, vel2, Color.Plum, new Vector2(1f, 1f), 0, Scale2, Scale2 - 0.5f, Main.rand.Next(27, 32)); + GeneralParticleHandler.SpawnParticle(crack2); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 2, Projectile.owner, 0f); Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 8; } diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 6a69508887..28560e40b0 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -182,7 +182,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index ed4698b813..6342229e0a 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Main.dedServ) { - for (int i = 0; i < (Projectile.Calamity().stealthStrike && Main.rand.NextBool(2) ? 2 : 1); i++) + for (int i = 0; i < (Projectile.Calamity().stealthStrike && Main.rand.NextBool() ? 2 : 1); i++) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 130, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f); } diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index c1637e0468..42b66ca213 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 29ca0adbec..43f02517a0 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs index 0033d3317b..e0a45320eb 100644 --- a/Projectiles/Rogue/SpearofDestinyStealth.cs +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue float radius = (50f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; Vector2 dustPosition = Projectile.Center; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; - Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 279 : 159); + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool() ? 279 : 159); dust.noGravity = true; dust.velocity = Projectile.velocity * 0.5f; dust.scale = 1.3f; diff --git a/Projectiles/Rogue/Stormfrontspark.cs b/Projectiles/Rogue/Stormfrontspark.cs index 9318fffd30..054880e784 100644 --- a/Projectiles/Rogue/Stormfrontspark.cs +++ b/Projectiles/Rogue/Stormfrontspark.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y += 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 226, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 98779f7d7b..c97ea7d5eb 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { //dust and lighting - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Rogue } //dust effects - int dustType = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue { int exo = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[exo].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[exo].scale = 0.5f; Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index d7e9c35c2c..ff3587775b 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { int num154 = 14; - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs index 8f358802ac..8032165b84 100644 --- a/Projectiles/Rogue/SupernovaSpike.cs +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.alpha = 0; } - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = Projectile.height = 32; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int num298 = Main.rand.NextBool() ? 107 : 234; if (Main.rand.NextBool(4)) { num298 = 269; @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num298, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index eeee92356c..da274b40d5 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.myPlayer != Projectile.owner) return; - Vector2 spawnPosition = target.Center + Vector2.UnitY * Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(200f, 270f); + Vector2 spawnPosition = target.Center + Vector2.UnitY * Main.rand.NextBool().ToDirectionInt() * Main.rand.NextFloat(200f, 270f); spawnPosition.X += Main.rand.NextFloatDirection() * target.width * 0.45f; int damage = (int)(Projectile.damage * StealthSplitMultiplier); Vector2 shootVelocity = Vector2.UnitY * (target.Center.Y - spawnPosition.Y > 0f).ToDirectionInt() * Main.rand.NextFloat(14f, 16.5f); diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index e669301cd8..b24787b4ab 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < icicleAmt; i++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); } } } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index a17e413cf7..049c3c8573 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue { int water = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[water].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[water].scale = 0.5f; Main.dust[water].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 62b69e7d8f..86394c3e44 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Item.NewItem(Projectile.GetSource_DropAsItem(), (int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ModContent.ItemType()); } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index 3af410475b..a2a877dff9 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Summon private void OnHitEffects(Vector2 targetPos) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int projAmt = Main.rand.Next(1, 3); var source = Projectile.GetSource_FromThis(); diff --git a/Projectiles/Summon/BloodBreath.cs b/Projectiles/Summon/BloodBreath.cs index 41a5284cc0..ca1626dfeb 100644 --- a/Projectiles/Summon/BloodBreath.cs +++ b/Projectiles/Summon/BloodBreath.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon break; } Time++; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 5, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100); if (Main.rand.NextBool(3)) diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 2fe9807ca2..f9353b9175 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.ai[0] += 1f; int dustType = (int)CalamityDusts.Brimstone; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int brim = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[brim]; diff --git a/Projectiles/Summon/CosmicViperConcussionMissile.cs b/Projectiles/Summon/CosmicViperConcussionMissile.cs index be32dd0567..15f9f9c8e1 100644 --- a/Projectiles/Summon/CosmicViperConcussionMissile.cs +++ b/Projectiles/Summon/CosmicViperConcussionMissile.cs @@ -69,11 +69,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index c85f623980..381f6414f3 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -130,11 +130,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index de2247851f..5d7b20315b 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -176,11 +176,11 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale *= 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs index 93ff28dd5d..91197b07e5 100644 --- a/Projectiles/Summon/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index df9fe99783..7b663641c3 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.myPlayer == Projectile.owner) { Vector2 initialVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), ArmPosition, initialVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, initialAngle, Main.rand.Next(100)); diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 5e33acbb23..9c14ce6548 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index c98aff69fa..784d0ece09 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon //dust if (Main.rand.NextBool(15)) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.localAI[0] += 1f; for (int i = 0; i < 60; i++) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 32c671a700..a0de92e05e 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Summon { for (int i = 0; i < 50; i++) { - int dusttype = Main.rand.NextBool(2) ? 68 : 67; + int dusttype = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { dusttype = 80; diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index bcde995cd2..7575ad1540 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -40,12 +40,12 @@ namespace CalamityMod.Projectiles.Summon float speedY = 1f; if (!speedXChoice) { - speedX = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedX = Main.rand.NextBool() ? 1.03f : 0.97f; speedXChoice = true; } if (!speedYChoice) { - speedY = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedY = Main.rand.NextBool() ? 1.03f : 0.97f; speedYChoice = true; } Projectile.velocity.X *= speedX; @@ -66,12 +66,12 @@ namespace CalamityMod.Projectiles.Summon num296 = 0.75f; } Projectile.ai[0] += 1f; - int num297 = Main.rand.NextBool(2) ? 68 : 67; + int num297 = Main.rand.NextBool() ? 68 : 67; if (Main.rand.NextBool(4)) { num297 = 80; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 0.8f); diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index f146bb983e..72a2ba68c9 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = Owner.Top - Vector2.UnitY * 45f + (Projectile.identity * 0.9f).ToRotationVector2() * 16f; Vector2 idealVelocity = Projectile.SafeDirectionTo(destination) * MathHelper.Lerp(2.3f, 8f, Utils.GetLerpValue(16f, 160f, Projectile.Distance(destination))); if (Projectile.velocity.Length() < 0.4f) - Projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool(2).ToDirectionInt()) * -3.6f; + Projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool().ToDirectionInt()) * -3.6f; else if (!Projectile.WithinRange(destination, 20f)) Projectile.velocity = Projectile.velocity * 0.9f + idealVelocity * 0.1f; diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 79e7aa366e..60d4f78487 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index 08393bb504..4a1f47f005 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index 7d753d7acc..5bd1922125 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index 6364d47e79..9eb4d9e887 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/HallowedStarSummon.cs b/Projectiles/Summon/HallowedStarSummon.cs index 73367adf00..fc11ae98db 100644 --- a/Projectiles/Summon/HallowedStarSummon.cs +++ b/Projectiles/Summon/HallowedStarSummon.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 16, 0f, 0f, 100, default, 1.2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index 44efc43732..fbf65002d8 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item45, Projectile.position); int blue = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 59, 0f, 0f, 100, default, 1f); Main.dust[blue].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[blue].scale = 0.5f; Main.dust[blue].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index ec6f630692..41e40b0fcb 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon for (int j = 0; j < 40; j++) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 6); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } } diff --git a/Projectiles/Summon/IrradiatedAura.cs b/Projectiles/Summon/IrradiatedAura.cs index 50dcb40466..1fce516a5f 100644 --- a/Projectiles/Summon/IrradiatedAura.cs +++ b/Projectiles/Summon/IrradiatedAura.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon { randomDust = 33; } - for (int num468 = 0; num468 < (Main.rand.NextBool(2) ? 1 : 2); num468++) + for (int num468 = 0; num468 < (Main.rand.NextBool() ? 1 : 2); num468++) { int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f); if (randomDust == 89) diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index 55d6850511..a2955632be 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index e45415ea5a..0dff71e507 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.localAI[0] == 0f) { - Projectile.velocity.Y = Main.rand.NextFloat(8f, 11f) * Main.rand.NextBool(2).ToDirectionInt(); - Projectile.velocity.Y = Main.rand.NextFloat(3f, 5f) * Main.rand.NextBool(2).ToDirectionInt(); + Projectile.velocity.Y = Main.rand.NextFloat(8f, 11f) * Main.rand.NextBool().ToDirectionInt(); + Projectile.velocity.Y = Main.rand.NextFloat(3f, 5f) * Main.rand.NextBool().ToDirectionInt(); // This AI variable doubles as the random frame on which this UFO chooses to shoot its machine gun. Projectile.localAI[0] = Main.rand.Next(1, (int)MidnightSunBeacon.MachineGunRate); diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index a0df1da3ec..6d923ced5f 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -1,7 +1,12 @@ using System; +using System.IO; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Summon.Whips; +using CalamityMod.NPCs.Providence; +using Humanizer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -13,6 +18,70 @@ namespace CalamityMod.Projectiles.Summon public Player Owner => Main.player[Projectile.owner]; public bool SpawnedFromPSC => Projectile.ai[0] == 1f; + + internal int phaseTimer + { + get => (int)Projectile.ai[1]; + set + { + Projectile.ai[1] = value; + Projectile.netUpdate = true; + } + } + + private int attackDelay = 0; + + public enum MiniOffenseAIState + { + Vanity, + Psa, + Spears, + Charges, + Fireballs + } + + public MiniOffenseAIState getAiState => SpawnedFromPSC ? + (MiniOffenseAIState)Math.Clamp(Projectile.ai[2], (int)MiniOffenseAIState.Spears, (int)MiniOffenseAIState.Fireballs) : + MiniOffenseAIState.Psa; + + public MiniOffenseAIState updateAiState(Player player, MiniOffenseAIState currentAIState) + { + MiniOffenseAIState? result = null; + if (SpawnedFromPSC && ForcedVanity) + result = MiniOffenseAIState.Vanity; + else if (!SpawnedFromPSC) + result = MiniOffenseAIState.Psa; + if (result != null) + { + Projectile.ai[2] = (int)result; + return (MiniOffenseAIState)result; + //Return early as the phaseTimer would overwrite the spears on hit counter + } + + int currentPhase = (int)currentAIState; + + if (phaseTimer <= 0) + { + currentPhase++; + if (currentPhase > (int)MiniOffenseAIState.Fireballs) //if it is beyond the last possible phase (in terms of enum order) reset to beginning + currentPhase = (int)MiniOffenseAIState.Spears; + result = (MiniOffenseAIState)currentPhase; + bool whip = player.HasBuff(); + int newPhaseTimer = result == MiniOffenseAIState.Charges ? 60 * (whip ? 10 : 6) : //charge time + result == MiniOffenseAIState.Fireballs ? 60 * (whip ? 10 : 6) : //fireball time + 60 * (whip ? 8 : 6); //spears time + phaseTimer = newPhaseTimer; + } + else + { + result = (MiniOffenseAIState)currentPhase; + phaseTimer--; + } + + Projectile.ai[2] = (int)result; + return (MiniOffenseAIState)result; + } + public bool ForcedVanity => SpawnedFromPSC && !Owner.Calamity().profanedCrystalBuffs; public override void SetStaticDefaults() @@ -36,24 +105,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; } - public override void AI() - { - // Despawn properly - if (Owner.Calamity().pSoulGuardians) - Projectile.timeLeft = 2; - if (!Owner.Calamity().pSoulArtifact || Owner.dead || !Owner.active) - { - Owner.Calamity().pSoulGuardians = false; - Projectile.active = false; - return; - } - - // Dynamically update stats here, originalDamage can be found in MiscEffects - Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.localNPCHitCooldown = (SpawnedFromPSC ? 6 : 9); - - // Find minion and charge if possible, make sure vanity minions are not chasing - NPC potentialTarget = Projectile.Center.MinionHoming(3000f, Owner); + private void BaseAI(NPC potentialTarget) + { if (potentialTarget != null && !ForcedVanity) { Vector2 targetDestination = potentialTarget.Center - Projectile.Center; @@ -68,6 +121,8 @@ namespace CalamityMod.Projectiles.Summon } else // Idle movement { + //Set rotation in case it's offset from the buffed charging + Projectile.rotation = (float)(Math.Atan(0)); Vector2 playerDestination = Owner.Center - Projectile.Center; playerDestination.X += Main.rand.NextFloat(-10f, 20f) - (60f * Owner.direction); playerDestination.Y += Main.rand.NextFloat(-10f, 20f) - 60f; @@ -101,6 +156,7 @@ namespace CalamityMod.Projectiles.Summon } // Turning (wtf is this) + // idk ask phup lmao if (Projectile.velocity.X < playerDestination.X) { Projectile.velocity.X += acceleration; @@ -126,6 +182,211 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity.Y -= acceleration * 2f; } } + } + + public void AdvancedAI(NPC potentialTarget, Player owner, MiniOffenseAIState aiState) + { + + bool buffedAi = owner.HasBuff(); + + Vector2 targetDestination = potentialTarget.Center - Projectile.Center; + if (attackDelay > 0) + attackDelay--; + switch (aiState) + { + case MiniOffenseAIState.Charges: + break; + case MiniOffenseAIState.Fireballs: + targetDestination.X += Main.rand.NextFloat(-5f, 5f); + targetDestination.Y += Main.rand.NextFloat(155f, 160f); + break; + case MiniOffenseAIState.Spears: + targetDestination.X += Main.rand.NextFloat(-5f, 5f); + targetDestination.Y += Main.rand.NextFloat(155f, 160f); + break; + } + + if (aiState != MiniOffenseAIState.Charges) + { + + Projectile.rotation = (float)(Math.Atan(0)); + float targetDist = targetDestination.Length(); + + float baseSpeed = (targetDist < 100f ? 28f : 24f) * 2f; + float inertia = 20f; + + targetDist = baseSpeed / targetDist; + targetDestination *= targetDist; + Projectile.velocity = (Projectile.velocity * inertia + targetDestination) / (inertia + 1f); + + if (aiState == MiniOffenseAIState.Fireballs) + { + if (attackDelay == 0) + { + if (buffedAi) + { + attackDelay = 100; + Projectile.velocity = Projectile.Center - potentialTarget.Center; + Projectile.velocity.Normalize(); + Projectile.velocity *= 29f; + int damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + var velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, potentialTarget, 28f); + int shotCount = 3; + int spread = -20; + for (int i = 0; i < shotCount; i++) + { + Vector2 perturbedspeed = new Vector2(velocity.X, velocity.Y).RotatedBy(MathHelper.ToRadians(spread)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedspeed, ModContent.ProjectileType(), damage, 1f, Projectile.owner, 1f); + spread += 20; + } + } + else + { + Projectile.velocity = Projectile.Center - potentialTarget.Center; + Projectile.velocity.Normalize(); + Projectile.velocity *= 20f; + attackDelay = 75; + int damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + var velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, potentialTarget, 25f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), damage, 1f, Projectile.owner); + } + } + } + else //Spears + { + if (attackDelay % (buffedAi ? 6 : 8) == 0) + { + //fire spear + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + + bool shouldShotGun = attackDelay == 0; + if (shouldShotGun) + { + int numProj = 5; + var velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, potentialTarget, buffedAi ? 28f : 20f); + int spread = buffedAi ? -10 : -20; + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread)); + int separation = (i * 4) - 8; + int spearBaseDamage = (int)(Projectile.originalDamage * 0.5f); + int spearDamage = (int)Owner.GetTotalDamage().ApplyTo(spearBaseDamage); + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y - separation, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), spearDamage, 1f, Projectile.owner, 1f, 1f); + if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].DamageType = DamageClass.Summon; + Main.projectile[proj].originalDamage = spearBaseDamage; + } + spread += buffedAi ? 5 : 10; + } + } + else + { + int spearBaseDamage = Projectile.originalDamage; + int spearDamage = (int)Owner.GetTotalDamage().ApplyTo(spearBaseDamage); + var velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, potentialTarget, buffedAi ? 28f : 20f); + var proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), spearDamage, 1f, Projectile.owner, 1f, 1f); + if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].DamageType = DamageClass.Summon; + Main.projectile[proj].originalDamage = Projectile.originalDamage; + } + } + } + + if (attackDelay == 0) + attackDelay = buffedAi ? 30 : 40; + } + } + else + { + var shouldDrawDust = buffedAi || attackDelay > 0; + if (buffedAi) + { + if (attackDelay <= 0) + owner.Calamity().rollBabSpears(1, true); + float distToTarget = Projectile.Distance(potentialTarget.Center) + .01f; + Projectile.velocity = Projectile.rotation.ToRotationVector2() * (28f + (28f / (distToTarget * .01f))); + Projectile.velocity = Vector2.Clamp(Projectile.velocity, Vector2.One * -50f, Vector2.One * 50f); + Projectile.rotation = Projectile.rotation.AngleTowards(Projectile.AngleTo(potentialTarget.Center), .001f * distToTarget); + } + else + { + if (attackDelay == 24) + { + Projectile.velocity = Projectile.SuperhomeTowardsTarget(potentialTarget, 35f, 1f); + Projectile.velocity *= 1.369f; + } + + } + if (attackDelay <= 0) + attackDelay = buffedAi ? 20 : 25; + + if (shouldDrawDust) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + var shouldAdjust = !Main.dayTime && buffedAi; + int dustId = ProvUtils.GetDustID(pscState); + for (int i = 0; i < 6; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + (Projectile.Size / 2f).RotatedBy(Projectile.rotation), dustId); + dust.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(20f * (i % 2 == 0).ToDirectionInt())); + dust.noGravity = true; + dust.fadeIn = shouldAdjust ? 0.9f : 1.8f; + dust.scale = Main.dayTime ? dust.scale : 0.45f; + } + } + } + } + + public override void AI() + { + Player owner = Owner; + // Despawn properly + if (owner.Calamity().pSoulGuardians) + Projectile.timeLeft = 2; + if (!owner.Calamity().pSoulArtifact || owner.dead || !owner.active) + { + owner.Calamity().pSoulGuardians = false; + Projectile.active = false; + return; + } + + var psc = owner.Calamity().profanedCrystal; + if (psc && !SpawnedFromPSC || !psc && SpawnedFromPSC) + { + Projectile.active = false; + } + + // Dynamically update stats here, originalDamage can be found in MiscEffects + Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + Projectile.localNPCHitCooldown = (SpawnedFromPSC ? 6 : 9); + + var currentAIState = getAiState; + + var newAIState = updateAiState(owner, currentAIState); + + if (newAIState != currentAIState) + { + Projectile.netUpdate = true; + } + + // Find minion and charge if possible, make sure vanity minions are not chasing + NPC potentialTarget = Projectile.Center.MinionHoming(3000f, owner); + + switch (getAiState) + { + case MiniOffenseAIState.Vanity: + case MiniOffenseAIState.Psa: + BaseAI(potentialTarget); + break; + default: + if (potentialTarget != null) + AdvancedAI(potentialTarget, owner, newAIState); + else + BaseAI(null); + break; + } // Direction and frames if (Math.Abs(Projectile.velocity.X) > 0.2f) @@ -150,6 +411,15 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] < 0f) Projectile.ai[1] = 15; } + else + { + var buffedAI = Owner.HasBuff(); + var state = getAiState; + if (state == MiniOffenseAIState.Charges && !buffedAI) + { + Owner.Calamity().rollBabSpears(1, true); + } + } } public override void OnHitPlayer(Player target, Player.HurtInfo info) @@ -164,6 +434,15 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] < 0f) Projectile.ai[1] = 15; } + else + { + var buffedAI = Owner.HasBuff(); + var state = getAiState; + if (state == MiniOffenseAIState.Charges && !buffedAI) + { + Owner.Calamity().rollBabSpears(1, true); + } + } } public override bool PreDraw(ref Color lightColor) @@ -176,5 +455,15 @@ namespace CalamityMod.Projectiles.Summon } return true; } + + public override void ReceiveExtraAI(BinaryReader reader) + { + attackDelay = reader.ReadInt32(); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(attackDelay); + } } } diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index ca8c3e78d6..4bc44f81d1 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using CalamityMod.Dusts; +using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -97,6 +97,20 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter++; Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + var psc = Owner.Calamity().profanedCrystal; + if (psc && !SpawnedFromPSC || !psc && SpawnedFromPSC) + { + int rock = ModContent.ProjectileType(); + foreach (var proj in Main.projectile) + { + if (proj.active && proj.owner == Owner.whoAmI && proj.type == rock) + { + proj.active = false; + } + } + Projectile.active = false; + } + var shieldIsActive = shieldActive; //avoid checkiing cooldowns multiple times per frame bool shouldSpawnRocks = !shieldActiveBefore && shieldIsActive; @@ -111,15 +125,15 @@ namespace CalamityMod.Projectiles.Summon { Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10)); Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero); - velocity *= 3f; - Dust.NewDustPerfect(Owner.Center, (int)CalamityDusts.ProfanedFire, velocity, 0, default(Color), 2f); + velocity *= (Main.dayTime || !SpawnedFromPSC) ? 3f : 6.9f; + var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f); + if (!Main.dayTime && SpawnedFromPSC) + dust.noGravity = true; } } - - // Dynamically update stats here, originalDamage can be found in MiscEffects + // Doesn't deal damage directly, damage used for rocks - Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); NPC potentialTarget = Projectile.Center.MinionHoming(1500f, Owner); Vector2 playerDestination = Owner.Center - Projectile.Center; switch (AIState) @@ -133,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon if (!Main.rand.NextBool(3)) continue; - Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, (int)CalamityDusts.ProfanedFire); + Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night))); dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f); dust.velocity.Y -= Main.rand.NextFloat(1f, 3f); dust.scale = Main.rand.NextFloat(1.15f, 1.45f); @@ -180,7 +194,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 13.5f; Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 13.5f; - Projectile.velocity *= dist > 10 ? 0.9f : 0.5f; + Projectile.velocity *= dist > 10 ? 0.9f : 0.3f; Projectile.spriteDirection = Projectile.DirectionTo(potentialTarget.Center).X > 0 ? 1 : -1; } else diff --git a/Projectiles/Summon/MiniGuardianHealer.cs b/Projectiles/Summon/MiniGuardianHealer.cs index 35ba77df58..ac3a3221c3 100644 --- a/Projectiles/Summon/MiniGuardianHealer.cs +++ b/Projectiles/Summon/MiniGuardianHealer.cs @@ -1,7 +1,13 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; +using System.IO; +using CalamityMod.Buffs.Summon.Whips; +using CalamityMod.Items.Accessories; +using CalamityMod.NPCs.Providence; +using static CalamityMod.Items.Accessories.ProfanedSoulCrystal; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -10,13 +16,26 @@ namespace CalamityMod.Projectiles.Summon public class MiniGuardianHealer : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + internal const int starTimer = 180; + internal const int laserTimer = 1200; + private bool hasSetTimers; + + public Player Owner => Main.player[Projectile.owner]; + + public bool SpawnedFromPSC => Projectile.ai[0] == 1f; + public bool ForcedVanity => SpawnedFromPSC && !Owner.Calamity().profanedCrystalBuffs; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; } + public bool isEmpowered => Main.player[Projectile.owner].Calamity().pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + public override void SetDefaults() { Projectile.netImportant = true; @@ -55,104 +74,27 @@ namespace CalamityMod.Projectiles.Summon Projectile.active = false; return; } - Projectile.MinionAntiClump(); - Player projOwner = Main.player[Projectile.owner]; - float num16 = 0.5f; - Projectile.tileCollide = false; - int num17 = 100; - Vector2 vector3 = Projectile.Center; - float num18 = projOwner.Center.X - vector3.X; - float num19 = projOwner.Center.Y - vector3.Y; - num19 += (float)Main.rand.Next(-10, 21); - num18 += (float)Main.rand.Next(-10, 21); - num18 += (float)(60 * -(float)projOwner.direction); - num19 -= 60f; - float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); - float num21 = 18f; - if (num20 < (float)num17 && projOwner.velocity.Y == 0f && - Projectile.position.Y + (float)Projectile.height <= projOwner.position.Y + (float)projOwner.height && - !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + if (!hasSetTimers) { - Projectile.ai[0] = 0f; - if (Projectile.velocity.Y < -6f) - { - Projectile.velocity.Y = -6f; - } - } - if (num20 > 2000f) - { - Projectile.position = projOwner.position; + Projectile.ai[1] = starTimer; + Projectile.ai[2] = laserTimer; + hasSetTimers = true; Projectile.netUpdate = true; } - if (num20 < 50f) + + Projectile.MinionAntiClump(); + Player owner = Owner; + + var psc = owner.Calamity().profanedCrystal; + if (psc && !SpawnedFromPSC || !psc && SpawnedFromPSC) { - if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) - { - Projectile.velocity *= 0.90f; - } - num16 = 0.01f; - } - else - { - if (num20 < 100f) - { - num16 = 0.1f; - } - if (num20 > 300f) - { - num16 = 1f; - } - num20 = num21 / num20; - num18 *= num20; - num19 *= num20; - } - - if (Projectile.velocity.X < num18) - { - Projectile.velocity.X += num16; - if (num16 > 0.05f && Projectile.velocity.X < 0f) - { - Projectile.velocity.X += num16; - } - } - if (Projectile.velocity.X > num18) - { - Projectile.velocity.X -= num16; - if (num16 > 0.05f && Projectile.velocity.X > 0f) - { - Projectile.velocity.X -= num16; - } - } - if (Projectile.velocity.Y < num19) - { - Projectile.velocity.Y += num16; - if (num16 > 0.05f && Projectile.velocity.Y < 0f) - { - Projectile.velocity.Y += num16 * 2f; - } - } - if (Projectile.velocity.Y > num19) - { - Projectile.velocity.Y -= num16; - if (num16 > 0.05f && Projectile.velocity.Y > 0f) - { - Projectile.velocity.Y -= num16 * 2f; - } - } - if (Projectile.velocity.X > 0.25f) - { - Projectile.direction = -1; - } - else if (Projectile.velocity.X < -0.25f) - { - Projectile.direction = 1; - } - - if (Math.Abs(Projectile.velocity.X) > 0.2f) - { - Projectile.spriteDirection = -Projectile.direction; + Projectile.active = false; } + + Vector2 playerDestination = owner.Center - Projectile.Center; + bool empowered = isEmpowered; + Projectile.frameCounter++; if (Projectile.frameCounter > 5) @@ -164,6 +106,247 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame = 0; } + + NPC target = null; + //this player whoami check is necessary, otherwise a laser occurs for every play with psc, which is funny but unbalanced + if (empowered && player.whoAmI == Main.myPlayer) + { + target = CalamityUtils.MinionHoming(Projectile.Center, 2000f, player); + if (target != null) + { + Projectile.spriteDirection = Projectile.DirectionTo(owner.Center).X > 0 ? 1 : -1; + if (Projectile.ai[1] <= 0) + { + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.Center); + + int totalFlameProjectiles = 30; + int totalRings = 3; + double radians = MathHelper.TwoPi / totalFlameProjectiles; + double angleA = radians * 0.5; + double angleB = MathHelper.ToRadians(90f) - angleA; + for (int i = 0; i < totalRings; i++) + { + bool firstRing = i % 2 == 0; + float starVelocity = i + 2f; + float velocityX = (float)(starVelocity * Math.Sin(angleA) / Math.Sin(angleB)); + Vector2 spinningPoint = firstRing ? new Vector2(-velocityX, -starVelocity) : new Vector2(0f, -starVelocity); + for (int j = 0; j < totalFlameProjectiles; j++) + { + Vector2 vector2 = spinningPoint.RotatedBy(radians * j); + int type = ModContent.ProjectileType(); + int dmgAmt = Projectile.originalDamage; + var star = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vector2 * 2.5f, type, dmgAmt, 0f, Main.myPlayer); + star.originalDamage = Projectile.originalDamage; + + Color dustColor = ProfanedSoulCrystal.GetColorForPsc(modPlayer.pscState, Main.dayTime); + dustColor.A = 255; + int maxDust = 3; + for (int k = 0; k < maxDust; k++) + { + int dust = Dust.NewDust(Projectile.Center, 0, 0, 267, 0f, 0f, 0, dustColor, 1f); + Main.dust[dust].position = Projectile.Center; + Main.dust[dust].velocity = vector2 * starVelocity * (k * 0.5f + 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].scale = 1f + k; + Main.dust[dust].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust2 = Dust.CloneDust(dust); + Dust dust3 = dust2; + dust3.scale /= 2f; + dust3 = dust2; + dust3.fadeIn /= 2f; + dust2.color = new Color(255, 255, 255, 255); + } + } + } + Projectile.ai[1] = starTimer; + } + + bool canDoLaser = player.HasBuff(); + + if (canDoLaser && Projectile.ai[2] <= 0) + { + SoundEngine.PlaySound(Providence.HolyRaySound, player.Center); + float rotation = 435f; + Vector2 velocity = target.Center - player.Center; + velocity.Normalize(); + + float beamDirection = -1f; + if (velocity.X < 0f) + beamDirection = 1f; + + int holyLaserDamage = Projectile.originalDamage * 5; + // 60 degrees offset + velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 4f); + int projectile = Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center.X, player.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, player.whoAmI); + + if (Main.projectile.IndexInRange(projectile)) + Main.projectile[projectile].originalDamage = holyLaserDamage; + + // -60 degrees offset + projectile = Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center.X, player.Center.Y, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, player.whoAmI); + + if (Main.projectile.IndexInRange(projectile)) + Main.projectile[projectile].originalDamage = holyLaserDamage; + + Projectile.ai[2] = laserTimer; + } + + + Projectile.ai[1]--; + if (canDoLaser) + Projectile.ai[2]--; + } + } + + if (target == null) + { + playerDestination.X += Main.rand.NextFloat(-5f, 5f); + playerDestination.Y += Main.rand.NextFloat(-10f, 10f); + + float playerDist = playerDestination.Length(); + float acceleration = 0.5f; + float returnSpeed = 18f; + + // Teleport if too far + if (playerDist > 2000f) + { + Projectile.position = owner.position; + Projectile.netUpdate = true; + } + // Slow down a lot when close + else if (playerDist < 50f) + { + acceleration = 0.01f; + if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) + Projectile.velocity *= 0.9f; + } + else + { + + if (playerDist < 100f) + acceleration = 0.1f; + + if (playerDist > 300f) + acceleration = 1f; + + playerDist = returnSpeed / playerDist; + playerDestination *= playerDist; + // Turning (wtf is this) (idk ask phup lmao) + if (Projectile.velocity.X < playerDestination.X) + { + Projectile.velocity.X += acceleration; + if (acceleration > 0.05f && Projectile.velocity.X < 0f) + Projectile.velocity.X += acceleration; + } + + if (Projectile.velocity.X > playerDestination.X) + { + Projectile.velocity.X -= acceleration; + if (acceleration > 0.05f && Projectile.velocity.X > 0f) + Projectile.velocity.X -= acceleration; + } + + if (Projectile.velocity.Y < playerDestination.Y) + { + Projectile.velocity.Y += acceleration; + if (acceleration > 0.05f && Projectile.velocity.Y < 0f) + Projectile.velocity.Y += acceleration * 2f; + } + + if (Projectile.velocity.Y > playerDestination.Y) + { + Projectile.velocity.Y -= acceleration; + if (acceleration > 0.05f && Projectile.velocity.Y > 0f) + Projectile.velocity.Y -= acceleration * 2f; + } + } + + // Direction + if (Math.Abs(Projectile.velocity.X) > 0.2f) + Projectile.direction = Projectile.spriteDirection = Math.Sign(Projectile.velocity.X); + } + else + { + if (Projectile.ai[2] <= 120f) + { + playerDestination = player.Center; + if (Projectile.Hitbox.Intersects(player.Hitbox)) + Projectile.ai[2] = 0f; + } + else + { + playerDestination = target.Center; + playerDestination.X += Main.rand.NextFloat(-5f, 5f); + playerDestination.Y += Main.rand.NextFloat(-155f, -160f); + } + + float dist = Projectile.Center.Distance(playerDestination); + float num543 = playerDestination.X; + float num544 = playerDestination.Y; + float num550 = 40f; + Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float num551 = num543 - vector43.X; + float num552 = num544 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 13.5f; + Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 13.5f; + + if (Projectile.ai[2] <= 120f) + Projectile.velocity *= dist > 10 ? MathHelper.SmoothStep(0.65f, 0.95f, 120f - Utils.GetLerpValue(120, Projectile.ai[2], 60)) : 0.1f; + else + Projectile.velocity *= dist > 10 ? 0.9f : 0.3f; + } + + if (Projectile.ai[2] <= 120f) + { + int dustCount = (int)Math.Round(MathHelper.SmoothStep(1f, 5f, Projectile.ai[2] / 120)); + float outwardness = MathHelper.SmoothStep(40f, 60f, Projectile.ai[2] / 120); + float dustScale = MathHelper.Lerp(1.15f, 1.425f, Projectile.ai[2] / 120); + for (int i = 0; i < dustCount; i++) + { + Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f); + Vector2 dustVelocity = (player.Center - spawnPosition) * 0.085f + owner.velocity; + + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + + Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState)); + dust.velocity = dustVelocity; + dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f); + dust.color = Color.Lerp(Color.LightCoral, Color.White, Projectile.ai[2] / 120 * Main.rand.NextFloat(0.65f, 1f)); + dust.noGravity = true; + dust.noLight = true; + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + // Has afterimages if maximum empowerment + if (SpawnedFromPSC && !ForcedVanity && Owner.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + return true; + } + + public override bool? CanDamage() => false; + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(hasSetTimers); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + hasSetTimers = reader.ReadBoolean(); } } } diff --git a/Projectiles/Summon/MiniGuardianHolyRay.cs b/Projectiles/Summon/MiniGuardianHolyRay.cs new file mode 100644 index 0000000000..0ee2fbd319 --- /dev/null +++ b/Projectiles/Summon/MiniGuardianHolyRay.cs @@ -0,0 +1,212 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Providence; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System; +using System.IO; +using CalamityMod.Buffs.Summon.Whips; +using Terraria; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class MiniGuardianHolyRay : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/ProvidenceHolyRay"; + public Player Owner => Main.player[Projectile.owner]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + } + + public override void SetDefaults() + { + Projectile.width = 48; + Projectile.height = 48; + Projectile.friendly = true; + Projectile.alpha = 255; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = 600; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 3; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Projectile.localAI[0]); + writer.Write(Projectile.localAI[1]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.localAI[0] = reader.ReadSingle(); + Projectile.localAI[1] = reader.ReadSingle(); + } + + public override void AI() + { + + Vector2? vector78 = null; + + if (Projectile.velocity.HasNaNs() || Projectile.velocity == Vector2.Zero) + Projectile.velocity = -Vector2.UnitY; + + Player owner = Main.player[Projectile.owner]; + + if (owner.active && !owner.dead) + { + Vector2 fireFrom = new Vector2(owner.Center.X, owner.Center.Y); + Projectile.position = fireFrom - new Vector2(Projectile.width, Projectile.height) / 2f; + Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + } + else + Projectile.Kill(); + + + if (Projectile.velocity.HasNaNs() || Projectile.velocity == Vector2.Zero) + Projectile.velocity = -Vector2.UnitY; + + float num801 = 0.66f; + Projectile.localAI[0] += 1f; + if (Projectile.localAI[0] >= 150f) + { + Projectile.Kill(); + return; + } + + Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * MathHelper.Pi / 150f) * 10f * num801; + if (Projectile.scale > num801) + Projectile.scale = num801; + + float num804 = Projectile.velocity.ToRotation(); + num804 += Projectile.ai[0]; + Projectile.rotation = num804 - MathHelper.PiOver2; + Projectile.velocity = num804.ToRotationVector2(); + + float num805 = 3f; + float num806 = Projectile.width; + + Vector2 samplingPoint = Projectile.Center; + if (vector78.HasValue) + samplingPoint = vector78.Value; + + float[] array3 = new float[(int)num805]; + Collision.LaserScan(samplingPoint, Projectile.velocity, num806 * Projectile.scale, 2400f, array3); + float num807 = 0f; + for (int num808 = 0; num808 < array3.Length; num808++) + { + num807 += array3[num808]; + } + num807 /= num805; + + // Fire laser through walls at max length + num807 = 2400f; + + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dustType = ProvUtils.GetDustID(pscState); + float amount = 0.5f; + Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], num807, amount); // Length of laser, linear interpolation + Vector2 vector79 = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f); + for (int num809 = 0; num809 < 2; num809++) + { + float num810 = Projectile.velocity.ToRotation() + (Main.rand.NextBool() ? -1f : 1f) * MathHelper.PiOver2; + float num811 = (float)Main.rand.NextDouble() * 2f + 2f; + Vector2 vector80 = new Vector2((float)Math.Cos(num810) * num811, (float)Math.Sin(num810) * num811); + int num812 = Dust.NewDust(vector79, 0, 0, dustType, vector80.X, vector80.Y, 0, default, 1f); + Main.dust[num812].noGravity = true; + Main.dust[num812].scale = 1.7f; + } + + if (Main.rand.NextBool(5)) + { + Vector2 value29 = Projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * Projectile.width; + int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); + Dust dust = Main.dust[num813]; + dust.velocity *= 0.5f; + Main.dust[num813].velocity.Y = -Math.Abs(Main.dust[num813].velocity.Y); + } + + DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Projectile.localAI[1], Projectile.width * Projectile.scale, DelegateMethods.CastLight); + } + + public override bool PreDraw(ref Color lightColor) + { + if (Projectile.velocity == Vector2.Zero) + return false; + + bool dayTime = Main.dayTime; + Texture2D texture2D19 = dayTime ? ModContent.Request(Texture, AssetRequestMode.ImmediateLoad).Value : + ModContent.Request("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight", AssetRequestMode.ImmediateLoad).Value; + Texture2D texture2D20 = dayTime ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value : + ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMidNight", AssetRequestMode.ImmediateLoad).Value; + Texture2D texture2D21 = dayTime ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd", AssetRequestMode.ImmediateLoad).Value : + ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value; + + float num223 = Projectile.localAI[1]; //length of laser + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Color color44 = ProvUtils.GetProjectileColor(pscState, 0) * 0.9f; + Vector2 vector = Projectile.Center - Main.screenPosition; + Rectangle? sourceRectangle2 = null; + Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, Projectile.rotation, texture2D19.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + num223 -= (texture2D19.Height / 2 + texture2D21.Height) * Projectile.scale; + Vector2 value20 = Projectile.Center; + value20 += Projectile.velocity * Projectile.scale * texture2D19.Height / 2f; + + if (num223 > 0f) + { + float num224 = 0f; + Rectangle rectangle7 = new Rectangle(0, 36 * (Projectile.timeLeft / 3 % 4), texture2D20.Width, 36); + while (num224 + 1f < num223) + { + if (num223 - num224 < rectangle7.Height) + rectangle7.Height = (int)(num223 - num224); + + Main.spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color44, Projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), Projectile.scale, SpriteEffects.None, 0); + num224 += rectangle7.Height * Projectile.scale; + value20 += Projectile.velocity * rectangle7.Height * Projectile.scale; + rectangle7.Y += 36; + + if (rectangle7.Y + rectangle7.Height > texture2D20.Height) + rectangle7.Y = 0; + } + } + + Vector2 vector2 = value20 - Main.screenPosition; + sourceRectangle2 = null; + + Main.spriteBatch.Draw(texture2D21, vector2, sourceRectangle2, color44, Projectile.rotation, texture2D21.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + + return false; + } + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = Projectile.velocity; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Projectile.localAI[1], Projectile.width * Projectile.scale, DelegateMethods.CutTiles); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + return true; + + float num6 = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + Projectile.velocity * Projectile.localAI[1], 22f * Projectile.scale, ref num6)) + return true; + + return false; + } + + public override bool? CanDamage() => Projectile.scale >= 0.5f; + } +} diff --git a/Projectiles/Summon/MiniGuardianRock.cs b/Projectiles/Summon/MiniGuardianRock.cs index 29a5fc8fa6..7bc6da0afc 100644 --- a/Projectiles/Summon/MiniGuardianRock.cs +++ b/Projectiles/Summon/MiniGuardianRock.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon.Whips; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -61,19 +62,28 @@ namespace CalamityMod.Projectiles.Summon rotationVelocityIncrease += rotationVelocityIncrease * (Projectile.ai[1] * 0.5f); // Rotate around Player - var psc = Owner.Calamity().profanedCrystalBuffs; - float angle = MathHelper.TwoPi / (psc ? 10 : 5) * Projectile.ai[1]; - float distance = psc ? 90f : 50f; + var psc = Owner.Calamity().pscState; + float angle = MathHelper.TwoPi / (psc > 0 ? 10 : 5) * Projectile.ai[1]; + float distance = 50f + (psc > 0 ? 30f : 0f); Projectile.Center = Owner.Center + Projectile.ai[1].ToRotationVector2() * distance; Projectile.rotation = Projectile.ai[1] + (float)Math.Atan(90); - Projectile.ai[1] -= MathHelper.ToRadians(2f); + Projectile.ai[1] += MathHelper.ToRadians(psc > 0 ? 2f : -2f); } else if (Projectile.ai[0] == 1f) //rock yeetage begins { - Projectile.velocity = Projectile.Center - Owner.Center; - Projectile.velocity.Normalize(); - Projectile.velocity *= Owner.Calamity().profanedCrystalBuffs ? 25f : 20f; - Projectile.ai[0] = 2f; + NPC target = Projectile.Center.MinionHoming(2000f, Owner); + if (Owner.HasBuff() && target != null) + { + Projectile.velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, 32f); + Projectile.ai[0] = 3f; //prevent slowdown if yeeted due to the ai buff from whips + } + else + { + Projectile.velocity = Projectile.Center - Owner.Center; + Projectile.velocity.Normalize(); + Projectile.velocity *= Owner.Calamity().profanedCrystalBuffs ? 25f : 20f; + Projectile.ai[0] = 2f; + } Projectile.timeLeft = 300; } else if (Projectile.ai[0] == 2f) //rocks have been yeeted, handle the aftermath diff --git a/Projectiles/Summon/MiniGuardianSpear.png b/Projectiles/Summon/MiniGuardianSpear.png deleted file mode 100644 index e64b5053e6..0000000000 Binary files a/Projectiles/Summon/MiniGuardianSpear.png and /dev/null differ diff --git a/Projectiles/Summon/MiniGuardianStars.cs b/Projectiles/Summon/MiniGuardianStars.cs new file mode 100644 index 0000000000..c912dc60e9 --- /dev/null +++ b/Projectiles/Summon/MiniGuardianStars.cs @@ -0,0 +1,126 @@ +using CalamityMod.NPCs.Providence; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Summon +{ + public class MiniGuardianStars : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 30; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.alpha = 255; + Projectile.penetrate = 1; + Projectile.timeLeft = 200; + } + + public override void AI() + { + if (Projectile.timeLeft % 4 == 0) //only once per 4 frames + Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); + + Player owner = Main.player[Projectile.owner]; + Projectile.damage = (int)owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + + if (Projectile.ai[0] < 240f) + { + Projectile.ai[0] += 1f; + + if (Projectile.timeLeft < 160) + Projectile.timeLeft = 160; + } + + if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; + } + + public override bool PreDraw(ref Color lightColor) + { + float lerpMult = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * (MathHelper.Pi * 2f) * 3f)) * 0.8f; + + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProfanedSoulCrystal.GetColorForPsc(Main.player[Projectile.owner].Calamity().pscState, Main.dayTime); + baseColor *= 0.5f; + baseColor.A = 0; + Color colorA = baseColor; + Color colorB = baseColor * 0.5f; + colorA *= lerpMult; + colorB *= lerpMult; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(0.5f, 1.5f) * lerpMult; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, colorA, upLeft, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, upRight, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, upLeft, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, upRight, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, up, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, left, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, up, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, left, origin, scale * 0.36f, spriteEffects, 0); + + return false; + } + + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + Projectile.ExpandHitboxBy(50); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dustType = ProvUtils.GetDustID(pscState); + for (int d = 0; d < 5; d++) + { + int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); + Main.dust[holy].velocity *= 3f; + Main.dust[holy].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[holy].scale = 0.5f; + Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int d = 0; d < 8; d++) + { + int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.75f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); + Main.dust[fire].velocity *= 2f; + Main.dust[fire].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.Kill(); + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode) + return; + + Projectile.Kill(); + } + } +} diff --git a/Projectiles/Summon/PhantomicDagger.cs b/Projectiles/Summon/PhantomicDagger.cs index f77618ca96..b82c4fbe46 100644 --- a/Projectiles/Summon/PhantomicDagger.cs +++ b/Projectiles/Summon/PhantomicDagger.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/PhantomicShield.cs b/Projectiles/Summon/PhantomicShield.cs index 0606dc902a..9d40625051 100644 --- a/Projectiles/Summon/PhantomicShield.cs +++ b/Projectiles/Summon/PhantomicShield.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index 6ccb3f30e6..80e1acf742 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -323,7 +323,7 @@ namespace CalamityMod.Projectiles.Summon int smallBee = ModContent.ProjectileType(); int bigBee = ModContent.ProjectileType(); int projType = smallBee; - if (Owner.ownedProjectileCounts[bigBee] <= 0 && Main.rand.NextBool(2)) + if (Owner.ownedProjectileCounts[bigBee] <= 0 && Main.rand.NextBool()) projType = bigBee; if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, target.Center, 0, 0)) diff --git a/Projectiles/Summon/ProfanedCrystalMageFireball.png b/Projectiles/Summon/ProfanedCrystalMageFireball.png deleted file mode 100644 index d83b5f5d2b..0000000000 Binary files a/Projectiles/Summon/ProfanedCrystalMageFireball.png and /dev/null differ diff --git a/Projectiles/Summon/ProfanedCrystalMageFireballSplit.png b/Projectiles/Summon/ProfanedCrystalMageFireballSplit.png deleted file mode 100644 index edcdd5d8b7..0000000000 Binary files a/Projectiles/Summon/ProfanedCrystalMageFireballSplit.png and /dev/null differ diff --git a/Projectiles/Summon/ProfanedCrystalMeleeSpear.png b/Projectiles/Summon/ProfanedCrystalMeleeSpear.png deleted file mode 100644 index e64b5053e6..0000000000 Binary files a/Projectiles/Summon/ProfanedCrystalMeleeSpear.png and /dev/null differ diff --git a/Projectiles/Summon/ProfanedCrystalRangedHugesNight.png b/Projectiles/Summon/ProfanedCrystalRangedHugesNight.png new file mode 100644 index 0000000000..99056d429d Binary files /dev/null and b/Projectiles/Summon/ProfanedCrystalRangedHugesNight.png differ diff --git a/Projectiles/Summon/ProfanedCrystalRangedSmalls.png b/Projectiles/Summon/ProfanedCrystalRangedSmalls.png index 102b893fb6..686ad9e91f 100644 Binary files a/Projectiles/Summon/ProfanedCrystalRangedSmalls.png and b/Projectiles/Summon/ProfanedCrystalRangedSmalls.png differ diff --git a/Projectiles/Summon/ProfanedCrystalWhip.png b/Projectiles/Summon/ProfanedCrystalWhip.png new file mode 100644 index 0000000000..6671719e6d Binary files /dev/null and b/Projectiles/Summon/ProfanedCrystalWhip.png differ diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 69daafa3f1..db1042ee93 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon int holy = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].position = Projectile.Center; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 2d133785ff..34afd42b59 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -2,11 +2,18 @@ using Microsoft.Xna.Framework.Graphics; using CalamityMod.NPCs.SupremeCalamitas; using System; +using System.Collections.Generic; using System.IO; +using CalamityMod.Buffs.Summon.Whips; +using CalamityMod.Items.Accessories; +using static CalamityMod.Items.Accessories.ProfanedSoulCrystal; +using CalamityMod.NPCs.Providence; +using CalamityMod.Projectiles.Boss; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Terraria.GameContent; namespace CalamityMod.Projectiles.Summon { @@ -16,6 +23,8 @@ namespace CalamityMod.Projectiles.Summon public class ProfanedCrystalMageFireball : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyBlast"; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; @@ -27,15 +36,15 @@ namespace CalamityMod.Projectiles.Summon private void Split(bool hit, bool chaseable) { Player player = Main.player[Projectile.owner]; - bool enrage = player.statLife <= (int)((double)player.statLifeMax2 * 0.5); + bool enrage = player.Calamity().pscState >= (int)ProfanedSoulCrystalState.Empowered; player.Calamity().rollBabSpears(hit ? 1 : 0, chaseable); - int outerSplits = enrage ? 20 : 10; - int innerSplits = enrage ? 16 : 8; - float mult = enrage ? 0.4f : 0.6f; + int outerSplits = enrage ? 16 : 10; + int innerSplits = enrage ? 12 : 8; + float mult = enrage ? 0.3f : 0.6f; if (!hit) mult = enrage ? 0.2f : 0.1f; //punishing to miss int damage = (int)((Projectile.damage * 0.2f) * mult); - int origDmg = (int)((Projectile.originalDamage * 0.2f) * mult); + int origDmg = (int)((Projectile.originalDamage * 0.2f) * mult); float outerAngleVariance = MathHelper.TwoPi / (float)outerSplits; float outerOffsetAngle = MathHelper.Pi / (2f * outerSplits); @@ -124,18 +133,27 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dustID = ProvUtils.GetDustID(pscState); + int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } + + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = ModContent.Request(Texture).Value; - int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3, texture2D13); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -162,21 +180,23 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - if (Main.myPlayer == Projectile.owner) + if (Main.myPlayer == Projectile.owner && Projectile.ai[1] == 0f) { Split(false, false); } SoundEngine.PlaySound(SoundID.Item20, Projectile.position); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dustID = ProvUtils.GetDustID(pscState); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 0, default, 2.5f); + int num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 50, default, 1.5f); + num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } @@ -188,6 +208,7 @@ namespace CalamityMod.Projectiles.Summon public class ProfanedCrystalMageFireballSplit : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire2"; private int damage; private int hits = 0; private NPC target = null; @@ -196,6 +217,7 @@ namespace CalamityMod.Projectiles.Summon { Main.projFrames[Projectile.type] = 4; ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.3f; } public override void SetDefaults() @@ -232,7 +254,7 @@ namespace CalamityMod.Projectiles.Summon } if (Projectile.timeLeft > 550) Projectile.velocity *= 0.95f; - int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); + int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), 0f, 0f, 100, default, Main.dayTime ? 1f : 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; @@ -307,6 +329,23 @@ namespace CalamityMod.Projectiles.Summon } } } + + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } + + public override bool PreDraw(ref Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Texture2D texture = Main.dayTime ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; + int y6 = num214 * Projectile.frame; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -326,8 +365,9 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.getRect().Intersects(target.getRect())) { hits++; - if (hits >= 100) + if (hits >= 25) Projectile.Kill(); + } return false; } @@ -343,11 +383,13 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 200; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -355,10 +397,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.75f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num624].velocity *= 2f; } @@ -372,10 +414,14 @@ namespace CalamityMod.Projectiles.Summon public class ProfanedCrystalMeleeSpear : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + + public override string Texture => "CalamityMod/Projectiles/Boss/HolySpear"; + public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.6f; } public override void SetDefaults() @@ -461,38 +507,30 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, ModContent.Request(Texture).Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1); return false; } - public override Color? GetAlpha(Color lightColor) - { - if (Projectile.timeLeft > 133) - { - Projectile.localAI[0] += 5f; - byte b2 = (byte)(((int)Projectile.localAI[0]) * 3); - byte a2 = (byte)((float)Projectile.alpha * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); - } - return new Color(255, 255, 255, Projectile.alpha); - } - private void onHit() { SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - if (Main.rand.NextBool(2) || Main.rand.NextBool(3)) //so it's not exactly 1 in 2, but it's not more or less consistently either. + if (Main.rand.NextBool() || Main.rand.NextBool(3)) //so it's not exactly 1 in 2, but it's not more or less consistently either. { Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); Projectile.width = Projectile.height = 200; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -500,10 +538,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.75f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num624].velocity *= 2f; } @@ -635,6 +673,7 @@ namespace CalamityMod.Projectiles.Summon ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.4f; } public override void SetDefaults() @@ -693,17 +732,29 @@ namespace CalamityMod.Projectiles.Summon Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; Projectile.velocity *= boomerSwarm ? 1.03f : 1.02f; - - int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); + int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; if (boomerSwarm) swarmAI(); } + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } + public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + Texture2D texture = Main.dayTime ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; + int y6 = num214 * Projectile.frame; + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -737,11 +788,13 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 200; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -749,10 +802,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.75f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num624].velocity *= 2f; } @@ -774,7 +827,7 @@ namespace CalamityMod.Projectiles.Summon } for (int i = 0; i < 4; i++) { - int num626 = Gore.NewGore(Projectile.GetSource_Death(), new Vector2(Projectile.position.X + (float)(Projectile.width / 2) - 24f, Projectile.position.Y + (float)(Projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(Projectile.GetSource_Death(), new Vector2(Projectile.position.X + (float)(Projectile.width / 2) - 24f, Projectile.position.Y + (float)(Projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.75f); Gore gore = Main.gore[num626]; gore.velocity *= scaleFactor10; if (i == 0 || i == 2) @@ -860,11 +913,13 @@ namespace CalamityMod.Projectiles.Summon Projectile.height = 50; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -872,10 +927,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 247, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.75f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); Main.dust[num624].velocity *= 2f; } } @@ -889,6 +944,22 @@ namespace CalamityMod.Projectiles.Summon { Main.player[Projectile.owner].Calamity().rollBabSpears(50, true); } + + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; + int y6 = num214 * Projectile.frame; + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } } #endregion @@ -900,6 +971,11 @@ namespace CalamityMod.Projectiles.Summon public class ProfanedCrystalRogueShard : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.25f; + } public override void SetDefaults() { Projectile.width = 34; @@ -919,7 +995,7 @@ namespace CalamityMod.Projectiles.Summon private void ai() { - if (Projectile.timeLeft > 90) + if (Projectile.timeLeft > 120) { Projectile.rotation += 1f; Projectile.velocity.X *= 0.985f; @@ -932,6 +1008,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.rotation -= 1.57f; } + float num535 = Projectile.position.X; float num536 = Projectile.position.Y; float num537 = 2000f; @@ -990,7 +1067,7 @@ namespace CalamityMod.Projectiles.Summon num552 *= num553; Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 15f; Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 15f; - + Projectile.velocity *= 1.05f; } else { @@ -1041,7 +1118,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(10)) { Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)Projectile.rotation, default); - Dust dust24 = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; + Dust dust24 = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1f)]; dust24.noGravity = true; dust24.noLight = true; dust24.scale = Projectile.Opacity * Projectile.localAI[0]; @@ -1055,7 +1132,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(10)) { Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default); - Dust dust25 = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; + Dust dust25 = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1f)]; dust25.noGravity = true; dust25.noLight = true; dust25.scale = Projectile.Opacity * Projectile.localAI[0]; @@ -1107,19 +1184,21 @@ namespace CalamityMod.Projectiles.Summon public override bool? CanHitNPC(NPC target) { - if (Projectile.timeLeft > 90) + if (Projectile.timeLeft > 120) return false; return null; } public override bool CanHitPvp(Player target) { - return Projectile.timeLeft <= 90; + return Projectile.timeLeft <= 120; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - Main.player[Projectile.owner].Calamity().rollBabSpears(Projectile.ai[0] == 0f ? 0 : 10, target.chaseable); + var calPlayer = Main.player[Projectile.owner].Calamity(); + var empowered = calPlayer.pscState == (int)ProfanedSoulCrystalState.Empowered; + calPlayer.rollBabSpears(Projectile.ai[0] == 0f ? 0 : empowered ? 30 : 10, target.chaseable); //empowered fires three times as many projectiles, keeps things consistent and easier to balance } public override void Kill(int timeLeft) @@ -1166,7 +1245,6 @@ namespace CalamityMod.Projectiles.Summon num72 = num73; } } - public override Color? GetAlpha(Color lightColor) { return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0); @@ -1174,16 +1252,190 @@ namespace CalamityMod.Projectiles.Summon } #endregion + + #region Whip + + public class ProfanedCrystalWhip : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + private Color specialColor = Color.Orange; + public Color SpecialDrawColor => specialColor; + + public override void SetStaticDefaults() { + ProjectileID.Sets.IsAWhip[Type] = true; + } + + public override void SetDefaults() + { + Projectile.DefaultToWhip(); + Projectile.WhipSettings.Segments = 20; + Projectile.WhipSettings.RangeMultiplier = 2.25f; + } + + public override bool PreAI() + { + ExtraBehavior(); + return true; + } + + public void ExtraBehavior() + { + var player = Main.player[Projectile.owner]; + specialColor = GetColorForPsc(Main.dayTime ? (int)ProfanedSoulCrystalState.Vanity : player.Calamity().pscState, Main.dayTime); + } + + private float Timer { + get => Projectile.ai[0]; + set => Projectile.ai[0] = value; + } + + public override void AI() + { + Player owner = Main.player[Projectile.owner]; + if (Projectile.ai[1] == 0f) + { + owner.itemAnimation = owner.itemAnimationMax; + owner.ApplyItemAnimation(owner.HeldItem); + Projectile.ai[1] = 1f; + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + Projectile.Center = Main.GetPlayerArmPosition(Projectile) + Projectile.velocity * Timer; + Projectile.spriteDirection = Projectile.velocity.X >= 0f ? 1 : -1; + + float swingTime = owner.itemAnimationMax * Projectile.MaxUpdates; + if (Timer >= swingTime) { + Projectile.Kill(); + return; + } + + owner.heldProj = Projectile.whoAmI; + if (Timer == swingTime / 2) { + List points = Projectile.WhipPointsForCollision; + Projectile.FillWhipControlPoints(Projectile, points); + SoundEngine.PlaySound(SoundID.Item153, points[points.Count - 1]); + } + + float swingProgress = Timer / swingTime; + if (Utils.GetLerpValue(0.1f, 0.7f, swingProgress, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, swingProgress, clamped: true) > 0.5f && !Main.rand.NextBool(3)) { + List points = Projectile.WhipPointsForCollision; + points.Clear(); + Projectile.FillWhipControlPoints(Projectile, points); + int pointIndex = points.Count - 1; + Rectangle spawnArea = Utils.CenteredRectangle(points[pointIndex], new Vector2(30f, 30f)); + int dustType = DustID.VenomStaff; + for (int i = 0; i < 2; i++) + { + Dust dust = Dust.NewDustDirect(spawnArea.TopLeft(), spawnArea.Width, spawnArea.Height, dustType, 0f, 0f, 100, Color.White); + dust.position = points[pointIndex]; + dust.fadeIn = 0.3f; + dust.scale = 2f; + Vector2 spinningpoint = points[pointIndex] - points[pointIndex - 1]; + dust.noGravity = true; + dust.velocity *= 0.5f; + dust.velocity += spinningpoint.RotatedBy(owner.direction * ((float)Math.PI / 2f)); + dust.velocity *= 0.5f; + } + } + } + + private void DrawLine(List list) { + Texture2D texture = TextureAssets.FishingLine.Value; + Rectangle frame = texture.Frame(); + Vector2 origin = new Vector2(frame.Width / 2, 0); + + Vector2 pos = list[0]; + for (int i = 0; i < list.Count - 2; i++) { + Vector2 element = list[i]; + Vector2 diff = list[i + 1] - element; + + float rotation = diff.ToRotation() - MathHelper.PiOver2; + Vector2 scale = new Vector2(1, (diff.Length()) / frame.Height); + + Main.EntitySpriteDraw(texture, pos - Main.screenPosition, frame, SpecialDrawColor, rotation, origin, scale, SpriteEffects.None, 0); + + pos += diff; + } + } + public override bool PreDraw(ref Color lightColor) { + List list = new List(); + Projectile.FillWhipControlPoints(Projectile, list); + + DrawLine(list); + + SpriteEffects flip = SpriteEffects.FlipHorizontally; + + Main.instance.LoadProjectile(Type); + Texture2D texture = TextureAssets.Projectile[Type].Value; + + Vector2 pos = list[0]; + + for (int i = 0; i < list.Count - 1; i++) { + Rectangle frame = new Rectangle(0, 0, 16, 22); // The size of the Handle (measured in pixels) + Vector2 origin = new Vector2(5, 8); // Offset for where the player's hand will start measured from the top left of the image. + float scale = 1; + + if (i == list.Count - 2) { + frame.Y = 126; // Distance from the top of the sprite to the start of the frame. + frame.Height = 34; // Height of the frame. + + Projectile.GetWhipSettings(Projectile, out float timeToFlyOut, out int _, out float _); + float t = Timer / timeToFlyOut; + scale = MathHelper.Lerp(0.5f, 1.5f, Utils.GetLerpValue(0.1f, 0.7f, t, true) * Utils.GetLerpValue(0.9f, 0.7f, t, true)); + } + else if (i > 6) { + // Third segment + frame.Y = 102; + frame.Height = 18; + } + else if (i > 3) { + // Second Segment + frame.Y = 70; + frame.Height = 18; + } + else if (i > 0) { + // First Segment + frame.Y = 38; + frame.Height = 18; + } + + Vector2 element = list[i]; + Vector2 diff = list[i + 1] - element; + + float rotation = diff.ToRotation() - MathHelper.PiOver2; + + Main.EntitySpriteDraw(texture, pos - Main.screenPosition, frame, Color.White, rotation, origin, scale, flip, 0); + + pos += diff; + } + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + int buffTime = CalamityUtils.SecondsToFrames(30); //30 second debuff to allow for time to swap and use other weapons + target.AddBuff(ModContent.BuffType(), buffTime); + Main.player[Projectile.owner].AddBuff(ModContent.BuffType(), buffTime); + Main.player[Projectile.owner].MinionAttackTargetNPC = target.whoAmI; + Projectile.damage = (int)(Projectile.damage * 0.7f); // multihit penalty + } + } + + #endregion + + #region Bab Projectiles #region Bab Spears - public class MiniGuardianSpear : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/HolySpear"; + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.5f; } public override void SetDefaults() @@ -1202,96 +1454,110 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } - public override void AI() + private void handleAI(bool miniGuardianPscAttack) { - int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - if (Projectile.timeLeft == 300) + if (!miniGuardianPscAttack) { - Projectile.velocity *= 0.01f; - } - else if (Projectile.timeLeft > 250) - { - Projectile.velocity *= 1.1f; - } - else if (Projectile.timeLeft == 250) - { - Projectile.velocity *= 5f; - } - if (Projectile.timeLeft <= 250) - { - float num535 = Projectile.position.X; - float num536 = Projectile.position.Y; - float num537 = 3000f; - bool flag19 = false; - NPC ownerMinionAttackTargetNPC2 = Projectile.OwnerMinionAttackTargetNPC; - if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(Projectile, false)) + if (Projectile.timeLeft == 300) { - float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); - float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); - float num541 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num539) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num540); - if (num541 < num537) - { - num537 = num541; - num535 = num539; - num536 = num540; - flag19 = true; - } + Projectile.velocity *= 0.01f; } - if (!flag19) + else if (Projectile.timeLeft > 250) { - for (int num542 = 0; num542 < Main.npc.Length; num542++) + Projectile.velocity *= 1.1f; + } + else if (Projectile.timeLeft == 250) + { + Projectile.velocity *= 5f; + } + if (Projectile.timeLeft <= 250) + { + float num535 = Projectile.position.X; + float num536 = Projectile.position.Y; + float num537 = 3000f; + bool flag19 = false; + NPC ownerMinionAttackTargetNPC2 = Projectile.OwnerMinionAttackTargetNPC; + if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(Projectile, false)) { - if (Main.npc[num542].CanBeChasedBy(Projectile, false)) + float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); + float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); + float num541 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num539) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num540); + if (num541 < num537) { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num543) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num544); - if (num545 < num537) + num537 = num541; + num535 = num539; + num536 = num540; + flag19 = true; + } + } + if (!flag19) + { + for (int num542 = 0; num542 < Main.npc.Length; num542++) + { + if (Main.npc[num542].CanBeChasedBy(Projectile, false)) { - num537 = num545; - num535 = num543; - num536 = num544; - flag19 = true; + float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); + float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); + float num545 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num543) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num544); + if (num545 < num537) + { + num537 = num545; + num535 = num543; + num536 = num544; + flag19 = true; + } } } } - } - if (flag19) - { - if (Projectile.ai[1] == 0f) + if (flag19) { - float num550 = 24f; //12 - Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); - float num551 = num535 - vector43.X; - float num552 = num536 - vector43.Y; - float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); - if (num553 < 100f) + if (Projectile.ai[1] == 0f) { - num550 = 28f; //14 + float num550 = 24f; //12 + Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float num551 = num535 - vector43.X; + float num552 = num536 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 15f; + Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 15f; } - num553 = num550 / num553; - num551 *= num553; - num552 *= num553; - Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 15f; - Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 15f; } } } + } + + public override void AI() + { + var psc = Projectile.ai[0] > 0f; + //Ensure that psa's spears are not coloured by night + int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day); + int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + handleAI(psc && Projectile.ai[1] > 0f); Projectile.rotation = Projectile.velocity.ToRotation() + 1.57079637f; } public override bool? CanHitNPC(NPC target) { - if (Projectile.timeLeft > 250) + if (Projectile.ai[1] == 0f && Projectile.timeLeft > 250) return false; return null; } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + var psc = Projectile.ai[0] > 0f; + int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, ModContent.Request(Texture).Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1); return false; } @@ -1305,28 +1571,308 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 200; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + var psc = Projectile.ai[0] > 0f; + var shouldAdjust = !Main.dayTime && psc; + int pscState = (int)(shouldAdjust ? Providence.BossMode.Night : Providence.BossMode.Day); + int dustID = ProvUtils.GetDustID(pscState); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = shouldAdjust ? 0.9f : 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 12; num623++) + for (int num623 = 0; num623 < (shouldAdjust ? 8 : 12); num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 1.25f : 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num624].fadeIn = shouldAdjust ? 0.9f : Main.dust[num624].fadeIn; + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 1f : 2f); Main.dust[num624].velocity *= 2f; - + Main.dust[num624].fadeIn = shouldAdjust ? 0.9f : Main.dust[num624].fadeIn; } } } } + #endregion + #region Bab Fireball + + public class MiniGuardianFireball : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyBlast"; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + private void Split() + { + int totalProjectiles = Projectile.ai[0] == 0f ? 8 : 4; + + float radians = MathHelper.TwoPi / totalProjectiles; + int type = ModContent.ProjectileType(); + float velocity = 5f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Projectile.velocity * 0.25f, type, (int)Math.Round(Projectile.originalDamage * 0.75), 0f, Projectile.owner, 1f); + } + } + + public override void SetDefaults() + { + Projectile.width = 180; + Projectile.height = 180; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.timeLeft = 75; + Projectile.minion = true; + Projectile.scale = 0.4f; + } + + public override bool PreAI() + { + Projectile.Calamity().overridesMinionDamagePrevention = true; + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + { + Projectile.frame = 0; + } + if (Projectile.timeLeft == 50) + { + Projectile.tileCollide = true; + } + if ((double)Math.Abs(Projectile.velocity.X) > 0.2) + { + Projectile.rotation = Projectile.direction; + } + if (Projectile.velocity.X < 0f) + { + Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); + } + else + { + Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); + } + return false; + } + + public override void AI() + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Main.dayTime ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; + int y6 = num214 * Projectile.frame; + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Main.myPlayer == Projectile.owner) + { + Split(); + } + SoundEngine.PlaySound(HolyBlast.ImpactSound, Projectile.Center); + Projectile.active = false; + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + if (info.Damage <= 0) + return; + + if (Main.myPlayer == Projectile.owner) + { + Split(); + } + SoundEngine.PlaySound(HolyBlast.ImpactSound, Projectile.Center); + Projectile.active = false; + } + + public override void Kill(int timeLeft) + { + if (Main.myPlayer == Projectile.owner) + { + Split(); + } + SoundEngine.PlaySound(HolyBlast.ImpactSound, Projectile.Center); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dustID = ProvUtils.GetDustID(pscState); + for (int num193 = 0; num193 < 6; num193++) + { + Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, Main.dayTime ? 1.5f : 0.5f); + } + for (int num194 = 0; num194 < 60; num194++) + { + int num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 0, default, Main.dayTime ? 2.5f : 0.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, Main.dayTime ? 1.5f : 0.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + } + + #endregion + + #region Bab Fireball Split + + + public class MiniGuardianFireballSplit : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire2"; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.3f; + } + + public override void SetDefaults() + { + Projectile.width = 26; + Projectile.height = 26; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 300; + Projectile.minion = true; + Projectile.gfxOffY = -25f; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 6; + Projectile.DamageType = DamageClass.Summon; + } + + public override bool PreAI() + { + Projectile.Calamity().overridesMinionDamagePrevention = true; + return true; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); + + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + if (Math.Abs(Projectile.velocity.X) < 8f) + Projectile.velocity.X *= 1.05f; + + NPC target = Projectile.Center.MinionHoming(2000f, Main.player[Projectile.owner], true); + + if (target != null) + { + float scaleFactor2 = Projectile.velocity.Length(); + Vector2 vector11 = target.Center - Projectile.Center; + vector11.Normalize(); + vector11 *= scaleFactor2; + float inertia = 15f; + Projectile.velocity = (Projectile.velocity * (inertia - 1f) + vector11) / inertia; + Projectile.velocity.Normalize(); + Projectile.velocity *= scaleFactor2; + } + + Projectile.rotation = Projectile.velocity.X * 0.025f; + } + + public override Color? GetAlpha(Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + return ProvUtils.GetProjectileColor(pscState, Projectile.alpha); + } + + public override bool PreDraw(ref Color lightColor) + { + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + Texture2D texture = Main.dayTime ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int num214 = texture.Height / Main.projFrames[Projectile.type]; + int y6 = num214 * Projectile.frame; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override void Kill(int timeLeft) + { + + SoundEngine.PlaySound(SoundID.Item14, Projectile.position); + Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); + Projectile.width = Projectile.height = 200; + Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int dust = ProvUtils.GetDustID(pscState); + + for (int num621 = 0; num621 < 4; num621++) + { + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool()) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 12; num623++) + { + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 3f : 0.5f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f); + Main.dust[num624].velocity *= 2f; + + } + } + } + + #endregion + #endregion } diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 95f996bbaa..586b58d78b 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item25, Projectile.position); int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index f462dff372..2c96352000 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 spawnOffset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(4f, 36f); Dust slime = Dust.NewDustPerfect(Projectile.Center + spawnOffset, 243); - slime.velocity = spawnOffset.RotatedBy(MathHelper.PiOver2 * Main.rand.NextBool(2).ToDirectionInt()) * 0.16f; + slime.velocity = spawnOffset.RotatedBy(MathHelper.PiOver2 * Main.rand.NextBool().ToDirectionInt()) * 0.16f; slime.scale = 1.2f; } } diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs index 432752186c..4e07ee7667 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Vector2 dustVel = shootDirection * dustSpeed; dustVel = dustVel.RotatedBy(-0.35f); dustVel = dustVel.RotatedByRandom(2.0f * 0.35f); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; Dust plasma = Dust.NewDustDirect(Projectile.TopLeft, Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); plasma.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 4f; @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Vector2 dustVel = shootDirection * dustSpeed; dustVel = dustVel.RotatedBy(-0.35f); dustVel = dustVel.RotatedByRandom(2.0f * 0.35f); - int randomDustType = Main.rand.NextBool(2) ? 107 : 110; + int randomDustType = Main.rand.NextBool() ? 107 : 110; Dust plasma = Dust.NewDustDirect(Projectile.TopLeft, Projectile.width, Projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); plasma.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(shootDirection.ToRotation()) * Projectile.width / 5f; diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index 2452049f2e..aa7275298c 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 4f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/VoidConcentrationOrb.cs b/Projectiles/Summon/VoidConcentrationOrb.cs index a2d8127062..c7491c846d 100644 --- a/Projectiles/Summon/VoidConcentrationOrb.cs +++ b/Projectiles/Summon/VoidConcentrationOrb.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[shadow].scale = 0.5f; Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs index be0189e31b..f9e013fb91 100644 --- a/Projectiles/Summon/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/AeroExplosive.cs b/Projectiles/Typeless/AeroExplosive.cs index a16b09d234..a0adffaebd 100644 --- a/Projectiles/Typeless/AeroExplosive.cs +++ b/Projectiles/Typeless/AeroExplosive.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Typeless { int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[smoke].scale = 0.5f; Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 345456431a..abf56a2509 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Typeless { int starryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.2f); Main.dust[starryDust].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[starryDust].scale = 0.5f; Main.dust[starryDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/BlazingStarHeal.cs b/Projectiles/Typeless/BlazingStarHeal.cs index e094391bac..f249d0465e 100644 --- a/Projectiles/Typeless/BlazingStarHeal.cs +++ b/Projectiles/Typeless/BlazingStarHeal.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Typeless int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs index 7b8d5dd2d3..d706f9aa9b 100644 --- a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs +++ b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Typeless int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[holy].velocity *= 3f; Main.dust[holy].noGravity = true; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[holy].scale = 0.5f; Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/ChaoticGeyser.cs b/Projectiles/Typeless/ChaoticGeyser.cs index a30b15ad15..dad02e60d5 100644 --- a/Projectiles/Typeless/ChaoticGeyser.cs +++ b/Projectiles/Typeless/ChaoticGeyser.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 16f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index d496d7dec9..73b1ec37f6 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index 7b3c80544e..3dfcd49d41 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index 2946bbda23..579cb71456 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 199, 0f, 0f, 100, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs index 38c811ba78..d73aa76a73 100644 --- a/Projectiles/Typeless/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ai[0] += 4f; int num462 = 0; float scale = 0.7f; - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(); if (Projectile.ai[1] == 0f) { scale = 1.5f; diff --git a/Projectiles/Typeless/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs index 51258111f5..839ded82f7 100644 --- a/Projectiles/Typeless/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/GoldenGunProj.cs b/Projectiles/Typeless/GoldenGunProj.cs index 24ded7aafd..07b10f848f 100644 --- a/Projectiles/Typeless/GoldenGunProj.cs +++ b/Projectiles/Typeless/GoldenGunProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,15 +39,15 @@ namespace CalamityMod.Projectiles.Typeless int num590 = 6; int num591 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num590, Projectile.position.Y + (float)num590), Projectile.width - num590 * 2, Projectile.height - num590 * 2, 170, 0f, 0f, 75, default, 1.2f); Dust dust = Main.dust[num591]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } @@ -80,19 +80,19 @@ namespace CalamityMod.Projectiles.Typeless { int num363 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 170, 0f, 0f, 75, default, 1.2f); Dust dust = Main.dust[num363]; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.alpha += 25; } - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { dust.scale = 0.6f; } diff --git a/Projectiles/Typeless/HolyExplosion.cs b/Projectiles/Typeless/HolyExplosion.cs index 7392f0cbab..f4923d0adf 100644 --- a/Projectiles/Typeless/HolyExplosion.cs +++ b/Projectiles/Typeless/HolyExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs index 3469e7c19c..7631e2be14 100644 --- a/Projectiles/Typeless/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num622].velocity *= 3f; if (Projectile.ai[0] == 1) Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Typeless int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, Main.rand.NextFloat(1.2f, 1.8f)); Main.dust[num622].velocity *= 3f; Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs index 09251fdd67..38f0457374 100644 --- a/Projectiles/Typeless/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Typeless int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num46].fadeIn = 1.4f; } @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num48].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 55aaf897a8..ee5c35f589 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Typeless int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 234, 0f, 0f, 155, default, 0.8f); Main.dust[idx].velocity *= 0.3f; Main.dust[idx].position = Projectile.Center + offset * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = 1.4f; } @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[idx].velocity *= 0.3f; Main.dust[idx].noGravity = true; Main.dust[idx].position = Projectile.Center + offset * (float)Projectile.width / 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].fadeIn = 1.4f; } diff --git a/Projectiles/Typeless/PauldronDash.cs b/Projectiles/Typeless/PauldronDash.cs index 96f5fe4b58..6ea9a1883e 100644 --- a/Projectiles/Typeless/PauldronDash.cs +++ b/Projectiles/Typeless/PauldronDash.cs @@ -39,12 +39,12 @@ namespace CalamityMod.Projectiles.Typeless for (int i = 0; i <= 8; i++) { - Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); dust.noGravity = false; } for (int i = 0; i <= 5; i++) { - Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); dust2.noGravity = false; } diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index 44fc8e37e4..1db8174d7f 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Typeless public static void FallingSandAI(this Projectile proj, int DustID, bool fired = true) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int i = Dust.NewDust(proj.position, proj.width, proj.height, DustID); Main.dust[i].velocity.X *= 0.4f; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 34efd37972..41fedf1e0e 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index cfadc95d13..6774138de3 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Typeless dust.scale += (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[num200]; diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index 24f9350a7e..2e139843ca 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Typeless/WulfrumLureSignal.cs b/Projectiles/Typeless/WulfrumLureSignal.cs index 10f8b63c78..9616dbe7cb 100644 --- a/Projectiles/Typeless/WulfrumLureSignal.cs +++ b/Projectiles/Typeless/WulfrumLureSignal.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Typeless if (tries < 500) { - int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType() : Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType() ; + int npcToSpawn = Main.rand.NextBool() ? ModContent.NPCType() : Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType() ; int index = NPC.NewNPC(Projectile.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn, Target:player.whoAmI); for (int iy = 0; iy < 16; iy++) diff --git a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs index d1b309b92e..bbb693d06f 100644 --- a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Microsoft.Xna.Framework; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides projectile.velocity += new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); // Flavor fire dust effect. - int dustEffect = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, Main.rand.NextBool(2) ? 1f : -1f, Main.rand.NextBool(2) ? 1f : -1f); + int dustEffect = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, Main.rand.NextBool() ? 1f : -1f, Main.rand.NextBool() ? 1f : -1f); Main.dust[dustEffect].noGravity = true; return false; @@ -125,4 +125,4 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides #endregion } -} \ No newline at end of file +} diff --git a/Tiles/Abyss/AbyssalPots.cs b/Tiles/Abyss/AbyssalPots.cs index 1e83f195c9..15ad3b67e2 100644 --- a/Tiles/Abyss/AbyssalPots.cs +++ b/Tiles/Abyss/AbyssalPots.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = 29; else type = 186; diff --git a/Tiles/Abyss/SulphurousCrateTile.cs b/Tiles/Abyss/SulphurousCrateTile.cs index 5975fdc8d3..bd4281ff65 100644 --- a/Tiles/Abyss/SulphurousCrateTile.cs +++ b/Tiles/Abyss/SulphurousCrateTile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Abyss public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) type = 44; else type = 33; diff --git a/Tiles/Astral/AstralCrateTile.cs b/Tiles/Astral/AstralCrateTile.cs index d4ce1fdae0..9de21644ba 100644 --- a/Tiles/Astral/AstralCrateTile.cs +++ b/Tiles/Astral/AstralCrateTile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Astral public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { type = ModContent.DustType(); } diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index e4cf50203c..a87c5751d0 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Tiles.Crags.Tree //chance to place a branch segment //also dont place branches below a certain threshold - if (Main.rand.NextBool(2) && branchSegmentDelay == 0 && k > 5) + if (Main.rand.NextBool() && branchSegmentDelay == 0 && k > 5) { if (k > 1 && k < 10) { diff --git a/Tiles/Furniture/TwinklerInABottleTile.cs b/Tiles/Furniture/TwinklerInABottleTile.cs index 4d01cc07ec..8a3a69b9c3 100644 --- a/Tiles/Furniture/TwinklerInABottleTile.cs +++ b/Tiles/Furniture/TwinklerInABottleTile.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Tiles.Furniture AdjTiles = new int[] { TileID.HangingLanterns, TileID.FireflyinaBottle, TileID.LightningBuginaBottle }; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 15; diff --git a/Tiles/FurnitureAbyss/AbyssLantern.cs b/Tiles/FurnitureAbyss/AbyssLantern.cs index edaac80a69..458ecc4871 100644 --- a/Tiles/FurnitureAbyss/AbyssLantern.cs +++ b/Tiles/FurnitureAbyss/AbyssLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss public class AbyssLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs index 38fbf7ec9b..0407e43ba6 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood public class AcidwoodLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index ddcddd6fb5..10eb94c4b3 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public class AncientLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index 3a0a81eb60..4c31af5d37 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public class AshenLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureBotanic/BotanicLantern.cs b/Tiles/FurnitureBotanic/BotanicLantern.cs index 67cd6358b2..c1de59b565 100644 --- a/Tiles/FurnitureBotanic/BotanicLantern.cs +++ b/Tiles/FurnitureBotanic/BotanicLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic public class BotanicLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs index 206bc2d0f7..8bb0c90656 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public class CosmiliteLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureEutrophic/EutrophicLantern.cs index 35ba95d681..6d7f2f9066 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public class EutrophicLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureExo/ExoLanternTile.cs b/Tiles/FurnitureExo/ExoLanternTile.cs index a5ffadf6c6..5820a74ed2 100644 --- a/Tiles/FurnitureExo/ExoLanternTile.cs +++ b/Tiles/FurnitureExo/ExoLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureExo public class ExoLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CanExplode(int i, int j) => false; diff --git a/Tiles/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index 245a0e748c..4b4e8d8d3f 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith public class MonolithLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs index 7a37da00d4..4e2caa8128 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly public class OtherworldlyLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs index 891ad168a6..54498835cc 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate public class PlaguedPlateLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 5ec2866a13..93797dadf5 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public class ProfanedLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs index b7feb61a0a..a32d2cec6b 100644 --- a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs +++ b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs @@ -20,17 +20,23 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious Main.tileLavaDeath[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.AnchorBottom = default(AnchorData); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.PlanterBox, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(Type); DustType = -1; TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); } } diff --git a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs index 1d013a5e6e..e07e0f5435 100644 --- a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs +++ b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs @@ -19,18 +19,24 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); TileObjectData.newTile.AnchorBottom = default(AnchorData); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.PlanterBox, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(Type); DustType = -1; TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); } } diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs index f4eb51dc06..1a5883322d 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious public class SacrilegiousLanternTile : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureSilva/SilvaLantern.cs b/Tiles/FurnitureSilva/SilvaLantern.cs index 6a9c8c9082..fbc4f618b7 100644 --- a/Tiles/FurnitureSilva/SilvaLantern.cs +++ b/Tiles/FurnitureSilva/SilvaLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva public class SilvaLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index a8103457db..b8a00bd068 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel public class StatigelLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureStratus/StratusLantern.cs b/Tiles/FurnitureStratus/StratusLantern.cs index 446fbf300b..7f217506b3 100644 --- a/Tiles/FurnitureStratus/StratusLantern.cs +++ b/Tiles/FurnitureStratus/StratusLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus public class StratusLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureVoid/VoidLantern.cs b/Tiles/FurnitureVoid/VoidLantern.cs index ce0854ffc7..75f0dd3f61 100644 --- a/Tiles/FurnitureVoid/VoidLantern.cs +++ b/Tiles/FurnitureVoid/VoidLantern.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid public class VoidLantern : ModTile { public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureWulfrum/WulfrumLantern.cs b/Tiles/FurnitureWulfrum/WulfrumLantern.cs index 8491f92610..7519473955 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLantern.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLantern.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Tiles.FurnitureWulfrum AdjTiles = new int[] { TileID.HangingLanterns }; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); + public override bool CanExplode(int i, int j) => false; public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index d08e438078..661874ac55 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -62,17 +62,7 @@ namespace CalamityMod.Tiles } } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - Tile tile = Main.tile[i, j]; - TileObjectData data = TileObjectData.GetTileData(tile); - int topLeftX = i - tile.TileFrameX / 18 % data.Width; - int topLeftY = j - tile.TileFrameY / 18 % data.Height; - if (WorldGen.IsBelowANonHammeredPlatform(topLeftX, topLeftY)) - { - offsetY -= 8; - } - } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => CalamityUtils.PlatformHangOffset(i, j, ref offsetY); public static int GetBannerNPC(int style) { diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index d7cc036196..911be960cd 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -1251,6 +1251,11 @@ namespace CalamityMod TileObjectData.newTile.LavaDeath = !lavaImmune; TileObjectData.newTile.LavaPlacement = lavaImmune ? LiquidPlacement.Allowed : LiquidPlacement.NotAllowed; TileObjectData.newTile.StyleLineSkip = 2; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.Platform, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawYOffset = -10; + TileObjectData.addAlternate(0); TileObjectData.addTile(mt.Type); // All hanging lanterns count as light sources. @@ -1261,6 +1266,19 @@ namespace CalamityMod mt.AdjTiles = new int[] { TileID.HangingLanterns }; } + // Allow hanging lanterns to move up when hung on platforms + internal static void PlatformHangOffset(int i, int j, ref int offsetY) + { + Tile tile = Main.tile[i, j]; + TileObjectData data = TileObjectData.GetTileData(tile); + int topLeftX = i - tile.TileFrameX / 18 % data.Width; + int topLeftY = j - tile.TileFrameY / 18 % data.Height; + if (WorldGen.IsBelowANonHammeredPlatform(topLeftX, topLeftY)) + { + offsetY -= 8; + } + } + /// /// Extension which initializes a ModTile to be a piano. /// diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 3bfa92bb67..6a294a5d54 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -225,7 +225,7 @@ namespace CalamityMod Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { num3 += 0.05f; } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index d05fd5b673..e0c1c5a7d0 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -56,15 +56,21 @@ namespace CalamityMod // Safety check: If for some reason the debuff array is not initialized yet, return and do nothing. // If the npc is not in the dictionary, return and do nothing. // Also, can I just say that I hate Sorted Dictionaries and Tuples and want to make something explode? -Ben + // I mean you can but sorted dicts and dicts in general are pre great -Amber bool exists = EnemyStats.DebuffImmunities.TryGetValue(npc.type, out var stupidTupleThing); if (npc.ModNPC is null || !exists) return; - // If the npc is immune to everything, make it immune to everything + // If the npc is immune to everything, make it immune to everything, except whips if (stupidTupleThing.Item1) { for (int k = 0; k < npc.buffImmune.Length; k++) - npc.buffImmune[k] = true; + { + if (!BuffID.Sets.IsAnNPCWhipDebuff[k]) + npc.buffImmune[k] = true; + } + NPCDebuffImmunityData debuffData = new NPCDebuffImmunityData { ImmuneToAllBuffsThatAreNotWhips = true }; + NPCID.Sets.DebuffImmunitySets[npc.type] = debuffData; } // Then set debuff vulnerabilities, or immunities if not immune to everything diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index c3750f6de6..3d1f740579 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -391,7 +391,7 @@ namespace CalamityMod { target.AddBuff(buff, SecondsToFrames(timeBase * 3f), false); } - else if (Main.rand.NextBool(2)) + else if (Main.rand.NextBool()) { target.AddBuff(buff, SecondsToFrames(timeBase * 2f), false); } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 926bee0dd5..ff3ca686ae 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -715,7 +715,7 @@ namespace CalamityMod { int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool()) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index f9a33db447..43e939ef2f 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -328,7 +328,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), - new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Granite, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), + new ChestItem((Main.rand.NextBool() && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Granite, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++) @@ -410,7 +410,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.Eggnog, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(200, 349 + 1)), - new ChestItem(Main.rand.NextBool(2) ? ItemID.GasTrap : ItemID.Marshmallow, 1) + new ChestItem(Main.rand.NextBool() ? ItemID.GasTrap : ItemID.Marshmallow, 1) }; } @@ -481,7 +481,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), - new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Marble, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), + new ChestItem((Main.rand.NextBool() && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Marble, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++)