mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Merge pull request #21 from magefree/master
Merge https://github.com/magefree/mage
This commit is contained in:
commit
5c34f5018b
4 changed files with 147 additions and 42 deletions
|
|
@ -38,8 +38,9 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.AttachedToControlledPermanentPredicate;
|
||||
import mage.filter.predicate.permanent.AttachedToPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -52,7 +53,8 @@ public class MiracleWorker extends CardImpl {
|
|||
private static final FilterPermanent filter = new FilterPermanent("Aura attached to a creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new AttachedToPredicate(new FilterControlledCreaturePermanent()));
|
||||
filter.add(new AttachedToControlledPermanentPredicate());
|
||||
filter.add(new AttachedToPredicate(new FilterCreaturePermanent()));
|
||||
filter.add(new SubtypePredicate(SubType.AURA));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,15 +39,12 @@ import mage.constants.Duration;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.predicate.ObjectPlayer;
|
||||
import mage.filter.predicate.ObjectPlayerPredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.predicate.permanent.AttachedToControlledPermanentPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
* @author North & L_J
|
||||
*/
|
||||
public class UmbraMystic extends CardImpl {
|
||||
|
||||
|
|
@ -55,6 +52,7 @@ public class UmbraMystic extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.AURA));
|
||||
filter.add(new AttachedToControlledPermanentPredicate());
|
||||
}
|
||||
|
||||
public UmbraMystic(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -78,24 +76,3 @@ public class UmbraMystic extends CardImpl {
|
|||
return new UmbraMystic(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UmbraMysticPredicate implements ObjectPlayerPredicate<ObjectPlayer<Permanent>> {
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectPlayer<Permanent> input, Game game) {
|
||||
Permanent attachement = input.getObject();
|
||||
if (attachement != null) {
|
||||
Permanent permanent = game.getPermanent(attachement.getAttachedTo());
|
||||
if (permanent != null && permanent.getControllerId().equals(input.getPlayerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Attached to permanents you control";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue