summaryrefslogtreecommitdiff
path: root/Card.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Card.hs')
-rw-r--r--Card.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Card.hs b/Card.hs
index 98e76fe..c674b5d 100644
--- a/Card.hs
+++ b/Card.hs
@@ -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')