From a0804b9213b1b0499b44bccbdb6125db7f285c65 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 21:47:54 +0000 Subject: [PATCH] - Added "blockingSource" and "blockedBySource" to Valid restrictions. --- src/forge/Card.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/forge/Card.java b/src/forge/Card.java index 9c38e252f52..bf1a3827927 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -2798,11 +2798,15 @@ public class Card extends MyObservable { else if (Property.startsWith("notattacking")) { if(isAttacking()) return false;} else if (Property.startsWith("blocking")) { if(!isBlocking()) return false;} + + else if (Property.startsWith("blockingSource")) { if(!isBlocking(source)) return false;} else if (Property.startsWith("notblocking")) { if(isBlocking()) return false;} else if (Property.startsWith("blocked")) { if(!AllZone.Combat.isBlocked(this)) return false;} + else if (Property.startsWith("blockedBySource")) { if(!isBlockedBy(source)) return false;} + else if (Property.startsWith("unblocked")) { if(!AllZone.Combat.isUnblocked(this)) return false;} else if (Property.startsWith("kicked")) { if(!isKicked()) return false; } @@ -2902,6 +2906,14 @@ public class Card extends MyObservable { return blockers.contains(this); } + public boolean isBlocking(Card attacker) { + return attacker.equals(AllZone.Combat.getAttackerBlockedBy(this)); + } + + public boolean isBlockedBy(Card blocker) { + return this.equals(AllZone.Combat.getAttackerBlockedBy(blocker)); + } + /////////////////////////// // // Damage code