diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index c0529a346c..2f885d0450 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -204,43 +204,69 @@ namespace CalamityMod.CalPlayer public bool HandleHorizontalDash(out DashDirection direction) { direction = DashDirection.Directionless; - bool justDashed = false; + bool dashWasExecuted = false; // If the manual hotkey is bound, standard Terraria dashes cannot be triggered by double tapping. - bool manualHotkeyBound = CalamityKeybinds.DashHotkey.GetAssignedKeys().Count > 0; - bool pressedManualHotkey = CalamityKeybinds.DashHotkey.JustPressed; + var manualDashHotkeys = CalamityKeybinds.DashHotkey.GetAssignedKeys(); + bool manualHotkeyBound = (manualDashHotkeys?.Count ?? 0) > 0; + bool pressedManualHotkey = manualHotkeyBound && CalamityKeybinds.DashHotkey.JustPressed; - bool vanillaRightDashInput = Player.controlRight && Player.releaseRight && !manualHotkeyBound; - bool manualRightDashInput = pressedManualHotkey && Player.direction == 1; - bool executeRightDash = vanillaRightDashInput || manualRightDashInput; + int dashDirectionToUse = 0; - bool vanillaLeftDashInput = Player.controlLeft && Player.releaseLeft && !manualHotkeyBound; - bool manualLeftDashInput = pressedManualHotkey && Player.direction == -1; - bool executeLeftDash = vanillaLeftDashInput || manualLeftDashInput; + // The manual hotkey is bound. Dashing is controlled solely by this hotkey. Vanilla inputs will not function. + if (pressedManualHotkey) + { + // If you are holding D but not A, then always dash right. + if (Player.controlRight && !Player.controlLeft) + dashDirectionToUse = 1; + // If you are holding A but not D, then always dash left. + else if (Player.controlLeft && !Player.controlRight) + dashDirectionToUse = -1; - if (executeRightDash) + // If you are holding neither A nor D, or holding both, then dash in the direction the player is moving. + // If the player is not moving at all, then dash the direction the player is facing. + else + { + if (MathF.Abs(Player.velocity.X) <= 0.01f) + dashDirectionToUse = Player.direction; + else + dashDirectionToUse = Player.velocity.X > 0f ? 1 : -1; + } + } + + // The manual hotkey is not bound. Dashing is controlled via vanilla inputs. + else if (!manualHotkeyBound) + { + // Check whether or not a horizontal dash was declared via vanilla methods this frame. + bool vanillaLeftDashInput = !manualHotkeyBound && Player.controlLeft && Player.releaseLeft; + bool vanillaRightDashInput = !manualHotkeyBound && Player.controlRight && Player.releaseRight; + dashDirectionToUse = vanillaRightDashInput ? 1 : vanillaLeftDashInput ? -1 : 0; + } + + + if (dashDirectionToUse == 1) { if (dashTimeMod > 0 || pressedManualHotkey) { direction = DashDirection.Right; - justDashed = true; + dashWasExecuted = true; dashTimeMod = 0; } else dashTimeMod = 15; } - else if (executeLeftDash) + else if (dashDirectionToUse == -1) { if (dashTimeMod < 0 || pressedManualHotkey) { direction = DashDirection.Left; - justDashed = true; + dashWasExecuted = true; dashTimeMod = 0; } else dashTimeMod = -15; } - return justDashed; + return dashWasExecuted; } public bool HandleOmnidirectionalDash(out DashDirection direction) diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenator.cs index e3a419047b..1eb16398dd 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenator.cs @@ -34,10 +34,12 @@ namespace CalamityMod.Items.Accessories //No lifesteal, no regen, no healing pots if (player.statLife >= (int)(player.statLifeMax2 * 0.5f)) { - player.statLife = (int)(player.statLifeMax2 * 0.5f); - player.lifeRegenCount = 0; + player.statLife = (int)(player.statLifeMax2 * 0.5f); player.moonLeech = true; modPlayer.healingPotBonus = 0; + + if (player.lifeRegenCount > 0) + player.lifeRegenCount = 0; } } } diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index 383679ead7..491b867b97 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -330,6 +330,7 @@ namespace CalamityMod.Items evilBossTwo.Add(ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Aerialite Ore evilBossTwo.Add(ModContent.ItemType(), fifteenPercent, 4, 7); // 15% 4-7 Aerialite Bar loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Sunlight + loot.AddIf(() => NPC.downedMoonlord, ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Exodium Clusters break; case ItemID.FrozenCrate: @@ -342,7 +343,7 @@ namespace CalamityMod.Items case ItemID.LavaCrate: case ItemID.LavaCrateHard: - loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Chaos + loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Havoc break; // Calamity does not touch Oasis Crates yet diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 0a817182e6..6f3d409d9e 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Vehemence"); - Tooltip.SetDefault("Casts intense bolts of hellish power that explode into skulls\n" + - "Direct hits inflict Demon Flames for an extended period of time"); + Tooltip.SetDefault("Casts intense bolts of hellish power that explode into skulls"); Item.staff[Item.type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Melee/CatastropheClaymore.cs b/Items/Weapons/Melee/CatastropheClaymore.cs index 2cd074f081..65e40fd82b 100644 --- a/Items/Weapons/Melee/CatastropheClaymore.cs +++ b/Items/Weapons/Melee/CatastropheClaymore.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Catastrophe Claymore"); - Tooltip.SetDefault("Fires sparkles which inflicts Frostbite, Hellfire, or Ichor"); + Tooltip.SetDefault("Fires sparkles which inflict Frostbite, Hellfire, or Ichor"); SacrificeTotal = 1; } diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index 1fb614dc15..04d9cd0404 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; @@ -144,10 +143,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.OnFire, 360); + target.AddBuff(ModContent.BuffType(), 600); if (!target.canGhostHeal || player.moonLeech) return; @@ -159,10 +155,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.OnFire, 360); + target.AddBuff(ModContent.BuffType(), 600); if (player.moonLeech) return; diff --git a/Items/Weapons/Rogue/AshenStalactite.cs b/Items/Weapons/Rogue/AshenStalactite.cs index cfa9f0087f..e56209aed2 100644 --- a/Items/Weapons/Rogue/AshenStalactite.cs +++ b/Items/Weapons/Rogue/AshenStalactite.cs @@ -24,9 +24,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 37; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 18; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 20; Item.knockBack = 1f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index 7a2eb87d28..295e17fe93 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -24,8 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = Item.height = 120; Item.damage = 616; Item.knockBack = 8.5f; - Item.useAnimation = 16; //Has to be different than UseTime to prevent clockwork - Item.useTime = 17; + Item.useAnimation = Item.useTime = 17; Item.DamageType = RogueDamageClass.Instance; Item.autoReuse = true; Item.shootSpeed = 18f; diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 05d0670316..be57d557b8 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -25,9 +25,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 150; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 37; //Has to be different than UseTime to prevent clockwork + Item.useAnimation = Item.useTime = 38; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 38; Item.knockBack = 10f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 6fec9e48a6..d4122ffa3a 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -130,6 +130,7 @@ namespace CalamityMod public const string CalamityWikiURL = "https://calamitymod.wiki.gg/wiki/{}"; /// + /// Vanilla main bosses:
/// 1.0 = King Slime
/// 2.0 = Eye of Cthulhu
/// 3.0 = Eater of Worlds / Brain of Cthulhu
@@ -156,12 +157,12 @@ namespace CalamityMod { "Crabulon", 2.7f }, { "HiveMind", 3.98f }, { "Perforators", 3.99f }, - { "SlimeGod", 6.5f }, + { "SlimeGod", 6.7f }, // Thorium Granite Energy Storm is 6.4f, Buried Champion is 6.5f, and Star Scouter is 6.9f { "Cryogen", 8.5f }, { "AquaticScourge", 9.5f }, { "CragmawMire", 9.52f }, { "BrimstoneElemental", 10.5f }, - { "CalamitasClone", 11.7f }, + { "CalamitasClone", 11.7f }, // Thorium Lich is 11.6f { "GreatSandShark", 12.09f }, { "Leviathan", 12.8f }, { "AstrumAureus", 12.81f }, @@ -170,10 +171,10 @@ namespace CalamityMod { "AstrumDeus", 17.5f }, { "ProfanedGuardians", 18.5f }, { "Dragonfolly", 18.6f }, - { "Providence", 19.01f }, // Thorium's Ragnarok will most likely be 19f - { "CeaselessVoid", 19.5f }, - { "StormWeaver", 19.51f }, - { "Signus", 19.52f }, + { "Providence", 19f }, // Thorium Primordials (Ragnarok) is 19.5f + { "CeaselessVoid", 19.6f }, + { "StormWeaver", 19.61f }, + { "Signus", 19.62f }, { "Polterghast", 20f }, { "Mauler", 20.491f }, { "NuclearTerror", 20.492f }, diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index daae2edd71..73929bf6ff 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using System; using Terraria; @@ -418,6 +419,8 @@ namespace CalamityMod.NPCs.NormalNPCs npcLoot.AddIf(() => NPC.downedGolemBoss, ItemID.MartianConduitPlating, 1, 10, 30); npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 10); + var postML = npcLoot.DefineConditionalDropSet(() => NPC.downedMoonlord); + postML.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 8, 12, 11, 16)); } } }