Added charge loop and enemy hit sounds

In GFB, the charge loop is louder and tile hits play metal pipe falling sound
This commit is contained in:
CongratsIsTrash committed 2024-04-19 00:14:08 -04:00
1 parent a15085f45c
commit a4e96eabf4
4 files changed
+21 -2

No files matched your search

+17 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Particles;
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -26,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged
public ref float Time => ref Projectile.ai[0];
public const float ChargeupTime = 120f;
public SlotId ChargeIdle;
// Controls the saw visually disappearing from the holdout when it fires.
public bool NoSawOnHoldout = false;
@@ -59,12 +61,19 @@ namespace CalamityMod.Projectiles.Ranged
{
Time++;
ActiveSound Idle;
if (SoundEngine.TryGetActiveSound(ChargeIdle, out Idle) && Idle.IsPlaying)
Idle.Position = GunTipPosition;
if (Owner.CantUseHoldout())
{
if (Projectile.ai[1] < 1f)
{
KeepRefreshingLifetime = false;
if (SoundEngine.TryGetActiveSound(ChargeIdle, out Idle))
Idle?.Stop();
Projectile.ai[1] = 1f;
Projectile.timeLeft = 30;
SoundEngine.PlaySound(SoundID.DD2_BallistaTowerShot, GunTipPosition);
@@ -151,6 +160,9 @@ namespace CalamityMod.Projectiles.Ranged
}
else
{
if ((Time + 240) % 360 == 0)
ChargeIdle = SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BuzzsawIdle") { Volume = Main.zenithWorld ? 1f : 0.5f }, GunTipPosition);
if (Time % 3 == 0)
{
Vector2 smokeVelocity = new Vector2(0f, Main.rand.NextFloat(-7f, -12f));
@@ -170,7 +182,11 @@ namespace CalamityMod.Projectiles.Ranged
// The holdout can deal damage; you're literally spinning up a buzzsaw at the end, after all.
public override bool? CanDamage() => !NoSawOnHoldout;
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Laceration>(), 240);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Laceration>(), 240);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.7f }, GunTipPosition);
}
public override void ModifyDamageHitbox(ref Rectangle hitbox)
{
+4 -1
View File
@@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Ranged
{
public new string LocalizationCategory => "Projectiles.Ranged";
public static readonly SoundStyle TileCollideGFB = new("CalamityMod/Sounds/Custom/MetalPipeFalling") { Volume = 1.5f };
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 4;
@@ -51,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged
public override bool OnTileCollide(Vector2 oldVelocity)
{
SoundEngine.PlaySound(SoundID.Item178, Projectile.Center); // Probably placeholder sound?
SoundEngine.PlaySound(Main.zenithWorld ? TileCollideGFB : SoundID.Item178, Projectile.Center); // Placeholder sound? Could fit
for (int s = 0; s < 7; s++)
{
@@ -91,6 +93,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Laceration>(), 150);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice"), Projectile.Center);
for (int p = 0; p < 6; p++)
{
Binary file not shown.
Binary file not shown.