* Fixed that the becomes land effects of Gaea's Liege and Graceful Antelope did not end when the source left the battlefield.

This commit is contained in:
LevelX2 2019-01-06 11:11:09 +01:00
parent ca18c6a283
commit 554e8076cf
4 changed files with 23 additions and 24 deletions

View file

@ -1,6 +1,6 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -28,14 +28,12 @@ import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author anonymous
*/
public final class GaeasLiege extends CardImpl {
final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control");
static {
@ -44,7 +42,7 @@ public final class GaeasLiege extends CardImpl {
public GaeasLiege(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}");
this.subtype.add(SubType.AVATAR);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
@ -55,8 +53,8 @@ public final class GaeasLiege extends CardImpl {
new SetPowerToughnessSourceEffect(new DefendersForestCount(), Duration.EndOfCombat),
new InvertCondition(SourceAttackingCondition.instance),
"As long as {this} isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as {this} is attacking, its power and toughness are each equal to the number of Forests defending player controls.")));
// {tap}: Target land becomes a Forest until Gaea's Liege leaves the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.WhileOnBattlefield, SubType.FOREST), new TapSourceCost());
// {T}: Target land becomes a Forest until Gaea's Liege leaves the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.UntilSourceLeavesBattlefield, SubType.FOREST), new TapSourceCost());
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}
@ -75,7 +73,7 @@ class DefendersForestCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
for (CombatGroup group :game.getCombat().getGroups()) {
for (CombatGroup group : game.getCombat().getGroups()) {
if (group.getAttackers().contains(sourceAbility.getSourceId())) {
UUID defenderId = group.getDefenderId();
if (group.isDefenderIsPlaneswalker()) {
@ -84,7 +82,7 @@ class DefendersForestCount implements DynamicValue {
defenderId = permanent.getControllerId();
}
}
FilterLandPermanent filter = new FilterLandPermanent("forest");
filter.add(new SubtypePredicate(SubType.FOREST));
return game.getBattlefield().countAll(filter, defenderId, game);

View file

@ -1,6 +1,6 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
@ -11,11 +11,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author cbt33, Loki (Contaminated Ground), Plopman (Larceny)
@ -23,7 +20,7 @@ import java.util.UUID;
public final class GracefulAntelope extends CardImpl {
public GracefulAntelope(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.subtype.add(SubType.ANTELOPE);
this.power = new MageInt(1);
@ -32,9 +29,8 @@ public final class GracefulAntelope extends CardImpl {
// Plainswalk
this.addAbility(new PlainswalkAbility());
// Whenever Graceful Antelope deals combat damage to a player, you may have target land become a Plains until Graceful Antelope leaves the battlefield.
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new BecomesBasicLandTargetEffect(Duration.WhileOnBattlefield, SubType.PLAINS), true);
Target target = new TargetLandPermanent();
ability.addTarget(target);
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new BecomesBasicLandTargetEffect(Duration.UntilSourceLeavesBattlefield, SubType.PLAINS), true);
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}