diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 5a3d336517..c4852c0263 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Buffs { player.lavaMax += 420; } + // Rogue weapons benefit from vanilla throwing crit, so don't double-increase rogue crit chance with these buffs. + /* else if (type == BuffID.Rage) { player.Calamity().throwingCrit += 10; @@ -34,6 +36,7 @@ namespace CalamityMod.Buffs { player.Calamity().throwingCrit += 2; } + */ else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) { float nebulaDamage = 0.075f * (float)player.nebulaLevelDamage; //7.5% to 22.5% diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 412cbec7e0..c9e7083053 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -9228,7 +9228,8 @@ namespace CalamityMod.CalPlayer player.rangedCrit += boost; player.magicCrit += boost; player.thrownCrit += boost; - throwingCrit += boost; + // Rogue weapons benefit from throwing crit AND rogue crit, so don't add both. + // throwingCrit += boost; } #endregion @@ -9289,7 +9290,14 @@ namespace CalamityMod.CalPlayer // This doesn't trigger stealth strike effects (ConsumeStealthStrike instead of StealthStrike) // so non-rogue weapons can't call lasers down from the sky and such. // Using any item which deals no damage or is a tool doesn't consume stealth. - bool playerUsingWeapon = player.HeldItem.damage > 0 && player.HeldItem.pick <= 0 && player.HeldItem.hammer <= 0 && player.HeldItem.axe <= 0; + Item it = player.HeldItem; + bool hasDamage = it.damage > 0; + bool isPickaxe = it.pick > 0; + bool isAxe = it.axe > 0; + bool isHammer = it.hammer > 0; + bool isPlaced = it.createTile != 0; + bool producesNoHitboxes = it.shoot == 0 && it.useStyle == ItemUseStyleID.SwingThrow && it.noMelee; + bool playerUsingWeapon = hasDamage && !(isPickaxe || isAxe || isHammer || isPlaced || producesNoHitboxes); if (!stealthStrikeThisFrame && player.itemAnimation == player.itemAnimationMax - 1 && playerUsingWeapon) ConsumeStealthByAttacking(); } diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index f088ae1b35..ba11775685 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -20,16 +20,19 @@ namespace CalamityMod.Items.Weapons.Rogue item.summon = false; } + // Simply add the player's dedicated rogue damage. + // Rogue weapons are internally throwing so they already benefit from throwing damage boosts. // 5E-06 to prevent downrounding is not needed anymore, added by TML itself public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { add += player.Calamity().throwingDamage - 1f; } - // Calculates a rogue weapon's crit chance using the player's rogue crit chance. + // Simply add the player's dedicated rogue crit chance. + // Rogue crit isn't boosted by Calamity universal crit boosts, so this won't double-add universal crit. public override void GetWeaponCrit(Player player, ref int crit) { - crit = item.crit + player.Calamity().throwingCrit; + crit += player.Calamity().throwingCrit; } public override float UseTimeMultiplier(Player player) diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/SunGodStaff.cs index 04f4be5b65..dd305b8186 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/SunGodStaff.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon position = Main.MouseWorld; speedX = 0; speedY = 0; - for (int x = 0; x < 1000; x++) + for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType()) diff --git a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs index ec545e62b5..bfd4852479 100644 --- a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs +++ b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Tundra Flame Blossoms Staff"); - Tooltip.SetDefault("Summons three unusual flowers over your head"); + Tooltip.SetDefault("Summons three unusual flowers over your head\n" + + "Each flower consumes one minion slot"); } public override void SetDefaults() @@ -32,9 +33,19 @@ namespace CalamityMod.Items.Weapons.Summon item.shootSpeed = 10f; item.summon = true; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) + { + proj.Kill(); + } + } for (int i = 0; i < 3; i++) { Projectile blossom = Projectile.NewProjectileDirect(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index df400c6cb5..93e95f268a 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -836,6 +836,7 @@ namespace CalamityMod sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1-(1f/3f), 2f/3f, 2f/3f}); diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index e13dca68ca..c19edecb2a 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1041,6 +1041,9 @@ namespace CalamityMod.NPCs.DevourerofGods public override void NPCLoot() { + // Stop the countdown -- if you kill DoG in less than 60 frames, this will stop another one from spawning. + CalamityWorld.DoGSecondStageCountdown = 0; + DropHelper.DropBags(npc); DropHelper.DropItem(npc, ModContent.ItemType(), 8, 14); diff --git a/Projectiles/Summon/TundraFlameBlossom.cs b/Projectiles/Summon/TundraFlameBlossom.cs index 72c66de54c..3833bfeb96 100644 --- a/Projectiles/Summon/TundraFlameBlossom.cs +++ b/Projectiles/Summon/TundraFlameBlossom.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.Center = Main.player[projectile.owner].Center + (projectile.ai[1] / 32f).ToRotationVector2() * 95f; + projectile.Center = player.Center + (projectile.ai[1] / 32f).ToRotationVector2() * 95f; projectile.scale = 1f + (float)Math.Sin(projectile.ai[1] / 40f) * 0.085f; projectile.Opacity = 1f - (float)Math.Sin(projectile.ai[1] / 45f) * 0.1f - 0.1f; // Range of 1f to 0.8f projectile.rotation += MathHelper.ToRadians(5f); diff --git a/UI/RipperUI.cs b/UI/RipperUI.cs index 95a6f46f9f..d8ead9eb62 100644 --- a/UI/RipperUI.cs +++ b/UI/RipperUI.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.World; using Microsoft.Xna.Framework.Input; +using System.Collections.Generic; namespace CalamityMod.UI { @@ -257,10 +258,14 @@ namespace CalamityMod.UI private static void CheckGarbageCornerPos() { - if (rageDrawPos.X <= 60f && rageDrawPos.Y <= 20f) + // This should only happen if something happens to the config file. + if (rageDrawPos == Vector2.Zero) rageDrawPos = new Vector2(DefaultRagePosX, DefaultRagePosY); - if (adrenDrawPos.X <= 60f && adrenDrawPos.Y <= 20f) + rageDrawPos = Vector2.Clamp(rageDrawPos, Vector2.Zero, new Vector2(Main.screenWidth - 104f, Main.screenHeight - 24f)); + + if (adrenDrawPos == Vector2.Zero) adrenDrawPos = new Vector2(DefaultAdrenPosX, DefaultAdrenPosY); + adrenDrawPos = Vector2.Clamp(adrenDrawPos, Vector2.Zero, new Vector2(Main.screenWidth - 104f, Main.screenHeight - 24f)); } private static Vector2 GetShakeOffset()