[CHK] Added "Oathkeeper, Takenos Daisho".

This commit is contained in:
LevelX2 2013-10-17 08:30:59 +02:00
parent f28b497dd0
commit 522318d31f
3 changed files with 172 additions and 7 deletions

View file

@ -29,6 +29,7 @@ package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -51,13 +52,16 @@ public class EquippedMatchesFilterCondition implements Condition {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
if (permanent != null && permanent.getAttachedTo() != null) {
Permanent attachedTo = game.getBattlefield().getPermanent(permanent.getAttachedTo());
if (attachedTo != null) {
if (filter.match(attachedTo, attachedTo.getId(),attachedTo.getControllerId(), game)) {
return true;
}
Permanent attachedTo = game.getBattlefield().getPermanent(permanent.getAttachedTo());
if (attachedTo == null) {
attachedTo = (Permanent) game.getLastKnownInformation(permanent.getAttachedTo(), Zone.BATTLEFIELD);
}
if (attachedTo != null) {
if (filter.match(attachedTo, attachedTo.getId(),attachedTo.getControllerId(), game)) {
return true;
}
}
}
}
return false;
}

View file

@ -64,7 +64,7 @@ public class ExileSourceEffect extends OneShotEffect<ExileSourceEffect> {
// try to exile card
Card card = game.getCard(source.getSourceId());
if (card != null) {
return card.moveToExile(null, "", source.getId(), game);
return card.moveToExile(null, "", source.getSourceId(), game);
}
}
return false;