diff options
Diffstat (limited to 'Card.hs')
-rw-r--r-- | Card.hs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -54,8 +54,8 @@ isAttack (Card _ rk) | otherwise = False -- | Check if `card` is valid after `prev`. --- | If `prev` attacks, `card` must be special. -isValid :: Card -> Card -> Bool -isValid prev@(Card st' rk') card@(Card st rk) = - match && (not (isAttack prev) || isSpecial card) +-- | If `att > 1`, player is under attack and `card` must be special. +isValid :: Card -> Int -> Card -> Bool +isValid prev@(Card st' rk') att card@(Card st rk) = + match && (att < 2 || isSpecial card) where match = (st == st') || (rk == rk') |