- Added "blockingSource" and "blockedBySource" to Valid restrictions.

This commit is contained in:
jendave
2011-08-06 21:47:54 +00:00
parent ab152e933d
commit a0804b9213

View File

@@ -2799,10 +2799,14 @@ public class Card extends MyObservable {
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