// Method for when cards fight each other, probably also evaluate if a card dies public static void CompareCards(Deck deck1, Deck deck2) { if (CurrentPlayerId == Player1Id) { HaveAttackedDeckIds1.Add(deck1.Id); } else if (CurrentPlayerId == Player2Id) { HaveAttackedDeckIds2.Add(deck2.Id); } Card card1 = deck1.GetCard(); Card card2 = deck2.GetCard(); deck1.TakeDamage(card2.Attack); deck2.TakeDamage(card1.Attack); if (deck1.HP <= 0) { deck1.DiscardCard(); } if (deck2.HP <= 0) { deck2.DiscardCard(); } }
public static void SwitchCurrentPlayer() { if (CurrentPlayerId == Player1Id) { Player player2 = Player.Find(Player2Id); StartingCombatCards2 = Deck.GetCardsInPlay(player2).Count; HaveAttackedDeckIds1.Clear(); HaveAttackedDeckIds2.Clear(); CurrentPlayerId = Player2Id; OtherPlayerId = Player1Id; } else { Player player1 = Player.Find(Player1Id); StartingCombatCards1 = Deck.GetCardsInPlay(player1).Count; HaveAttackedDeckIds1.Clear(); HaveAttackedDeckIds2.Clear(); CurrentPlayerId = Player1Id; OtherPlayerId = Player2Id; } }