mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
DeclarationInStone additional checks
This commit is contained in:
parent
db1c5ef843
commit
56b673e1a9
1 changed files with 6 additions and 1 deletions
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in a new issue