diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4bf87ee71a..ab0725cc8c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -285,6 +285,9 @@ namespace CalamityMod.CalPlayer public bool DoGLore = false; public bool yharonLore = false; public bool SCalLore = false; + public bool oceanLore = false; + public bool corruptionLore = false; + public bool crimsonLore = false; // Accessory public bool fasterMeleeLevel = false; @@ -1207,6 +1210,9 @@ namespace CalamityMod.CalPlayer DoGLore = false; yharonLore = false; SCalLore = false; + oceanLore = false; + corruptionLore = false; + crimsonLore = false; luxorsGift = false; fungalSymbiote = false; @@ -10431,7 +10437,7 @@ namespace CalamityMod.CalPlayer internal void rollBabSpears(int randAmt, bool chaseable) { - if (player.whoAmI == Main.myPlayer && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable) + if (player.whoAmI == Main.myPlayer && !endoCooper && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable) { int spearsFired = 0; for (int i = 0; i < Main.projectile.Length; i++) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 195fa16e1d..99840a7a3d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -314,7 +314,7 @@ namespace CalamityMod.CalPlayer #region Misc Effects private static void MiscEffects(Player player, CalamityPlayer modPlayer, Mod mod) { - if (modPlayer.stealthUIAlpha > 0f && modPlayer.rogueStealthMax <= 0f) + if (modPlayer.stealthUIAlpha > 0f && (modPlayer.rogueStealth <= 0f || modPlayer.rogueStealthMax <= 0f)) { modPlayer.stealthUIAlpha -= 0.035f; modPlayer.stealthUIAlpha = MathHelper.Clamp(modPlayer.stealthUIAlpha, 0f, 1f); @@ -3517,11 +3517,11 @@ namespace CalamityMod.CalPlayer Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + NPC npc = Main.npc[i]; + if (npc.active && !npc.dontTakeDamage && !npc.friendly && !npc.townNPC && npc.immune[player.whoAmI] <= 0 && npc.damage > 0) { - NPC nPC = Main.npc[i]; - Rectangle rect = nPC.getRect(); - if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + Rectangle rect = npc.getRect(); + if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) { if (Main.rand.NextBool(10) && player.immuneTime <= 0) { diff --git a/CalamityMod.cs b/CalamityMod.cs index 330dfaeb24..60cbeb7690 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -57,6 +57,7 @@ using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; diff --git a/Configs.cs b/Configs.cs index c3fea76d6f..dcd48b0749 100644 --- a/Configs.cs +++ b/Configs.cs @@ -40,6 +40,23 @@ namespace CalamityMod [Tooltip("Enables the visibility of the stealth bar")] public bool StealthBar { get; set; } + [Label("Stealth Meter Position X")] + [Tooltip("Changes the X position of the Stealth Meter")] + [Range(0f, 1660f)] + [DefaultValue(730f)] + public float StealthMeterPosX { get; set; } + + [Label("Stealth Meter Position Y")] + [Tooltip("Changes the Y position of the Stealth Meter")] + [Range(0f, 1100f)] + [DefaultValue(30f)] + public float StealthMeterPosY { get; set; } + + [DefaultValue(false)] + [Label("Meter Position Lock")] + [Tooltip("Prevents the movement of the Adrenaline, Rage and Stealth bars with the Mouse")] + public bool MeterPosLock { get; set; } + [DefaultValue(true)] [Label("Boss Health Bar Small Text")] [Tooltip("Enables the small text below the health bar\nThis displays the exact health amount or remaining boss parts")] @@ -92,33 +109,28 @@ namespace CalamityMod [Label("Rage Meter Position X")] [Tooltip("Changes the X position of the Rage Meter")] - [Range(0f, 1000f)] + [Range(0f, 1660f)] [DefaultValue(500f)] public float RageMeterPosX { get; set; } [Label("Rage Meter Position Y")] [Tooltip("Changes the Y position of the Rage Meter")] - [Range(0f, 1000f)] + [Range(0f, 1100f)] [DefaultValue(30f)] public float RageMeterPosY { get; set; } [Label("Adrenaline Meter Position X")] [Tooltip("Changes the X position of the Adrenaline Meter")] - [Range(0f, 1000f)] + [Range(0f, 1660f)] [DefaultValue(650f)] public float AdrenalineMeterPosX { get; set; } [Label("Adrenaline Meter Position Y")] [Tooltip("Changes the Y position of the Adrenaline Meter")] - [Range(0f, 1000f)] + [Range(0f, 1100f)] [DefaultValue(30f)] public float AdrenalineMeterPosY { get; set; } - [DefaultValue(false)] - [Label("Meter Position Lock")] - [Tooltip("Prevents the movement of the Adrenaline and Rage bars with the Mouse")] - public bool MeterPosLock { get; set; } - [DefaultValue(false)] [Label("Revengeance and Death Thorium Boss buff")] [Tooltip("Buffs the health of Thorium bosses if Revengeance or Death is enabled")] diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index bb5ac445c0..5e73a3b8d1 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -63,18 +63,18 @@ namespace CalamityMod.Events ( ModContent.NPCType(), 1, false ) }; - public static List PossibleMinibossesAS = new List() + public static List<(int, bool)> PossibleMinibossesAS = new List<(int, bool)>() { - ModContent.NPCType() + (ModContent.NPCType(), true) }; - public static List PossibleMinibossesPolter = new List() + public static List<(int, bool)> PossibleMinibossesPolter = new List<(int, bool)>() { - ModContent.NPCType(), - ModContent.NPCType() + (ModContent.NPCType(), true), + (ModContent.NPCType(), false) }; - public static readonly List AllMinibosses = PossibleMinibossesAS.Concat(PossibleMinibossesPolter).Distinct().ToList(); + public static readonly List AllMinibosses = PossibleMinibossesAS.Select(miniboss => miniboss.Item1).ToList().Concat(PossibleMinibossesPolter.Select(miniboss => miniboss.Item1)).Distinct().ToList(); public static bool AnyRainMinibosses { @@ -82,7 +82,8 @@ namespace CalamityMod.Events { for (int i = 0; i < Main.npc.Length; i++) { - if (Main.npc[i].active && (PossibleMinibossesAS.Contains(Main.npc[i].type)) || PossibleMinibossesPolter.Contains(Main.npc[i].type)) + if (Main.npc[i].active && (PossibleMinibossesAS.Select(miniboss => miniboss.Item1).Contains(Main.npc[i].type) || + PossibleMinibossesPolter.Select(miniboss => miniboss.Item1).Contains(Main.npc[i].type))) { return true; } @@ -141,7 +142,7 @@ namespace CalamityMod.Events /// /// Attempts to start the Acid Rain event. Will fail if there is another invasion going on or the EoC has not been killed yet (unless you're in hardmode). /// - public static void TryStartEvent() + public static void TryStartEvent(bool forceRain = false) { if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode) || CalamityWorld.bossRushActive) return; @@ -161,6 +162,19 @@ namespace CalamityMod.Events CalamityWorld.acidRainPoints = (int)(180 * Math.Log(playerCount + Math.E - 1)); // Make it rain normally + if (forceRain) + { + Main.raining = true; + Main.cloudBGActive = 1f; + Main.numCloudsTemp = Main.cloudLimit; + Main.numClouds = Main.numCloudsTemp; + Main.windSpeedTemp = 0.72f; + Main.windSpeedSet = Main.windSpeedTemp; + Main.weatherCounter = 600; + Main.maxRaining = 0.89f; + CalamityWorld.forcedDownpourWithTear = true; + CalamityMod.UpdateServerBoolean(); + } if (CalamityWorld.startAcidicDownpour) { Main.raining = true; @@ -203,7 +217,7 @@ namespace CalamityMod.Events // You will be tempted to turn this into a single if conditional. // Don't do this. Doing so has caused so much misery, with various things being read instead - // of the correct thing, look booleans being mixed up in the sending and receiving process. + // of the correct thing, like booleans being mixed up in the sending and receiving process. // In short, leave this alone. if (Main.netMode == NetmodeID.Server) { diff --git a/Events/AcidRainT2_BossChecklist.png b/Events/AcidRainT2_BossChecklist.png index 75fa9ae23d..22dbb5cc20 100644 Binary files a/Events/AcidRainT2_BossChecklist.png and b/Events/AcidRainT2_BossChecklist.png differ diff --git a/Events/AcidRainT3_BossChecklist.png b/Events/AcidRainT3_BossChecklist.png new file mode 100644 index 0000000000..cff4064a5a Binary files /dev/null and b/Events/AcidRainT3_BossChecklist.png differ diff --git a/Gores/CryoChipGore1.png b/Gores/CryoChipGore1.png new file mode 100644 index 0000000000..904507eeb1 Binary files /dev/null and b/Gores/CryoChipGore1.png differ diff --git a/Gores/CryoChipGore2.png b/Gores/CryoChipGore2.png new file mode 100644 index 0000000000..aaf1693fc1 Binary files /dev/null and b/Gores/CryoChipGore2.png differ diff --git a/Gores/CryoChipGore3.png b/Gores/CryoChipGore3.png new file mode 100644 index 0000000000..d81d455e55 Binary files /dev/null and b/Gores/CryoChipGore3.png differ diff --git a/Gores/CryoDeathGore1.png b/Gores/CryoDeathGore1.png new file mode 100644 index 0000000000..9407be825b Binary files /dev/null and b/Gores/CryoDeathGore1.png differ diff --git a/Gores/CryoDeathGore2.png b/Gores/CryoDeathGore2.png new file mode 100644 index 0000000000..c8e6178908 Binary files /dev/null and b/Gores/CryoDeathGore2.png differ diff --git a/Gores/CryoDeathGore3.png b/Gores/CryoDeathGore3.png new file mode 100644 index 0000000000..f79742d318 Binary files /dev/null and b/Gores/CryoDeathGore3.png differ diff --git a/Gores/CryoGore1.png b/Gores/CryoGore1.png deleted file mode 100644 index aa6a4d0f2b..0000000000 Binary files a/Gores/CryoGore1.png and /dev/null differ diff --git a/Gores/CryoGore10.png b/Gores/CryoGore10.png deleted file mode 100644 index c48f9449ca..0000000000 Binary files a/Gores/CryoGore10.png and /dev/null differ diff --git a/Gores/CryoGore2.png b/Gores/CryoGore2.png deleted file mode 100644 index 1773da8509..0000000000 Binary files a/Gores/CryoGore2.png and /dev/null differ diff --git a/Gores/CryoGore3.png b/Gores/CryoGore3.png deleted file mode 100644 index a1b065d30a..0000000000 Binary files a/Gores/CryoGore3.png and /dev/null differ diff --git a/Gores/CryoGore4.png b/Gores/CryoGore4.png deleted file mode 100644 index 42d55c2032..0000000000 Binary files a/Gores/CryoGore4.png and /dev/null differ diff --git a/Gores/CryoGore5.png b/Gores/CryoGore5.png deleted file mode 100644 index a903261431..0000000000 Binary files a/Gores/CryoGore5.png and /dev/null differ diff --git a/Gores/CryoGore6.png b/Gores/CryoGore6.png deleted file mode 100644 index f975cb7084..0000000000 Binary files a/Gores/CryoGore6.png and /dev/null differ diff --git a/Gores/CryoGore7.png b/Gores/CryoGore7.png deleted file mode 100644 index 56dde6cf9a..0000000000 Binary files a/Gores/CryoGore7.png and /dev/null differ diff --git a/Gores/CryoGore8.png b/Gores/CryoGore8.png deleted file mode 100644 index cecad5837e..0000000000 Binary files a/Gores/CryoGore8.png and /dev/null differ diff --git a/Gores/CryoGore9.png b/Gores/CryoGore9.png deleted file mode 100644 index b821b01c11..0000000000 Binary files a/Gores/CryoGore9.png and /dev/null differ diff --git a/Gores/CryoShieldGore1.png b/Gores/CryoShieldGore1.png new file mode 100644 index 0000000000..8f6874dfa7 Binary files /dev/null and b/Gores/CryoShieldGore1.png differ diff --git a/Gores/CryoShieldGore2.png b/Gores/CryoShieldGore2.png new file mode 100644 index 0000000000..018a05bcbd Binary files /dev/null and b/Gores/CryoShieldGore2.png differ diff --git a/Gores/CryoShieldGore3.png b/Gores/CryoShieldGore3.png new file mode 100644 index 0000000000..c474411b10 Binary files /dev/null and b/Gores/CryoShieldGore3.png differ diff --git a/Gores/CryoShieldGore4.png b/Gores/CryoShieldGore4.png new file mode 100644 index 0000000000..6c0779a977 Binary files /dev/null and b/Gores/CryoShieldGore4.png differ diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index 329e491131..15eb77fb3c 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -11,13 +11,13 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Cryo Stone"); Tooltip.SetDefault("One of the ancient relics\n" + "Increases damage reduction by 5% and all damage by 3%"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 5)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(4, 4)); } public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 40; + item.height = 40; item.value = Item.buyPrice(0, 15, 0, 0); item.rare = 5; item.defense = 6; diff --git a/Items/Accessories/CryoStone.png b/Items/Accessories/CryoStone.png index 996686a0cb..3d99e9fbcd 100644 Binary files a/Items/Accessories/CryoStone.png and b/Items/Accessories/CryoStone.png differ diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index b9b8a24c37..941cf1dcc7 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories "Being below 25% life grants the player 10 defense and 15% increased max movement speed and acceleration\n" + "Provides heat and cold protection in Death Mode\n" + "Revengeance drop"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 10)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); } public override void SetDefaults() diff --git a/Items/Accessories/FrostFlare.png b/Items/Accessories/FrostFlare.png index e868973ad7..3063824fcb 100644 Binary files a/Items/Accessories/FrostFlare.png and b/Items/Accessories/FrostFlare.png differ diff --git a/Items/Accessories/GoldBurdenBreaker.cs b/Items/Accessories/GoldBurdenBreaker.cs index e1e72baec3..7924d28bdf 100644 --- a/Items/Accessories/GoldBurdenBreaker.cs +++ b/Items/Accessories/GoldBurdenBreaker.cs @@ -1,4 +1,6 @@ -using CalamityMod.NPCs; +using CalamityMod.CalPlayer; +using CalamityMod.NPCs; +using CalamityMod.World; using Terraria; using Terraria.ModLoader; @@ -27,8 +29,11 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - if (CalamityGlobalNPC.AnyBossNPCS()) + if (CalamityPlayer.areThereAnyDamnBosses) { return; } + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.dashMod = modPlayer.dashMod == 7 ? 0 : modPlayer.dashMod; //statis belt memes for projectile spam :feelsgreat: + if (player.velocity.X > 5f) { player.velocity.X *= 1.025f; diff --git a/Items/Accessories/ScuttlersJewel.cs b/Items/Accessories/ScuttlersJewel.cs index 6fa0ff6283..c01bd63a66 100644 --- a/Items/Accessories/ScuttlersJewel.cs +++ b/Items/Accessories/ScuttlersJewel.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Scuttler's Jewel"); - Tooltip.SetDefault("Rogue javelin projectiles have a chance spawn a jewel spike when destroyed"); + Tooltip.SetDefault("Rogue javelin projectiles have a chance to spawn a jewel spike when destroyed"); } public override void SetDefaults() diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index ce26fb4d85..5ae9c73599 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories.Wings "All melee attacks and projectiles inflict frostburn\n" + "Icicles rain down as you fly\n" + "Provides heat and cold protection in Death Mode"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 3)); } public override void SetDefaults() diff --git a/Items/Accessories/Wings/SoulofCryogen.png b/Items/Accessories/Wings/SoulofCryogen.png index 712c79d439..3dfe0c6f18 100644 Binary files a/Items/Accessories/Wings/SoulofCryogen.png and b/Items/Accessories/Wings/SoulofCryogen.png differ diff --git a/Items/Armor/Vanity/CryogenMask.png b/Items/Armor/Vanity/CryogenMask.png index 34a74d6572..2526886f2f 100644 Binary files a/Items/Armor/Vanity/CryogenMask.png and b/Items/Armor/Vanity/CryogenMask.png differ diff --git a/Items/Armor/Vanity/CryogenMask_Head.png b/Items/Armor/Vanity/CryogenMask_Head.png index 797cf0a72c..cf3de4a113 100644 Binary files a/Items/Armor/Vanity/CryogenMask_Head.png and b/Items/Armor/Vanity/CryogenMask_Head.png differ diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 7c16239701..e4d965dc09 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodfin"); - Tooltip.SetDefault(@"Grants a buff that boosts life regen for 10 seconds -The life regen boost is stronger if below 75% health -Angiogenesis"); + Tooltip.SetDefault(@"The wonders of angiogenesis +Grants a buff that boosts life regen for 10 seconds +The life regen boost is stronger if below 75% health"); } public override void SetDefaults() @@ -34,10 +34,7 @@ Angiogenesis"); item.potion = true; } - public override bool CanUseItem(Player player) - { - return player.FindBuffIndex(BuffID.PotionSickness) == -1; - } + public override bool CanUseItem(Player player) => player.FindBuffIndex(BuffID.PotionSickness) == -1; public override void OnConsumeItem(Player player) { diff --git a/Items/LoreItems/KnowledgeCorruption.cs b/Items/LoreItems/KnowledgeCorruption.cs index 122f31f421..a8709930c5 100644 --- a/Items/LoreItems/KnowledgeCorruption.cs +++ b/Items/LoreItems/KnowledgeCorruption.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.CalPlayer; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.LoreItems @@ -9,7 +10,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("The Corruption"); Tooltip.SetDefault("The rotten and forever-deteriorating landscape of infected life, brought upon by a deadly microbe long ago.\n" + - "It is rumored that the microbe was created through experimentation by a long-dead race, predating the Terrarians."); + "It is rumored that the microbe was created through experimentation by a long-dead race, predating the Terrarians.\n" + + "Place in your inventory to prevent the hive cysts from spawning."); } public override void SetDefaults() @@ -24,5 +26,11 @@ namespace CalamityMod.Items.LoreItems { return false; } + + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.corruptionLore = true; + } } } diff --git a/Items/LoreItems/KnowledgeCrimson.cs b/Items/LoreItems/KnowledgeCrimson.cs index 4ce721a3bd..a0941df4a0 100644 --- a/Items/LoreItems/KnowledgeCrimson.cs +++ b/Items/LoreItems/KnowledgeCrimson.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.CalPlayer; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.LoreItems @@ -9,7 +10,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("The Crimson"); Tooltip.SetDefault("This bloody hell, spawned from a formless mass of flesh that fell from the stars eons ago.\n" + - "It is now home to many hideous creatures, spawned from the pumping blood and lurching organs deep within."); + "It is now home to many hideous creatures, spawned from the pumping blood and lurching organs deep within.\n" + + "Place in your inventory to prevent the perforator cysts from spawning."); } public override void SetDefaults() @@ -24,5 +26,11 @@ namespace CalamityMod.Items.LoreItems { return false; } + + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.crimsonLore = true; + } } } diff --git a/Items/LoreItems/KnowledgeCryogen.png b/Items/LoreItems/KnowledgeCryogen.png index 5e09a7e601..2e06d445ba 100644 Binary files a/Items/LoreItems/KnowledgeCryogen.png and b/Items/LoreItems/KnowledgeCryogen.png differ diff --git a/Items/LoreItems/KnowledgeOcean.cs b/Items/LoreItems/KnowledgeOcean.cs index 33f858bc69..0159a2a75d 100644 --- a/Items/LoreItems/KnowledgeOcean.cs +++ b/Items/LoreItems/KnowledgeOcean.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.CalPlayer; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.LoreItems @@ -9,7 +10,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("The Ocean"); Tooltip.SetDefault("Take care to not disturb the deep waters of this world.\n" + - "You may awaken something more terrifying than death itself."); + "You may awaken something more terrifying than death itself.\n" + + "Place in your inventory to prevent the mysterious siren lure from spawning."); } public override void SetDefaults() @@ -24,5 +26,11 @@ namespace CalamityMod.Items.LoreItems { return false; } + + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.oceanLore = true; + } } } diff --git a/Items/Materials/Acidwood.png b/Items/Materials/Acidwood.png index b9ce4603be..82bc081c82 100644 Binary files a/Items/Materials/Acidwood.png and b/Items/Materials/Acidwood.png differ diff --git a/Items/Materials/CryoBar.png b/Items/Materials/CryoBar.png index c5ca9a3c1d..a26ccbab74 100644 Binary files a/Items/Materials/CryoBar.png and b/Items/Materials/CryoBar.png differ diff --git a/Items/Placeables/Furniture/Trophies/CryogenTrophy.png b/Items/Placeables/Furniture/Trophies/CryogenTrophy.png index 8bf385bc9c..fdf05cf132 100644 Binary files a/Items/Placeables/Furniture/Trophies/CryogenTrophy.png and b/Items/Placeables/Furniture/Trophies/CryogenTrophy.png differ diff --git a/Items/SummonItems/CryoKey.png b/Items/SummonItems/CryoKey.png index c92ac1e684..eb924ac4ad 100644 Binary files a/Items/SummonItems/CryoKey.png and b/Items/SummonItems/CryoKey.png differ diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs index 633257da91..c20bf87364 100644 --- a/Items/SummonItems/Invasion/CausticTear.cs +++ b/Items/SummonItems/Invasion/CausticTear.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.SummonItems.Invasion public override bool UseItem(Player player) { - AcidRainEvent.TryStartEvent(); + CalamityMod.UpdateServerBoolean(); + AcidRainEvent.TryStartEvent(true); return true; } } diff --git a/Items/SummonItems/Invasion/CausticTearNonConsumable.cs b/Items/SummonItems/Invasion/CausticTearNonConsumable.cs index 3671db6856..0ce49c855e 100644 --- a/Items/SummonItems/Invasion/CausticTearNonConsumable.cs +++ b/Items/SummonItems/Invasion/CausticTearNonConsumable.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.SummonItems.Invasion { if (!CalamityWorld.rainingAcid) { - AcidRainEvent.TryStartEvent(); + AcidRainEvent.TryStartEvent(true); } else { diff --git a/Items/Tools/FlamebeakHampick.cs b/Items/Tools/FlamebeakHampick.cs index cce946278b..cfe91e3a42 100644 --- a/Items/Tools/FlamebeakHampick.cs +++ b/Items/Tools/FlamebeakHampick.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Tools private static int HammerPower = 130; public override void SetStaticDefaults() { - DisplayName.SetDefault("Flamebeak Hampick"); + DisplayName.SetDefault("Seismic Hampick"); Tooltip.SetDefault(@"Capable of mining Lihzahrd Bricks Left click to use as a pickaxe Right click to use as a hammer"); diff --git a/Items/TreasureBags/CryogenBag.png b/Items/TreasureBags/CryogenBag.png index fce610a0a5..2591195666 100644 Binary files a/Items/TreasureBags/CryogenBag.png and b/Items/TreasureBags/CryogenBag.png differ diff --git a/Items/Weapons/Magic/BittercoldStaff.png b/Items/Weapons/Magic/BittercoldStaff.png index 80eec4cc57..b5e111264f 100644 Binary files a/Items/Weapons/Magic/BittercoldStaff.png and b/Items/Weapons/Magic/BittercoldStaff.png differ diff --git a/Items/Weapons/Magic/SnowstormStaff.png b/Items/Weapons/Magic/SnowstormStaff.png index 15b88a52f8..3de7de8742 100644 Binary files a/Items/Weapons/Magic/SnowstormStaff.png and b/Items/Weapons/Magic/SnowstormStaff.png differ diff --git a/Items/Weapons/Melee/AccretionDiskMelee.cs b/Items/Weapons/Melee/AccretionDiskMelee.cs index 23206b8a26..1eadd4f954 100644 --- a/Items/Weapons/Melee/AccretionDiskMelee.cs +++ b/Items/Weapons/Melee/AccretionDiskMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,11 +31,18 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 38; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 13f; item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/Avalanche.png b/Items/Weapons/Melee/Avalanche.png index 6c7c5fb9c4..66aabe640b 100644 Binary files a/Items/Weapons/Melee/Avalanche.png and b/Items/Weapons/Melee/Avalanche.png differ diff --git a/Items/Weapons/Melee/CatastropheClaymore.cs b/Items/Weapons/Melee/CatastropheClaymore.cs index ab3bd85183..556abda6b2 100644 --- a/Items/Weapons/Melee/CatastropheClaymore.cs +++ b/Items/Weapons/Melee/CatastropheClaymore.cs @@ -35,20 +35,13 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - switch (Main.rand.Next(3)) - { - case 0: - type = ModContent.ProjectileType(); - break; - case 1: - type = ModContent.ProjectileType(); - break; - case 2: - type = ModContent.ProjectileType(); - break; - default: - break; - } + type = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); return false; } diff --git a/Items/Weapons/Melee/Chaotrix.cs b/Items/Weapons/Melee/Chaotrix.cs index a0fbe0b00a..1a35401fe1 100644 --- a/Items/Weapons/Melee/Chaotrix.cs +++ b/Items/Weapons/Melee/Chaotrix.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Chaotrix"); + DisplayName.SetDefault("Fault Line"); Tooltip.SetDefault("Explodes on enemy hits\n" + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; diff --git a/Items/Weapons/Melee/CorpusAvertorMelee.cs b/Items/Weapons/Melee/CorpusAvertorMelee.cs index f5834482e5..768a0e7aa4 100644 --- a/Items/Weapons/Melee/CorpusAvertorMelee.cs +++ b/Items/Weapons/Melee/CorpusAvertorMelee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index bc3516e8d7..06c9fab271 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 58; - item.damage = 55; + item.damage = 33; item.melee = true; item.useAnimation = 24; item.useStyle = 1; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { type = Main.rand.NextBool(2) ? type : ModContent.ProjectileType(); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)((double)damage * 0.6), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Melee/DepthBlade.cs b/Items/Weapons/Melee/DepthBlade.cs index b0822caff3..0cd1dad426 100644 --- a/Items/Weapons/Melee/DepthBlade.cs +++ b/Items/Weapons/Melee/DepthBlade.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; - item.hammer = 70; + item.hammer = 50; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 9aecc3eeae..279009840b 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; diff --git a/Items/Weapons/Melee/EradicatorMelee.cs b/Items/Weapons/Melee/EradicatorMelee.cs index 3814e11695..31f6afb425 100644 --- a/Items/Weapons/Melee/EradicatorMelee.cs +++ b/Items/Weapons/Melee/EradicatorMelee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -31,11 +31,18 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 54; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Vector2 origin = new Vector2(31f, 29f); diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index 2abf3230d7..838bf0e9f9 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Exsanguination Lance"); + DisplayName.SetDefault("Vulcanite Lance"); Tooltip.SetDefault("Explodes on enemy hits and summons homing flares on critical hits"); } diff --git a/Items/Weapons/Melee/FlameScytheMelee.cs b/Items/Weapons/Melee/FlameScytheMelee.cs index 3f423d2b20..3d88b310f4 100644 --- a/Items/Weapons/Melee/FlameScytheMelee.cs +++ b/Items/Weapons/Melee/FlameScytheMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flame Scythe"); + DisplayName.SetDefault("Subduction Slicer"); Tooltip.SetDefault("Throws a scythe that explodes on enemy hits"); } @@ -30,10 +31,17 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 48; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 16f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/GalaxySmasherMelee.cs b/Items/Weapons/Melee/GalaxySmasherMelee.cs index 9f4639f092..3c7b87bc71 100644 --- a/Items/Weapons/Melee/GalaxySmasherMelee.cs +++ b/Items/Weapons/Melee/GalaxySmasherMelee.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/GlacialCrusher.png b/Items/Weapons/Melee/GlacialCrusher.png index 1e7dfd3c37..af07fe060d 100644 Binary files a/Items/Weapons/Melee/GlacialCrusher.png and b/Items/Weapons/Melee/GlacialCrusher.png differ diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.cs b/Items/Weapons/Melee/KelvinCatalystMelee.cs index e069ce832b..60abe63ddf 100644 --- a/Items/Weapons/Melee/KelvinCatalystMelee.cs +++ b/Items/Weapons/Melee/KelvinCatalystMelee.cs @@ -4,7 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Melee/MangroveChakramMelee.cs b/Items/Weapons/Melee/MangroveChakramMelee.cs index 02889a7b8e..b2c51b0be1 100644 --- a/Items/Weapons/Melee/MangroveChakramMelee.cs +++ b/Items/Weapons/Melee/MangroveChakramMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,10 +30,17 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 38; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 16f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/NanoblackReaperMelee.cs b/Items/Weapons/Melee/NanoblackReaperMelee.cs index a5e26f0b0a..1b869aecba 100644 --- a/Items/Weapons/Melee/NanoblackReaperMelee.cs +++ b/Items/Weapons/Melee/NanoblackReaperMelee.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/PwnagehammerMelee.cs b/Items/Weapons/Melee/PwnagehammerMelee.cs index 3b70273a77..60f28b067f 100644 --- a/Items/Weapons/Melee/PwnagehammerMelee.cs +++ b/Items/Weapons/Melee/PwnagehammerMelee.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,10 +30,17 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 68; item.value = Item.buyPrice(0, 48, 0, 0); item.rare = 6; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index 15a73c77b2..c5112d6e8a 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/SeashellBoomerangMelee.cs b/Items/Weapons/Melee/SeashellBoomerangMelee.cs index 0a748e3ef5..79febc672a 100644 --- a/Items/Weapons/Melee/SeashellBoomerangMelee.cs +++ b/Items/Weapons/Melee/SeashellBoomerangMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,10 +29,17 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 34; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 11.5f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/StellarContemptMelee.cs b/Items/Weapons/Melee/StellarContemptMelee.cs index 716cea5214..49ab290972 100644 --- a/Items/Weapons/Melee/StellarContemptMelee.cs +++ b/Items/Weapons/Melee/StellarContemptMelee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/StormRuler.cs b/Items/Weapons/Melee/StormRuler.cs index fddf99b370..44889f4bbf 100644 --- a/Items/Weapons/Melee/StormRuler.cs +++ b/Items/Weapons/Melee/StormRuler.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 74; - item.damage = 95; + item.damage = 80; item.melee = true; item.useAnimation = 25; item.useTime = 25; diff --git a/Items/Weapons/Melee/TerraDiskMelee.cs b/Items/Weapons/Melee/TerraDiskMelee.cs index 62f0b29536..83ff1603bd 100644 --- a/Items/Weapons/Melee/TerraDiskMelee.cs +++ b/Items/Weapons/Melee/TerraDiskMelee.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index 2bfb276451..ba5e4479cd 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,11 +32,18 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 160; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; item.Calamity().customRarity = CalamityRarity.Developer; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs index 3f428a7161..22f27ca5af 100644 --- a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs +++ b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,10 +31,17 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 28; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index 8cfe3189e9..2b22d5f43d 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -61,25 +61,15 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int card = ModContent.ProjectileType(); - switch (Main.rand.Next(4)) - { - case 0: - card = ModContent.ProjectileType(); - break; - case 1: - card = ModContent.ProjectileType(); - break; - case 2: - card = ModContent.ProjectileType(); - break; - case 3: - card = ModContent.ProjectileType(); - break; - default: - break; - } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, card, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + int card = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }); + + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, card, damage, knockBack, player.whoAmI, 0f, 0f); return false; } } diff --git a/Items/Weapons/Ranged/EffluviumBow.png b/Items/Weapons/Ranged/EffluviumBow.png index 4821396777..f7ab0c0429 100644 Binary files a/Items/Weapons/Ranged/EffluviumBow.png and b/Items/Weapons/Ranged/EffluviumBow.png differ diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index bde6567295..6ed6729314 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public override void SetStaticDefaults() { - DisplayName.SetDefault("Greatbow of Turmoil"); + DisplayName.SetDefault("Continental Greatbow"); Tooltip.SetDefault("Wooden arrows are set alight with fire\n" + "Fires 3 arrows at once\n" + "Fires 2 additional cursed, hellfire, or ichor arrows"); diff --git a/Items/Weapons/Rogue/AccretionDisk.cs b/Items/Weapons/Rogue/AccretionDisk.cs index 3dd455302b..32da2c5c22 100644 --- a/Items/Weapons/Rogue/AccretionDisk.cs +++ b/Items/Weapons/Rogue/AccretionDisk.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 855a99e517..2b5627bb41 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index c636b2f43e..f114c903d6 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 64310e3584..21d7a99cbc 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Items/Weapons/Rogue/FlameScythe.cs b/Items/Weapons/Rogue/FlameScythe.cs index 0e4f29e819..f717c72d5f 100644 --- a/Items/Weapons/Rogue/FlameScythe.cs +++ b/Items/Weapons/Rogue/FlameScythe.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flame Scythe"); + DisplayName.SetDefault("Subduction Slicer"); Tooltip.SetDefault("Throws a scythe that explodes on enemy hits"); } diff --git a/Items/Weapons/Rogue/GalaxySmasherRogue.cs b/Items/Weapons/Rogue/GalaxySmasherRogue.cs index 8230867646..f5bbadb4c6 100644 --- a/Items/Weapons/Rogue/GalaxySmasherRogue.cs +++ b/Items/Weapons/Rogue/GalaxySmasherRogue.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/IceStar.png b/Items/Weapons/Rogue/IceStar.png index ec834cdfa5..c71cf0bd49 100644 Binary files a/Items/Weapons/Rogue/IceStar.png and b/Items/Weapons/Rogue/IceStar.png differ diff --git a/Items/Weapons/Rogue/Icebreaker.png b/Items/Weapons/Rogue/Icebreaker.png index 7839c05097..2b21544257 100644 Binary files a/Items/Weapons/Rogue/Icebreaker.png and b/Items/Weapons/Rogue/Icebreaker.png differ diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index ab79e1d97b..aa4384ba5b 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -4,7 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index a6fb666d1b..5a0d797ec6 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/NanoblackReaperRogue.cs b/Items/Weapons/Rogue/NanoblackReaperRogue.cs index a4234a6dd9..c2ea74d77f 100644 --- a/Items/Weapons/Rogue/NanoblackReaperRogue.cs +++ b/Items/Weapons/Rogue/NanoblackReaperRogue.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/Pwnagehammer.cs b/Items/Weapons/Rogue/Pwnagehammer.cs index b8fcc62704..22c306977d 100644 --- a/Items/Weapons/Rogue/Pwnagehammer.cs +++ b/Items/Weapons/Rogue/Pwnagehammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index 393a9b41ac..07806dd396 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/SeashellBoomerang.cs b/Items/Weapons/Rogue/SeashellBoomerang.cs index d2a608bff1..cd9eb3a0c4 100644 --- a/Items/Weapons/Rogue/SeashellBoomerang.cs +++ b/Items/Weapons/Rogue/SeashellBoomerang.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/StellarContemptRogue.cs b/Items/Weapons/Rogue/StellarContemptRogue.cs index 8e410b1a3e..307f59266f 100644 --- a/Items/Weapons/Rogue/StellarContemptRogue.cs +++ b/Items/Weapons/Rogue/StellarContemptRogue.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index f1a3b5f415..84124fafee 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs index 355add4068..cc7d1d8545 100644 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.cs b/Items/Weapons/Rogue/TruePaladinsHammer.cs index 8ef4ef2c1d..d8bfd06b6b 100644 --- a/Items/Weapons/Rogue/TruePaladinsHammer.cs +++ b/Items/Weapons/Rogue/TruePaladinsHammer.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index 46a9c0fd19..d75c63b183 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -43,33 +43,33 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position.X, position.Y, (int)((double)speedX * 1.2), (int)((double)speedY * 1.2), ModContent.ProjectileType(), (int)(damage * 1.4), knockBack, Main.myPlayer); - Main.projectile[p].Calamity().stealthStrike = true; - if (Main.rand.NextBool(3)) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 1.1), knockBack * 2f, Main.myPlayer); - } - else if (Main.rand.NextBool(2)) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 1.2), knockBack, Main.myPlayer); - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, Main.myPlayer); - } - } - else if (Main.rand.NextBool(3)) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 1.1), knockBack * 2f, Main.myPlayer); - } - else if (Main.rand.NextBool(2)) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 1.2), knockBack, Main.myPlayer); - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, Main.myPlayer); + int stealth = Projectile.NewProjectile(position.X, position.Y, speedX * 1.2f, speedY * 1.2f, ModContent.ProjectileType(), (int)(damage * 1.4), knockBack, Main.myPlayer); + Main.projectile[stealth].Calamity().stealthStrike = true; } + int utensil = item.shoot; + float dmgMult = 1f; + float kbMult = 1f; + switch (Main.rand.Next(3)) + { + case 0: + utensil = item.shoot; + dmgMult = 1.1f; + kbMult = 2f; + break; + case 1: + utensil = ModContent.ProjectileType(); + dmgMult = 1.2f; + kbMult = 1f; + break; + case 2: + utensil = ModContent.ProjectileType(); + dmgMult = 1f; + kbMult = 1f; + break; + default: + break; + } + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, utensil, (int)(damage * dmgMult), knockBack * kbMult, Main.myPlayer); return false; } } diff --git a/Items/Weapons/Summon/CinderBlossomStaff.cs b/Items/Weapons/Summon/CinderBlossomStaff.cs index e3c1587ec0..98c146c24c 100644 --- a/Items/Weapons/Summon/CinderBlossomStaff.cs +++ b/Items/Weapons/Summon/CinderBlossomStaff.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Fireblossom, 5); - recipe.AddIngredient(ItemID.LavaBucket, 10); + recipe.AddIngredient(ItemID.LavaBucket, 2); recipe.AddIngredient(ItemID.HellstoneBar, 10); recipe.SetResult(this); recipe.AddTile(TileID.Anvils); diff --git a/Items/Weapons/Typeless/AethersWhisper.cs b/Items/Weapons/Typeless/AethersWhisper.cs index 803413a8ad..1404877502 100644 --- a/Items/Weapons/Typeless/AethersWhisper.cs +++ b/Items/Weapons/Typeless/AethersWhisper.cs @@ -1,7 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 56222ab4f1..8676aee509 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -560,7 +560,7 @@ namespace CalamityMod { InvasionDifficulty.TryGetValue("Acid Rain Aquatic Scourge", out float order); List enemies = AcidRainEvent.PossibleEnemiesAS.Select(enemy => enemy.Item1).ToList(); - enemies.Add(ModContent.NPCType()); + enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Item1)); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; @@ -574,13 +574,13 @@ namespace CalamityMod { InvasionDifficulty.TryGetValue("Acid Rain Polterghast", out float order); List enemies = AcidRainEvent.PossibleEnemiesPolter.Select(enemy => enemy.Item1).ToList(); - enemies.Add(ModContent.NPCType()); + enemies.AddRange(AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Item1)); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{summon}] or wait for the invasion to occur naturally after the Polterghast is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); - string bossLogTex = "CalamityMod/Events/AcidRainT2_BossChecklist"; + string bossLogTex = "CalamityMod/Events/AcidRainT3_BossChecklist"; string iconTexture = "CalamityMod/ExtraTextures/UI/AcidRainIcon"; AddInvasion(bossChecklist, calamity, "Acid Rain (Post-Polter)", order, enemies, DownedBoomerDuke, summon, loot, collection, instructions, despawn, bossLogTex, iconTexture); } diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 494f0ad7d2..d1784cbf3b 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,12 +30,14 @@ namespace CalamityMod.NPCs.AcidRain if (CalamityWorld.downedPolterghast) { + npc.Calamity().DR = 0.3f; npc.damage = 160; npc.lifeMax = 6650; npc.defense = 45; } else if (CalamityWorld.downedAquaticScourge) { + npc.Calamity().DR = 0.1f; npc.damage = 80; npc.lifeMax = 705; } @@ -61,7 +64,18 @@ namespace CalamityMod.NPCs.AcidRain if (Main.rand.NextBool(480)) Main.PlaySound(SoundID.Zombie, npc.Center, 32); // Slither sound - if (npc.wet) + if (npc.ai[2] == 0f && !npc.wet) + { + npc.netUpdate = true; + npc.ai[2] = 1f; + } + if (npc.ai[2] == 1f && npc.wet) + { + npc.netUpdate = true; + npc.ai[2] = 0f; + } + + if (npc.ai[2] == 0f) { npc.ai[1] += 1f; if (npc.ai[1] % 150f == 0f || npc.direction == 0) @@ -87,7 +101,26 @@ namespace CalamityMod.NPCs.AcidRain npc.spriteDirection = npc.direction; npc.velocity.Y += (Main.player[npc.target].position.Y > npc.position.Y).ToDirectionInt() * yAcceleration; - npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-maxSpeedX, -maxSpeedY), new Vector2(maxSpeedX, maxSpeedY)); + if (npc.velocity.X > maxSpeedX) + { + npc.velocity.X = maxSpeedX; + npc.netUpdate = true; + } + if (npc.velocity.X < -maxSpeedX) + { + npc.velocity.X = -maxSpeedX; + npc.netUpdate = true; + } + if (npc.velocity.Y > maxSpeedY) + { + npc.velocity.Y = maxSpeedY; + npc.netUpdate = true; + } + if (npc.velocity.Y < -maxSpeedY) + { + npc.velocity.Y = -maxSpeedY; + npc.netUpdate = true; + } npc.rotation = npc.velocity.X * 0.02f; } else @@ -119,6 +152,10 @@ namespace CalamityMod.NPCs.AcidRain } } } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture + "Glow"), npc); + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); diff --git a/NPCs/AcidRain/AcidEelGlow.png b/NPCs/AcidRain/AcidEelGlow.png new file mode 100644 index 0000000000..14e5183f3a Binary files /dev/null and b/NPCs/AcidRain/AcidEelGlow.png differ diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 25fc4f3028..6628ac50fb 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -140,9 +140,9 @@ namespace CalamityMod.NPCs.AcidRain if (!Phase2) { - npc.Calamity().DR = 0.5f; + npc.Calamity().DR = 0.4f; if (!player.wet) - npc.Calamity().DR = 0.8f; + npc.Calamity().DR = 0.6f; npc.HitSound = SoundID.NPCHit42; if (npc.ai[0] % 420f < 240f) { diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index 4859c7e6c1..9ffc0ecd5c 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -28,9 +28,13 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 0; npc.lifeMax = 700; + npc.aiStyle = aiType = -1; + npc.Calamity().DR = 0.15f; + if (CalamityWorld.downedPolterghast) { npc.lifeMax = 7500; + npc.Calamity().DR = 0.4f; } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 5c0bbcbd76..a3d47365f0 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -26,10 +26,11 @@ namespace CalamityMod.NPCs.AcidRain public override void SetDefaults() { npc.width = 40; - npc.height = 30; + npc.height = 44; npc.damage = 145; npc.lifeMax = 6410; + npc.Calamity().DR = 0.25f; npc.defense = 50; npc.aiStyle = aiType = -1; @@ -190,6 +191,7 @@ namespace CalamityMod.NPCs.AcidRain float opacity = MathHelper.Lerp(0.3f, 0.9f, (npc.ai[3] - 480f) / 60f); Utils.DrawLine(spriteBatch, npc.Top + new Vector2(0f, 4f), npc.Top + new Vector2(0f, 4f) - Vector2.UnitY * length, Color.Lerp(Color.Lime, Color.Transparent, opacity)); } + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture + "Glow"), npc); } public override void NPCLoot() diff --git a/NPCs/AcidRain/GammaSlimeGlow.png b/NPCs/AcidRain/GammaSlimeGlow.png new file mode 100644 index 0000000000..8c5ee1e1f7 Binary files /dev/null and b/NPCs/AcidRain/GammaSlimeGlow.png differ diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 3866837a48..8863f8bb6c 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -24,17 +25,11 @@ namespace CalamityMod.NPCs.AcidRain npc.width = 40; npc.height = 30; + npc.Calamity().DR = 0.15f; npc.damage = 75; npc.lifeMax = 640; npc.defense = 5; - if (CalamityWorld.downedPolterghast) - { - npc.damage = 245; - npc.lifeMax = 5995; - npc.defense = 60; - } - npc.knockBackResist = 0f; animationType = 81; for (int k = 0; k < npc.buffImmune.Length; k++) @@ -329,8 +324,11 @@ namespace CalamityMod.NPCs.AcidRain Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IrradiatedSlime2"), 1f); } } - - public override void NPCLoot() + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture + "Glow"), npc); + } + public override void NPCLoot() { DropHelper.DropItemChance(npc, ModContent.ItemType(), 100); } diff --git a/NPCs/AcidRain/IrradiatedSlimeGlow.png b/NPCs/AcidRain/IrradiatedSlimeGlow.png new file mode 100644 index 0000000000..91bb11a744 Binary files /dev/null and b/NPCs/AcidRain/IrradiatedSlimeGlow.png differ diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index e74be6b84f..cc055dc5bf 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -1,8 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Enemy; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +8,6 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Weapons.Rogue; namespace CalamityMod.NPCs.AcidRain { @@ -157,7 +153,7 @@ namespace CalamityMod.NPCs.AcidRain } } } - npc.spriteDirection = (npc.velocity.X > 0).ToDirectionInt(); + npc.spriteDirection = (npc.velocity.X < 0).ToDirectionInt(); } else { @@ -165,7 +161,7 @@ namespace CalamityMod.NPCs.AcidRain { ShootPosition = player.Center; npc.netUpdate = true; - npc.spriteDirection = (ShootPosition.X - npc.Center.X > 0).ToDirectionInt(); + npc.spriteDirection = (ShootPosition.X - npc.Center.X < 0).ToDirectionInt(); } switch (PhaseArray[AttackIndex]) { @@ -390,6 +386,11 @@ namespace CalamityMod.NPCs.AcidRain npc.frame.Y = Walking ? 4 * frameHeight : 0; } } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture), npc, true); + return false; + } public override bool CheckDead() { if (!npc.dontTakeDamage) diff --git a/NPCs/AcidRain/NuclearTerror.png b/NPCs/AcidRain/NuclearTerror.png index 1e815f2429..0b1c23b0b9 100644 Binary files a/NPCs/AcidRain/NuclearTerror.png and b/NPCs/AcidRain/NuclearTerror.png differ diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 42b465bfa4..32583795a7 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Enemy; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -156,5 +157,9 @@ namespace CalamityMod.NPCs.AcidRain { target.AddBuff(ModContent.BuffType(), 300); } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture + "Glow"), npc, true); + } } } diff --git a/NPCs/AcidRain/NuclearToadGlow.png b/NPCs/AcidRain/NuclearToadGlow.png new file mode 100644 index 0000000000..d51d2291f3 Binary files /dev/null and b/NPCs/AcidRain/NuclearToadGlow.png differ diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 9fda3479c6..6dfe9404bc 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -26,20 +26,17 @@ namespace CalamityMod.NPCs.AcidRain npc.height = 34; npc.aiStyle = aiType = -1; - npc.damage = 40; - npc.lifeMax = 360; - npc.defense = 8; + npc.damage = 75; + npc.lifeMax = 605; + npc.defense = 15; + npc.Calamity().DR = 0.2f; if (CalamityWorld.downedPolterghast) { npc.damage = 180; npc.lifeMax = 5700; npc.defense = 65; - } - else if (CalamityWorld.downedAquaticScourge) - { - npc.damage = 75; - npc.lifeMax = 605; + npc.Calamity().DR = 0.35f; } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 77fa9094cb..793d6a2ed9 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -39,11 +39,13 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 175; npc.lifeMax = 6300; npc.defense = 58; + npc.Calamity().DR = 0.2f; } else if (CalamityWorld.downedAquaticScourge) { npc.damage = 85; npc.lifeMax = 700; + npc.Calamity().DR = 0.1f; } npc.knockBackResist = 0f; @@ -117,6 +119,11 @@ namespace CalamityMod.NPCs.AcidRain } else { + // Consistently update the enemy. + if (npc.ai[3] % 40f == 39f) + { + npc.netUpdate = true; + } // Dive upward in an attempt to hit to the player if (npc.ai[1] > TotalTime - DiveTime) { diff --git a/NPCs/AcidRain/SulfurousSkater.cs b/NPCs/AcidRain/SulfurousSkater.cs index ef5a8646ff..4ecd62c3a0 100644 --- a/NPCs/AcidRain/SulfurousSkater.cs +++ b/NPCs/AcidRain/SulfurousSkater.cs @@ -5,7 +5,9 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,12 +16,20 @@ namespace CalamityMod.NPCs.AcidRain { public class SulfurousSkater : ModNPC { + public bool Flying = false; public override void SetStaticDefaults() { DisplayName.SetDefault("Sulphurous Skater"); Main.npcFrameCount[npc.type] = 5; } - + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Flying); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + Flying = reader.ReadBoolean(); + } public override void SetDefaults() { npc.width = 48; @@ -34,6 +44,7 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 140; npc.lifeMax = 6600; npc.defense = 33; + npc.Calamity().DR = 0.15f; } npc.knockBackResist = 0f; @@ -56,7 +67,7 @@ namespace CalamityMod.NPCs.AcidRain { npc.TargetClosest(false); Player player = Main.player[npc.target]; - if (npc.ai[0] == 0f) + if (!Flying) { npc.Calamity().DR = 0.35f; npc.noGravity = false; @@ -92,7 +103,6 @@ namespace CalamityMod.NPCs.AcidRain if (npc.velocity.Y >= 0f) { npc.velocity.Y = -3f; - npc.netUpdate = true; } } @@ -102,8 +112,9 @@ namespace CalamityMod.NPCs.AcidRain if (closestBubble.Hitbox.Intersects(npc.Hitbox)) { - npc.ai[0] = 1f; + Flying = true; closestBubble.Kill(); + npc.netSpam = 0; npc.netUpdate = true; } } @@ -123,7 +134,8 @@ namespace CalamityMod.NPCs.AcidRain npc.ai[1] = 0f; npc.velocity.Y -= jumpSpeed; npc.velocity.X = lungeForwardSpeed * (npc.Center.X - destination.X < 0).ToDirectionInt(); - npc.spriteDirection = (npc.Center.X - destination.X < 0).ToDirectionInt(); + npc.spriteDirection = (npc.Center.X - destination.X > 0).ToDirectionInt(); + npc.netSpam = 0; npc.netUpdate = true; } } @@ -140,25 +152,18 @@ namespace CalamityMod.NPCs.AcidRain if (npc.Distance(player.Center) < 200f) inertia *= 0.667f; npc.velocity = (npc.velocity * inertia + npc.DirectionTo(player.Center) * speed) / (inertia + 1f); - npc.spriteDirection = (npc.velocity.X > 0).ToDirectionInt(); - if (player.dead && npc.Distance(player.Center) < 20f) + npc.spriteDirection = (npc.velocity.X < 0).ToDirectionInt(); + if (npc.Distance(player.Center) < 20f) { - npc.ai[0] = 0f; + Flying = false; + npc.netSpam = 0; npc.netUpdate = true; } } } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if (npc.ai[0] != 0f) - { - npc.ai[0] = 0f; - npc.netUpdate = true; - } - } public override void FindFrame(int frameHeight) { - if (npc.ai[0] == 0f) + if (!Flying) npc.frame.Y = 0; else { @@ -174,6 +179,10 @@ namespace CalamityMod.NPCs.AcidRain } } } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + CalamityGlobalNPC.DrawGlowmask(spriteBatch, ModContent.GetTexture(Texture + "Glow"), npc, true, Vector2.UnitY * 4f); + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); diff --git a/NPCs/AcidRain/SulfurousSkater.png b/NPCs/AcidRain/SulfurousSkater.png index 6a49d2534a..55b5932047 100644 Binary files a/NPCs/AcidRain/SulfurousSkater.png and b/NPCs/AcidRain/SulfurousSkater.png differ diff --git a/NPCs/AcidRain/SulfurousSkaterGlow.png b/NPCs/AcidRain/SulfurousSkaterGlow.png new file mode 100644 index 0000000000..8bfef7e576 Binary files /dev/null and b/NPCs/AcidRain/SulfurousSkaterGlow.png differ diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index be3833c619..9e0c6c1c0d 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -37,11 +37,13 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 160; npc.lifeMax = 7200; npc.defense = 78; + npc.Calamity().DR = 0.4f; } else if (CalamityWorld.downedAquaticScourge) { npc.damage = 66; npc.lifeMax = 850; + npc.Calamity().DR = 0.25f; } npc.knockBackResist = 0f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 83a5a5300d..a99499f8a6 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1108,6 +1108,24 @@ namespace CalamityMod.NPCs } #endregion + #region Glowmask Drawing + public static void DrawGlowmask(SpriteBatch spriteBatch, Texture2D texture, NPC npc, bool invertedDirection = false, Vector2 offset = default) + { + SpriteEffects effects = npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + if (invertedDirection) + effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, + npc.Center - Main.screenPosition + offset, + npc.frame, + Color.White, + npc.rotation, + npc.Size / 2f, + npc.scale, + effects, + 0f); + } + #endregion + // TODO -- Change Iron Heart damage in here for Iron Heart mode #region Iron Heart Changes private void IronHeartChanges(NPC npc) @@ -3774,13 +3792,16 @@ namespace CalamityMod.NPCs if (player.Calamity().ZoneSulphur && !player.Calamity().ZoneAbyss && CalamityWorld.rainingAcid) { - spawnRate = Main.hardMode ? 36 : 33; - maxSpawns = Main.hardMode ? 15 : 12; if (AcidRainEvent.AnyRainMinibosses) { maxSpawns = 5; spawnRate *= 2; } + else + { + spawnRate = Main.hardMode ? 36 : 33; + maxSpawns = Main.hardMode ? 15 : 12; + } } } } @@ -3917,7 +3938,7 @@ namespace CalamityMod.NPCs if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 2)) { List<(int, int, bool)> PossibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; - List PossibleMinibosses = new List(); + List<(int, bool)> PossibleMinibosses = new List<(int, bool)>(); if (CalamityWorld.downedAquaticScourge) { PossibleEnemies = AcidRainEvent.PossibleEnemiesAS; @@ -3931,13 +3952,18 @@ namespace CalamityMod.NPCs foreach (int enemy in PossibleEnemies.Select(enemyType => enemyType.Item1)) { if (spawnInfo.water || !PossibleEnemies.First(potential => potential.Item1 == enemy).Item3) - pool.Add(enemy, 1f); + { + pool.Add(enemy, 1f); + } } if (PossibleMinibosses.Count > 0) { - foreach (int enemy in PossibleMinibosses) + foreach (int enemy in PossibleMinibosses.Select(miniboss => miniboss.Item1).ToList()) { - pool.Add(enemy, 0.05f); + if (spawnInfo.water || !PossibleMinibosses.First(potential => potential.Item1 == enemy).Item2) + { + pool.Add(enemy, 0.05f); + } } } pool.Add(ModContent.NPCType(), 0.08f); @@ -5146,7 +5172,7 @@ namespace CalamityMod.NPCs target.type != NPCID.TheDestroyerBody && target.type != NPCID.TheDestroyerTail && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && - target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && target.type != NPCID.DD2Betsy && !CalamityMod.enemyImmunityList.Contains(target.type)) + target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && target.type != NPCID.DD2Betsy && !CalamityMod.enemyImmunityList.Contains(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } @@ -5244,7 +5270,7 @@ namespace CalamityMod.NPCs public static void DoFlyingAI(NPC npc, float maxSpeed, float acceleration, float circleTime, float minDistanceTarget = 150f, bool shouldAttackTarget = true) { //Pick a new target. - if (npc.target < 0 || npc.target >= 255 || Main.player[npc.target].dead) + if (npc.target < 0 || npc.target >= Main.maxPlayers || Main.player[npc.target].dead) { npc.TargetClosest(true); } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 4ff26b5c7b..702e888b47 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1609,8 +1609,8 @@ namespace CalamityMod.NPCs CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke. } } - if (AcidRainEvent.PossibleMinibossesAS.Contains(npc.type) || - AcidRainEvent.PossibleMinibossesPolter.Contains(npc.type)) + if (AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Item1).Contains(npc.type) || + AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Item1).Contains(npc.type)) { CalamityWorld.acidRainPoints -= AcidRainEvent.MinibossDeathValue; if (CalamityWorld.downedPolterghast) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 34d0791f70..487e1c4105 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -31,9 +31,11 @@ namespace CalamityMod.NPCs.Cryogen { private int time = 0; private int iceShard = 0; - private bool drawAltTexture = false; + private int currentPhase = 1; private int teleportLocationX = 0; + public override string Texture => "CalamityMod/NPCs/Cryogen/Cryogen_Phase1"; + public override void SetStaticDefaults() { DisplayName.SetDefault("Cryogen"); @@ -43,8 +45,8 @@ namespace CalamityMod.NPCs.Cryogen { npc.npcSlots = 24f; npc.damage = 50; - npc.width = 80; - npc.height = 80; + npc.width = 86; + npc.height = 88; npc.defense = 12; npc.Calamity().RevPlusDR(0.1f); npc.LifeMaxNERB(17900, 26300, 3000000); @@ -96,7 +98,6 @@ namespace CalamityMod.NPCs.Cryogen public override void SendExtraAI(BinaryWriter writer) { - writer.Write(drawAltTexture); writer.Write(time); writer.Write(iceShard); writer.Write(teleportLocationX); @@ -105,7 +106,6 @@ namespace CalamityMod.NPCs.Cryogen public override void ReceiveExtraAI(BinaryReader reader) { - drawAltTexture = reader.ReadBoolean(); time = reader.ReadInt32(); iceShard = reader.ReadInt32(); teleportLocationX = reader.ReadInt32(); @@ -128,6 +128,11 @@ namespace CalamityMod.NPCs.Cryogen bool death = CalamityWorld.death || CalamityWorld.bossRushActive; double multAdd = revenge ? 0.1 : 0D; + if ((int)npc.ai[0] + 1 > currentPhase && currentPhase < 6) + { + handlePhaseTransition((int)npc.ai[0] + 1); + } + if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 6 { int num6 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); @@ -695,9 +700,6 @@ namespace CalamityMod.NPCs.Cryogen double HPMult = death ? 0.4 : 0.15 + multAdd; if ((double)npc.life < (double)npc.lifeMax * HPMult) { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); - drawAltTexture = true; - for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); @@ -730,17 +732,6 @@ namespace CalamityMod.NPCs.Cryogen teleportLocationX = 0; iceShard = 0; npc.netUpdate = true; - - string key = "Mods.CalamityMod.CryogenBossText"; - Color messageColor = Color.Cyan; - if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } } } else if (npc.ai[0] == 5f) @@ -994,11 +985,24 @@ namespace CalamityMod.NPCs.Cryogen } } + private void handlePhaseTransition (int newPhase) + { + int chipGoreAmount = newPhase >= 5 ? 3 : newPhase >= 3 ? 2 : 1; + for (int i = 1; i < chipGoreAmount; i++) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryoChipGore" + i), 1f); + } + currentPhase = newPhase; + Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures { - if (drawAltTexture) + if (currentPhase > 1) { - Texture2D texture = ModContent.GetTexture("CalamityMod/NPCs/Cryogen/Cryogen2"); + string phase = "CalamityMod/NPCs/Cryogen/Cryogen_Phase" + currentPhase; + Texture2D texture = ModContent.GetTexture(phase); CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); return false; } @@ -1038,9 +1042,11 @@ namespace CalamityMod.NPCs.Cryogen Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore8"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore9"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore10"), 1f); + for (int i = 1; i < 4; i++) + { + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoDeathGore" + i), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoChipGore" + i), 1f); + } } } diff --git a/NPCs/Cryogen/Cryogen.png b/NPCs/Cryogen/Cryogen.png deleted file mode 100644 index 877504d4d2..0000000000 Binary files a/NPCs/Cryogen/Cryogen.png and /dev/null differ diff --git a/NPCs/Cryogen/Cryogen2.png b/NPCs/Cryogen/Cryogen2.png deleted file mode 100644 index 37b23b9dcd..0000000000 Binary files a/NPCs/Cryogen/Cryogen2.png and /dev/null differ diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index 8bb95b619b..8064b30814 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -22,8 +22,8 @@ namespace CalamityMod.NPCs.Cryogen npc.canGhostHeal = false; npc.noTileCollide = true; npc.damage = 50; - npc.width = 240; - npc.height = 240; + npc.width = 190; + npc.height = 190; npc.Calamity().RevPlusDR(0.4f); npc.lifeMax = 1400; if (CalamityWorld.bossRushActive) @@ -118,14 +118,15 @@ namespace CalamityMod.NPCs.Cryogen Main.projectile[ice].timeLeft = 300; Main.projectile[ice2].timeLeft = 300; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + float randomSpread; for (int spike = 0; spike < 4; spike++) { randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore4"), 1f); - Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore5"), 1f); - Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore6"), 1f); - Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore7"), 1f); + for (int x = 0; x < 4; x++) + { + Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoShieldGore" + x), 1f); + } + } } } diff --git a/NPCs/Cryogen/CryogenIce.png b/NPCs/Cryogen/CryogenIce.png index ec6e31c4c5..0bc36aa215 100644 Binary files a/NPCs/Cryogen/CryogenIce.png and b/NPCs/Cryogen/CryogenIce.png differ diff --git a/NPCs/Cryogen/Cryogen_Head_Boss.png b/NPCs/Cryogen/Cryogen_Head_Boss.png deleted file mode 100644 index b6882e3da3..0000000000 Binary files a/NPCs/Cryogen/Cryogen_Head_Boss.png and /dev/null differ diff --git a/NPCs/Cryogen/Cryogen_Phase1.png b/NPCs/Cryogen/Cryogen_Phase1.png new file mode 100644 index 0000000000..0cdb4ad832 Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase1.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase1_Head_Boss.png b/NPCs/Cryogen/Cryogen_Phase1_Head_Boss.png new file mode 100644 index 0000000000..f7692996b1 Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase1_Head_Boss.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase2.png b/NPCs/Cryogen/Cryogen_Phase2.png new file mode 100644 index 0000000000..ee0cb52260 Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase2.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase3.png b/NPCs/Cryogen/Cryogen_Phase3.png new file mode 100644 index 0000000000..24658919da Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase3.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase4.png b/NPCs/Cryogen/Cryogen_Phase4.png new file mode 100644 index 0000000000..5ee789e690 Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase4.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase5.png b/NPCs/Cryogen/Cryogen_Phase5.png new file mode 100644 index 0000000000..8a601f5611 Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase5.png differ diff --git a/NPCs/Cryogen/Cryogen_Phase6.png b/NPCs/Cryogen/Cryogen_Phase6.png new file mode 100644 index 0000000000..a0b6ecf43b Binary files /dev/null and b/NPCs/Cryogen/Cryogen_Phase6.png differ diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index 6400baf2d7..7e7bf044b6 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.HiveMind public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) + if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || spawnInfo.player.Calamity().corruptionLore) { return 0f; } diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 99c1663019..33058b34b4 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -60,7 +60,8 @@ namespace CalamityMod.NPCs.Leviathan NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || - spawnInfo.player.Calamity().ZoneSulphur) + spawnInfo.player.Calamity().ZoneSulphur || + spawnInfo.player.Calamity().oceanLore) { return 0f; } diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 365a6fed02..454ee1ecd7 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(10, 27)); + DropHelper.DropItem(npc, ModContent.ItemType(), 10, 26); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 675d768def..e2764b7929 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -423,9 +423,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - DropHelper.DropItemChance(npc, ModContent.ItemType(), 40); + DropHelper.DropItemChance(npc, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); - DropHelper.DropItem(npc, ModContent.ItemType(), Main.rand.Next(2, 5)); + DropHelper.DropItem(npc, ModContent.ItemType(), 2, 4); } } } diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 36136f0b15..1fd4007cfe 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(10, 27)); + DropHelper.DropItem(npc, ModContent.ItemType(), 10, 26); } } } diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index c933ca60f1..1ee625d81f 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -69,12 +69,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(15, 17)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(10, 15)); - if (Main.rand.NextBool(100) && NPC.downedBoss3) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } + DropHelper.DropItem(npc, ModContent.ItemType(), 15, 16); + DropHelper.DropItem(npc, ItemID.Gel, 10, 14); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedBoss3, 0.01f, 1, 1); } } } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 6376cc9350..4ccead5df9 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(10, 27)); + DropHelper.DropItem(npc, ModContent.ItemType(), 10, 26); } } } diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 8104f589d5..e7b7b17f8d 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -48,7 +48,7 @@ namespace CalamityMod.NPCs.NormalNPCs } int num2 = 4; bool flag4 = npc.velocity.Y == 0f; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) { diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 703bd2381d..ba182feb66 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -68,8 +68,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(15, 17)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(10, 15)); + DropHelper.DropItem(npc, ModContent.ItemType(), 15, 16); + DropHelper.DropItem(npc, ItemID.Gel, 10, 14); } } } diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index 946bec3407..80365d7de9 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(10, 27)); + DropHelper.DropItem(npc, ModContent.ItemType(), 10, 26); } } } diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index 9e18c8b571..fb6513dbb5 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -35,15 +35,11 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = false; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = npc.type; bannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index a6f45177b8..a099954ed2 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -34,15 +34,11 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = false; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = ModContent.NPCType(); bannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/NormalNPCs/PlaguedDerpling.cs index 52afd3fe76..8e04409ddf 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/NormalNPCs/PlaguedDerpling.cs @@ -31,15 +31,11 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit22; npc.DeathSound = SoundID.NPCDeath25; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = npc.type; bannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/NormalNPCs/PlaguedFlyingFox.cs index b74084d933..74e0885bdc 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/NormalNPCs/PlaguedFlyingFox.cs @@ -29,15 +29,11 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath4; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = npc.type; bannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index d8c146344e..59fac63837 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -36,15 +36,11 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = npc.type; bannerItem = ModContent.ItemType(); diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 1ae934eae3..cd902882db 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Perforator public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) + if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || spawnInfo.player.Calamity().crimsonLore) { return 0f; } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index e312662e7c..bc436b83f3 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -38,15 +38,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index ed74cb6ebf..0e6837b1fd 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -36,15 +36,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index dab3ee7017..dbca172691 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -32,15 +32,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.noGravity = true; npc.canGhostHeal = false; npc.noTileCollide = true; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 29b68c3aee..d0d18b042e 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -49,6 +49,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[BuffID.Frostburn] = false; npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.Oiled] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 6cda77c37b..140e3f7cc2 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -19,6 +19,7 @@ using System; using System.IO; using Terraria; using Terraria.ID; +using Terraria.Graphics.Shaders; using Terraria.ModLoader; using Terraria.ModLoader.Config; using CalamityMod; @@ -566,8 +567,11 @@ namespace CalamityMod.NPCs.SlimeGod } public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); + GameShaders.Misc["CalamityMod:FlameShader"].Apply(null); + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) { spriteEffects = SpriteEffects.FlipHorizontally; @@ -605,8 +609,10 @@ namespace CalamityMod.NPCs.SlimeGod float num165 = npc.rotation; Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); goto IL_6881; - } - return false; + } + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); + return false; } public override void BossLoot(ref string name, ref int potionType) diff --git a/Projectiles/Boss/IceBomb.png b/Projectiles/Boss/IceBomb.png index d4bedafb33..a960989721 100644 Binary files a/Projectiles/Boss/IceBomb.png and b/Projectiles/Boss/IceBomb.png differ diff --git a/Projectiles/Boss/IceRain.png b/Projectiles/Boss/IceRain.png index 198f04ee07..14ddad107b 100644 Binary files a/Projectiles/Boss/IceRain.png and b/Projectiles/Boss/IceRain.png differ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index cf07748f4d..5feaaf6998 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -5,6 +5,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Healing; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Yoyos; @@ -61,7 +62,7 @@ namespace CalamityMod.Projectiles private int counter = 0; private int counter2 = 0; - public int lineColor = 0; //holy mother of god, Eater of Shoals was a pain in the ass + public int lineColor = 0; //Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben public bool extorterBoost = false; public bool overridesMinionDamagePrevention = false; @@ -1951,10 +1952,10 @@ namespace CalamityMod.Projectiles int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || - projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || (projectile.type == ModContent.ProjectileType() && projectile.melee)) Main.projectile[projectile2].Calamity().forceMelee = true; - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ModContent.ProjectileType() && projectile.Calamity().rogue) Main.projectile[projectile2].Calamity().forceRogue = true; } } diff --git a/Projectiles/Rogue/AccretionDisk2.cs b/Projectiles/Hybrid/AccretionDisk2.cs similarity index 98% rename from Projectiles/Rogue/AccretionDisk2.cs rename to Projectiles/Hybrid/AccretionDisk2.cs index 584ab6accf..427416d322 100644 --- a/Projectiles/Rogue/AccretionDisk2.cs +++ b/Projectiles/Hybrid/AccretionDisk2.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class AccretionDisk2 : ModProjectile { diff --git a/Projectiles/Rogue/AccretionDisk2.png b/Projectiles/Hybrid/AccretionDisk2.png similarity index 100% rename from Projectiles/Rogue/AccretionDisk2.png rename to Projectiles/Hybrid/AccretionDisk2.png diff --git a/Projectiles/Rogue/AccretionDiskProj.cs b/Projectiles/Hybrid/AccretionDiskProj.cs similarity index 84% rename from Projectiles/Rogue/AccretionDiskProj.cs rename to Projectiles/Hybrid/AccretionDiskProj.cs index a8860aab0e..db0a1ec849 100644 --- a/Projectiles/Rogue/AccretionDiskProj.cs +++ b/Projectiles/Hybrid/AccretionDiskProj.cs @@ -7,7 +7,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class AccretionDiskProj : ModProjectile { @@ -102,8 +102,16 @@ namespace CalamityMod.Projectiles.Rogue for (i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + int disk = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + if (projectile.melee) + Main.projectile[disk].Calamity().forceMelee = true; + else + Main.projectile[disk].Calamity().forceRogue = true; + int disk2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + if (projectile.melee) + Main.projectile[disk2].Calamity().forceMelee = true; + else + Main.projectile[disk2].Calamity().forceRogue = true; } } } diff --git a/Projectiles/Rogue/AccretionDiskProj.png b/Projectiles/Hybrid/AccretionDiskProj.png similarity index 100% rename from Projectiles/Rogue/AccretionDiskProj.png rename to Projectiles/Hybrid/AccretionDiskProj.png diff --git a/Projectiles/Magic/AetherBeam.cs b/Projectiles/Hybrid/AetherBeam.cs similarity index 99% rename from Projectiles/Magic/AetherBeam.cs rename to Projectiles/Hybrid/AetherBeam.cs index acc680a9da..442f59ad43 100644 --- a/Projectiles/Magic/AetherBeam.cs +++ b/Projectiles/Hybrid/AetherBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic +namespace CalamityMod.Projectiles.Hybrid { public class AetherBeam : ModProjectile { diff --git a/Projectiles/Magic/AetherBeam.png b/Projectiles/Hybrid/AetherBeam.png similarity index 100% rename from Projectiles/Magic/AetherBeam.png rename to Projectiles/Hybrid/AetherBeam.png diff --git a/Projectiles/Typeless/CorpusAvertorClone.cs b/Projectiles/Hybrid/CorpusAvertorClone.cs similarity index 66% rename from Projectiles/Typeless/CorpusAvertorClone.cs rename to Projectiles/Hybrid/CorpusAvertorClone.cs index 778f7d5f02..1bd9edd5c9 100644 --- a/Projectiles/Typeless/CorpusAvertorClone.cs +++ b/Projectiles/Hybrid/CorpusAvertorClone.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class CorpusAvertorClone : ModProjectile { @@ -56,41 +56,7 @@ namespace CalamityMod.Projectiles.Typeless } projectile.width = projectile.height = (int)(24f * projectile.scale); - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 300f; - bool flag17 = false; - - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - - if (flag17) - { - float num483 = 16f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - } + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 16f, 20f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Typeless/CorpusAvertorClone.png b/Projectiles/Hybrid/CorpusAvertorClone.png similarity index 100% rename from Projectiles/Typeless/CorpusAvertorClone.png rename to Projectiles/Hybrid/CorpusAvertorClone.png diff --git a/Projectiles/Typeless/CorpusAvertorProj.cs b/Projectiles/Hybrid/CorpusAvertorProj.cs similarity index 95% rename from Projectiles/Typeless/CorpusAvertorProj.cs rename to Projectiles/Hybrid/CorpusAvertorProj.cs index 6d9c8252a2..0d6d1935cb 100644 --- a/Projectiles/Typeless/CorpusAvertorProj.cs +++ b/Projectiles/Hybrid/CorpusAvertorProj.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class CorpusAvertorProj : ModProjectile { @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless velocity *= mult; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), - (int)((float)projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f); + (int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f); } } else diff --git a/Projectiles/Typeless/CorpusAvertorProj.png b/Projectiles/Hybrid/CorpusAvertorProj.png similarity index 100% rename from Projectiles/Typeless/CorpusAvertorProj.png rename to Projectiles/Hybrid/CorpusAvertorProj.png diff --git a/Projectiles/Rogue/EmpyreanKnife.cs b/Projectiles/Hybrid/EmpyreanKnife.cs similarity index 99% rename from Projectiles/Rogue/EmpyreanKnife.cs rename to Projectiles/Hybrid/EmpyreanKnife.cs index 83d372c9ee..0ccd843fb8 100644 --- a/Projectiles/Rogue/EmpyreanKnife.cs +++ b/Projectiles/Hybrid/EmpyreanKnife.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class EmpyreanKnife : ModProjectile { diff --git a/Projectiles/Rogue/EmpyreanKnife.png b/Projectiles/Hybrid/EmpyreanKnife.png similarity index 100% rename from Projectiles/Rogue/EmpyreanKnife.png rename to Projectiles/Hybrid/EmpyreanKnife.png diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Hybrid/EradicatorProjectile.cs similarity index 89% rename from Projectiles/Rogue/EradicatorProjectile.cs rename to Projectiles/Hybrid/EradicatorProjectile.cs index c0c839cb90..458f86a7a3 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Hybrid/EradicatorProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class EradicatorProjectile : ModProjectile { @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 origin = new Vector2(31f, 29f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/EradicatorProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/EradicatorProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/EradicatorProjectile.png b/Projectiles/Hybrid/EradicatorProjectile.png similarity index 100% rename from Projectiles/Rogue/EradicatorProjectile.png rename to Projectiles/Hybrid/EradicatorProjectile.png diff --git a/Projectiles/Rogue/EradicatorProjectileGlow.png b/Projectiles/Hybrid/EradicatorProjectileGlow.png similarity index 100% rename from Projectiles/Rogue/EradicatorProjectileGlow.png rename to Projectiles/Hybrid/EradicatorProjectileGlow.png diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Hybrid/FlameScytheProjectile.cs similarity index 98% rename from Projectiles/Rogue/FlameScytheProjectile.cs rename to Projectiles/Hybrid/FlameScytheProjectile.cs index 64d64fed4f..57e8b9a374 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Hybrid/FlameScytheProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class FlameScytheProjectile : ModProjectile { diff --git a/Projectiles/Rogue/FlameScytheProjectile.png b/Projectiles/Hybrid/FlameScytheProjectile.png similarity index 100% rename from Projectiles/Rogue/FlameScytheProjectile.png rename to Projectiles/Hybrid/FlameScytheProjectile.png diff --git a/Projectiles/Typeless/GalaxySmasherHammer.cs b/Projectiles/Hybrid/GalaxySmasherHammer.cs similarity index 97% rename from Projectiles/Typeless/GalaxySmasherHammer.cs rename to Projectiles/Hybrid/GalaxySmasherHammer.cs index e65bfa40d9..16010c3265 100644 --- a/Projectiles/Typeless/GalaxySmasherHammer.cs +++ b/Projectiles/Hybrid/GalaxySmasherHammer.cs @@ -1,13 +1,13 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class GalaxySmasherHammer : ModProjectile { @@ -186,8 +186,11 @@ namespace CalamityMod.Projectiles.Typeless // NebulaShot projectile adjusts its own damage type based on ai[0] if (projectile.owner == Main.myPlayer) { - float damageType = projectile.melee ? 1f : 2f; - int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner, damageType, 0f); + int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner); + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 30; } diff --git a/Projectiles/Typeless/GalaxySmasherHammer.png b/Projectiles/Hybrid/GalaxySmasherHammer.png similarity index 100% rename from Projectiles/Typeless/GalaxySmasherHammer.png rename to Projectiles/Hybrid/GalaxySmasherHammer.png diff --git a/Projectiles/Typeless/KelvinCatalystBoomerang.cs b/Projectiles/Hybrid/KelvinCatalystBoomerang.cs similarity index 98% rename from Projectiles/Typeless/KelvinCatalystBoomerang.cs rename to Projectiles/Hybrid/KelvinCatalystBoomerang.cs index 0ecbc6cdb6..ddbc6a3144 100644 --- a/Projectiles/Typeless/KelvinCatalystBoomerang.cs +++ b/Projectiles/Hybrid/KelvinCatalystBoomerang.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -6,7 +7,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class KelvinCatalystBoomerang : ModProjectile { diff --git a/Projectiles/Typeless/KelvinCatalystBoomerang.png b/Projectiles/Hybrid/KelvinCatalystBoomerang.png similarity index 100% rename from Projectiles/Typeless/KelvinCatalystBoomerang.png rename to Projectiles/Hybrid/KelvinCatalystBoomerang.png diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Hybrid/MangroveChakramProjectile.cs similarity index 97% rename from Projectiles/Rogue/MangroveChakramProjectile.cs rename to Projectiles/Hybrid/MangroveChakramProjectile.cs index fad282df61..0c32453a85 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Hybrid/MangroveChakramProjectile.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class MangroveChakramProjectile : ModProjectile { diff --git a/Projectiles/Rogue/MangroveChakramProjectile.png b/Projectiles/Hybrid/MangroveChakramProjectile.png similarity index 100% rename from Projectiles/Rogue/MangroveChakramProjectile.png rename to Projectiles/Hybrid/MangroveChakramProjectile.png diff --git a/Projectiles/Typeless/NanoblackMain.cs b/Projectiles/Hybrid/NanoblackMain.cs similarity index 99% rename from Projectiles/Typeless/NanoblackMain.cs rename to Projectiles/Hybrid/NanoblackMain.cs index f97cade254..b3b27c092f 100644 --- a/Projectiles/Typeless/NanoblackMain.cs +++ b/Projectiles/Hybrid/NanoblackMain.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class NanoblackMain : ModProjectile { diff --git a/Projectiles/Typeless/NanoblackMain.png b/Projectiles/Hybrid/NanoblackMain.png similarity index 100% rename from Projectiles/Typeless/NanoblackMain.png rename to Projectiles/Hybrid/NanoblackMain.png diff --git a/Projectiles/Typeless/NanoblackSplit.cs b/Projectiles/Hybrid/NanoblackSplit.cs similarity index 98% rename from Projectiles/Typeless/NanoblackSplit.cs rename to Projectiles/Hybrid/NanoblackSplit.cs index ad1165ac49..bae91bf90e 100644 --- a/Projectiles/Typeless/NanoblackSplit.cs +++ b/Projectiles/Hybrid/NanoblackSplit.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class NanoblackSplit : ModProjectile { @@ -182,7 +182,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.spriteDirection == -1) eff = SpriteEffects.FlipHorizontally; Vector2 origin = new Vector2(fWidthOverTwo, fHeightOverTwo); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NanoblackSplitGlow"), + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/NanoblackSplitGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, projectile.scale, eff, 0f); } diff --git a/Projectiles/Typeless/NanoblackSplit.png b/Projectiles/Hybrid/NanoblackSplit.png similarity index 100% rename from Projectiles/Typeless/NanoblackSplit.png rename to Projectiles/Hybrid/NanoblackSplit.png diff --git a/Projectiles/Typeless/NanoblackSplitGlow.png b/Projectiles/Hybrid/NanoblackSplitGlow.png similarity index 100% rename from Projectiles/Typeless/NanoblackSplitGlow.png rename to Projectiles/Hybrid/NanoblackSplitGlow.png diff --git a/Projectiles/Rogue/OPHammer.cs b/Projectiles/Hybrid/OPHammer.cs similarity index 99% rename from Projectiles/Rogue/OPHammer.cs rename to Projectiles/Hybrid/OPHammer.cs index ed4389cc8b..0278d3d2db 100644 --- a/Projectiles/Rogue/OPHammer.cs +++ b/Projectiles/Hybrid/OPHammer.cs @@ -6,7 +6,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class OPHammer : ModProjectile { diff --git a/Projectiles/Rogue/OPHammer.png b/Projectiles/Hybrid/OPHammer.png similarity index 100% rename from Projectiles/Rogue/OPHammer.png rename to Projectiles/Hybrid/OPHammer.png diff --git a/Projectiles/Rogue/PwnagehammerProj.cs b/Projectiles/Hybrid/PwnagehammerProj.cs similarity index 96% rename from Projectiles/Rogue/PwnagehammerProj.cs rename to Projectiles/Hybrid/PwnagehammerProj.cs index ff99710942..b84082b42c 100644 --- a/Projectiles/Rogue/PwnagehammerProj.cs +++ b/Projectiles/Hybrid/PwnagehammerProj.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class PwnagehammerProj : ModProjectile { diff --git a/Projectiles/Rogue/PwnagehammerProj.png b/Projectiles/Hybrid/PwnagehammerProj.png similarity index 100% rename from Projectiles/Rogue/PwnagehammerProj.png rename to Projectiles/Hybrid/PwnagehammerProj.png diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs similarity index 95% rename from Projectiles/Melee/ScourgeoftheCosmosMini.cs rename to Projectiles/Hybrid/ScourgeoftheCosmosMini.cs index 8ffc75c27a..28b2ffb3e8 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee +namespace CalamityMod.Projectiles.Hybrid { public class ScourgeoftheCosmosMini : ModProjectile { @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Melee int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; Vector2 origin = new Vector2(9f, 10f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); } } } diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.png b/Projectiles/Hybrid/ScourgeoftheCosmosMini.png similarity index 100% rename from Projectiles/Melee/ScourgeoftheCosmosMini.png rename to Projectiles/Hybrid/ScourgeoftheCosmosMini.png diff --git a/Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png b/Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow.png similarity index 100% rename from Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png rename to Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow.png diff --git a/Projectiles/Melee/ScourgeoftheCosmosProj.cs b/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs similarity index 99% rename from Projectiles/Melee/ScourgeoftheCosmosProj.cs rename to Projectiles/Hybrid/ScourgeoftheCosmosProj.cs index 23fd15b6b0..fe4711abc4 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee +namespace CalamityMod.Projectiles.Hybrid { public class ScourgeoftheCosmosProj : ModProjectile { diff --git a/Projectiles/Melee/ScourgeoftheCosmosProj.png b/Projectiles/Hybrid/ScourgeoftheCosmosProj.png similarity index 100% rename from Projectiles/Melee/ScourgeoftheCosmosProj.png rename to Projectiles/Hybrid/ScourgeoftheCosmosProj.png diff --git a/Projectiles/Rogue/SeashellBoomerangProjectile.cs b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs similarity index 93% rename from Projectiles/Rogue/SeashellBoomerangProjectile.cs rename to Projectiles/Hybrid/SeashellBoomerangProjectile.cs index a9c21fc490..d7209de0a7 100644 --- a/Projectiles/Rogue/SeashellBoomerangProjectile.cs +++ b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs @@ -1,6 +1,6 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class SeashellBoomerangProjectile : ModProjectile { diff --git a/Projectiles/Rogue/SeashellBoomerangProjectile.png b/Projectiles/Hybrid/SeashellBoomerangProjectile.png similarity index 100% rename from Projectiles/Rogue/SeashellBoomerangProjectile.png rename to Projectiles/Hybrid/SeashellBoomerangProjectile.png diff --git a/Projectiles/Typeless/StellarContemptHammer.cs b/Projectiles/Hybrid/StellarContemptHammer.cs similarity index 99% rename from Projectiles/Typeless/StellarContemptHammer.cs rename to Projectiles/Hybrid/StellarContemptHammer.cs index 570812b8f1..8391f02918 100644 --- a/Projectiles/Typeless/StellarContemptHammer.cs +++ b/Projectiles/Hybrid/StellarContemptHammer.cs @@ -6,7 +6,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class StellarContemptHammer : ModProjectile { diff --git a/Projectiles/Typeless/StellarContemptHammer.png b/Projectiles/Hybrid/StellarContemptHammer.png similarity index 100% rename from Projectiles/Typeless/StellarContemptHammer.png rename to Projectiles/Hybrid/StellarContemptHammer.png diff --git a/Projectiles/Typeless/TerraDiskProjectile.cs b/Projectiles/Hybrid/TerraDiskProjectile.cs similarity index 99% rename from Projectiles/Typeless/TerraDiskProjectile.cs rename to Projectiles/Hybrid/TerraDiskProjectile.cs index 9c5f21aaa8..a1b023665f 100644 --- a/Projectiles/Typeless/TerraDiskProjectile.cs +++ b/Projectiles/Hybrid/TerraDiskProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class TerraDiskProjectile : ModProjectile { diff --git a/Projectiles/Typeless/TerraDiskProjectile.png b/Projectiles/Hybrid/TerraDiskProjectile.png similarity index 100% rename from Projectiles/Typeless/TerraDiskProjectile.png rename to Projectiles/Hybrid/TerraDiskProjectile.png diff --git a/Projectiles/Typeless/TerraDiskProjectile2.cs b/Projectiles/Hybrid/TerraDiskProjectile2.cs similarity index 97% rename from Projectiles/Typeless/TerraDiskProjectile2.cs rename to Projectiles/Hybrid/TerraDiskProjectile2.cs index 02357760e1..bb7c3c1d1a 100644 --- a/Projectiles/Typeless/TerraDiskProjectile2.cs +++ b/Projectiles/Hybrid/TerraDiskProjectile2.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless +namespace CalamityMod.Projectiles.Hybrid { public class TerraDiskProjectile2 : ModProjectile { diff --git a/Projectiles/Typeless/TerraDiskProjectile2.png b/Projectiles/Hybrid/TerraDiskProjectile2.png similarity index 100% rename from Projectiles/Typeless/TerraDiskProjectile2.png rename to Projectiles/Hybrid/TerraDiskProjectile2.png diff --git a/Projectiles/Rogue/TriactisOPHammer.cs b/Projectiles/Hybrid/TriactisOPHammer.cs similarity index 99% rename from Projectiles/Rogue/TriactisOPHammer.cs rename to Projectiles/Hybrid/TriactisOPHammer.cs index be35c91d5c..1c4ddffd63 100644 --- a/Projectiles/Rogue/TriactisOPHammer.cs +++ b/Projectiles/Hybrid/TriactisOPHammer.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class TriactisOPHammer : ModProjectile { diff --git a/Projectiles/Rogue/TriactisOPHammer.png b/Projectiles/Hybrid/TriactisOPHammer.png similarity index 100% rename from Projectiles/Rogue/TriactisOPHammer.png rename to Projectiles/Hybrid/TriactisOPHammer.png diff --git a/Projectiles/Magic/IceSpike.png b/Projectiles/Magic/IceSpike.png index 198f04ee07..14ddad107b 100644 Binary files a/Projectiles/Magic/IceSpike.png and b/Projectiles/Magic/IceSpike.png differ diff --git a/Projectiles/Magic/Snowflake.png b/Projectiles/Magic/Snowflake.png index ec834cdfa5..c71cf0bd49 100644 Binary files a/Projectiles/Magic/Snowflake.png and b/Projectiles/Magic/Snowflake.png differ diff --git a/Projectiles/Melee/AccretionDisk2Melee.cs b/Projectiles/Melee/AccretionDisk2Melee.cs deleted file mode 100644 index 21b4e368cf..0000000000 --- a/Projectiles/Melee/AccretionDisk2Melee.cs +++ /dev/null @@ -1,58 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class AccretionDisk2Melee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Accretion Disk"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.alpha = 120; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 60; - aiType = ProjectileID.WoodenBoomerang; - } - - public override void AI() - { - if (Main.rand.NextBool(2)) - { - int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); - Main.dust[num250].noGravity = true; - Main.dust[num250].velocity *= 0f; - } - Lighting.AddLight(projectile.Center, 0.15f, 1f, 0.25f); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } -} diff --git a/Projectiles/Melee/AccretionDisk2Melee.png b/Projectiles/Melee/AccretionDisk2Melee.png deleted file mode 100644 index e131c1a252..0000000000 Binary files a/Projectiles/Melee/AccretionDisk2Melee.png and /dev/null differ diff --git a/Projectiles/Melee/AccretionDiskMeleeProj.cs b/Projectiles/Melee/AccretionDiskMeleeProj.cs deleted file mode 100644 index a91f4c4ab2..0000000000 --- a/Projectiles/Melee/AccretionDiskMeleeProj.cs +++ /dev/null @@ -1,129 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class AccretionDiskMeleeProj : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Accretion Disk"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 6; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 400; - aiType = ProjectileID.WoodenBoomerang; - } - - public override void AI() - { - if (Main.rand.NextBool(2)) - { - for (int num468 = 0; num468 < 1; num468++) - { - int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); - Main.dust[num250].noGravity = true; - Main.dust[num250].velocity *= 0f; - } - } - - Lighting.AddLight(projectile.Center, 0.15f, 1f, 0.25f); - - int[] array = new int[20]; - int num428 = 0; - float distance = 300f; - bool flag14 = false; - for (int num430 = 0; num430 < 200; num430++) - { - if (Main.npc[num430].CanBeChasedBy(projectile, false)) - { - float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2); - - bool useCollisionDetection = extraDistance < distance; - bool canHit = true; - if (useCollisionDetection) - canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1); - - if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit) - { - if (num428 < 20) - { - array[num428] = num430; - num428++; - } - flag14 = true; - } - } - } - - if (flag14) - { - int num434 = Main.rand.Next(num428); - num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 8f) - { - projectile.localAI[0] = 0f; - float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - value10 += projectile.velocity * 4f; - float num438 = num435 - value10.X; - float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); - num440 = num437 / num440; - if (Main.rand.NextBool(3)) - { - if (projectile.owner == Main.myPlayer) - { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - for (i = 0; i < 4; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } - } - } - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } -} diff --git a/Projectiles/Melee/AccretionDiskMeleeProj.png b/Projectiles/Melee/AccretionDiskMeleeProj.png deleted file mode 100644 index e131c1a252..0000000000 Binary files a/Projectiles/Melee/AccretionDiskMeleeProj.png and /dev/null differ diff --git a/Projectiles/Melee/AtaraxiaHoming.cs b/Projectiles/Melee/AtaraxiaHoming.cs index 8320c0701b..6c569c0933 100644 --- a/Projectiles/Melee/AtaraxiaHoming.cs +++ b/Projectiles/Melee/AtaraxiaHoming.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 0f) { // Find the closest target. The range decreases each time you find a closer target. - for (int i = 0; i < 200; ++i) + for (int i = 0; i < Main.maxNPCs; ++i) { if (Main.npc[i].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Melee/EradicatorMeleeProjectile.cs b/Projectiles/Melee/EradicatorMeleeProjectile.cs deleted file mode 100644 index e515c19017..0000000000 --- a/Projectiles/Melee/EradicatorMeleeProjectile.cs +++ /dev/null @@ -1,59 +0,0 @@ -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class EradicatorMeleeProjectile : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eradicator"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 58; - projectile.height = 58; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 180; - aiType = ProjectileID.WoodenBoomerang; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 3; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 20, ModContent.ProjectileType()); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 origin = new Vector2(31f, 29f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/EradicatorMeleeProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Frostburn, 600); - } - } -} diff --git a/Projectiles/Melee/EradicatorMeleeProjectile.png b/Projectiles/Melee/EradicatorMeleeProjectile.png deleted file mode 100644 index e028ca0e83..0000000000 Binary files a/Projectiles/Melee/EradicatorMeleeProjectile.png and /dev/null differ diff --git a/Projectiles/Melee/EradicatorMeleeProjectileGlow.png b/Projectiles/Melee/EradicatorMeleeProjectileGlow.png deleted file mode 100644 index 152b9ce5ae..0000000000 Binary files a/Projectiles/Melee/EradicatorMeleeProjectileGlow.png and /dev/null differ diff --git a/Projectiles/Melee/FlameScytheProjectileMelee.cs b/Projectiles/Melee/FlameScytheProjectileMelee.cs deleted file mode 100644 index 55060e33dc..0000000000 --- a/Projectiles/Melee/FlameScytheProjectileMelee.cs +++ /dev/null @@ -1,64 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class FlameScytheProjectileMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scythe"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.extraUpdates = 1; - projectile.timeLeft = 600; - projectile.alpha = 55; - aiType = ProjectileID.WoodenBoomerang; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X, projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y); - if (Main.rand.NextBool(8)) - { - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.75f); - Main.gore[smoke].behindTiles = true; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D tex = Main.projectileTexture[projectile.type]; - spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 6; - target.AddBuff(BuffID.OnFire, 300); - if (projectile.owner == Main.myPlayer) - { - int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[boom].Calamity().forceMelee = true; - } - } - } -} diff --git a/Projectiles/Melee/FlameScytheProjectileMelee.png b/Projectiles/Melee/FlameScytheProjectileMelee.png deleted file mode 100644 index 2fb615a053..0000000000 Binary files a/Projectiles/Melee/FlameScytheProjectileMelee.png and /dev/null differ diff --git a/Projectiles/Melee/IceBombFriendly.png b/Projectiles/Melee/IceBombFriendly.png index d4bedafb33..a960989721 100644 Binary files a/Projectiles/Melee/IceBombFriendly.png and b/Projectiles/Melee/IceBombFriendly.png differ diff --git a/Projectiles/Melee/Iceberg.png b/Projectiles/Melee/Iceberg.png index d4bedafb33..a960989721 100644 Binary files a/Projectiles/Melee/Iceberg.png and b/Projectiles/Melee/Iceberg.png differ diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs index 24a6dbc317..03ab9ade1d 100644 --- a/Projectiles/Melee/LaserFountain.cs +++ b/Projectiles/Melee/LaserFountain.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.owner == Main.myPlayer) { - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(350f * Main.player[projectile.owner].meleeDamage), projectile.knockBack, projectile.owner, 0f, 0f); + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(350f * Main.player[projectile.owner].MeleeDamage()), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[projectile1].Calamity().forceMelee = true; Main.projectile[projectile1].aiStyle = 1; } diff --git a/Projectiles/Melee/MangroveChakramProjectileMelee.cs b/Projectiles/Melee/MangroveChakramProjectileMelee.cs deleted file mode 100644 index 89686493e9..0000000000 --- a/Projectiles/Melee/MangroveChakramProjectileMelee.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class MangroveChakramProjectileMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chakram"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 600; - aiType = ProjectileID.WoodenBoomerang; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D tex = Main.projectileTexture[projectile.type]; - spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 6; - target.AddBuff(BuffID.CursedInferno, 240); - } - } -} diff --git a/Projectiles/Melee/MangroveChakramProjectileMelee.png b/Projectiles/Melee/MangroveChakramProjectileMelee.png deleted file mode 100644 index 5e0ab11e47..0000000000 Binary files a/Projectiles/Melee/MangroveChakramProjectileMelee.png and /dev/null differ diff --git a/Projectiles/Ranged/NebulaShot.cs b/Projectiles/Melee/NebulaShot.cs similarity index 82% rename from Projectiles/Ranged/NebulaShot.cs rename to Projectiles/Melee/NebulaShot.cs index 6da0c66cca..540bbdaff2 100644 --- a/Projectiles/Ranged/NebulaShot.cs +++ b/Projectiles/Melee/NebulaShot.cs @@ -3,7 +3,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Ranged +namespace CalamityMod.Projectiles.Melee { public class NebulaShot : ModProjectile { @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.height = 4; projectile.friendly = true; projectile.ignoreWater = true; - projectile.ranged = true; + projectile.melee = true; projectile.alpha = 255; projectile.penetrate = 1; projectile.extraUpdates = 5; @@ -35,12 +35,6 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); } - // Force damage type based on AI variable (this is outdated code and the weapons themselves should set the force variables) - if (projectile.ai[0] == 1f) - projectile.Calamity().forceMelee = true; - else if (projectile.ai[0] == 2f) - projectile.Calamity().forceRogue = true; - if (projectile.alpha > 0) { projectile.alpha -= 15; diff --git a/Projectiles/Ranged/NebulaShot.png b/Projectiles/Melee/NebulaShot.png similarity index 100% rename from Projectiles/Ranged/NebulaShot.png rename to Projectiles/Melee/NebulaShot.png diff --git a/Projectiles/Melee/OPHammerMelee.cs b/Projectiles/Melee/OPHammerMelee.cs deleted file mode 100644 index b9548956ac..0000000000 --- a/Projectiles/Melee/OPHammerMelee.cs +++ /dev/null @@ -1,131 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class OPHammerMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hammer"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 62; - projectile.height = 62; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 2; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.35f, 0.35f, 0f); - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 30f) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float num42 = 16f; - float num43 = 3.2f; - Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; - float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; - float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); - if (num46 > 3000f) - { - projectile.Kill(); - } - num46 = num42 / num46; - num44 *= num46; - num45 *= num46; - if (projectile.velocity.X < num44) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && num44 > 0f) - { - projectile.velocity.X = projectile.velocity.X + num43; - } - } - else if (projectile.velocity.X > num44) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && num44 < 0f) - { - projectile.velocity.X = projectile.velocity.X - num43; - } - } - if (projectile.velocity.Y < num45) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && num45 > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - } - } - else if (projectile.velocity.Y > num45) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && num45 < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - } - } - if (Main.myPlayer == projectile.owner) - { - Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); - if (rectangle.Intersects(value2)) - { - projectile.Kill(); - } - } - } - projectile.rotation += 0.5f; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 250, 250, 50); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - if (projectile.owner == Main.myPlayer) - { - int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[boom].Calamity().forceMelee = true; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Melee/OPHammerMelee.png b/Projectiles/Melee/OPHammerMelee.png deleted file mode 100644 index b527ef88b6..0000000000 Binary files a/Projectiles/Melee/OPHammerMelee.png and /dev/null differ diff --git a/Projectiles/Melee/SeashellBoomerangProjectileMelee.cs b/Projectiles/Melee/SeashellBoomerangProjectileMelee.cs deleted file mode 100644 index b16f998a41..0000000000 --- a/Projectiles/Melee/SeashellBoomerangProjectileMelee.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class SeashellBoomerangProjectileMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boomerang"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 240; - aiType = ProjectileID.WoodenBoomerang; - } - } -} diff --git a/Projectiles/Melee/SeashellBoomerangProjectileMelee.png b/Projectiles/Melee/SeashellBoomerangProjectileMelee.png deleted file mode 100644 index 4e0fba13e0..0000000000 Binary files a/Projectiles/Melee/SeashellBoomerangProjectileMelee.png and /dev/null differ diff --git a/Projectiles/Melee/StormMark.cs b/Projectiles/Melee/StormMark.cs index 8f699e670d..4d776911d1 100644 --- a/Projectiles/Melee/StormMark.cs +++ b/Projectiles/Melee/StormMark.cs @@ -126,8 +126,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] += 1f; if (projectile.localAI[1] == 60f && projectile.owner == Main.myPlayer) { - int num1137 = 100; - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), num1137, 3f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner, 0f, 0f); } if (projectile.localAI[1] >= 120f) { diff --git a/Projectiles/Melee/TriactisOPHammerMelee.cs b/Projectiles/Melee/TriactisOPHammerMelee.cs deleted file mode 100644 index c3846c7793..0000000000 --- a/Projectiles/Melee/TriactisOPHammerMelee.cs +++ /dev/null @@ -1,148 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class TriactisOPHammerMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hammer"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 160; - projectile.height = 160; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.75f); - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 30f) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float num42 = 20f; - float num43 = 5f; - Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; - float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; - float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); - if (num46 > 3000f) - { - projectile.Kill(); - } - num46 = num42 / num46; - num44 *= num46; - num45 *= num46; - if (projectile.velocity.X < num44) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && num44 > 0f) - { - projectile.velocity.X = projectile.velocity.X + num43; - } - } - else if (projectile.velocity.X > num44) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && num44 < 0f) - { - projectile.velocity.X = projectile.velocity.X - num43; - } - } - if (projectile.velocity.Y < num45) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && num45 > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - } - } - else if (projectile.velocity.Y > num45) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && num45 < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - } - } - if (Main.myPlayer == projectile.owner) - { - Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); - if (rectangle.Intersects(value2)) - { - projectile.Kill(); - } - } - } - projectile.rotation += 0.5f; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 250, 250, 50); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - 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); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - 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); - 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); - Main.dust[num624].velocity *= 2f; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Melee/TriactisOPHammerMelee.png b/Projectiles/Melee/TriactisOPHammerMelee.png deleted file mode 100644 index 3f86fa3c6d..0000000000 Binary files a/Projectiles/Melee/TriactisOPHammerMelee.png and /dev/null differ diff --git a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs index 8c38d1c234..4a68d994ff 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public override void SetStaticDefaults() { - DisplayName.SetDefault("Chaotrix"); + DisplayName.SetDefault("Fault"); ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 14f; ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 290f; ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 13f; diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index f8fa1f1b5d..d163446b5d 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -102,8 +102,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos velocity = velocity.SafeNormalize(Vector2.Zero) * laserSpeed; if (projectile.owner == Main.myPlayer) { - // ai[0] = 1f for melee - int proj = Projectile.NewProjectile(laserSpawnPosition, velocity, ModContent.ProjectileType(), laserDamage, laserKB, projectile.owner, 1f, 0f); + int proj = Projectile.NewProjectile(laserSpawnPosition, velocity, ModContent.ProjectileType(), laserDamage, laserKB, projectile.owner); Main.projectile[proj].Calamity().forceMelee = true; } } diff --git a/Projectiles/Ranged/VanquisherArrowMain.cs b/Projectiles/Ranged/VanquisherArrowMain.cs index b90d3dae9e..563ce01430 100644 --- a/Projectiles/Ranged/VanquisherArrowMain.cs +++ b/Projectiles/Ranged/VanquisherArrowMain.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; @@ -42,8 +43,6 @@ namespace CalamityMod.Projectiles.Ranged } } - // DEFECT -- Vanquisher Arrow projectile glowmask doesn't work. - /* public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 origin = new Vector2(0f, 0f); @@ -54,9 +53,9 @@ namespace CalamityMod.Projectiles.Ranged byte a2 = (byte)(100f * ((float)b2 / 255f)); color = new Color((int)b2, (int)b2, (int)b2, (int)a2); } - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Ranged/VanquisherArrowMainGlow"), projectile.Center - Main.screenPosition, null, color, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Ranged/VanquisherArrowGlow"), projectile.Center - Main.screenPosition, frame, color, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); } - */ public override Color? GetAlpha(Color lightColor) { diff --git a/Projectiles/Rogue/FrostShardFriendly.png b/Projectiles/Rogue/FrostShardFriendly.png index cf7a6c32b1..14ddad107b 100644 Binary files a/Projectiles/Rogue/FrostShardFriendly.png and b/Projectiles/Rogue/FrostShardFriendly.png differ diff --git a/Projectiles/Rogue/IceStarProjectile.png b/Projectiles/Rogue/IceStarProjectile.png index ec834cdfa5..c71cf0bd49 100644 Binary files a/Projectiles/Rogue/IceStarProjectile.png and b/Projectiles/Rogue/IceStarProjectile.png differ diff --git a/Projectiles/Rogue/IcebreakerHammer.png b/Projectiles/Rogue/IcebreakerHammer.png index 7839c05097..2b21544257 100644 Binary files a/Projectiles/Rogue/IcebreakerHammer.png and b/Projectiles/Rogue/IcebreakerHammer.png differ diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index 6f9824308d..797a94632f 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -79,15 +79,8 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1]++ % 35f == 34f && Collision.CanHit(projectile.position, projectile.width, projectile.height, potentialTarget.position, potentialTarget.width, potentialTarget.height)) { - Vector2 startingVelocity = new Vector2(0f, -Main.rand.NextFloat(10f, 18f)); - for (int i = 0; i < 3; i++) - { - float angle = (float)Math.Atan(Math.Abs(potentialTarget.Center.X - projectile.Center.X) / 360f); - angle *= Math.Sign(potentialTarget.Center.X - projectile.Center.X); - angle += Main.rand.NextFloat(MathHelper.ToRadians(4f)) * Main.rand.NextBool(2).ToDirectionInt(); - Projectile.NewProjectile(projectile.Center, startingVelocity.RotatedBy(angle), ModContent.ProjectileType(), - projectile.damage, projectile.knockBack, projectile.owner); - } + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center) * Main.rand.NextFloat(10f, 18f), ModContent.ProjectileType(), + projectile.damage, projectile.knockBack, projectile.owner); } } } diff --git a/Projectiles/Typeless/DarkIce.png b/Projectiles/Typeless/DarkIce.png index 9f30449aae..98bedb5a00 100644 Binary files a/Projectiles/Typeless/DarkIce.png and b/Projectiles/Typeless/DarkIce.png differ diff --git a/Projectiles/Typeless/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs index b903c7057d..3186fed573 100644 --- a/Projectiles/Typeless/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Typeless bool flag49 = false; Vector2 center12 = new Vector2(0f, 0f); float num948 = 600f; - for (int num949 = 0; num949 < 200; num949++) + for (int num949 = 0; num949 < Main.maxNPCs; num949++) { if (Main.npc[num949].CanBeChasedBy(projectile, false)) { @@ -185,8 +185,8 @@ namespace CalamityMod.Projectiles.Typeless public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Vector2 origin = new Vector2(17f, 17f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); } } } diff --git a/Projectiles/Typeless/VanquisherArrowSplit.cs b/Projectiles/Typeless/VanquisherArrowSplit.cs index e8dcd8bbc6..6b54a6e74d 100644 --- a/Projectiles/Typeless/VanquisherArrowSplit.cs +++ b/Projectiles/Typeless/VanquisherArrowSplit.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; @@ -29,21 +30,22 @@ namespace CalamityMod.Projectiles.Typeless CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f); } - // DEFECT -- Vanquisher Arrow duplicate projectile glow doesn't work. - /* public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Vector2 origin = new Vector2(0f, 0f); - Color color = new Color(0, 0, 0, 0); - if (projectile.timeLeft < 85) - { - byte b2 = (byte)(projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - color = new Color((int)b2, (int)b2, (int)b2, (int)a2); - } - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/VanquisherArrowSplitGlow"), projectile.Center - Main.screenPosition, null, color, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + if (projectile.timeLeft < 90) + { + Vector2 origin = new Vector2(0f, 0f); + Color color = Color.White; + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + color = new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/VanquisherArrowSplitGlow"), projectile.Center - Main.screenPosition, frame, color, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); + } } - */ public override Color? GetAlpha(Color lightColor) { diff --git a/Tiles/Abyss/AcidWoodTree.png b/Tiles/Abyss/AcidWoodTree.png index 83e3d403ad..a8d7c10bcd 100644 Binary files a/Tiles/Abyss/AcidWoodTree.png and b/Tiles/Abyss/AcidWoodTree.png differ diff --git a/Tiles/Abyss/AcidWoodTreeSapling.png b/Tiles/Abyss/AcidWoodTreeSapling.png index 63fc6902a6..a462af14c2 100644 Binary files a/Tiles/Abyss/AcidWoodTreeSapling.png and b/Tiles/Abyss/AcidWoodTreeSapling.png differ diff --git a/Tiles/Abyss/AcidWoodTreeTops.png b/Tiles/Abyss/AcidWoodTreeTops.png index cdbd445831..4d803745c0 100644 Binary files a/Tiles/Abyss/AcidWoodTreeTops.png and b/Tiles/Abyss/AcidWoodTreeTops.png differ diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index dc42b6b5de..93e9b6d296 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -11,29 +11,10 @@ namespace CalamityMod.Tiles.Astral return ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralTree_Tops"); } - public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) - { - return ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralTree_Branches"); - } - - public override Texture2D GetTexture() - { - return ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralTree"); - } - - public override int DropWood() - { - return ModContent.ItemType(); - } - - public override int CreateDust() - { - return ModContent.DustType(); - } - - public override int GrowthFXGore() - { - return -1; - } + public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) => ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralTree_Branches"); + public override Texture2D GetTexture() => ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralTree"); + public override int DropWood() => ModContent.ItemType(); + public override int CreateDust() => ModContent.DustType(); + public override int GrowthFXGore() => -1; } } diff --git a/Tiles/Furniture/BossTrophy.png b/Tiles/Furniture/BossTrophy.png index c01723d5b6..e91a2c001c 100644 Binary files a/Tiles/Furniture/BossTrophy.png and b/Tiles/Furniture/BossTrophy.png differ diff --git a/UI/StealthStrikeUI.cs b/UI/StealthStrikeUI.cs index 903edfef0e..a9d4e30f41 100644 --- a/UI/StealthStrikeUI.cs +++ b/UI/StealthStrikeUI.cs @@ -1,40 +1,89 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; namespace CalamityMod.UI { - public static class StealthStrikeUI + public class StealthStrikeUI { + public static Vector2 DrawPosition = new Vector2(CalamityMod.CalamityConfig.StealthMeterPosX, CalamityMod.CalamityConfig.StealthMeterPosY); + public static Vector2 Offset = DrawPosition; public static void Draw(SpriteBatch spriteBatch, Player player) { + if (DrawPosition.X <= 60f && DrawPosition.Y <= 20f) + { + DrawPosition.X = Main.screenWidth / 2f; + DrawPosition.Y = Main.screenHeight / 2 + Main.LocalPlayer.height / 2f + 24f; + } CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.stealthUIAlpha <= 0f || !CalamityMod.CalamityConfig.StealthBar) + { + if (CalamityMod.CalamityConfig.StealthMeterPosX != DrawPosition.X) + { + CalamityMod.CalamityConfig.StealthMeterPosX = DrawPosition.X; + CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + } + if (CalamityMod.CalamityConfig.StealthMeterPosY != DrawPosition.Y) + { + CalamityMod.CalamityConfig.StealthMeterPosY = DrawPosition.Y; + CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + } return; + } Texture2D edgeTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeter"); Texture2D indicatorTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeterStrikeIndicator"); Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeterBar"); Texture2D fullBarTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeterBarFull"); - Vector2 drawPosition = Main.screenPosition + new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f + new Vector2(0f, player.height / 2f + 24f) - Main.screenPosition; - spriteBatch.Draw(edgeTexture, drawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(edgeTexture, DrawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); if (modPlayer.rogueStealth >= modPlayer.rogueStealthMax * (modPlayer.stealthStrikeHalfCost ? 0.5f : 1f)) { - spriteBatch.Draw(indicatorTexture, drawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, indicatorTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(indicatorTexture, DrawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, indicatorTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); } float completionRatio = modPlayer.rogueStealth / modPlayer.rogueStealthMax; Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * completionRatio), barTexture.Width); bool full = modPlayer.rogueStealth >= modPlayer.rogueStealthMax; - spriteBatch.Draw(full ? fullBarTexture : barTexture, drawPosition, barRectangle, Color.White * modPlayer.stealthUIAlpha, 0f, indicatorTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - if (new Rectangle((int)(drawPosition.X + Main.screenPosition.X - player.width / 2), (int)(drawPosition.Y + Main.screenPosition.Y), barTexture.Width, barTexture.Height).Intersects( + spriteBatch.Draw(full ? fullBarTexture : barTexture, DrawPosition, barRectangle, Color.White * modPlayer.stealthUIAlpha, 0f, indicatorTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + if (new Rectangle((int)(DrawPosition.X + Main.screenPosition.X - player.width / 2), (int)(DrawPosition.Y + Main.screenPosition.Y), barTexture.Width, barTexture.Height).Intersects( new Rectangle((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, 8, 8))) { - if (modPlayer.rogueStealthMax > 0f) + if (modPlayer.rogueStealthMax > 0f && modPlayer.stealthUIAlpha >= 0.5f) { Main.LocalPlayer.mouseInterface = true; Main.instance.MouseText("Stealth: " + (int)(modPlayer.rogueStealth * 100) + "/" + (int)(modPlayer.rogueStealthMax * 100) + "", 0, 0, -1, -1, -1, -1); //only way I got this to show up consistently, otherwise it fucked up and showed up anywhere onscreen lol. + modPlayer.stealthUIAlpha = MathHelper.Lerp(modPlayer.stealthUIAlpha, 0.25f, 0.035f); + } + } + if (!CalamityMod.CalamityConfig.MeterPosLock) + { + if (new Rectangle((int)(DrawPosition.X + Main.screenPosition.X - 26), (int)(DrawPosition.Y + Main.screenPosition.Y - 9), 52, 18).Intersects( + new Rectangle((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, 8, 8))) + { + if (Mouse.GetState().LeftButton == ButtonState.Pressed) + { + Offset = new Vector2(Mouse.GetState().X, Mouse.GetState().Y); + DrawPosition.X = Offset.X; + DrawPosition.Y = Offset.Y; + } + if (Mouse.GetState().LeftButton == ButtonState.Released) + { + DrawPosition.X = Offset.X; + DrawPosition.Y = Offset.Y; + } + } + + if (CalamityMod.CalamityConfig.StealthMeterPosX != DrawPosition.X) + { + CalamityMod.CalamityConfig.StealthMeterPosX = DrawPosition.X; + CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + } + if (CalamityMod.CalamityConfig.StealthMeterPosY != DrawPosition.Y) + { + CalamityMod.CalamityConfig.StealthMeterPosY = DrawPosition.Y; + CalamityMod.SaveConfig(CalamityMod.CalamityConfig); } } } diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 89fe4e131c..6101906b9d 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -867,6 +867,9 @@ namespace CalamityMod RecipeGroup sand = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Sand"]]; sand.ValidItems.Add(ModContent.ItemType()); + RecipeGroup wood = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Wood"]]; + wood.ValidItems.Add(ModContent.ItemType()); //Astral Monolith was decidedly not wood-like enough + //New Groups RecipeGroup group = new RecipeGroup(() => "Any Copper Bar", new int[] { diff --git a/Waters/SulphuricWater.cs b/Waters/SulphuricWater.cs index 7a8b7c3179..1c0a59d613 100644 --- a/Waters/SulphuricWater.cs +++ b/Waters/SulphuricWater.cs @@ -9,9 +9,26 @@ namespace CalamityMod.Waters { public override bool ChooseWaterStyle() { - bool inXZone = Main.LocalPlayer.Center.X < 10400f; + int biomeWidth; + // Small world + if (Main.maxTilesX == 4200) + { + biomeWidth = 270; + } + // Medium world + else if (Main.maxTilesX == 6400) + { + biomeWidth = 365; + } + // Large world + else + { + biomeWidth = 430; + } + biomeWidth += 25; + bool inXZone = Main.LocalPlayer.Center.X < biomeWidth * 16f; if (!CalamityWorld.abyssSide) - inXZone = Main.LocalPlayer.Center.X > Main.maxTilesX * 16f - 10400f; + inXZone = Main.LocalPlayer.Center.X > Main.maxTilesX * 16f - biomeWidth * 16f; bool inYZone = Main.LocalPlayer.Center.Y < Main.rockLayer * 16f - 320 && Main.LocalPlayer.Center.Y >= 5800f; diff --git a/World/Abyss.cs b/World/Abyss.cs index b89bd3844b..caac763694 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -639,81 +639,82 @@ namespace CalamityMod.World tile.type != TileID.Sand && tile.type != TileID.Containers && tile.type != TileID.Coral && - tile.type != TileID.BeachPiles; - if (abyssIndex > abyssChasmX + 75) + tile.type != TileID.BeachPiles && + tile.type != ModContent.TileType(); + if (abyssIndex2 > rockLayer - Main.rand.Next(30)) { - if (WorldGen.genRand.Next(4) == 0) + if (abyssIndex > abyssChasmX + 75 - Main.rand.Next(30)) + { + if (WorldGen.genRand.Next(4) == 0) + { + if (canConvert) + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + else if (!tile.active()) + { + tile.active(true); + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + } + } + else if (abyssIndex > abyssChasmX + 70) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (canConvert) + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + else if (!tile.active()) + { + tile.active(true); + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + } + } + else { if (canConvert) { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } } - else if (!tile.active() && - abyssIndex2 > rockLayer) + else if (!tile.active()) { tile.active(true); - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - } - } - else if (abyssIndex > abyssChasmX + 70) - { - if (WorldGen.genRand.Next(2) == 0) - { - if (canConvert) - { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - } - } - else - { - if (canConvert) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else - { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } } } } @@ -736,80 +737,80 @@ namespace CalamityMod.World tile.type != TileID.Containers && tile.type != TileID.Coral && tile.type != TileID.BeachPiles; - if (abyssIndex < abyssChasmX - 75) + if (abyssIndex2 > rockLayer - Main.rand.Next(30)) { - if (WorldGen.genRand.Next(4) == 0) + if (abyssIndex < abyssChasmX - 75) + { + if (WorldGen.genRand.Next(4) == 0) + { + if (canConvert) + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + else if (!tile.active()) + { + tile.active(true); + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + } + } + else if (abyssIndex < abyssChasmX - 70) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (canConvert) + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + else if (!tile.active()) + { + tile.active(true); + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } + } + } + else { if (canConvert) { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } } - else if (!tile.active() && - abyssIndex2 > rockLayer) + else if (!tile.active()) { tile.active(true); - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - } - } - else if (abyssIndex < abyssChasmX - 70) - { - if (WorldGen.genRand.Next(2) == 0) - { - if (canConvert) - { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); - } - } - } - else - { - if (canConvert) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)ModContent.TileType(); - tile.wall = (ushort)ModContent.WallType(); - } - else - { - tile.wall = (ushort)ModContent.WallType(); - tile.type = (ushort)ModContent.TileType(); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)ModContent.TileType(); + tile.wall = (ushort)ModContent.WallType(); + } + else + { + tile.wall = (ushort)ModContent.WallType(); + tile.type = (ushort)ModContent.TileType(); + } } } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index a164b53531..29c31f96b1 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -110,6 +110,7 @@ namespace CalamityMod.World public static bool triedToSummonOldDuke = false; public static bool startAcidicDownpour = false; public static bool forcedRainAlready = false; + public static bool forcedDownpourWithTear = false; public static float AcidRainCompletionRatio { get @@ -373,6 +374,8 @@ namespace CalamityMod.World downed.Add("startDownpour"); if (forcedRainAlready) downed.Add("forcedRain"); + if (forcedDownpourWithTear) + downed.Add("forcedTear"); return new TagCompound { @@ -443,6 +446,7 @@ namespace CalamityMod.World triedToSummonOldDuke = downed.Contains("spawnedBoomer"); startAcidicDownpour = downed.Contains("startDownpour"); forcedRainAlready = downed.Contains("forcedRain"); + forcedDownpourWithTear = downed.Contains("forcedTear"); abyssChasmBottom = tag.GetInt("abyssChasmBottom"); acidRainPoints = tag.GetInt("acidRainPoints"); @@ -531,7 +535,7 @@ namespace CalamityMod.World BitsByte flags8 = reader.ReadByte(); forcedRainAlready = flags8[0]; - _ = flags8[1]; + forcedDownpourWithTear = flags8[1]; _ = flags8[2]; _ = flags8[3]; _ = flags8[4]; @@ -622,7 +626,7 @@ namespace CalamityMod.World BitsByte flags8 = new BitsByte(); flags8[0] = forcedRainAlready; - flags8[1] = false; + flags8[1] = forcedDownpourWithTear; flags8[2] = false; flags8[3] = false; flags8[4] = false; @@ -719,7 +723,7 @@ namespace CalamityMod.World BitsByte flags8 = reader.ReadByte(); forcedRainAlready = flags8[0]; - _ = flags8[1]; + forcedDownpourWithTear = flags8[1]; _ = flags8[2]; _ = flags8[3]; _ = flags8[4]; @@ -974,7 +978,7 @@ namespace CalamityMod.World } // Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea) // You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!! - if (startAcidicDownpour) + if (startAcidicDownpour || forcedDownpourWithTear) { Main.raining = true; Main.cloudBGActive = 1f; diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index ead0f46c6a..a772ad61be 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -4059,13 +4059,13 @@ namespace CalamityMod.World { smallHoleLimit = 1360f; if (Main.maxTilesY > 2100) { smallHoleLimit = 1950f; } } if (ocean && num > smallHoleLimit) { - if (num3 < 4.0) //min width + if (num3 < 7.0) //min width { - num3 = 4.0; //min width + num3 = 7.0; //min width } - if (num3 > 6.0) //max width + if (num3 > 11.0) //max width { - num3 = 6.0; //max width + num3 = 11.0; //max width } } else //dig large hole