From 3b85e385949771e19e08ccdc7c4de4d7bd8998e1 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Sat, 2 May 2020 23:04:58 +0100 Subject: [PATCH 1/3] adjusted bloodworm spawning --- NPCs/AcidRain/BloodwormNormal.cs | 7 +++++++ NPCs/CalamityGlobalNPC.cs | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) 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 c9537a7058..9b29f04f30 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4115,10 +4115,6 @@ namespace CalamityMod.NPCs } } } - if (CalamityWorld.downedPolterghast) - { - pool.Add(NPCType(), AcidRainEvent.BloodwormSpawnRate); - } } } } From 5ebc8044832080fadc99b85dda7979aa739967fd Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 2 May 2020 17:53:41 -0500 Subject: [PATCH 2/3] Dyes are less pricey --- Items/Dyes/AstralBlueDye.cs | 2 +- Items/Dyes/AstralOrangeDye.cs | 2 +- Items/Dyes/AstralSwirlDye.cs | 2 +- Items/Dyes/CeaselessDye.cs | 2 +- Items/Dyes/DragonSoulDye.cs | 2 +- Items/Dyes/ElementalDye.cs | 2 +- Items/Dyes/EndothermicDye.cs | 2 +- Items/Dyes/NightmareDye.cs | 2 +- Items/Dyes/ReaverDye.cs | 2 +- Items/Dyes/ShadowspecDye.cs | 2 +- Items/Dyes/StratusDye.cs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) 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() From 4a030054e41b554566fbe0caaf5cece6367d7246 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 May 2020 19:28:48 -0400 Subject: [PATCH 3/3] fixed stealth consumption logic, whoops --- CalPlayer/CalamityPlayer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c9e7083053..2954015149 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -9296,8 +9296,9 @@ namespace CalamityMod.CalPlayer 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 producesNoHitboxes = it.shoot == 0 && it.noMelee; + bool playerUsingWeapon = hasDamage && !producesNoHitboxes && !hasNonWeaponFunction; if (!stealthStrikeThisFrame && player.itemAnimation == player.itemAnimationMax - 1 && playerUsingWeapon) ConsumeStealthByAttacking(); }