예제 #1
0
 // This method is called from the gamestate and passes in itself
 public override void Play()
 {
     // A "move" can mean different things for a minion card
     // If it's on board, it is attacking another minion
     if (OnBoard)
     {
         CanAttack = false;
         Game.BroadcastEffect(Effect.MinionAttacking);
         if (Game.LastMove.Targeted.AsCard() is HeroCard h)
         {
             h.Owner.Health -= this.Attack;
             return;
         }
         MinionCard Attacker = Game.LastMove.Targeted.AsCardT <MinionCard>();
         this.Health     -= Attacker.Attack;
         Attacker.Health -= this.Attack;
     }
     // But otherwise, it is being played
     else
     {
         Game.BroadcastEffect(Effect.CardPlayed);
         OnBoard = true;
         Game.ActivePlayer.Board.Add(this);
         Game.ActivePlayer.Mana -= this.ManaCost;
         if (Game.ActivePlayer.Mana < 0)
         {
             Game.ActivePlayer.Mana = 0;
         }
         OnPlay?.Invoke(Game, Game.LastMove);
     }
     CanAttack = false;
 }
예제 #2
0
 public override void Play()
 {
     // CardPlayed procs before the card effect
     Game.BroadcastEffect(Effect.CardPlayed);
     Game.CurrentPower       = this;
     Game.ActivePlayer.Mana -= this.ManaCost;
 }
예제 #3
0
 public override void Play()
 {
     Game.ActivePlayer.Mana -= this.ManaCost;
     Game.BroadcastEffect(Effect.CardPlayed);
     this.SpellEffect(Game, Game.LastMove);
 }