mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
[CHK] Added "Oathkeeper, Takenos Daisho".
This commit is contained in:
parent
f28b497dd0
commit
522318d31f
3 changed files with 172 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue