cards/CardMountain.cs
using Sandbox;
using System.Threading.Tasks;
public class CardMountain : Card
{
public override bool CantBeMoved => true;
public override bool ShouldHandleEvent( EventType eventType )
{
if( eventType == EventType.Mismatch && Manager.Instance.ChosenCards.Contains( this ) )
{
var otherCard = Manager.Instance.ChosenCards[0] == this ? Manager.Instance.ChosenCards[1] : Manager.Instance.ChosenCards[0];
if ( otherCard.CardType == CardType.Rocket )
return true;
}
return false;
}
public override async Task HandleEventAsync( EventType eventType )
{
Manager.Instance.PushEventMessage( this, eventType );
await Task.DelayRealtime( 1000 );
//Manager.Instance.PlayCardSfxBetween( "rocket_move", card0, card1, volume: 0.7f, pitch: Game.Random.Float( 0.9f, 1.1f ) );
Manager.Instance.PopEventMessage();
}
}