diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c9e7083053..ff818d43b0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -9292,12 +9292,13 @@ namespace CalamityMod.CalPlayer // Using any item which deals no damage or is a tool doesn't consume stealth. Item it = player.HeldItem; bool hasDamage = it.damage > 0; + bool hasHitboxes = !it.noMelee || it.shoot > 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); + bool hasNonWeaponFunction = isPickaxe || isAxe || isHammer || isPlaced; + bool playerUsingWeapon = hasDamage && hasHitboxes && !hasNonWeaponFunction; if (!stealthStrikeThisFrame && player.itemAnimation == player.itemAnimationMax - 1 && playerUsingWeapon) ConsumeStealthByAttacking(); } diff --git a/Items/Dyes/AstralBlueDye.cs b/Items/Dyes/AstralBlueDye.cs index a2444ed0b8..602f7341f4 100644 --- a/Items/Dyes/AstralBlueDye.cs +++ b/Items/Dyes/AstralBlueDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { item.rare = 9; - item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.value = Item.sellPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/AstralOrangeDye.cs b/Items/Dyes/AstralOrangeDye.cs index 4e8588dee7..4945847a5e 100644 --- a/Items/Dyes/AstralOrangeDye.cs +++ b/Items/Dyes/AstralOrangeDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { item.rare = 9; - item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.value = Item.sellPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/AstralSwirlDye.cs b/Items/Dyes/AstralSwirlDye.cs index f657ac43b8..33ff3d0f06 100644 --- a/Items/Dyes/AstralSwirlDye.cs +++ b/Items/Dyes/AstralSwirlDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { item.rare = 9; - item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.value = Item.sellPrice(0, 3, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/CeaselessDye.cs b/Items/Dyes/CeaselessDye.cs index 46e236aa59..c865caa946 100644 --- a/Items/Dyes/CeaselessDye.cs +++ b/Items/Dyes/CeaselessDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.PureGreen; - item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + item.value = Item.sellPrice(0, 4, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/DragonSoulDye.cs b/Items/Dyes/DragonSoulDye.cs index c59c6eaca3..e5ff29b85c 100644 --- a/Items/Dyes/DragonSoulDye.cs +++ b/Items/Dyes/DragonSoulDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.Violet; - item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.value = Item.sellPrice(0, 8, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/ElementalDye.cs b/Items/Dyes/ElementalDye.cs index 793e4d343e..a53145c467 100644 --- a/Items/Dyes/ElementalDye.cs +++ b/Items/Dyes/ElementalDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; - item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.value = Item.sellPrice(0, 2, 50, 0); } public override void AddRecipes() diff --git a/Items/Dyes/EndothermicDye.cs b/Items/Dyes/EndothermicDye.cs index c145b058cb..6630a5ac20 100644 --- a/Items/Dyes/EndothermicDye.cs +++ b/Items/Dyes/EndothermicDye.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; + item.value = Item.sellPrice(0, 5, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/NightmareDye.cs b/Items/Dyes/NightmareDye.cs index 53386334ec..9807c284bb 100644 --- a/Items/Dyes/NightmareDye.cs +++ b/Items/Dyes/NightmareDye.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; + item.value = Item.sellPrice(0, 5, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/ReaverDye.cs b/Items/Dyes/ReaverDye.cs index f437db45a9..80379e10db 100644 --- a/Items/Dyes/ReaverDye.cs +++ b/Items/Dyes/ReaverDye.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { item.rare = 7; - item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.value = Item.sellPrice(0, 1, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/ShadowspecDye.cs b/Items/Dyes/ShadowspecDye.cs index 12c84124f1..03e6b1997f 100644 --- a/Items/Dyes/ShadowspecDye.cs +++ b/Items/Dyes/ShadowspecDye.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.Developer; - item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; + item.value = Item.sellPrice(0, 10, 0, 0); } public override void AddRecipes() diff --git a/Items/Dyes/StratusDye.cs b/Items/Dyes/StratusDye.cs index 70917b52d7..f7e57b0be3 100644 --- a/Items/Dyes/StratusDye.cs +++ b/Items/Dyes/StratusDye.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Dyes { item.rare = 10; item.Calamity().customRarity = CalamityRarity.PureGreen; - item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + item.value = Item.sellPrice(0, 4, 50, 0); } public override void AddRecipes() diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index ce4cdfc89b..430b4314ab 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.SummonItems; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -98,6 +99,12 @@ namespace CalamityMod.NPCs.AcidRain Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + return (spawnInfo.player.Calamity().ZoneSulphur && CalamityWorld.downedPolterghast && !CalamityWorld.rainingAcid) ? SpawnCondition.WormCritter.Chance * 1.569f : 0f; + } + public override void OnCatchNPC(Player player, Item item) { try diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8c998861f5..bda56ad8ba 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4115,10 +4115,6 @@ namespace CalamityMod.NPCs } } } - if (CalamityWorld.downedPolterghast) - { - pool.Add(NPCType(), AcidRainEvent.BloodwormSpawnRate); - } } } }