From ff0dc912e197c41121dc13caa5d61d02ecbf99ce Mon Sep 17 00:00:00 2001 From: Memes Date: Sat, 4 May 2024 22:10:20 +0200 Subject: [PATCH] Harvest Staff fixes. 1. SCREAMS TOO LOUD. 2. If a pumpkin is too far away from its sentry and is still on the growing state: it'll despawn. --- Projectiles/Summon/HarvestStaffMinion.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/HarvestStaffMinion.cs b/Projectiles/Summon/HarvestStaffMinion.cs index 34813bebac..c00e7bf69b 100644 --- a/Projectiles/Summon/HarvestStaffMinion.cs +++ b/Projectiles/Summon/HarvestStaffMinion.cs @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon private SoundStyle _idleRareSound = new("CalamityMod/Sounds/Custom/PumpkinRareIdle") { Volume = 0.2f }; - private SoundStyle _screamSound = new("CalamityMod/Sounds/Custom/PumpkinScream", 2); + private SoundStyle _screamSound = new("CalamityMod/Sounds/Custom/PumpkinScream", 2) { Volume = 0.5f }; private SoundStyle _jumpSound = new("CalamityMod/Sounds/Custom/PumpkinJump"); @@ -222,6 +222,12 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + if (Animation == AnimationState.Grow && (MySentry is null || Projectile.Distance(MySentry.Center) > 600f)) + { + Projectile.Kill(); + NetUpdate(); + } + Target = Projectile.Center.MinionHoming(State == AIState.Still ? PlantedEnemyDistanceDetection : NormalEnemyDistanceDetection, Owner, false); switch (State) @@ -292,6 +298,9 @@ namespace CalamityMod.Projectiles.Summon public override void OnKill(int timeLeft) { + if (State != AIState.Attack) + return; + Projectile.ExpandHitboxBy(4f); Projectile.Damage(); @@ -323,6 +332,7 @@ namespace CalamityMod.Projectiles.Summon dust.color = Color.Chocolate; } } + if (Main.zenithWorld) SoundEngine.PlaySound(_boomSoundGFB, Projectile.Center); else