mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 02:52:02 -08:00
some more equipment-related filter changes
This commit is contained in:
parent
f5d48634a3
commit
d223d9aad4
21 changed files with 105 additions and 280 deletions
|
|
@ -1,8 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
|
@ -12,29 +9,25 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public final class AcidWebSpider extends CardImpl {
|
public final class AcidWebSpider extends CardImpl {
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
public AcidWebSpider(UUID ownerId, CardSetInfo setInfo) {
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
|
||||||
}
|
|
||||||
|
|
||||||
public AcidWebSpider (UUID ownerId, CardSetInfo setInfo) {
|
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
|
|
||||||
this.subtype.add(SubType.SPIDER);
|
this.subtype.add(SubType.SPIDER);
|
||||||
|
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(5);
|
this.toughness = new MageInt(5);
|
||||||
this.addAbility(ReachAbility.getInstance());
|
this.addAbility(ReachAbility.getInstance());
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
import mage.filter.predicate.permanent.AttachedToPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DefenderAttackedEvent;
|
import mage.game.events.DefenderAttackedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
|
@ -102,21 +102,11 @@ class AkiriFearlessVoyagerTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
class AkiriFearlessVoyagerEffect extends OneShotEffect {
|
class AkiriFearlessVoyagerEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static enum AkiriFearlessVoyagerPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
|
||||||
return game.getPermanent(input.getObject().getAttachedTo()) != null
|
|
||||||
&& game.getControllerId(input.getObject().getAttachedTo()).equals(input.getPlayerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final FilterPermanent filter
|
private static final FilterPermanent filter
|
||||||
= new FilterPermanent(SubType.EQUIPMENT, "equipment attached to a creature you control");
|
= new FilterPermanent(SubType.EQUIPMENT, "equipment attached to a creature you control");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(AkiriFearlessVoyagerPredicate.instance);
|
filter.add(new AttachedToPredicate(StaticFilters.FILTER_CONTROLLED_CREATURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
AkiriFearlessVoyagerEffect() {
|
AkiriFearlessVoyagerEffect() {
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,27 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
|
||||||
import mage.target.common.TargetAttackingCreature;
|
import mage.target.common.TargetAttackingCreature;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class ArmedResponse extends CardImpl {
|
public final class ArmedResponse extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledArtifactPermanent filter = new FilterControlledArtifactPermanent("Equipment you control");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public ArmedResponse(UUID ownerId, CardSetInfo setInfo) {
|
public ArmedResponse(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||||
|
|
||||||
// Armed Response deals damage to target attacking creature equal to the number of Equipment you control.
|
// Armed Response deals damage to target attacking creature equal to the number of Equipment you control.
|
||||||
Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter));
|
Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||||
effect.setText("{this} deals damage to target attacking creature equal to the number of Equipment you control");
|
effect.setText("{this} deals damage to target attacking creature equal to the number of Equipment you control");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addTarget(new TargetAttackingCreature());
|
this.getSpellAbility().addTarget(new TargetAttackingCreature());
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
@ -21,12 +21,6 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class ArmoryAutomaton extends CardImpl {
|
public final class ArmoryAutomaton extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArmoryAutomaton(UUID ownerId, CardSetInfo setInfo) {
|
public ArmoryAutomaton(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||||
|
|
||||||
|
|
@ -36,7 +30,7 @@ public final class ArmoryAutomaton extends CardImpl {
|
||||||
|
|
||||||
// Whenever Armory Automaton enters or attacks, you may attach any number of target Equipment to it.
|
// Whenever Armory Automaton enters or attacks, you may attach any number of target Equipment to it.
|
||||||
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new ArmoryAutomatonEffect(), true);
|
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new ArmoryAutomatonEffect(), true);
|
||||||
ability.addTarget(new TargetPermanent(0, Integer.MAX_VALUE, filter));
|
ability.addTarget(new TargetPermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,34 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.AttachEffect;
|
import mage.abilities.effects.common.AttachEffect;
|
||||||
import mage.abilities.keyword.EnchantAbility;
|
import mage.abilities.keyword.EnchantAbility;
|
||||||
|
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class ArtificersHex extends CardImpl {
|
public final class ArtificersHex extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
static {
|
|
||||||
filter.add(CardType.ARTIFACT.getPredicate());
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArtificersHex(UUID ownerId, CardSetInfo setInfo) {
|
public ArtificersHex(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||||
this.subtype.add(SubType.AURA);
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
|
|
||||||
// Enchant Equipment
|
// Enchant Equipment
|
||||||
TargetPermanent auraTarget = new TargetPermanent(filter);
|
TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT);
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||||
Ability ability = new EnchantAbility(auraTarget);
|
Ability ability = new EnchantAbility(auraTarget);
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.predicate.permanent.AttachedToSourcePredicate;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
|
@ -32,7 +31,7 @@ public final class BalanWanderingKnight extends CardImpl {
|
||||||
private static final FilterPermanent filter = new FilterPermanent(SubType.EQUIPMENT, "");
|
private static final FilterPermanent filter = new FilterPermanent(SubType.EQUIPMENT, "");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(BalanWanderingKnightPredicate.instance);
|
filter.add(AttachedToSourcePredicate.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Condition condition
|
private static final Condition condition
|
||||||
|
|
@ -69,15 +68,6 @@ public final class BalanWanderingKnight extends CardImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BalanWanderingKnightPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
|
||||||
return input.getObject().isAttachedTo(input.getSourceId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class BalanWanderingKnightEffect extends OneShotEffect {
|
class BalanWanderingKnightEffect extends OneShotEffect {
|
||||||
|
|
||||||
BalanWanderingKnightEffect() {
|
BalanWanderingKnightEffect() {
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,9 @@ import mage.constants.AttachmentType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.Game;
|
import mage.filter.predicate.permanent.AttachedToPredicate;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -34,7 +32,7 @@ public final class BridesGown extends CardImpl {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new NamePredicate("Groom's Finery"));
|
filter.add(new NamePredicate("Groom's Finery"));
|
||||||
filter.add(BridesGownPredicate.instance);
|
filter.add(new AttachedToPredicate(StaticFilters.FILTER_CONTROLLED_CREATURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, false);
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, false);
|
||||||
|
|
@ -74,15 +72,3 @@ public final class BridesGown extends CardImpl {
|
||||||
return new BridesGown(this);
|
return new BridesGown(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BridesGownPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
|
||||||
Permanent permanent = game.getPermanent(input.getObject().getAttachedTo());
|
|
||||||
return permanent != null
|
|
||||||
&& permanent.isCreature(game)
|
|
||||||
&& permanent.isControlledBy(input.getPlayerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
|
|
@ -21,10 +20,7 @@ import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.predicate.permanent.AttachedToSourcePredicate;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.filter.predicate.permanent.AttachedToPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -76,25 +72,6 @@ public final class CaptainAmericaFirstAvenger extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CaptainAmericaPredicate implements ObjectSourcePlayerPredicate<MageObject> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
// Functional negation of AnotherPredicate.
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
|
||||||
if (!input.getObject().getId().equals(input.getSourceId())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
int zcc = input.getSource().getSourceObjectZoneChangeCounter();
|
|
||||||
return zcc == input.getObject().getZoneChangeCounter(game);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "{this}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum CaptainAmericaFirstAvengerValue implements DynamicValue {
|
enum CaptainAmericaFirstAvengerValue implements DynamicValue {
|
||||||
instance;
|
instance;
|
||||||
|
|
||||||
|
|
@ -131,11 +108,9 @@ enum CaptainAmericaFirstAvengerValue implements DynamicValue {
|
||||||
class CaptainAmericaFirstAvengerUnattachCost extends CostImpl implements EarlyTargetCost {
|
class CaptainAmericaFirstAvengerUnattachCost extends CostImpl implements EarlyTargetCost {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent(SubType.EQUIPMENT, "equipment attached to this creature");
|
private static final FilterPermanent filter = new FilterPermanent(SubType.EQUIPMENT, "equipment attached to this creature");
|
||||||
private static final FilterPermanent subfilter = new FilterControlledPermanent("{this}");
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
subfilter.add(CaptainAmericaPredicate.instance);
|
filter.add(AttachedToSourcePredicate.instance);
|
||||||
filter.add(new AttachedToPredicate(subfilter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CaptainAmericaFirstAvengerUnattachCost() {
|
CaptainAmericaFirstAvengerUnattachCost() {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.FilterPermanent;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.PhyrexianGermToken;
|
import mage.game.permanent.token.PhyrexianGermToken;
|
||||||
|
|
@ -23,13 +22,6 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class GripOfPhyresis extends CardImpl {
|
public final class GripOfPhyresis extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(CardType.ARTIFACT.getPredicate());
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public GripOfPhyresis(UUID ownerId, CardSetInfo setInfo) {
|
public GripOfPhyresis(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||||
|
|
||||||
|
|
@ -37,7 +29,7 @@ public final class GripOfPhyresis extends CardImpl {
|
||||||
GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true);
|
GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true);
|
||||||
effect.setText("Gain control of target Equipment");
|
effect.setText("Gain control of target Equipment");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
Target targetEquipment = new TargetPermanent(filter);
|
Target targetEquipment = new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT);
|
||||||
this.getSpellAbility().addTarget(targetEquipment);
|
this.getSpellAbility().addTarget(targetEquipment);
|
||||||
this.getSpellAbility().addEffect(new GripOfPhyresisEffect());
|
this.getSpellAbility().addEffect(new GripOfPhyresisEffect());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,9 @@ import mage.constants.AttachmentType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.Game;
|
import mage.filter.predicate.permanent.AttachedToPredicate;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -34,7 +32,7 @@ public final class GroomsFinery extends CardImpl {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new NamePredicate("Bride's Gown"));
|
filter.add(new NamePredicate("Bride's Gown"));
|
||||||
filter.add(GroomsFineryPredicate.instance);
|
filter.add(new AttachedToPredicate(StaticFilters.FILTER_CONTROLLED_CREATURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, false);
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, false);
|
||||||
|
|
@ -74,15 +72,3 @@ public final class GroomsFinery extends CardImpl {
|
||||||
return new GroomsFinery(this);
|
return new GroomsFinery(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GroomsFineryPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
|
||||||
Permanent permanent = game.getPermanent(input.getObject().getAttachedTo());
|
|
||||||
return permanent != null
|
|
||||||
&& permanent.isCreature(game)
|
|
||||||
&& permanent.isControlledBy(input.getPlayerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
|
@ -13,29 +11,27 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.AttachmentType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public final class ManrikiGusari extends CardImpl {
|
public final class ManrikiGusari extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ManrikiGusari(UUID ownerId, CardSetInfo setInfo) {
|
public ManrikiGusari(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
// Equipped creature gets +1/+2 and has "{tap}: Destroy target Equipment."
|
// Equipped creature gets +1/+2 and has "{tap}: Destroy target Equipment."
|
||||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(1, 2)));
|
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(1, 2)));
|
||||||
Ability gainedAbility = new SimpleActivatedAbility(new DestroyTargetEffect(), new TapSourceCost());
|
Ability gainedAbility = new SimpleActivatedAbility(new DestroyTargetEffect(), new TapSourceCost());
|
||||||
gainedAbility.addTarget(new TargetPermanent(filter));
|
gainedAbility.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.EQUIPMENT)));
|
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.EQUIPMENT)));
|
||||||
// Equip {1}
|
// Equip {1}
|
||||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));
|
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||||
|
|
@ -12,31 +10,24 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||||
*/
|
*/
|
||||||
public final class MilitantInquisitor extends CardImpl {
|
public final class MilitantInquisitor extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(CardType.ARTIFACT.getPredicate());
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public MilitantInquisitor(UUID ownerId, CardSetInfo setInfo) {
|
public MilitantInquisitor(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.CLERIC);
|
this.subtype.add(SubType.CLERIC);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Miltant Inquisitor gets +1/+0 for each Equipment you control.
|
// Miltant Inquisitor gets +1/+0 for each Equipment you control.
|
||||||
this.addAbility(new SimpleStaticAbility(new BoostSourceEffect(new PermanentsOnBattlefieldCount(filter), StaticValue.get(0), Duration.WhileOnBattlefield)));
|
this.addAbility(new SimpleStaticAbility(new BoostSourceEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT), StaticValue.get(0), Duration.WhileOnBattlefield)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private MilitantInquisitor(final MilitantInquisitor card) {
|
private MilitantInquisitor(final MilitantInquisitor card) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.LoyaltyAbility;
|
import mage.abilities.LoyaltyAbility;
|
||||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||||
|
|
@ -16,7 +15,7 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.KorSoldierToken;
|
import mage.game.permanent.token.KorSoldierToken;
|
||||||
|
|
@ -24,10 +23,11 @@ import mage.game.permanent.token.NahiriTheLithomancerEquipmentToken;
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class NahiriTheLithomancer extends CardImpl {
|
public final class NahiriTheLithomancer extends CardImpl {
|
||||||
|
|
@ -72,12 +72,6 @@ public final class NahiriTheLithomancer extends CardImpl {
|
||||||
|
|
||||||
class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Equipment you control");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
NahiriTheLithomancerFirstAbilityEffect() {
|
NahiriTheLithomancerFirstAbilityEffect() {
|
||||||
super(Outcome.PutCreatureInPlay);
|
super(Outcome.PutCreatureInPlay);
|
||||||
this.staticText = "Create a 1/1 white Kor Soldier creature token. You may attach an Equipment you control to it";
|
this.staticText = "Create a 1/1 white Kor Soldier creature token. You may attach an Equipment you control to it";
|
||||||
|
|
@ -102,7 +96,7 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
||||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||||
if (tokenPermanent != null) {
|
if (tokenPermanent != null) {
|
||||||
//TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
|
//TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
|
||||||
Target target = new TargetControlledPermanent(0, 1, filter, true);
|
Target target = new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT, true);
|
||||||
if (target.canChoose(controller.getId(), source, game)
|
if (target.canChoose(controller.getId(), source, game)
|
||||||
&& controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + '?', source, game)) {
|
&& controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + '?', source, game)) {
|
||||||
if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), source, game)) {
|
if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), source, game)) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -19,19 +20,13 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public final class RustsporeRam extends CardImpl {
|
public final class RustsporeRam extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public RustsporeRam(UUID ownerId, CardSetInfo setInfo) {
|
public RustsporeRam(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}");
|
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}");
|
||||||
this.subtype.add(SubType.SHEEP);
|
this.subtype.add(SubType.SHEEP);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.TriggeredAbility;
|
import mage.abilities.TriggeredAbility;
|
||||||
import mage.abilities.common.DealsDamageSourceTriggeredAbility;
|
import mage.abilities.common.DealsDamageSourceTriggeredAbility;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
|
@ -14,10 +13,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.predicate.permanent.AttachedToSourcePredicate;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
|
@ -32,7 +28,7 @@ public final class ShacklesOfTreachery extends CardImpl {
|
||||||
= new FilterPermanent(SubType.EQUIPMENT, "Equipment attached to it");
|
= new FilterPermanent(SubType.EQUIPMENT, "Equipment attached to it");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(ShacklesOfTreacheryPredicate.instance);
|
filter.add(AttachedToSourcePredicate.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShacklesOfTreachery(UUID ownerId, CardSetInfo setInfo) {
|
public ShacklesOfTreachery(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
@ -64,13 +60,3 @@ public final class ShacklesOfTreachery extends CardImpl {
|
||||||
return new ShacklesOfTreachery(this);
|
return new ShacklesOfTreachery(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ShacklesOfTreacheryPredicate implements ObjectSourcePlayerPredicate<MageObject> {
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
|
||||||
Permanent permanent = input.getSource().getSourcePermanentIfItStillExists(game);
|
|
||||||
return permanent != null && permanent.getAttachments().contains(input.getObject().getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
|
|
@ -9,33 +8,26 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
|
||||||
import mage.game.permanent.token.HumanSoldierToken;
|
import mage.game.permanent.token.HumanSoldierToken;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||||
*/
|
*/
|
||||||
public final class StrengthOfArms extends CardImpl {
|
public final class StrengthOfArms extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("If you control an Equipment,");
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public StrengthOfArms(UUID ownerId, CardSetInfo setInfo) {
|
public StrengthOfArms(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
|
||||||
|
|
||||||
// Target creature gets +2/+2 until end of turn.
|
// Target creature gets +2/+2 until end of turn.
|
||||||
// If you control an Equipment, create a 1/1 white Human Soldier creature token.
|
// If you control an Equipment, create a 1/1 white Human Soldier creature token.
|
||||||
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
|
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateTokenEffect(new HumanSoldierToken()),
|
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateTokenEffect(new HumanSoldierToken()),
|
||||||
new PermanentsOnTheBattlefieldCondition(filter),
|
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT),
|
||||||
"If you control an Equipment, create a 1/1 white Human Soldier creature token."));
|
"If you control an Equipment, create a 1/1 white Human Soldier creature token."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,27 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.effects.mana.BasicManaEffect;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
import mage.abilities.effects.mana.BasicManaEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.FilterPermanent;
|
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public final class TurnToDust extends CardImpl {
|
public final class TurnToDust extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public TurnToDust(UUID ownerId, CardSetInfo setInfo) {
|
public TurnToDust(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
|
||||||
|
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
this.getSpellAbility().addEffect(new BasicManaEffect(Mana.GreenMana(1)));
|
this.getSpellAbility().addEffect(new BasicManaEffect(Mana.GreenMana(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.u;
|
package mage.cards.u;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
|
@ -8,29 +7,23 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterArtifactPermanent;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetArtifactPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author wetterlicht
|
* @author wetterlicht
|
||||||
*/
|
*/
|
||||||
public final class Unforge extends CardImpl {
|
public final class Unforge extends CardImpl {
|
||||||
|
|
||||||
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Unforge(UUID ownerId, CardSetInfo setInfo) {
|
public Unforge(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||||
|
|
||||||
// Destroy target Equipment. If that Equipment was attached to a creature, Unforge deals 2 damage to that creature.
|
// Destroy target Equipment. If that Equipment was attached to a creature, Unforge deals 2 damage to that creature.
|
||||||
getSpellAbility().addTarget(new TargetArtifactPermanent(filter));
|
getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||||
getSpellAbility().addEffect(new DestroyTargetEffect());
|
getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||||
getSpellAbility().addEffect(new UnforgeEffect());
|
getSpellAbility().addEffect(new UnforgeEffect());
|
||||||
}
|
}
|
||||||
|
|
@ -46,14 +39,14 @@ public final class Unforge extends CardImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class UnforgeEffect extends OneShotEffect{
|
class UnforgeEffect extends OneShotEffect {
|
||||||
|
|
||||||
UnforgeEffect(){
|
UnforgeEffect() {
|
||||||
super(Outcome.Damage);
|
super(Outcome.Damage);
|
||||||
staticText = "If that Equipment was attached to a creature, {this} deals 2 damage to that creature.";
|
staticText = "If that Equipment was attached to a creature, {this} deals 2 damage to that creature.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private UnforgeEffect(final UnforgeEffect effect){
|
private UnforgeEffect(final UnforgeEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,8 +56,8 @@ class UnforgeEffect extends OneShotEffect{
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
creature.damage(2, source.getSourceId(), source, game, false, true);
|
creature.damage(2, source.getSourceId(), source, game, false, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.w;
|
package mage.cards.w;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
|
|
@ -12,24 +10,19 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class WeaponsTrainer extends CardImpl {
|
public final class WeaponsTrainer extends CardImpl {
|
||||||
|
|
||||||
private static final String rule = "Other creatures you control get +1/+0 as long as you control an Equipment.";
|
private static final String rule = "Other creatures you control get +1/+0 as long as you control an Equipment.";
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Equipment");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public WeaponsTrainer(UUID ownerId, CardSetInfo setInfo) {
|
public WeaponsTrainer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.SOLDIER);
|
this.subtype.add(SubType.SOLDIER);
|
||||||
this.subtype.add(SubType.ALLY);
|
this.subtype.add(SubType.ALLY);
|
||||||
|
|
@ -38,7 +31,7 @@ public final class WeaponsTrainer extends CardImpl {
|
||||||
|
|
||||||
// Other creatures you control get +1/+0 as long as you control an Equipment.
|
// Other creatures you control get +1/+0 as long as you control an Equipment.
|
||||||
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, true),
|
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, true),
|
||||||
new PermanentsOnTheBattlefieldCondition(filter), rule);
|
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT), rule);
|
||||||
this.addAbility(new SimpleStaticAbility(effect));
|
this.addAbility(new SimpleStaticAbility(effect));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
|
|
||||||
package mage.filter.predicate.permanent;
|
package mage.filter.predicate.permanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicate;
|
import mage.filter.predicate.ObjectSourcePlayer;
|
||||||
|
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LoneFox
|
* @author LoneFox
|
||||||
*/
|
*/
|
||||||
public class AttachedToPredicate implements Predicate<Permanent> {
|
public class AttachedToPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||||
|
|
||||||
private final FilterPermanent filter;
|
private final FilterPermanent filter;
|
||||||
|
|
||||||
|
|
@ -20,10 +20,14 @@ public class AttachedToPredicate implements Predicate<Permanent> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Permanent input, Game game) {
|
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||||
UUID attachedTo = input.getAttachedTo();
|
return Optional
|
||||||
Permanent permanent = game.getPermanent(attachedTo);
|
.ofNullable(input)
|
||||||
return filter.match(permanent, game);
|
.map(ObjectSourcePlayer::getObject)
|
||||||
|
.map(Permanent::getAttachedTo)
|
||||||
|
.map(game::getPermanent)
|
||||||
|
.map(permanent -> filter.match(permanent, input.getPlayerId(), input.getSource(), game))
|
||||||
|
.orElse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Susucr
|
* @author Susucr
|
||||||
*/
|
*/
|
||||||
|
|
@ -15,10 +13,7 @@ public enum AttachedToSourcePredicate implements ObjectSourcePlayerPredicate<Per
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||||
return Optional.of(input.getObject())
|
return input.getObject().isAttachedTo(input.getSourceId());
|
||||||
.map(Permanent::getAttachedTo)
|
|
||||||
.filter(p -> p.equals(input.getSourceId()))
|
|
||||||
.isPresent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue