forked from External/mage
[FIN] Implement Raubahn, Bull of Ala Mhigo
This commit is contained in:
parent
1481b2ce8d
commit
9d6398dec4
18 changed files with 247 additions and 556 deletions
|
|
@ -1,42 +1,30 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class AuraFinesse extends CardImpl {
|
||||
|
||||
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Aura you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
filter.add(SubType.AURA.getPredicate());
|
||||
}
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.AURA);
|
||||
|
||||
public AuraFinesse(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
|
||||
// Attach target Aura you control to target creature.
|
||||
this.getSpellAbility().addEffect(new AuraFinesseEffect());
|
||||
this.getSpellAbility().addEffect(new AttachTargetToTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
||||
|
|
@ -53,47 +41,3 @@ public final class AuraFinesse extends CardImpl {
|
|||
return new AuraFinesse(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AuraFinesseEffect extends OneShotEffect {
|
||||
|
||||
AuraFinesseEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Attach target Aura you control to target creature";
|
||||
}
|
||||
|
||||
private AuraFinesseEffect(final AuraFinesseEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuraFinesseEffect copy() {
|
||||
return new AuraFinesseEffect(this);
|
||||
}
|
||||
|
||||
// 15/06/2010 As Aura Finesse resolves, if either target is illegal,
|
||||
// the spell resolves but the Aura doesn’t move. You still draw a card.
|
||||
// If both targets are illegal, Aura Finesse doesn’t resolve and you don’t draw a card.
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent aura = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (aura != null && creature != null) {
|
||||
Permanent oldCreature = game.getPermanent(aura.getAttachedTo());
|
||||
if (oldCreature != null && !oldCreature.equals(creature)) {
|
||||
Target auraTarget = aura.getSpellAbility().getTargets().get(0);
|
||||
if (!auraTarget.canTarget(creature.getId(), game)) {
|
||||
game.informPlayers(aura.getLogName() + " was not attched to " +creature.getLogName() + " because it's no legal target for the aura" );
|
||||
} else if (oldCreature.removeAttachment(aura.getId(), source, game)) {
|
||||
game.informPlayers(aura.getLogName() + " was unattached from " + oldCreature.getLogName() + " and attached to " + creature.getLogName());
|
||||
creature.addAttachment(aura.getId(), source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,28 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class AuriokWindwalker extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
||||
}
|
||||
|
||||
public AuriokWindwalker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -41,9 +30,10 @@ public final class AuriokWindwalker extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {T}: Attach target Equipment you control to target creature you control.
|
||||
Ability ability = new SimpleActivatedAbility(new AttachTargetEquipmentEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetControlledPermanent(filter));
|
||||
Ability ability = new SimpleActivatedAbility(new AttachTargetToTargetEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -57,30 +47,3 @@ public final class AuriokWindwalker extends CardImpl {
|
|||
return new AuriokWindwalker(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AttachTargetEquipmentEffect extends OneShotEffect {
|
||||
|
||||
AttachTargetEquipmentEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "Attach target Equipment you control to target creature you control";
|
||||
}
|
||||
|
||||
private AttachTargetEquipmentEffect(final AttachTargetEquipmentEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttachTargetEquipmentEffect copy() {
|
||||
return new AttachTargetEquipmentEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent equipment = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (creature != null && equipment != null) {
|
||||
return creature.addAttachment(equipment.getId(), source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,35 +3,28 @@ package mage.cards.b;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.RebelRedToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.EachTargetPointer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BarretAvalancheLeader extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||
private static final FilterPermanent filter2 = new FilterControlledPermanent(SubType.REBEL);
|
||||
|
||||
public BarretAvalancheLeader(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -48,12 +41,12 @@ public final class BarretAvalancheLeader extends CardImpl {
|
|||
|
||||
// Avalanche! -- Whenever an Equipment you control enters, create a 2/2 red Rebel creature token.
|
||||
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
|
||||
new CreateTokenEffect(new RebelRedToken()), filter
|
||||
new CreateTokenEffect(new RebelRedToken()), StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT
|
||||
).withFlavorWord("Avalanche!"));
|
||||
|
||||
// At the beginning of combat on your turn, attach up to one target Equipment you control to target Rebel you control.
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new BarretAvalancheLeaderEffect());
|
||||
ability.addTarget(new TargetPermanent(0, 1, filter));
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new AttachTargetToTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetPermanent(filter2));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -67,33 +60,3 @@ public final class BarretAvalancheLeader extends CardImpl {
|
|||
return new BarretAvalancheLeader(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarretAvalancheLeaderEffect extends OneShotEffect {
|
||||
|
||||
BarretAvalancheLeaderEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "attach up to one target Equipment you control to target Rebel you control";
|
||||
this.setTargetPointer(new EachTargetPointer());
|
||||
}
|
||||
|
||||
private BarretAvalancheLeaderEffect(final BarretAvalancheLeaderEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarretAvalancheLeaderEffect copy() {
|
||||
return new BarretAvalancheLeaderEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = this
|
||||
.getTargetPointer()
|
||||
.getTargets(game, source)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
return permanents.size() >= 2 && permanents.get(1).addAttachment(permanents.get(0).getId(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.MyTurnCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
|
||||
|
|
@ -16,19 +16,17 @@ import mage.abilities.keyword.HasteAbility;
|
|||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterEquipmentPermanent;
|
||||
import mage.filter.predicate.permanent.EquippedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.SwordToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.EachTargetPointer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -36,12 +34,10 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class BlacksmithsTalent extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterEquipmentPermanent("equipment you control");
|
||||
private static final FilterPermanent filter2 = new FilterCreaturePermanent();
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
filter2.add(EquippedPredicate.instance);
|
||||
filter.add(EquippedPredicate.instance);
|
||||
}
|
||||
|
||||
public BlacksmithsTalent(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -59,10 +55,8 @@ public final class BlacksmithsTalent extends CardImpl {
|
|||
this.addAbility(new ClassLevelAbility(2, "{2}{R}"));
|
||||
|
||||
// At the beginning of combat on your turn, attach target Equipment you control to up to one target creature you control.
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(
|
||||
new BlacksmithsTalentEffect()
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new AttachTargetToTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent(0, 1));
|
||||
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(ability, 2)));
|
||||
|
||||
|
|
@ -71,10 +65,10 @@ public final class BlacksmithsTalent extends CardImpl {
|
|||
|
||||
// During your turn, equipped creatures you control have double strike and haste.
|
||||
ability = new SimpleStaticAbility(new ConditionalContinuousEffect(new GainAbilityControlledEffect(
|
||||
DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter2
|
||||
DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter
|
||||
), MyTurnCondition.instance, "during your turn, equipped creatures you control have double strike"));
|
||||
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(
|
||||
HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter2
|
||||
HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter
|
||||
), MyTurnCondition.instance, "and haste"));
|
||||
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(ability, 3)));
|
||||
}
|
||||
|
|
@ -88,32 +82,3 @@ public final class BlacksmithsTalent extends CardImpl {
|
|||
return new BlacksmithsTalent(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BlacksmithsTalentEffect extends OneShotEffect {
|
||||
|
||||
BlacksmithsTalentEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.setTargetPointer(new EachTargetPointer());
|
||||
staticText = "attach target Equipment you control to up to one target creature you control";
|
||||
}
|
||||
|
||||
private BlacksmithsTalentEffect(final BlacksmithsTalentEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlacksmithsTalentEffect copy() {
|
||||
return new BlacksmithsTalentEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<UUID> targets = this.getTargetPointer().getTargets(game, source);
|
||||
if (targets.size() < 2) {
|
||||
return false;
|
||||
}
|
||||
Permanent equipment = game.getPermanent(targets.get(0));
|
||||
Permanent creature = game.getPermanent(targets.get(1));
|
||||
return equipment != null && creature != null && creature.addAttachment(equipment.getId(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +1,35 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class BrassSquire extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
||||
}
|
||||
|
||||
public BrassSquire(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||
this.subtype.add(SubType.MYR);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {tap}: Attach target Equipment you control to target creature you control.
|
||||
Ability ability = new SimpleActivatedAbility(new EquipEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetControlledPermanent(filter));
|
||||
Ability ability = new SimpleActivatedAbility(new AttachTargetToTargetEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -54,30 +43,3 @@ public final class BrassSquire extends CardImpl {
|
|||
return new BrassSquire(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EquipEffect extends OneShotEffect {
|
||||
|
||||
EquipEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "Attach target Equipment you control to target creature you control";
|
||||
}
|
||||
|
||||
private EquipEffect(final EquipEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipEffect copy() {
|
||||
return new EquipEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent equipment = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (creature != null && equipment != null) {
|
||||
return creature.addAttachment(equipment.getId(), source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,26 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.EarlyTargetCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageMultiEffect;
|
||||
import mage.constants.*;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.common.FilterEquipmentPermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
|
|
@ -30,21 +33,16 @@ import mage.target.Target;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetAnyTargetAmount;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Grath
|
||||
*/
|
||||
public final class CaptainAmericaFirstAvenger extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterEquipmentPermanent("Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public CaptainAmericaFirstAvenger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}{U}");
|
||||
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
|
|
@ -65,7 +63,7 @@ public final class CaptainAmericaFirstAvenger extends CardImpl {
|
|||
ability = new BeginningOfCombatTriggeredAbility(
|
||||
new CaptainAmericaFirstAvengerCatchEffect()
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(0, 1, filter));
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
this.addAbility(ability.withFlavorWord("... Catch"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,6 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterEquipmentPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.EnchantedPredicate;
|
||||
import mage.filter.predicate.permanent.EquippedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.InsectToken;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
|
@ -32,36 +13,40 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
|||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.EquippedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author balazskristof
|
||||
*/
|
||||
public final class CloudExSOLDIER extends CardImpl {
|
||||
|
||||
private static final FilterControlledArtifactPermanent filter = new FilterControlledArtifactPermanent("Equipment you control");
|
||||
private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("equipped attacking creature you control");
|
||||
private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent();
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("equipped attacking creature you control");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
||||
filter2.add(Predicates.and(
|
||||
AttackingPredicate.instance,
|
||||
EquippedPredicate.instance
|
||||
filter.add(Predicates.and(
|
||||
AttackingPredicate.instance,
|
||||
EquippedPredicate.instance
|
||||
));
|
||||
filter3.add(new PowerPredicate(ComparisonType.MORE_THAN, 6));
|
||||
}
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
filter2.add(new PowerPredicate(ComparisonType.MORE_THAN, 6));
|
||||
}
|
||||
|
||||
public CloudExSOLDIER(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}");
|
||||
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
|
|
@ -74,15 +59,15 @@ public final class CloudExSOLDIER extends CardImpl {
|
|||
|
||||
// When Cloud enters, attach up to one target Equipment you control to it.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new CloudExSOLDIEREntersEffect());
|
||||
ability.addTarget(new TargetPermanent(0, 1, filter));
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever Cloud attacks, draw a card for each equipped attacking creature you control. Then if Cloud has power 7 or greater, create two Treasure tokens.
|
||||
Ability ability2 = new AttacksTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter2)));
|
||||
Ability ability2 = new AttacksTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter)));
|
||||
ability2.addEffect(new ConditionalOneShotEffect(
|
||||
new CreateTokenEffect(new TreasureToken(), 2),
|
||||
new SourceMatchesFilterCondition(filter3),
|
||||
"Then if {this} has power 7 or greater, create two Treasure tokens."
|
||||
new CreateTokenEffect(new TreasureToken(), 2),
|
||||
new SourceMatchesFilterCondition(filter2),
|
||||
"Then if {this} has power 7 or greater, create two Treasure tokens."
|
||||
));
|
||||
this.addAbility(ability2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.abilities.mana.ConditionalColoredManaAbility;
|
||||
|
|
@ -18,17 +18,17 @@ import mage.abilities.mana.builder.ConditionalManaBuilder;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CommanderPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public final class CodsworthHandyHelper extends CardImpl {
|
|||
));
|
||||
|
||||
// {T}: Attach target Aura or Equipment you control to target creature you control. Activate only as a sorcery.
|
||||
Ability ability = new ActivateAsSorceryActivatedAbility(new CodsworthHandyHelperEffect(), new TapSourceCost());
|
||||
Ability ability = new ActivateAsSorceryActivatedAbility(new AttachTargetToTargetEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetPermanent(filter2));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
@ -124,45 +124,3 @@ class CodsworthHandyHelperManaCondition implements Condition {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
class CodsworthHandyHelperEffect extends OneShotEffect {
|
||||
|
||||
CodsworthHandyHelperEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Attach target Aura or Equipment you control to target creature you control";
|
||||
}
|
||||
|
||||
private CodsworthHandyHelperEffect(final CodsworthHandyHelperEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodsworthHandyHelperEffect copy() {
|
||||
return new CodsworthHandyHelperEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent attachment = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (controller == null || attachment == null || creature == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (creature.cantBeAttachedBy(attachment, source, game, true)) {
|
||||
game.informPlayers(attachment.getLogName() + " was not attached to " + creature.getLogName()
|
||||
+ " because it's not a legal target" + CardUtil.getSourceLogName(game, source));
|
||||
return false;
|
||||
}
|
||||
Permanent oldCreature = game.getPermanent(attachment.getAttachedTo());
|
||||
if (oldCreature != null) {
|
||||
oldCreature.removeAttachment(attachment.getId(), source, game);
|
||||
}
|
||||
creature.addAttachment(attachment.getId(), source, game);
|
||||
game.informPlayers(attachment.getLogName() + " was "
|
||||
+ (oldCreature != null ? "unattached from " + oldCreature.getLogName() + " and " : "")
|
||||
+ "attached to " + creature.getLogName()
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@ package mage.cards.h;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.ModalDoubleFacedCard;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
|
|
@ -32,6 +32,7 @@ import mage.target.TargetPermanent;
|
|||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -40,12 +41,12 @@ import java.util.UUID;
|
|||
public final class HalvarGodOfBattle extends ModalDoubleFacedCard {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
private static final FilterPermanent filter2 = new FilterPermanent("aura or equipment attached to a creature you control");
|
||||
private static final FilterPermanent filter2 = new FilterPermanent("Aura or Equipment attached to a creature you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(EnchantedPredicate.instance, EquippedPredicate.instance));
|
||||
filter2.add(Predicates.or(SubType.AURA.getPredicate(), SubType.EQUIPMENT.getPredicate()));
|
||||
filter2.add(new HalvarGodOfBattlePredicate(StaticFilters.FILTER_CONTROLLED_CREATURE));
|
||||
filter2.add(HalvarGodOfBattlePredicate.instance);
|
||||
}
|
||||
|
||||
public HalvarGodOfBattle(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -63,12 +64,13 @@ public final class HalvarGodOfBattle extends ModalDoubleFacedCard {
|
|||
|
||||
// Creatures you control that are enchanted or equipped have double strike.
|
||||
this.getLeftHalfCard().addAbility(new SimpleStaticAbility(
|
||||
new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter
|
||||
new GainAbilityControlledEffect(
|
||||
DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter
|
||||
).setText("Creatures you control that are enchanted or equipped have double strike")
|
||||
));
|
||||
|
||||
// At the beginning of each combat, you may attach target Aura or Equipment attached to a creature you control to target creature you control.
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(TargetController.ANY, new HalvarGodOfBattleEffect(), false);
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(TargetController.ANY, new AttachTargetToTargetEffect(), true);
|
||||
ability.addTarget(new TargetPermanent(filter2));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.getLeftHalfCard().addAbility(ability);
|
||||
|
|
@ -101,49 +103,6 @@ public final class HalvarGodOfBattle extends ModalDoubleFacedCard {
|
|||
}
|
||||
}
|
||||
|
||||
class HalvarGodOfBattleEffect extends OneShotEffect {
|
||||
|
||||
HalvarGodOfBattleEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "you may attach target Aura or Equipment attached to a creature you control to target creature you control";
|
||||
}
|
||||
|
||||
private HalvarGodOfBattleEffect(final HalvarGodOfBattleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HalvarGodOfBattleEffect copy() {
|
||||
return new HalvarGodOfBattleEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent attachment = game.getPermanent(source.getTargets().get(0).getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (controller != null && attachment != null && creature != null && creature.isControlledBy(controller.getId())) {
|
||||
Permanent oldCreature = game.getPermanent(attachment.getAttachedTo());
|
||||
if (oldCreature != null && oldCreature.isControlledBy(controller.getId()) && !oldCreature.equals(creature)) {
|
||||
if (creature.cantBeAttachedBy(attachment, source, game, true)) {
|
||||
game.informPlayers(attachment.getLogName() + " was not attached to " + creature.getLogName()
|
||||
+ " because it's not a legal target");
|
||||
return false;
|
||||
}
|
||||
if (controller.chooseUse(Outcome.BoostCreature, "Attach " + attachment.getLogName()
|
||||
+ " to " + creature.getLogName() + "?", source, game)) {
|
||||
oldCreature.removeAttachment(attachment.getId(), source, game);
|
||||
creature.addAttachment(attachment.getId(), source, game);
|
||||
game.informPlayers(attachment.getLogName() + " was unattached from " + oldCreature.getLogName()
|
||||
+ " and attached to " + creature.getLogName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class SwordOfTheRealmsEffect extends OneShotEffect {
|
||||
|
||||
SwordOfTheRealmsEffect() {
|
||||
|
|
@ -174,23 +133,17 @@ class SwordOfTheRealmsEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
class HalvarGodOfBattlePredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public HalvarGodOfBattlePredicate(FilterPermanent filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
enum HalvarGodOfBattlePredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
UUID attachedTo = input.getObject().getAttachedTo();
|
||||
Permanent permanent = game.getPermanent(attachedTo);
|
||||
return permanent != null && filter.match(permanent, input.getPlayerId(), input.getSource(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "attached to " + filter.getMessage();
|
||||
return Optional
|
||||
.ofNullable(input)
|
||||
.map(ObjectSourcePlayer::getObject)
|
||||
.map(Permanent::getAttachedTo)
|
||||
.map(game::getPermanent)
|
||||
.map(permanent -> permanent.isControlledBy(input.getPlayerId()))
|
||||
.orElse(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
|
@ -23,9 +22,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class KazuulsTollCollector extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterControlledPermanent(SubType.EQUIPMENT, "Equipment you control");
|
||||
|
||||
public KazuulsTollCollector(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.OGRE);
|
||||
|
|
@ -35,7 +31,7 @@ public final class KazuulsTollCollector extends CardImpl {
|
|||
|
||||
// {0}: Attach target Equipment you control to Kazuul's Toll Collector. Activate this ability only any time you could cast a sorcery.
|
||||
Ability ability = new ActivateAsSorceryActivatedAbility(new KazuulsTollCollectorEffect(), new GenericManaCost(0));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.EquippedPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -29,11 +29,10 @@ import java.util.UUID;
|
|||
public final class KembaKhaEnduring extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent(SubType.CAT, "Cat");
|
||||
private static final FilterPermanent filter2 = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||
private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent("equipped creatures");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("equipped creatures");
|
||||
|
||||
static {
|
||||
filter3.add(EquippedPredicate.instance);
|
||||
filter2.add(EquippedPredicate.instance);
|
||||
}
|
||||
|
||||
public KembaKhaEnduring(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -49,12 +48,12 @@ public final class KembaKhaEnduring extends CardImpl {
|
|||
Ability ability = new EntersBattlefieldThisOrAnotherTriggeredAbility(
|
||||
new KembaKhaEnduringEffect(), filter, false, true
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(0, 1, filter2));
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Equipped creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostControlledEffect(
|
||||
1, 1, Duration.WhileOnBattlefield, filter3
|
||||
1, 1, Duration.WhileOnBattlefield, filter2
|
||||
)));
|
||||
|
||||
// {3}{W}{W}: Create a 2/2 white Cat creature token.
|
||||
|
|
|
|||
|
|
@ -1,36 +1,26 @@
|
|||
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class KorOutfitter extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
||||
}
|
||||
|
||||
public KorOutfitter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}");
|
||||
this.subtype.add(SubType.KOR);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
|
||||
|
|
@ -38,8 +28,8 @@ public final class KorOutfitter extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Kor Outfitter enters the battlefield, you may attach target Equipment you control to target creature you control.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new EquipEffect(), true);
|
||||
ability.addTarget(new TargetControlledPermanent(filter));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new AttachTargetToTargetEffect(), true);
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -53,30 +43,3 @@ public final class KorOutfitter extends CardImpl {
|
|||
return new KorOutfitter(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EquipEffect extends OneShotEffect {
|
||||
|
||||
EquipEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "attach target Equipment you control to target creature you control";
|
||||
}
|
||||
|
||||
private EquipEffect(final EquipEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipEffect copy() {
|
||||
return new EquipEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent equipment = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (creature != null && equipment != null) {
|
||||
return creature.addAttachment(equipment.getId(), source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,26 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class MagneticTheft extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
||||
|
||||
static {
|
||||
filter.add(SubType.EQUIPMENT.getPredicate());
|
||||
}
|
||||
|
||||
public MagneticTheft(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
|
||||
|
||||
// Attach target Equipment to target creature.
|
||||
this.getSpellAbility().addEffect(new EquipEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addEffect(new AttachTargetToTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_EQUIPMENT));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
@ -46,30 +33,3 @@ public final class MagneticTheft extends CardImpl {
|
|||
return new MagneticTheft(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EquipEffect extends OneShotEffect {
|
||||
|
||||
EquipEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "Attach target Equipment to target creature";
|
||||
}
|
||||
|
||||
private EquipEffect(final EquipEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipEffect copy() {
|
||||
return new EquipEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent equipment = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (creature != null && equipment != null) {
|
||||
return creature.addAttachment(equipment.getId(), source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
56
Mage.Sets/src/mage/cards/r/RaubahnBullOfAlaMhigo.java
Normal file
56
Mage.Sets/src/mage/cards/r/RaubahnBullOfAlaMhigo.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.dynamicvalue.common.SourcePermanentPowerValue;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetAttackingCreature;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RaubahnBullOfAlaMhigo extends CardImpl {
|
||||
|
||||
|
||||
public RaubahnBullOfAlaMhigo(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Ward--Pay life equal to Raubahn's power.
|
||||
this.addAbility(new WardAbility(new PayLifeCost(
|
||||
SourcePermanentPowerValue.NOT_NEGATIVE, "Pay life equal to {this}'s power"
|
||||
)));
|
||||
|
||||
// Whenever Raubahn attacks, attach up to one target Equipment you control to target attacking creature.
|
||||
Ability ability = new AttacksTriggeredAbility(new AttachTargetToTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetAttackingCreature());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private RaubahnBullOfAlaMhigo(final RaubahnBullOfAlaMhigo card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaubahnBullOfAlaMhigo copy() {
|
||||
return new RaubahnBullOfAlaMhigo(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachTargetToTargetEffect;
|
||||
import mage.abilities.effects.common.DoWhenCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
|
|
@ -16,27 +15,19 @@ import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.EachTargetPointer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WeaponsVendor extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterControlledPermanent(SubType.EQUIPMENT, "you control an Equipment")
|
||||
);
|
||||
|
|
@ -54,8 +45,8 @@ public final class WeaponsVendor extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
|
||||
|
||||
// At the beginning of combat on your turn, if you control an Equipment, you may pay {1}. When you do, attach target Equipment you control to target creature you control.
|
||||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new WeaponsVendorEffect(), false);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new AttachTargetToTargetEffect(), false);
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new DoWhenCostPaid(
|
||||
ability, new GenericManaCost(1),
|
||||
|
|
@ -72,32 +63,3 @@ public final class WeaponsVendor extends CardImpl {
|
|||
return new WeaponsVendor(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WeaponsVendorEffect extends OneShotEffect {
|
||||
|
||||
WeaponsVendorEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "attach target Equipment you control to target creature you control";
|
||||
this.setTargetPointer(new EachTargetPointer());
|
||||
}
|
||||
|
||||
private WeaponsVendorEffect(final WeaponsVendorEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaponsVendorEffect copy() {
|
||||
return new WeaponsVendorEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = this.getTargetPointer()
|
||||
.getTargets(game, source)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
return permanents.size() >= 2 && permanents.get(1).addAttachment(permanents.get(0).getId(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,6 +302,9 @@ public final class FinalFantasy extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Ragnarok, Divine Deliverance", "446b", Rarity.UNCOMMON, mage.cards.r.RagnarokDivineDeliverance.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ragnarok, Divine Deliverance", "526b", Rarity.UNCOMMON, mage.cards.r.RagnarokDivineDeliverance.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ragnarok, Divine Deliverance", "99b", Rarity.UNCOMMON, mage.cards.r.RagnarokDivineDeliverance.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Raubahn, Bull of Ala Mhigo", 151, Rarity.RARE, mage.cards.r.RaubahnBullOfAlaMhigo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Raubahn, Bull of Ala Mhigo", 388, Rarity.RARE, mage.cards.r.RaubahnBullOfAlaMhigo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Raubahn, Bull of Ala Mhigo", 465, Rarity.RARE, mage.cards.r.RaubahnBullOfAlaMhigo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Reach the Horizon", 195, Rarity.UNCOMMON, mage.cards.r.ReachTheHorizon.class));
|
||||
cards.add(new SetCardInfo("Relm's Sketching", 67, Rarity.UNCOMMON, mage.cards.r.RelmsSketching.class));
|
||||
cards.add(new SetCardInfo("Reno and Rude", 113, Rarity.UNCOMMON, mage.cards.r.RenoAndRude.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.EachTargetPointer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class AttachTargetToTargetEffect extends OneShotEffect {
|
||||
|
||||
public AttachTargetToTargetEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.setTargetPointer(new EachTargetPointer());
|
||||
}
|
||||
|
||||
private AttachTargetToTargetEffect(final AttachTargetToTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttachTargetToTargetEffect copy() {
|
||||
return new AttachTargetToTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = this.getTargetPointer()
|
||||
.getTargets(game, source)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
return permanents.size() >= 2 && permanents.get(1).addAttachment(permanents.get(0).getId(), source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
if (mode.getTargets().size() != 2) {
|
||||
throw new IllegalStateException("It must have two targets, but found " + mode.getTargets().size());
|
||||
}
|
||||
return "attach " + mode.getTargets().get(0).getDescription() + " to " + mode.getTargets().get(0).getDescription();
|
||||
}
|
||||
}
|
||||
|
|
@ -1215,6 +1215,12 @@ public final class StaticFilters {
|
|||
FILTER_PERMANENT_EQUIPMENT.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterPermanent FILTER_CONTROLLED_PERMANENT_EQUIPMENT = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||
|
||||
static {
|
||||
FILTER_CONTROLLED_PERMANENT_EQUIPMENT.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterPermanent FILTER_PERMANENT_FORTIFICATION = new FilterPermanent();
|
||||
|
||||
static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue