mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Fix issues with the ChosenSubtypePredicate and clone effects. (#5164)
Update ChosenSubtypePredicate to be an ObjectPlayer predicate. This fixes how cards that use it act when cloned. Fixes https://github.com/magefree/mage/issues/5136
This commit is contained in:
parent
a164dad83f
commit
14520097a5
10 changed files with 45 additions and 18 deletions
|
|
@ -30,7 +30,7 @@ public final class BelbesPortal extends CardImpl {
|
|||
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.PutCreatureInPlay)));
|
||||
// {3}, {tap}: You may put a creature card of the chosen type from your hand onto the battlefield.
|
||||
FilterCreatureCard filter = new FilterCreatureCard("a creature card of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new PutCardFromHandOntoBattlefieldEffect(filter),
|
||||
new ManaCostsImpl("{3}"));
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class BrassHeraldEntersEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterCard filter = new FilterCard("creature cards of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(source.getSourceId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
return new RevealLibraryPutIntoHandEffect(4, filter, Zone.LIBRARY).apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public final class CallerOfTheHunt extends CardImpl {
|
|||
if (mageObject != null
|
||||
&& effect.apply(game, ability)) {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new ChosenSubtypePredicate(mageObject.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
ContinuousEffect effectPower = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom);
|
||||
ContinuousEffect effectToughness = new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom);
|
||||
game.addEffect(effectPower, ability);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class HeraldsHornEffect extends OneShotEffect {
|
|||
|
||||
// If it's a creature card of the chosen type, you may reveal it and put it into your hand.
|
||||
FilterCreatureCard filter = new FilterCreatureCard("creature card of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(source.getSourceId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
String message = "Reveal the top card of your library and put that card into your hand?";
|
||||
if (card != null) {
|
||||
if (filter.match(card, game) && controller.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public final class KindredBoon extends CardImpl {
|
|||
|
||||
// {1}{W}: Put a divinity counter on target creature you control of the chosen type.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.DIVINITY.createInstance()), new ManaCostsImpl("{1}{W}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class KindredDiscovery extends CardImpl {
|
|||
|
||||
// Whenever a creature you control of the chosen type enters the battlefield or attacks, draw a card.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature you control of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
this.addAbility(new EntersBattlefieldOrAttacksAllTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), filter, false));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class MirrorOfTheForebears extends CardImpl {
|
|||
|
||||
// 1: Until end of turn, Mirror of the Forebears becomes a copy of target creature you control of the chosen type, except it's an artifact in addition to its other types.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirrorOfTheForebearsCopyEffect(), new ManaCostsImpl("{1}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class TravelersCloak extends CardImpl {
|
|||
|
||||
// Enchanted creature has landwalk of the chosen type.
|
||||
FilterLandPermanent filter = new FilterLandPermanent("Landwalk of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability landwalkAbility = new LandwalkAbility(filter);
|
||||
Effect effect = new GainAbilityAttachedEffect(landwalkAbility, AttachmentType.AURA);
|
||||
effect.setText("Enchanted creature has landwalk of the chosen type");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue