cards/CardBell.cs
using Sandbox;
using System.Threading.Tasks;
public class CardBell : Card
{
public override bool ShouldHandleEvent( EventType eventType )
{
return (eventType == EventType.MoveCard && Manager.Instance.MovedCard == this) || (eventType == EventType.SwapCards && Manager.Instance.SwappedCards.Contains( this ));
}
public override async Task HandleEventAsync( EventType eventType )
{
Manager.Instance.PlayCardSfx( "bell", this, volume: 0.45f, pitch: Game.Random.Float( 0.95f, 1.1f ) );
await Task.DelayRealtime( 0 );
}
public override void PlayShakeSfx()
{
Manager.Instance.PlayCardSfx( "bell", this, volume: 0.45f, pitch: Game.Random.Float( 0.95f, 1.1f ) );
}
public override bool OverrideShakeSfx => true;
}