From 7ce69bbe434d1ff336bbef131b6e3e39b1dd8ea4 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 10 May 2020 14:58:41 -0500 Subject: [PATCH] Fixed errors in CalamityPlayer someone else made. Added Death Mode weather projectile frequency config. --- CalPlayer/CalamityPlayer.cs | 4 ++-- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Configs.cs | 8 ++++++++ Projectiles/Boss/IceRain.cs | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5a3c6339ec..795f954a4a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5627,7 +5627,7 @@ namespace CalamityMod.CalPlayer #region Modify Hit By Proj public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit) { - if (CalamityMod.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) + if (CalamityMod.projectileDestroyExceptionList.TrueForAll(x => proj.type != x)) { if (player.HeldItem.type == ModContent.ItemType() && proj.active && proj.hostile && player.altFunctionUse == 2 && Main.rand.NextBool(2)) @@ -5832,7 +5832,7 @@ namespace CalamityMod.CalPlayer //1 second for DM lightning, 2 seconds for Storm Weaver/Cultist lightning } } - if (CalamityMod.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) + if (CalamityMod.projectileDestroyExceptionList.TrueForAll(x => proj.type != x)) { if (projRef && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.NextBool(20)) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3482524556..12508aa88a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -564,7 +564,7 @@ namespace CalamityMod.CalPlayer if (Main.raining) { - float frequencyMult = 1f - Main.cloudAlpha; // 1 to 0.11 + float frequencyMult = (1f - Main.cloudAlpha) * CalamityMod.CalamityConfig.WeatherEffectRateMultiplier; // 3 to 0.055 Vector2 spawnPoint = new Vector2(player.Center.X + (float)Main.rand.Next(-1000, 1001), player.Center.Y - (float)Main.rand.Next(700, 801)); Tile tileSafely = Framing.GetTileSafely((int)(spawnPoint.X / 16f), (int)(spawnPoint.Y / 16f)); diff --git a/Configs.cs b/Configs.cs index f24a56915c..d45ffccf1e 100644 --- a/Configs.cs +++ b/Configs.cs @@ -163,6 +163,14 @@ namespace CalamityMod [Tooltip("Buffs the health of Thorium bosses if Revengeance or Death is enabled")] public bool RevengeanceAndDeathThoriumBossBuff { get; set; } + [Header("Death Mode Changes")] + + [DefaultValue(1f)] + [Range(0.5f, 3f)] + [Label("Weather Effect Rate Multiplier")] + [Tooltip("Affects all Death Mode weather projectiles, increase to decrease the amount of projectiles, decrease to increase the amount of projectiles")] + public float WeatherEffectRateMultiplier { get; set; } + [Header("Boss Rush Curses")] [DefaultValue(false)] diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index 1d66e1582c..86e93a70ad 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0.01f, 0.25f, 0.25f); + Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0f, 0.25f, 0.25f); if (projectile.ai[0] != 2f) projectile.aiStyle = 1;