DeclarationInStone additional checks

This commit is contained in:
drmDev 2016-04-03 06:57:47 -04:00
parent db1c5ef843
commit 56b673e1a9

View file

@ -74,6 +74,7 @@ public class DeclarationInStone extends CardImpl {
class DeclarationInStoneEffect extends OneShotEffect { class DeclarationInStoneEffect extends OneShotEffect {
private static final FilterCreaturePermanent creaturesOnly = new FilterCreaturePermanent();
private static final FilterCreaturePermanent nonTokenFilter = new FilterCreaturePermanent("nontoken creature"); private static final FilterCreaturePermanent nonTokenFilter = new FilterCreaturePermanent("nontoken creature");
static{ static{
nonTokenFilter.add(Predicates.not(new TokenPredicate())); nonTokenFilter.add(Predicates.not(new TokenPredicate()));
@ -106,7 +107,11 @@ class DeclarationInStoneEffect extends OneShotEffect {
String name = targetPermanent.getName(); String name = targetPermanent.getName();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controllerPermanentId)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controllerPermanentId)) {
if (permanent != null && permanent.getName().equals(name)) { if (permanent != null && permanent.getName().equals(name)) {
// only exile creatures (reported bug on awakened lands targetted exiling all other lands of same name)
if (creaturesOnly.match(permanent, game)) {
you.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); you.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
// exiled count only matters for non-tokens // exiled count only matters for non-tokens
if (nonTokenFilter.match(permanent, game)) { if (nonTokenFilter.match(permanent, game)) {